diff --git a/account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts b/account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts index 45db31a09b..91cf9f321f 100644 --- a/account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts +++ b/account-kit/smart-contracts/src/msca/plugins/multi-owner/plugin.ts @@ -340,8 +340,16 @@ export const MultiOwnerPluginExecutionFunctionAbi = [ type: "function", name: "updateOwners", inputs: [ - { name: "ownersToAdd", type: "address[]", internalType: "address[]" }, - { name: "ownersToRemove", type: "address[]", internalType: "address[]" }, + { + name: "ownersToAdd", + type: "address[]", + internalType: "address[]", + }, + { + name: "ownersToRemove", + type: "address[]", + internalType: "address[]", + }, ], outputs: [], stateMutability: "nonpayable", @@ -355,9 +363,17 @@ export const MultiOwnerPluginExecutionFunctionAbi = [ { name: "name", type: "string", internalType: "string" }, { name: "version", type: "string", internalType: "string" }, { name: "chainId", type: "uint256", internalType: "uint256" }, - { name: "verifyingContract", type: "address", internalType: "address" }, + { + name: "verifyingContract", + type: "address", + internalType: "address", + }, { name: "salt", type: "bytes32", internalType: "bytes32" }, - { name: "extensions", type: "uint256[]", internalType: "uint256[]" }, + { + name: "extensions", + type: "uint256[]", + internalType: "uint256[]", + }, ], stateMutability: "view", }, @@ -383,9 +399,17 @@ export const MultiOwnerPluginAbi = [ { name: "name", type: "string", internalType: "string" }, { name: "version", type: "string", internalType: "string" }, { name: "chainId", type: "uint256", internalType: "uint256" }, - { name: "verifyingContract", type: "address", internalType: "address" }, + { + name: "verifyingContract", + type: "address", + internalType: "address", + }, { name: "salt", type: "bytes32", internalType: "bytes32" }, - { name: "extensions", type: "uint256[]", internalType: "uint256[]" }, + { + name: "extensions", + type: "uint256[]", + internalType: "uint256[]", + }, ], stateMutability: "view", }, @@ -460,7 +484,11 @@ export const MultiOwnerPluginAbi = [ type: "tuple", internalType: "struct PluginManifest", components: [ - { name: "interfaceIds", type: "bytes4[]", internalType: "bytes4[]" }, + { + name: "interfaceIds", + type: "bytes4[]", + internalType: "bytes4[]", + }, { name: "dependencyInterfaceIds", type: "bytes4[]", @@ -481,7 +509,11 @@ export const MultiOwnerPluginAbi = [ type: "bool", internalType: "bool", }, - { name: "canSpendNativeToken", type: "bool", internalType: "bool" }, + { + name: "canSpendNativeToken", + type: "bool", + internalType: "bool", + }, { name: "permittedExternalCalls", type: "tuple[]", @@ -492,8 +524,16 @@ export const MultiOwnerPluginAbi = [ type: "address", internalType: "address", }, - { name: "permitAnySelector", type: "bool", internalType: "bool" }, - { name: "selectors", type: "bytes4[]", internalType: "bytes4[]" }, + { + name: "permitAnySelector", + type: "bool", + internalType: "bool", + }, + { + name: "selectors", + type: "bytes4[]", + internalType: "bytes4[]", + }, ], }, { @@ -516,7 +556,11 @@ export const MultiOwnerPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -546,7 +590,11 @@ export const MultiOwnerPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -576,7 +624,11 @@ export const MultiOwnerPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -606,7 +658,11 @@ export const MultiOwnerPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -636,7 +692,11 @@ export const MultiOwnerPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -654,7 +714,11 @@ export const MultiOwnerPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -748,11 +812,19 @@ export const MultiOwnerPluginAbi = [ type: "tuple", internalType: "struct UserOperation", components: [ - { name: "sender", type: "address", internalType: "address" }, + { + name: "sender", + type: "address", + internalType: "address", + }, { name: "nonce", type: "uint256", internalType: "uint256" }, { name: "initCode", type: "bytes", internalType: "bytes" }, { name: "callData", type: "bytes", internalType: "bytes" }, - { name: "callGasLimit", type: "uint256", internalType: "uint256" }, + { + name: "callGasLimit", + type: "uint256", + internalType: "uint256", + }, { name: "verificationGasLimit", type: "uint256", @@ -763,13 +835,21 @@ export const MultiOwnerPluginAbi = [ type: "uint256", internalType: "uint256", }, - { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, + { + name: "maxFeePerGas", + type: "uint256", + internalType: "uint256", + }, { name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256", }, - { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { + name: "paymasterAndData", + type: "bytes", + internalType: "bytes", + }, { name: "signature", type: "bytes", internalType: "bytes" }, ], }, @@ -801,8 +881,16 @@ export const MultiOwnerPluginAbi = [ type: "function", name: "updateOwners", inputs: [ - { name: "ownersToAdd", type: "address[]", internalType: "address[]" }, - { name: "ownersToRemove", type: "address[]", internalType: "address[]" }, + { + name: "ownersToAdd", + type: "address[]", + internalType: "address[]", + }, + { + name: "ownersToRemove", + type: "address[]", + internalType: "address[]", + }, ], outputs: [], stateMutability: "nonpayable", @@ -817,11 +905,19 @@ export const MultiOwnerPluginAbi = [ type: "tuple", internalType: "struct UserOperation", components: [ - { name: "sender", type: "address", internalType: "address" }, + { + name: "sender", + type: "address", + internalType: "address", + }, { name: "nonce", type: "uint256", internalType: "uint256" }, { name: "initCode", type: "bytes", internalType: "bytes" }, { name: "callData", type: "bytes", internalType: "bytes" }, - { name: "callGasLimit", type: "uint256", internalType: "uint256" }, + { + name: "callGasLimit", + type: "uint256", + internalType: "uint256", + }, { name: "verificationGasLimit", type: "uint256", @@ -832,13 +928,21 @@ export const MultiOwnerPluginAbi = [ type: "uint256", internalType: "uint256", }, - { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, + { + name: "maxFeePerGas", + type: "uint256", + internalType: "uint256", + }, { name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256", }, - { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { + name: "paymasterAndData", + type: "bytes", + internalType: "bytes", + }, { name: "signature", type: "bytes", internalType: "bytes" }, ], }, diff --git a/account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts b/account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts index fea9ce6730..a57ab60fd7 100644 --- a/account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts +++ b/account-kit/smart-contracts/src/msca/plugins/session-key/plugin.ts @@ -481,7 +481,11 @@ export const SessionKeyPluginExecutionFunctionAbi = [ type: "tuple[]", internalType: "struct Call[]", components: [ - { name: "target", type: "address", internalType: "address" }, + { + name: "target", + type: "address", + internalType: "address", + }, { name: "value", type: "uint256", internalType: "uint256" }, { name: "data", type: "bytes", internalType: "bytes" }, ], @@ -497,7 +501,11 @@ export const SessionKeyPluginExecutionFunctionAbi = [ inputs: [ { name: "sessionKey", type: "address", internalType: "address" }, { name: "tag", type: "bytes32", internalType: "bytes32" }, - { name: "permissionUpdates", type: "bytes[]", internalType: "bytes[]" }, + { + name: "permissionUpdates", + type: "bytes[]", + internalType: "bytes[]", + }, ], outputs: [], stateMutability: "nonpayable", @@ -542,7 +550,11 @@ export const SessionKeyPluginAbi = [ inputs: [ { name: "sessionKey", type: "address", internalType: "address" }, { name: "tag", type: "bytes32", internalType: "bytes32" }, - { name: "permissionUpdates", type: "bytes[]", internalType: "bytes[]" }, + { + name: "permissionUpdates", + type: "bytes[]", + internalType: "bytes[]", + }, ], outputs: [], stateMutability: "nonpayable", @@ -556,7 +568,11 @@ export const SessionKeyPluginAbi = [ type: "tuple[]", internalType: "struct Call[]", components: [ - { name: "target", type: "address", internalType: "address" }, + { + name: "target", + type: "address", + internalType: "address", + }, { name: "value", type: "uint256", internalType: "uint256" }, { name: "data", type: "bytes", internalType: "bytes" }, ], @@ -582,7 +598,11 @@ export const SessionKeyPluginAbi = [ inputs: [ { name: "account", type: "address", internalType: "address" }, { name: "sessionKey", type: "address", internalType: "address" }, - { name: "contractAddress", type: "address", internalType: "address" }, + { + name: "contractAddress", + type: "address", + internalType: "address", + }, ], outputs: [ { name: "isOnList", type: "bool", internalType: "bool" }, @@ -622,9 +642,21 @@ export const SessionKeyPluginAbi = [ components: [ { name: "hasLimit", type: "bool", internalType: "bool" }, { name: "limit", type: "uint256", internalType: "uint256" }, - { name: "limitUsed", type: "uint256", internalType: "uint256" }, - { name: "refreshInterval", type: "uint48", internalType: "uint48" }, - { name: "lastUsedTime", type: "uint48", internalType: "uint48" }, + { + name: "limitUsed", + type: "uint256", + internalType: "uint256", + }, + { + name: "refreshInterval", + type: "uint48", + internalType: "uint48", + }, + { + name: "lastUsedTime", + type: "uint48", + internalType: "uint48", + }, ], }, ], @@ -645,9 +677,21 @@ export const SessionKeyPluginAbi = [ components: [ { name: "hasLimit", type: "bool", internalType: "bool" }, { name: "limit", type: "uint256", internalType: "uint256" }, - { name: "limitUsed", type: "uint256", internalType: "uint256" }, - { name: "refreshInterval", type: "uint48", internalType: "uint48" }, - { name: "lastUsedTime", type: "uint48", internalType: "uint48" }, + { + name: "limitUsed", + type: "uint256", + internalType: "uint256", + }, + { + name: "refreshInterval", + type: "uint48", + internalType: "uint48", + }, + { + name: "lastUsedTime", + type: "uint48", + internalType: "uint48", + }, ], }, { name: "shouldReset", type: "bool", internalType: "bool" }, @@ -682,9 +726,21 @@ export const SessionKeyPluginAbi = [ components: [ { name: "hasLimit", type: "bool", internalType: "bool" }, { name: "limit", type: "uint256", internalType: "uint256" }, - { name: "limitUsed", type: "uint256", internalType: "uint256" }, - { name: "refreshInterval", type: "uint48", internalType: "uint48" }, - { name: "lastUsedTime", type: "uint48", internalType: "uint48" }, + { + name: "limitUsed", + type: "uint256", + internalType: "uint256", + }, + { + name: "refreshInterval", + type: "uint48", + internalType: "uint48", + }, + { + name: "lastUsedTime", + type: "uint48", + internalType: "uint48", + }, ], }, ], @@ -706,7 +762,11 @@ export const SessionKeyPluginAbi = [ inputs: [ { name: "account", type: "address", internalType: "address" }, { name: "sessionKey", type: "address", internalType: "address" }, - { name: "contractAddress", type: "address", internalType: "address" }, + { + name: "contractAddress", + type: "address", + internalType: "address", + }, { name: "selector", type: "bytes4", internalType: "bytes4" }, ], outputs: [{ name: "isOnList", type: "bool", internalType: "bool" }], @@ -746,7 +806,11 @@ export const SessionKeyPluginAbi = [ type: "tuple", internalType: "struct PluginManifest", components: [ - { name: "interfaceIds", type: "bytes4[]", internalType: "bytes4[]" }, + { + name: "interfaceIds", + type: "bytes4[]", + internalType: "bytes4[]", + }, { name: "dependencyInterfaceIds", type: "bytes4[]", @@ -767,7 +831,11 @@ export const SessionKeyPluginAbi = [ type: "bool", internalType: "bool", }, - { name: "canSpendNativeToken", type: "bool", internalType: "bool" }, + { + name: "canSpendNativeToken", + type: "bool", + internalType: "bool", + }, { name: "permittedExternalCalls", type: "tuple[]", @@ -778,8 +846,16 @@ export const SessionKeyPluginAbi = [ type: "address", internalType: "address", }, - { name: "permitAnySelector", type: "bool", internalType: "bool" }, - { name: "selectors", type: "bytes4[]", internalType: "bytes4[]" }, + { + name: "permitAnySelector", + type: "bool", + internalType: "bool", + }, + { + name: "selectors", + type: "bytes4[]", + internalType: "bytes4[]", + }, ], }, { @@ -802,7 +878,11 @@ export const SessionKeyPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -832,7 +912,11 @@ export const SessionKeyPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -862,7 +946,11 @@ export const SessionKeyPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -892,7 +980,11 @@ export const SessionKeyPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -922,7 +1014,11 @@ export const SessionKeyPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -940,7 +1036,11 @@ export const SessionKeyPluginAbi = [ type: "uint8", internalType: "enum ManifestAssociatedFunctionType", }, - { name: "functionId", type: "uint8", internalType: "uint8" }, + { + name: "functionId", + type: "uint8", + internalType: "uint8", + }, { name: "dependencyIndex", type: "uint256", @@ -1034,11 +1134,19 @@ export const SessionKeyPluginAbi = [ type: "tuple", internalType: "struct UserOperation", components: [ - { name: "sender", type: "address", internalType: "address" }, + { + name: "sender", + type: "address", + internalType: "address", + }, { name: "nonce", type: "uint256", internalType: "uint256" }, { name: "initCode", type: "bytes", internalType: "bytes" }, { name: "callData", type: "bytes", internalType: "bytes" }, - { name: "callGasLimit", type: "uint256", internalType: "uint256" }, + { + name: "callGasLimit", + type: "uint256", + internalType: "uint256", + }, { name: "verificationGasLimit", type: "uint256", @@ -1049,13 +1157,21 @@ export const SessionKeyPluginAbi = [ type: "uint256", internalType: "uint256", }, - { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, + { + name: "maxFeePerGas", + type: "uint256", + internalType: "uint256", + }, { name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256", }, - { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { + name: "paymasterAndData", + type: "bytes", + internalType: "bytes", + }, { name: "signature", type: "bytes", internalType: "bytes" }, ], }, @@ -1141,11 +1257,19 @@ export const SessionKeyPluginAbi = [ type: "tuple", internalType: "struct UserOperation", components: [ - { name: "sender", type: "address", internalType: "address" }, + { + name: "sender", + type: "address", + internalType: "address", + }, { name: "nonce", type: "uint256", internalType: "uint256" }, { name: "initCode", type: "bytes", internalType: "bytes" }, { name: "callData", type: "bytes", internalType: "bytes" }, - { name: "callGasLimit", type: "uint256", internalType: "uint256" }, + { + name: "callGasLimit", + type: "uint256", + internalType: "uint256", + }, { name: "verificationGasLimit", type: "uint256", @@ -1156,13 +1280,21 @@ export const SessionKeyPluginAbi = [ type: "uint256", internalType: "uint256", }, - { name: "maxFeePerGas", type: "uint256", internalType: "uint256" }, + { + name: "maxFeePerGas", + type: "uint256", + internalType: "uint256", + }, { name: "maxPriorityFeePerGas", type: "uint256", internalType: "uint256", }, - { name: "paymasterAndData", type: "bytes", internalType: "bytes" }, + { + name: "paymasterAndData", + type: "bytes", + internalType: "bytes", + }, { name: "signature", type: "bytes", internalType: "bytes" }, ], }, @@ -1212,7 +1344,12 @@ export const SessionKeyPluginAbi = [ indexed: true, internalType: "address", }, - { name: "tag", type: "bytes32", indexed: true, internalType: "bytes32" }, + { + name: "tag", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, ], anonymous: false, }, diff --git a/site/pages/react-native/getting-started/getting-started-expo.mdx b/site/pages/react-native/getting-started/getting-started-expo.mdx index 3d930a602d..8ea5d203c0 100644 --- a/site/pages/react-native/getting-started/getting-started-expo.mdx +++ b/site/pages/react-native/getting-started/getting-started-expo.mdx @@ -141,11 +141,11 @@ To ensure the Signer package works correctly, you'll need to add the following d :::code-group ```bash [npm] -npm install @account-kit/signer react-native-mmkv zustand abitype +npm install @account-kit/signer react-native-mmkv zustand abitype react-native-inappbrowser-reborn ``` ```bash [yarn] -yarn add @account-kit/signer react-native-mmkv zustand abitype +yarn add @account-kit/signer react-native-mmkv zustand abitype react-native-inappbrowser-reborn ``` ::: diff --git a/site/pages/react-native/getting-started/getting-started-rn-bare.mdx b/site/pages/react-native/getting-started/getting-started-rn-bare.mdx index 0ff150a6ad..ed13b37a7e 100644 --- a/site/pages/react-native/getting-started/getting-started-rn-bare.mdx +++ b/site/pages/react-native/getting-started/getting-started-rn-bare.mdx @@ -118,11 +118,11 @@ To ensure the Signer package works correctly, you'll need to add the following d :::code-group ```bash [npm] -npm install @account-kit/signer react-native-mmkv zustand abitype +npm install @account-kit/signer react-native-mmkv zustand abitype react-native-inappbrowser-reborn ``` ```bash [yarn] -yarn add @account-kit/signer react-native-mmkv zustand abitype +yarn add @account-kit/signer react-native-mmkv zustand abitype react-native-inappbrowser-reborn ``` ::: diff --git a/site/pages/react-native/signer/authenticating-users/authenticating-with-social-auth.mdx b/site/pages/react-native/signer/authenticating-users/authenticating-with-social-auth.mdx new file mode 100644 index 0000000000..b57bbae6b9 --- /dev/null +++ b/site/pages/react-native/signer/authenticating-users/authenticating-with-social-auth.mdx @@ -0,0 +1,51 @@ +--- +title: Authenticating Users via Social Auth +description: Learn how to authenticate users via social auth +--- + +# Authenticating Users via Social Auth + +This guide assumes you have already followed the [Setup Guide](/react-native/signer/setup-guide) and have a basic understanding of how to use the Signer in your project. + +:::info +For example code on how to use the Signer in your project, please checkout our example apps in our github repository. + +- [Bare React Native Example](https://github.com/alchemyplatform/aa-sdk/tree/main/examples/react-native-bare-example) +- [Expo Example](https://github.com/alchemyplatform/aa-sdk/tree/main/examples/react-native-expo-example) + +::: + +## Create a Signer Instance + +```ts twoslash +// [!include ~/shared/react-native/signer.ts] +``` + +## Authenticate a User + +To authenticate a user via **social auth**, use the `signer.authenticate()` method with the `type` set to `OAuth`, the `redirectUrl` set to your app's deep link, the `mode` set to `redirect` and the `authProviderId` set to the social auth provider you want to use. + +Here is an example, authenticating a user via Google: + +:::code-group + +```ts twoslash [example.ts] +import { signer } from "./signer"; + +signer + .authenticate({ + type: "OAuth", + redirectUrl: "com.example.app://oauth", + mode: "redirect", + authProviderId: "google", + }) + .catch((error) => { + console.error(error); + }); +``` + +```ts twoslash [signer.ts] filename="signer.ts" +// [!include ~/shared/react-native/signer.ts] +``` + +::: diff --git a/site/pages/react-native/signer/setup-guide.mdx b/site/pages/react-native/signer/setup-guide.mdx index 6b252146bb..97647c8cd9 100644 --- a/site/pages/react-native/signer/setup-guide.mdx +++ b/site/pages/react-native/signer/setup-guide.mdx @@ -55,6 +55,22 @@ Setting up the React Native Signer is similar to setting up the [React Signer](/ />
+ **Social auth** + + If you want to enable social login, toggle which auth providers + you want to support. + + - Make sure to add your app's deep link as a **whitelisted origin**. This is necessary to handle redirects from the signer after a user has been authenticated. + - Add the link that your dapp will be running on to the **whitelisted origin** list + - Optionally enter your own OAuth credentials or use our defaults + +
+ configure social auth + 3. Create the config and copy the **API Key**