Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@vercel/analytics": "^1.6.1",
"@vercel/speed-insights": "^1.3.1",
"abitype": "^1.2.3",
"accounts": "^0.5.9",
"accounts": "^0.6.0",
"cva": "1.0.0-beta.4",
"mermaid": "^11.12.2",
"monaco-editor": "^0.55.1",
Expand Down
24 changes: 16 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions src/pages/accounts/api/provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,31 @@ const provider = Provider.create({
})
```

### feePayerUrl
### feePayer

- **Type:** `string`
- **Type:** `string | { url: string; precedence?: 'fee-payer-first' | 'user-first' }`
- **Optional**

Fee payer URL for interacting with a service running [`Handler.feePayer`](/accounts/server/handler.feePayer) from `accounts/server`.
Fee payer configuration for interacting with a service running [`Handler.feePayer`](/accounts/server/handler.feePayer) from `accounts/server`. Pass a URL string, or an object with `url` and optional `precedence` to control whether the fee payer or the user pays first.

```ts twoslash
import { Provider } from 'accounts'

const provider = Provider.create({
feePayerUrl: 'https://myapp.com/fee-payer', // [!code focus]
feePayer: 'https://myapp.com/fee-payer', // [!code focus]
})
```

Or with precedence:

```ts twoslash
import { Provider } from 'accounts'

const provider = Provider.create({
feePayer: { // [!code focus]
url: 'https://myapp.com/fee-payer', // [!code focus]
precedence: 'user-first', // [!code focus]
}, // [!code focus]
})
```

Expand Down
8 changes: 4 additions & 4 deletions src/pages/accounts/wagmi/tempoWallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ export const config = createConfig({
})
```

### feePayerUrl
### feePayer

- **Type:** `string`
- **Type:** `string | { url: string; precedence?: 'fee-payer-first' | 'user-first' }`
- **Optional**

Fee payer URL for interacting with a service running [`Handler.feePayer`](/accounts/server/handler.feePayer) from `accounts/server`.
Fee payer configuration for interacting with a service running [`Handler.feePayer`](/accounts/server/handler.feePayer) from `accounts/server`. Pass a URL string, or an object with `url` and optional `precedence`.

:::info
[See the guide](/guide/payments/sponsor-user-fees)
Expand All @@ -102,7 +102,7 @@ export const config = createConfig({
chains: [tempo],
connectors: [
tempoWallet({
feePayerUrl: 'https://myapp.com/fee-payer', // [!code focus]
feePayer: 'https://myapp.com/fee-payer', // [!code focus]
}),
],
transports: { [tempo.id]: http() },
Expand Down
8 changes: 4 additions & 4 deletions src/pages/accounts/wagmi/webAuthn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ export const config = createConfig({
})
```

### feePayerUrl
### feePayer

- **Type:** `string`
- **Type:** `string | { url: string; precedence?: 'fee-payer-first' | 'user-first' }`
- **Optional**

Fee payer URL for interacting with a service running [`Handler.feePayer`](/accounts/server/handler.feePayer) from `accounts/server`.
Fee payer configuration for interacting with a service running [`Handler.feePayer`](/accounts/server/handler.feePayer) from `accounts/server`. Pass a URL string, or an object with `url` and optional `precedence`.

:::info
[See the guide](/guide/payments/sponsor-user-fees)
Expand All @@ -143,7 +143,7 @@ export const config = createConfig({
connectors: [
webAuthn({
authUrl: '/auth',
feePayerUrl: 'https://myapp.com/fee-payer', // [!code focus]
feePayer: 'https://myapp.com/fee-payer', // [!code focus]
}),
],
transports: { [tempo.id]: http() },
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guide/payments/sponsor-user-fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ import { createConfig, http } from 'wagmi'

export const config = createConfig({
connectors: [tempoWallet({
feePayerUrl: 'https://sponsor.moderato.tempo.xyz', // [!code focus]
feePayer: 'https://sponsor.moderato.tempo.xyz', // [!code focus]
})],
chains: [tempo],
multiInjectedProviderDiscovery: false,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/guide/use-accounts/embed-tempo-wallet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export function Example() {

### Fee Sponsorship

The `tempoWallet` connector supports fee sponsorship via a `feePayerUrl`. This allows you to sponsor transaction fees for your users.
The `tempoWallet` connector supports fee sponsorship via a `feePayer` option. This allows you to sponsor transaction fees for your users.

```tsx twoslash [config.ts]
// @noErrors
Expand All @@ -252,7 +252,7 @@ import { tempoWallet } from 'accounts/wagmi'
export const config = createConfig({
chains: [tempo],
connectors: [tempoWallet({
feePayerUrl: 'https://sponsor.example.com', // [!code ++]
feePayer: 'https://sponsor.example.com', // [!code ++]
})],
transports: {
[tempo.id]: http(),
Expand Down
5 changes: 4 additions & 1 deletion src/snippets/wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ import { KeyManager, webAuthn } from 'wagmi/tempo'
export const config = createConfig({
connectors: [
tempoWallet({
feePayerUrl: 'https://sponsor.moderato.tempo.xyz',
feePayer: {
precedence: 'user-first',
url: 'https://sponsor.moderato.tempo.xyz',
},
}),
],
chains: [tempo],
Expand Down
5 changes: 4 additions & 1 deletion src/wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export function getConfig(options: getConfig.Options = {}) {
{ token: thetaUsd, limit: parseUnits('500', 6) },
],
}),
feePayerUrl: 'https://sponsor.moderato.tempo.xyz',
feePayer: {
precedence: 'user-first',
url: 'https://sponsor.moderato.tempo.xyz',
},
}),
webAuthn({
grantAccessKey: {
Expand Down
Loading