viem 2.55.17 → 2.55.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/_cjs/errors/version.js +1 -1
- package/_cjs/tempo/actions/earn.js +12 -4
- package/_cjs/tempo/actions/earn.js.map +1 -1
- package/_cjs/tempo/actions/zone.js +16 -16
- package/_cjs/tempo/actions/zone.js.map +1 -1
- package/_cjs/tempo/zones/Abis.js +2 -2
- package/_cjs/tempo/zones/Abis.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/tempo/actions/earn.js +14 -6
- package/_esm/tempo/actions/earn.js.map +1 -1
- package/_esm/tempo/actions/zone.js +17 -17
- package/_esm/tempo/actions/zone.js.map +1 -1
- package/_esm/tempo/zones/Abis.js +2 -2
- package/_esm/tempo/zones/Abis.js.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/tempo/Decorator.d.ts +2 -2
- package/_types/tempo/actions/earn.d.ts +5 -5
- package/_types/tempo/actions/earn.d.ts.map +1 -1
- package/_types/tempo/actions/zone.d.ts +17 -17
- package/_types/tempo/actions/zone.d.ts.map +1 -1
- package/_types/tempo/zones/Abis.d.ts +2 -2
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/tempo/Decorator.ts +2 -2
- package/tempo/actions/earn.ts +19 -11
- package/tempo/actions/zone.ts +35 -31
- package/tempo/zones/Abis.ts +2 -2
package/tempo/actions/zone.ts
CHANGED
|
@@ -76,8 +76,6 @@ export type EncryptedPayload = {
|
|
|
76
76
|
export type PreparedEncryptedDeposit = {
|
|
77
77
|
/** Amount of tokens to deposit. */
|
|
78
78
|
amount: bigint
|
|
79
|
-
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
80
|
-
bouncebackRecipient: Address
|
|
81
79
|
/** Parent chain ID (e.g. `42431` for moderato). */
|
|
82
80
|
chainId: number
|
|
83
81
|
/** Encrypted deposit payload. */
|
|
@@ -88,6 +86,8 @@ export type PreparedEncryptedDeposit = {
|
|
|
88
86
|
portalAddress: Address
|
|
89
87
|
/** Address that will call the Zone portal. */
|
|
90
88
|
sender: Address
|
|
89
|
+
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
90
|
+
tempoRefundRecipient: Address
|
|
91
91
|
/** Token address or ID to deposit. */
|
|
92
92
|
token: TokenId.TokenIdOrAddress
|
|
93
93
|
/** Zone ID (e.g. `7`). */
|
|
@@ -153,12 +153,13 @@ export async function deposit<
|
|
|
153
153
|
if (!account_) throw new Error('`account` is required.')
|
|
154
154
|
|
|
155
155
|
const recipient = parameters.recipient ?? account_.address
|
|
156
|
-
const
|
|
156
|
+
const tempoRefundRecipient =
|
|
157
|
+
parameters.tempoRefundRecipient ?? account_.address
|
|
157
158
|
const args = {
|
|
158
159
|
...parameters,
|
|
159
|
-
bouncebackRecipient,
|
|
160
160
|
chainId,
|
|
161
161
|
recipient,
|
|
162
|
+
tempoRefundRecipient,
|
|
162
163
|
}
|
|
163
164
|
return sendTransaction(client, {
|
|
164
165
|
...rest,
|
|
@@ -172,18 +173,16 @@ export namespace deposit {
|
|
|
172
173
|
chain extends Chain | undefined = Chain | undefined,
|
|
173
174
|
account extends Account | undefined = Account | undefined,
|
|
174
175
|
> = WriteParameters<chain, account> &
|
|
175
|
-
Omit<Args, '
|
|
176
|
-
/** Refund recipient on the parent chain. @default `account.address` */
|
|
177
|
-
bouncebackRecipient?: Address | undefined
|
|
176
|
+
Omit<Args, 'chainId' | 'recipient' | 'tempoRefundRecipient'> & {
|
|
178
177
|
/** Recipient address in the zone. @default `account.address` */
|
|
179
178
|
recipient?: Address | undefined
|
|
179
|
+
/** Refund recipient on the parent chain. @default `account.address` */
|
|
180
|
+
tempoRefundRecipient?: Address | undefined
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
export type Args = {
|
|
183
184
|
/** Amount of tokens to deposit. */
|
|
184
185
|
amount: bigint
|
|
185
|
-
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
186
|
-
bouncebackRecipient: Address
|
|
187
186
|
/** Parent chain ID (e.g. `42431` for moderato). */
|
|
188
187
|
chainId: number
|
|
189
188
|
/** Optional deposit memo. @default `0x00...00` */
|
|
@@ -192,6 +191,8 @@ export namespace deposit {
|
|
|
192
191
|
portalAddress?: Address | undefined
|
|
193
192
|
/** Recipient address in the zone. */
|
|
194
193
|
recipient: Address
|
|
194
|
+
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
195
|
+
tempoRefundRecipient: Address
|
|
195
196
|
/** Token address or ID to deposit. */
|
|
196
197
|
token: TokenId.TokenIdOrAddress
|
|
197
198
|
/** Zone ID (e.g. `7`). */
|
|
@@ -212,10 +213,10 @@ export namespace deposit {
|
|
|
212
213
|
export function calls(args: Args) {
|
|
213
214
|
const {
|
|
214
215
|
amount,
|
|
215
|
-
bouncebackRecipient,
|
|
216
216
|
chainId,
|
|
217
217
|
memo = zeroHash,
|
|
218
218
|
recipient,
|
|
219
|
+
tempoRefundRecipient,
|
|
219
220
|
token,
|
|
220
221
|
zoneId,
|
|
221
222
|
} = args
|
|
@@ -232,7 +233,7 @@ export namespace deposit {
|
|
|
232
233
|
address: portalAddress,
|
|
233
234
|
abi: ZoneAbis.zonePortal,
|
|
234
235
|
functionName: 'deposit',
|
|
235
|
-
args: [tokenAddress, recipient, amount, memo,
|
|
236
|
+
args: [tokenAddress, recipient, amount, memo, tempoRefundRecipient],
|
|
236
237
|
})
|
|
237
238
|
return [approveCall, depositCall]
|
|
238
239
|
}
|
|
@@ -286,12 +287,13 @@ export async function depositSync<
|
|
|
286
287
|
if (!account_) throw new Error('`account` is required.')
|
|
287
288
|
|
|
288
289
|
const recipient = parameters.recipient ?? account_.address
|
|
289
|
-
const
|
|
290
|
+
const tempoRefundRecipient =
|
|
291
|
+
parameters.tempoRefundRecipient ?? account_.address
|
|
290
292
|
const args = {
|
|
291
293
|
...parameters,
|
|
292
|
-
bouncebackRecipient,
|
|
293
294
|
chainId,
|
|
294
295
|
recipient,
|
|
296
|
+
tempoRefundRecipient,
|
|
295
297
|
}
|
|
296
298
|
const receipt = await sendTransactionSync(client, {
|
|
297
299
|
...rest,
|
|
@@ -478,7 +480,8 @@ export async function encryptedDeposit<
|
|
|
478
480
|
const account_ = account ? parseAccount(account) : undefined
|
|
479
481
|
if (!account_) throw new Error('`account` is required.')
|
|
480
482
|
|
|
481
|
-
const
|
|
483
|
+
const tempoRefundRecipient =
|
|
484
|
+
parameters.tempoRefundRecipient ?? account_.address
|
|
482
485
|
|
|
483
486
|
if ('encrypted' in parameters) {
|
|
484
487
|
if (parameters.chainId !== chainId) {
|
|
@@ -490,7 +493,7 @@ export async function encryptedDeposit<
|
|
|
490
493
|
...pickWriteParameters(parameters as never),
|
|
491
494
|
calls: encryptedDeposit.calls({
|
|
492
495
|
...parameters,
|
|
493
|
-
|
|
496
|
+
tempoRefundRecipient,
|
|
494
497
|
}),
|
|
495
498
|
} as never) as never
|
|
496
499
|
}
|
|
@@ -499,11 +502,11 @@ export async function encryptedDeposit<
|
|
|
499
502
|
|
|
500
503
|
const prepared = await encryptedDeposit.prepare(client, {
|
|
501
504
|
amount: parameters.amount,
|
|
502
|
-
bouncebackRecipient,
|
|
503
505
|
memo: parameters.memo,
|
|
504
506
|
portalAddress: parameters.portalAddress,
|
|
505
507
|
recipient,
|
|
506
508
|
sender: account_.address,
|
|
509
|
+
tempoRefundRecipient,
|
|
507
510
|
token: parameters.token,
|
|
508
511
|
zoneId: parameters.zoneId,
|
|
509
512
|
})
|
|
@@ -522,16 +525,16 @@ export namespace encryptedDeposit {
|
|
|
522
525
|
(
|
|
523
526
|
| (Omit<
|
|
524
527
|
Args,
|
|
525
|
-
| 'bouncebackRecipient'
|
|
526
528
|
| 'chainId'
|
|
527
529
|
| 'encrypted'
|
|
528
530
|
| 'keyIndex'
|
|
529
531
|
| 'recipient'
|
|
532
|
+
| 'tempoRefundRecipient'
|
|
530
533
|
> & {
|
|
531
|
-
/** Refund recipient on the parent chain. @default `account.address` */
|
|
532
|
-
bouncebackRecipient?: Address | undefined
|
|
533
534
|
/** Recipient address in the zone. @default `account.address` */
|
|
534
535
|
recipient?: Address | undefined
|
|
536
|
+
/** Refund recipient on the parent chain. @default `account.address` */
|
|
537
|
+
tempoRefundRecipient?: Address | undefined
|
|
535
538
|
})
|
|
536
539
|
| PreparedEncryptedDeposit
|
|
537
540
|
)
|
|
@@ -539,8 +542,6 @@ export namespace encryptedDeposit {
|
|
|
539
542
|
export type Args = {
|
|
540
543
|
/** Amount of tokens to deposit. */
|
|
541
544
|
amount: bigint
|
|
542
|
-
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
543
|
-
bouncebackRecipient: Address
|
|
544
545
|
/** Parent chain ID (e.g. `42431` for moderato). */
|
|
545
546
|
chainId: number
|
|
546
547
|
/** Encrypted deposit payload. */
|
|
@@ -553,6 +554,8 @@ export namespace encryptedDeposit {
|
|
|
553
554
|
portalAddress?: Address | undefined
|
|
554
555
|
/** Recipient address in the zone. */
|
|
555
556
|
recipient: Address
|
|
557
|
+
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
558
|
+
tempoRefundRecipient: Address
|
|
556
559
|
/** Token address or ID to deposit. */
|
|
557
560
|
token: TokenId.TokenIdOrAddress
|
|
558
561
|
/** Zone ID (e.g. `7`). */
|
|
@@ -581,9 +584,9 @@ export namespace encryptedDeposit {
|
|
|
581
584
|
* const prepared = await Actions.zone.encryptedDeposit.prepare(client, {
|
|
582
585
|
* token: '0x20c0...0001',
|
|
583
586
|
* amount: 1_000_000n,
|
|
584
|
-
* bouncebackRecipient: '0x...',
|
|
585
587
|
* recipient: '0x...',
|
|
586
588
|
* sender: '0x...',
|
|
589
|
+
* tempoRefundRecipient: '0x...',
|
|
587
590
|
* zoneId: 7,
|
|
588
591
|
* })
|
|
589
592
|
* ```
|
|
@@ -604,11 +607,11 @@ export namespace encryptedDeposit {
|
|
|
604
607
|
|
|
605
608
|
const {
|
|
606
609
|
amount,
|
|
607
|
-
bouncebackRecipient,
|
|
608
610
|
memo,
|
|
609
611
|
portalAddress: portalAddress_,
|
|
610
612
|
recipient,
|
|
611
613
|
sender: sender_ = client.account?.address,
|
|
614
|
+
tempoRefundRecipient,
|
|
612
615
|
token,
|
|
613
616
|
zoneId,
|
|
614
617
|
...rest
|
|
@@ -634,12 +637,12 @@ export namespace encryptedDeposit {
|
|
|
634
637
|
|
|
635
638
|
return {
|
|
636
639
|
amount,
|
|
637
|
-
bouncebackRecipient,
|
|
638
640
|
chainId,
|
|
639
641
|
encrypted,
|
|
640
642
|
keyIndex,
|
|
641
643
|
portalAddress,
|
|
642
644
|
sender,
|
|
645
|
+
tempoRefundRecipient,
|
|
643
646
|
token,
|
|
644
647
|
zoneId,
|
|
645
648
|
}
|
|
@@ -661,8 +664,6 @@ export namespace encryptedDeposit {
|
|
|
661
664
|
export type Args = {
|
|
662
665
|
/** Amount of tokens to deposit. */
|
|
663
666
|
amount: bigint
|
|
664
|
-
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
665
|
-
bouncebackRecipient: Address
|
|
666
667
|
/** Optional deposit memo. @default `0x00...00` */
|
|
667
668
|
memo?: Hex.Hex | undefined
|
|
668
669
|
/** Zone portal address. @default resolved via the portal registry. */
|
|
@@ -671,6 +672,8 @@ export namespace encryptedDeposit {
|
|
|
671
672
|
recipient: Address
|
|
672
673
|
/** Address that will call the Zone portal. */
|
|
673
674
|
sender: Address
|
|
675
|
+
/** Refund recipient on the parent chain if the deposit bounces. */
|
|
676
|
+
tempoRefundRecipient: Address
|
|
674
677
|
/** Token address or ID to deposit. */
|
|
675
678
|
token: TokenId.TokenIdOrAddress
|
|
676
679
|
/** Zone ID (e.g. `7`). */
|
|
@@ -796,10 +799,10 @@ export namespace encryptedDeposit {
|
|
|
796
799
|
export function calls(args: Args | PreparedEncryptedDeposit) {
|
|
797
800
|
const {
|
|
798
801
|
amount,
|
|
799
|
-
bouncebackRecipient,
|
|
800
802
|
chainId,
|
|
801
803
|
encrypted,
|
|
802
804
|
keyIndex,
|
|
805
|
+
tempoRefundRecipient,
|
|
803
806
|
token,
|
|
804
807
|
zoneId,
|
|
805
808
|
} = args
|
|
@@ -828,7 +831,7 @@ export namespace encryptedDeposit {
|
|
|
828
831
|
amount,
|
|
829
832
|
keyIndex,
|
|
830
833
|
encryptedPayload,
|
|
831
|
-
|
|
834
|
+
tempoRefundRecipient,
|
|
832
835
|
],
|
|
833
836
|
})
|
|
834
837
|
return [approveCall, depositCall]
|
|
@@ -882,7 +885,8 @@ export async function encryptedDepositSync<
|
|
|
882
885
|
const account_ = account ? parseAccount(account) : undefined
|
|
883
886
|
if (!account_) throw new Error('`account` is required.')
|
|
884
887
|
|
|
885
|
-
const
|
|
888
|
+
const tempoRefundRecipient =
|
|
889
|
+
parameters.tempoRefundRecipient ?? account_.address
|
|
886
890
|
|
|
887
891
|
if ('encrypted' in parameters) {
|
|
888
892
|
if (parameters.chainId !== chainId) {
|
|
@@ -896,7 +900,7 @@ export async function encryptedDepositSync<
|
|
|
896
900
|
throwOnReceiptRevert,
|
|
897
901
|
calls: encryptedDeposit.calls({
|
|
898
902
|
...parameters,
|
|
899
|
-
|
|
903
|
+
tempoRefundRecipient,
|
|
900
904
|
}),
|
|
901
905
|
} as never)
|
|
902
906
|
return { receipt }
|
|
@@ -906,11 +910,11 @@ export async function encryptedDepositSync<
|
|
|
906
910
|
|
|
907
911
|
const prepared = await encryptedDeposit.prepare(client, {
|
|
908
912
|
amount: parameters.amount,
|
|
909
|
-
bouncebackRecipient,
|
|
910
913
|
memo: parameters.memo,
|
|
911
914
|
portalAddress: parameters.portalAddress,
|
|
912
915
|
recipient,
|
|
913
916
|
sender: account_.address,
|
|
917
|
+
tempoRefundRecipient,
|
|
914
918
|
token: parameters.token,
|
|
915
919
|
zoneId: parameters.zoneId,
|
|
916
920
|
})
|
package/tempo/zones/Abis.ts
CHANGED
|
@@ -121,7 +121,7 @@ export const zonePortal = [
|
|
|
121
121
|
{ name: 'to', type: 'address' },
|
|
122
122
|
{ name: 'amount', type: 'uint128' },
|
|
123
123
|
{ name: 'memo', type: 'bytes32' },
|
|
124
|
-
{ name: '
|
|
124
|
+
{ name: 'tempoRefundRecipient', type: 'address' },
|
|
125
125
|
],
|
|
126
126
|
outputs: [{ name: '', type: 'bytes32' }],
|
|
127
127
|
},
|
|
@@ -144,7 +144,7 @@ export const zonePortal = [
|
|
|
144
144
|
{ name: 'tag', type: 'bytes16' },
|
|
145
145
|
],
|
|
146
146
|
},
|
|
147
|
-
{ name: '
|
|
147
|
+
{ name: 'tempoRefundRecipient', type: 'address' },
|
|
148
148
|
],
|
|
149
149
|
outputs: [{ name: '', type: 'bytes32' }],
|
|
150
150
|
},
|