Skip to content
Open
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
9 changes: 9 additions & 0 deletions .changeset/tempo-zone-sdk-helpers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'viem': patch
---

`viem/tempo`: Added Zone helpers for preparing encrypted deposit recipients, waiting for processed deposits, and preparing withdrawals without broadcasting.

`viem/tempo`: Deposit helpers now accept an explicit `portalAddress` for zones outside viem's built-in registry. Prepared encrypted deposits now honor their `portalAddress` when building calls (previously the portal was always re-derived from the registry).

`viem/tempo`: Zone withdrawal helpers now use `callbackGas` for the callback gas limit, leaving `gas` for transaction gas overrides. `zone.getWithdrawalFee` keeps a deprecated `gas` alias.
4 changes: 3 additions & 1 deletion site/pages/tempo/actions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@
| [`zone.encryptedDeposit`](/tempo/actions/zone.encryptedDeposit) | Deposits tokens into a zone with encrypted recipient and memo |
| [`zone.getAuthorizationTokenInfo`](/tempo/actions/zone.getAuthorizationTokenInfo) | Gets the authenticated account and expiry from the current authorization token |
| [`zone.getDepositStatus`](/tempo/actions/zone.getDepositStatus) | Gets deposit processing status for a given Tempo block number |
| [`zone.getWithdrawalFee`](/tempo/actions/zone.getWithdrawalFee) | Gets the withdrawal fee for a given gas limit |
| [`zone.getWithdrawalFee`](/tempo/actions/zone.getWithdrawalFee) | Gets the withdrawal fee for a given callback gas limit |
| [`zone.getZoneInfo`](/tempo/actions/zone.getZoneInfo) | Gets metadata about the current zone |
| [`zone.prepareWithdrawal`](/tempo/actions/zone.prepareWithdrawal) | Prepares withdrawal calls and fee details without broadcasting |
| [`zone.requestVerifiableWithdrawal`](/tempo/actions/zone.requestVerifiableWithdrawal) | Requests a verifiable withdrawal from a zone to the parent Tempo chain |
| [`zone.requestWithdrawal`](/tempo/actions/zone.requestWithdrawal) | Requests a withdrawal from a zone to the parent Tempo chain |
| [`zone.signAuthorizationToken`](/tempo/actions/zone.signAuthorizationToken) | Signs a zone authorization token for authenticating zone RPC requests |
| [`zone.waitForDepositProcessed`](/tempo/actions/zone.waitForDepositProcessed) | Waits for a Tempo block's deposits to be processed by the zone |
8 changes: 8 additions & 0 deletions site/pages/tempo/actions/zone.deposit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ Token address or ID to deposit.
Zone ID to deposit into (e.g. `7`).
### portalAddress (optional)
- **Type:** `Address`
- **Default:** viem's zone registry
Zone portal address on the parent Tempo chain. Pass this for hosted or custom zones that are not in
viem's built-in registry.
### memo (optional)
- **Type:** `Hex`
Expand Down
23 changes: 23 additions & 0 deletions site/pages/tempo/actions/zone.encryptedDeposit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ export const broadcaster = client

:::

## Recipient-Only Usage

`zone.encryptedDeposit.prepare` returns a complete deposit intent with `token`, `amount`, and the
encrypted recipient instructions. Use `zone.encryptedDeposit.prepareRecipient` when you only need the
recipient-encryption piece because another contract or service controls the token movement.

```ts twoslash
import { client } from './viem.config'

const preparedRecipient = await client.zone.encryptedDeposit.prepareRecipient({
recipient: '0x0000000000000000000000000000000000000001',
zoneId: 7,
})
```

## Return Type

```ts
Expand Down Expand Up @@ -109,6 +124,14 @@ Token address or ID to deposit.

Zone ID to deposit into (e.g. `7`).

### portalAddress (optional)

- **Type:** `Address`
- **Default:** viem's zone registry

Zone portal address on the parent Tempo chain. Pass this for hosted or custom zones that are not in
viem's built-in registry.

### memo (optional)

- **Type:** `Hex`
Expand Down
6 changes: 3 additions & 3 deletions site/pages/tempo/actions/zone.getWithdrawalFee.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ console.log('Fee:', fee)

:::

### Custom Gas Limit
### Custom Callback Gas Limit

```ts twoslash
// @twoslash-cache: {"v":2,"hash":"400184268ea2cd3a6cf88917d013ceefa81ebc1cd0cdb11c0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SAKIFAmm2IZq+CV9iUwAFoT44PcDU0VTS3B3ySQgKg6h8BpIySEllrAcnhJFaKkA30kCgXmBBARgN5h8O4SIvc3KslhPaVDVC6FZFM2gosJRaMVEvnUWDWmeMCa6KKVwYklh/ySHDjEuJeAADi5TKlGLyaQFJOr0mZN5QIaUlg7h2BqbBepSBGkgCVuKV8HTFhgGFVEU15rEBGmtcuQGMFqBwTBmUzVx4UKIA7TI688jDQNFNYIWAeBhxLIeUC2NHyyHTPdJcsmcB3TrEGBEf5YAqK5OLAU8xaa53VM5c63lnioX1B7abRYAB9M2YAMVgAaNwV8jNmBIFAEmasQg8DbBAA0BoQA==="}
import { client } from './zones.config'

const fee = await client.zone.getWithdrawalFee({
gas: 100_000n,
callbackGas: 100_000n,
})
```

Expand All @@ -44,7 +44,7 @@ The withdrawal fee as a bigint.

## Parameters

### gas (optional)
### callbackGas (optional)

- **Type:** `bigint`
- **Default:** `0n`
Expand Down
73 changes: 73 additions & 0 deletions site/pages/tempo/actions/zone.prepareWithdrawal.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# `zone.prepareWithdrawal`

Prepares a zone withdrawal without broadcasting it.

Use this to inspect the ZoneOutbox calls and fee details before submitting a withdrawal. The helper
returns the same approve/request calls used by
[`zone.requestWithdrawal`](/tempo/actions/zone.requestWithdrawal), the protocol withdrawal fee, and
optionally an estimated zone transaction fee.

## Usage

:::code-group

```ts twoslash [example.ts]
import { client } from './zones.config'

const prepared = await client.zone.prepareWithdrawal({
token: '0x20c0000000000000000000000000000000000001',
amount: 1_000_000n,
to: '0x0000000000000000000000000000000000000001',
estimateTransactionFee: true,
transactionFeeScale: 1_000_000_000_000n,
})

console.log('Total fee:', prepared.totalFee)
```

```ts twoslash [zones.config.ts] filename="zones.config.ts"
// [!include ~/snippets/tempo/zones.config.ts:setup]
```

:::

## Return Type

```ts
type ReturnType = {
amount: bigint
callbackGas: bigint
calls: unknown[]
data: Hex
estimatedGas?: bigint
fallbackRecipient: Address
gasPrice?: bigint
memo: Hex
to: Address
token: TokenIdOrAddress
totalFee: bigint
transactionFee?: bigint
withdrawalFee: bigint
}
```

## Parameters

Accepts the same withdrawal parameters as [`zone.requestWithdrawal`](/tempo/actions/zone.requestWithdrawal),
plus the options below.

### estimateTransactionFee (optional)

- **Type:** `boolean`
- **Default:** `false`

Whether to estimate the zone transaction gas fee and include it in `transactionFee` and `totalFee`.
Requires `transactionFeeScale`.

### transactionFeeScale

- **Type:** `bigint`

Divisor used to convert `estimatedGas * gasPrice` (18-decimal units) into the fee token's base
units: `10 ** (18 - decimals)`. For a 6-decimal fee token, pass `1_000_000_000_000n`. Required when
`estimateTransactionFee` is `true`; omit it otherwise.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Optional callback data for the recipient.
Fallback address if callback fails.
### gas (optional)
### callbackGas (optional)
- **Type:** `bigint`
- **Default:** `0n`
Expand Down
2 changes: 1 addition & 1 deletion site/pages/tempo/actions/zone.requestWithdrawal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Optional callback data for the recipient.
Fallback address if callback fails.
### gas (optional)
### callbackGas (optional)
- **Type:** `bigint`
- **Default:** `0n`
Expand Down
59 changes: 59 additions & 0 deletions site/pages/tempo/actions/zone.waitForDepositProcessed.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# `zone.waitForDepositProcessed`

Waits until deposits for a given Tempo block number have been processed by the zone.

Use this after a parent-chain deposit transaction has been included and you want to wait for the
corresponding zone balance to be available.

## Usage

:::code-group

```ts twoslash [example.ts]
import { client } from './zones.config'

const status = await client.zone.waitForDepositProcessed({
tempoBlockNumber: 123456n,
})

console.log('Processed:', status.processed)
```

```ts twoslash [zones.config.ts] filename="zones.config.ts"
// [!include ~/snippets/tempo/zones.config.ts:setup]
```

:::

## Return Type

```ts
type ReturnType = {
deposits: Deposit[]
processed: boolean
tempoBlockNumber: bigint
zoneProcessedThrough: bigint
}
```

## Parameters

### tempoBlockNumber

- **Type:** `bigint`

The Tempo L1 block number to wait for.

### pollingInterval (optional)

- **Type:** `number`
- **Default:** `client.pollingInterval`

Polling frequency, in milliseconds.

### timeout (optional)

- **Type:** `number`
- **Default:** `60_000`

Maximum time to wait, in milliseconds. Set to `0` to disable the timeout.
22 changes: 15 additions & 7 deletions site/pages/tempo/guides/zones/deposit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,19 @@ const { receipt } = await client.zone.encryptedDepositSync({

:::

### Check Deposit Status
### Wait for Zone Processing

After depositing, confirm the funds have landed inside the zone with
[`zone.getDepositStatus`](/tempo/actions/zone.getDepositStatus), querying by the Mainnet block number
of your deposit. This call runs against the zone client.
After depositing, wait for the funds to land inside the zone with
[`zone.waitForDepositProcessed`](/tempo/actions/zone.waitForDepositProcessed), querying by the Mainnet
block number of your deposit. This call runs against the zone client.

:::code-group

```ts twoslash [example.ts]
// @twoslash-cache: {"v":2,"hash":"1291cbf697bb60877644df577f40983e152248fa587857cb3771f0b2aa87db0f","data":"N4Igdg9gJgpgziAXAbVAFwJ4AcZJACwgDcYAnEAGhDRgA808AKAQwBsBLZuASgAIBjCGDhoBHGGDSJeAYXGSAPAAk0aLABVSzYVgik0FXsAA6YXud4AjVhH4BrAKK0sN0mTgB+aSbMW/yOxgMaRFSdjAAcwBdaRl8ZnCAIRt7Jxc9MgBuUz8/WAAzZgBXVilZeKSUx2dXLJyLAF9eAB9eIrAC8JgoFraOmHyuqGzfc2tbO3V2AFsYaQBGAAZlkb9BSS1+NE9vetzeZFoQtDDImPKEsBkhE+Yt3p99/eQ4CCLSfhgASShpMCLppYyOc4pdrhs7qJWu1OmBuqsnk1of1BnDhntchI4AAlGARdihDBeC7hcG3e7I2HwjF+LEAVTA7BIpDgbFxr1YzOJoNJN02UL6VPRo1y0xKaHY/DYrAAzNyKlc+ZDejCBkMEfsyPwAGwAFgAnAAmABqZHYgzI8rBSopgrVaI1vCRdtR1JFADpPbx5gBWXjTDK8T3ux10GgdaQKdYi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CJBS1wXLBs6dn6vwgO/OAn8CHwMIMQlB7A0HkLALBHcf8kI4BAQ0WGM5dzannEjSIuF0Jowxnudmp4Fw42JpRAmWwaKGgABxk0YgQZi5BWK03YvTRmZBMB8AAsBHmEEoK/mwQLLQQt3D/h3FY8WvNIIoN/JQxxssWR0Lfh/BQliQLuJsV4mCv8EICOAa+KAtgEB7iicIXg39ea8BMZ8S+kR/YRN4PkPQvBmC8HxCQMw6gYDgwgFYKovBY5JXdK+TcEREnIGQCAOgzBwaLlfAAA36dsMGEMjACDcCgmAchoaiCaPkN+vAADkRBxzTHmUMsSIz8BCUMAomAABZaAZAUHVJmXMxZyyAD0NAqnnJ2XAVZjIqmjmALwK5uhyxbE4Skk5DCFlLMqZcypuh7mmB4lDCcZ9RkwHGZMicjBWz43CNIHZ+zYBaDQBARgGFuAUHqLcUS+hpCbLUIwbFA5uDujzIwV5EB3mkLgCS7gpgQWry/LYlMxYikAHcEiQ0PO6HZ7oQnWM8dBOFuLAUQAtgAOUSmQBYYAcVgAaIysA/TekgCiBQdpDiumvh1U4lkvAAC0L8qEskaZq9pbh4LCFfOofAMBUmhLArk6CFrNUgFQruDCupsJSJRvMdc1ACK7hAEKsJIqSJKNPCo/cVF1FExlDKHRFMmIvkMaG/mDMmbmJeRK6VsrSDSEsDWcIR4vVzh9H65cAag1wzkW+KpBa44GOPMomUqjrxE0NA0D1ghYB4GHOs55YLJBOnyac90NyOYwXWIMCIwKwA8WIuyrlPLeKSH5RzQVrjnUeLZWK3w1Lm1JQWIaGUuofTagVWS18QtmBIFAEmasQg8DbBAA0BoQA="}
import { client } from './zones.config'

const status = await client.zone.getDepositStatus({
const status = await client.zone.waitForDepositProcessed({
tempoBlockNumber: 123456n,
})
```
Expand Down Expand Up @@ -125,8 +125,16 @@ Validate the public transaction details before broadcasting a prepared payload f

### Track the Deposit Block Number

`zone.getDepositStatus` is keyed by the Mainnet block number of the deposit. Capture it from the
deposit receipt so you can reliably poll for processing.
`zone.waitForDepositProcessed` is keyed by the Mainnet block number of the deposit. Capture it from
the deposit receipt so you can reliably wait for processing.

### Use a Custom Portal for Hosted Zones

If your zone's portal is not in viem's built-in registry, pass `portalAddress` to
[`zone.deposit`](/tempo/actions/zone.deposit), [`zone.encryptedDeposit`](/tempo/actions/zone.encryptedDeposit),
`zone.encryptedDeposit.prepare`, or `zone.encryptedDeposit.prepareRecipient`.
This keeps hosted-zone integrations from needing to fork the Zone helpers while the registry catches
up.

## See More

Expand Down
8 changes: 8 additions & 0 deletions site/vocs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3047,6 +3047,10 @@ export default defineConfig({
text: 'getZoneInfo',
link: '/tempo/actions/zone.getZoneInfo',
},
{
text: 'prepareWithdrawal',
link: '/tempo/actions/zone.prepareWithdrawal',
},
{
text: 'requestVerifiableWithdrawal',
link: '/tempo/actions/zone.requestVerifiableWithdrawal',
Expand All @@ -3059,6 +3063,10 @@ export default defineConfig({
text: 'signAuthorizationToken',
link: '/tempo/actions/zone.signAuthorizationToken',
},
{
text: 'waitForDepositProcessed',
link: '/tempo/actions/zone.waitForDepositProcessed',
},
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ export { datahavenTestnet } from './definitions/datahavenTestnet.js'
export { dbkchain } from './definitions/dbkchain.js'
export { dchain } from './definitions/dchain.js'
export { dchainTestnet } from './definitions/dchainTestnet.js'
export { defiOracleMetaMainnet } from './definitions/defiOracleMetaMainnet.js'
export { defichainEvm } from './definitions/defichainEvm.js'
export { defichainEvmTestnet } from './definitions/defichainEvmTestnet.js'
export { defiOracleMetaMainnet } from './definitions/defiOracleMetaMainnet.js'
export { degen } from './definitions/degen.js'
export { dfk } from './definitions/dfk.js'
export { diode } from './definitions/diode.js'
Expand Down
6 changes: 4 additions & 2 deletions src/clients/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ function isPlainObject(value: unknown): value is Record<string, unknown> {
* Binds an action function to a `client`, returning a parameter-only version
* along with any helpers the action exposes. Helpers that need a client
* (`.call`, `.calls`, `.callWithPeriod`, `.estimateGas`, `.prepare`,
* `.simulate`) are bound to `client`; pure helpers (`.extractEvent`,
* `.extractEvents`) are copied as-is. Used by decorators that attach
* `.prepareRecipient`, `.simulate`) are bound to `client`; pure helpers
* (`.extractEvent`, `.extractEvents`) are copied as-is. Used by decorators
* that attach
* namespaced actions to a Client.
* @internal
*/
Expand All @@ -366,6 +367,7 @@ export function bindActionDecorators(
'callWithPeriod',
'estimateGas',
'prepare',
'prepareRecipient',
'simulate',
] as const)
if (Object.hasOwn(action, key)) {
Expand Down
5 changes: 5 additions & 0 deletions src/tempo/Decorator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ describe('decorator', () => {
expect(typeof client2.token.transfer.estimateGas).toBe('function')
expect(typeof client2.token.transfer.simulate).toBe('function')
expect(typeof client2.zone.encryptedDeposit.prepare).toBe('function')
expect(typeof client2.zone.encryptedDeposit.prepareRecipient).toBe(
'function',
)
expect(typeof client2.zone.prepareWithdrawal).toBe('function')
expect(typeof client2.zone.waitForDepositProcessed).toBe('function')
})

test('binds missing action entries', () => {
Expand Down
Loading
Loading