diff --git a/docs/base-account/improve-ux/spend-permissions.mdx b/docs/base-account/improve-ux/spend-permissions.mdx
index 2f3a1ce2..ad9bb0ba 100644
--- a/docs/base-account/improve-ux/spend-permissions.mdx
+++ b/docs/base-account/improve-ux/spend-permissions.mdx
@@ -11,6 +11,10 @@ After the user signs the permission, the `spender` can initiate transfers within
Read more about the Spend Permission Manager contract and supported chains on [GitHub](https://github.com/coinbase/spend-permissions).
+
+ Spend Permissions for Base App Mini Apps are coming soon and will be supported in a future update.
+
+
## Usage
### Request a Spend Permission
@@ -31,6 +35,14 @@ You create an EIP-712 payload that describes the permission and ask the user to
```tsx
import { requestSpendPermission } from "@base-org/account/spend-permission";
+import { createBaseAccountSDK } from "@base-org/account";
+import { base } from "viem/chains";
+
+const sdk = createBaseAccountSDK({
+ appName: 'Base Account SDK Demo',
+ appLogoUrl: 'https://base.org/logo.png',
+ appChainIds: [base.id],
+});
const permission = await requestSpendPermission({
account: "0x...",
@@ -39,6 +51,7 @@ const permission = await requestSpendPermission({
chainId: 8453, // or any other supported chain
allowance: 1_000_000n,
periodInDays: 30,
+ provider: sdk.getProvider(),
});
console.log("Spend Permission:", permission);
@@ -177,6 +190,15 @@ import {
prepareRevokeCallData,
} from "@base-org/account/spend-permission";
+import { createBaseAccountSDK } from "@base-org/account";
+import { base } from "viem/chains";
+
+const sdk = createBaseAccountSDK({
+ appName: 'Base Account SDK Demo',
+ appLogoUrl: 'https://base.org/logo.png',
+ appChainIds: [base.id],
+});
+
const spender = "0xAppSpenderAddress";
// 1) Fetch available permissions
@@ -184,6 +206,7 @@ const permissions = await fetchPermissions({
account: "0xUserBaseAccountAddress",
chainId: 84532,
spender,
+ provider: sdk.getProvider(),
});
// ========================================
@@ -237,6 +260,7 @@ const newPermission = await requestSpendPermission({
chainId: 84532,
allowance: 1_000_000n,
periodInDays: 30,
+ provider: sdk.getProvider(),
});
// 3. prepare the calls
diff --git a/docs/base-account/reference/spend-permission-utilities/fetchPermissions.mdx b/docs/base-account/reference/spend-permission-utilities/fetchPermissions.mdx
index f6e6827f..eaf2f12d 100644
--- a/docs/base-account/reference/spend-permission-utilities/fetchPermissions.mdx
+++ b/docs/base-account/reference/spend-permission-utilities/fetchPermissions.mdx
@@ -24,20 +24,62 @@ Defined in the [Base Account SDK](https://github.com/base/account-sdk)
Spender address you intend to use for spending.
+
+ EIP-1193 compliant Ethereum provider instance. Get this from `sdk.getProvider()`.
+
+
## Returns
Array of spend permissions matching the query.
+
+
+
+Deterministic EIP-712 hash of the permission.
+
+
+
+ Signature for the EIP-712 payload.
+
+
+
+ Target chain ID.
+
+
+
+Underlying permission fields.
+
+
+
+
+
+
+Duration in seconds.
+Unix timestamp (seconds).
+Unix timestamp (seconds).
+
+
+
+
+
```typescript Fetch permissions
import { fetchPermissions } from "@base-org/account/spend-permission";
+import { createBaseAccountSDK } from "@base-org/account";
+
+const sdk = createBaseAccountSDK({
+ appName: 'My App',
+ appLogoUrl: 'https://example.com/logo.png',
+ appChainIds: [84532],
+});
const permissions = await fetchPermissions({
account: "0xUserBaseAccountAddress",
chainId: 84532,
spender: "0xAppSpenderAddress",
+ provider: sdk.getProvider(),
});
```
diff --git a/docs/base-account/reference/spend-permission-utilities/getPermissionStatus.mdx b/docs/base-account/reference/spend-permission-utilities/getPermissionStatus.mdx
index 447368b6..ebb5d7f4 100644
--- a/docs/base-account/reference/spend-permission-utilities/getPermissionStatus.mdx
+++ b/docs/base-account/reference/spend-permission-utilities/getPermissionStatus.mdx
@@ -13,7 +13,37 @@ Defined in the [Base Account SDK](https://github.com/base/account-sdk)
## Parameters
- Signed permission to evaluate.
+ Signed permission to evaluate. This should be a SpendPermission object returned from [`requestSpendPermission`](/base-account/reference/spend-permission-utilities/requestSpendPermission) or fetched via [`fetchPermissions`](/base-account/reference/spend-permission-utilities/fetchPermissions).
+
+
+
+Deterministic EIP-712 hash of the permission.
+
+
+
+ Signature for the EIP-712 payload.
+
+
+
+ Target chain ID.
+
+
+
+Underlying permission fields.
+
+
+
+
+
+
+Duration in seconds.
+Unix timestamp (seconds).
+Unix timestamp (seconds).
+
+
+
+
+
## Returns
diff --git a/docs/base-account/reference/spend-permission-utilities/prepareRevokeCallData.mdx b/docs/base-account/reference/spend-permission-utilities/prepareRevokeCallData.mdx
index af913f77..37e3950b 100644
--- a/docs/base-account/reference/spend-permission-utilities/prepareRevokeCallData.mdx
+++ b/docs/base-account/reference/spend-permission-utilities/prepareRevokeCallData.mdx
@@ -14,7 +14,37 @@ Defined in the [Base Account SDK](https://github.com/base/account-sdk)
## Parameters
- The permission to revoke.
+ The spend permission to revoke. This should be a SpendPermission object returned from [`requestSpendPermission`](/base-account/reference/spend-permission-utilities/requestSpendPermission) or fetched via [`fetchPermissions`](/base-account/reference/spend-permission-utilities/fetchPermissions).
+
+
+
+Deterministic EIP-712 hash of the permission.
+
+
+
+ Signature for the EIP-712 payload.
+
+
+
+ Target chain ID.
+
+
+
+Underlying permission fields.
+
+
+
+
+
+
+Duration in seconds.
+Unix timestamp (seconds).
+Unix timestamp (seconds).
+
+
+
+
+
## Returns
diff --git a/docs/base-account/reference/spend-permission-utilities/prepareSpendCallData.mdx b/docs/base-account/reference/spend-permission-utilities/prepareSpendCallData.mdx
index b8111081..0c0ea604 100644
--- a/docs/base-account/reference/spend-permission-utilities/prepareSpendCallData.mdx
+++ b/docs/base-account/reference/spend-permission-utilities/prepareSpendCallData.mdx
@@ -14,8 +14,37 @@ Defined in the [Base Account SDK](https://github.com/base/account-sdk)
## Parameters
- Signed permission returned from `requestSpendPermission` or fetched via
- `fetchPermissions`.
+ Signed permission returned from [`requestSpendPermission`](/base-account/reference/spend-permission-utilities/requestSpendPermission) or fetched via [`fetchPermissions`](/base-account/reference/spend-permission-utilities/fetchPermissions).
+
+
+
+Deterministic EIP-712 hash of the permission.
+
+
+
+ Signature for the EIP-712 payload.
+
+
+
+ Target chain ID.
+
+
+
+Underlying permission fields.
+
+
+
+
+
+
+Duration in seconds.
+Unix timestamp (seconds).
+Unix timestamp (seconds).
+
+
+
+
+
diff --git a/docs/base-account/reference/spend-permission-utilities/requestRevoke.mdx b/docs/base-account/reference/spend-permission-utilities/requestRevoke.mdx
index fdf7eb17..28b56d5e 100644
--- a/docs/base-account/reference/spend-permission-utilities/requestRevoke.mdx
+++ b/docs/base-account/reference/spend-permission-utilities/requestRevoke.mdx
@@ -13,7 +13,37 @@ Defined in the [Base Account SDK](https://github.com/base/account-sdk)
## Parameters
- The permission to revoke.
+ The spend permission to revoke. This should be a SpendPermission object returned from [`requestSpendPermission`](/base-account/reference/spend-permission-utilities/requestSpendPermission) or fetched via [`fetchPermissions`](/base-account/reference/spend-permission-utilities/fetchPermissions).
+
+
+
+Deterministic EIP-712 hash of the permission.
+
+
+
+ Signature for the EIP-712 payload.
+
+
+
+ Target chain ID.
+
+
+
+Underlying permission fields.
+
+
+
+
+
+
+Duration in seconds.
+Unix timestamp (seconds).
+Unix timestamp (seconds).
+
+
+
+
+
## Returns
diff --git a/docs/base-account/reference/spend-permission-utilities/requestSpendPermission.mdx b/docs/base-account/reference/spend-permission-utilities/requestSpendPermission.mdx
index e3c31b86..a75b3088 100644
--- a/docs/base-account/reference/spend-permission-utilities/requestSpendPermission.mdx
+++ b/docs/base-account/reference/spend-permission-utilities/requestSpendPermission.mdx
@@ -54,6 +54,10 @@ Defined in the [Base Account SDK](https://github.com/base/account-sdk)
Arbitrary data to attach to the permission. Hex string. Defaults to `0x`.
+
+ EIP-1193 compliant Ethereum provider instance. Get this from `sdk.getProvider()`.
+
+
## Returns
@@ -93,6 +97,13 @@ Underlying permission fields.
```typescript Create and sign a spend permission
import { requestSpendPermission } from "@base-org/account/spend-permission";
+import { createBaseAccountSDK } from "@base-org/account";
+
+const sdk = createBaseAccountSDK({
+ appName: 'My App',
+ appLogoUrl: 'https://example.com/logo.png',
+ appChainIds: [84532],
+});
const permission = await requestSpendPermission({
account: "0xUserBaseAccountAddress",
@@ -101,6 +112,7 @@ const permission = await requestSpendPermission({
chainId: 84532,
allowance: 1_000_000n,
periodInDays: 30,
+ provider: sdk.getProvider(),
});
console.log("Spend Permission:", permission);