ox 0.14.0 → 0.14.1
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/tempo/AuthorizationTempo.js +7 -2
- package/_cjs/tempo/AuthorizationTempo.js.map +1 -1
- package/_cjs/tempo/KeyAuthorization.js +18 -4
- package/_cjs/tempo/KeyAuthorization.js.map +1 -1
- package/_cjs/tempo/SignatureEnvelope.js +27 -7
- package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
- package/_cjs/tempo/TempoAddress.js +10 -3
- package/_cjs/tempo/TempoAddress.js.map +1 -1
- package/_cjs/tempo/TokenId.js +8 -5
- package/_cjs/tempo/TokenId.js.map +1 -1
- package/_cjs/tempo/TransactionRequest.js +2 -1
- package/_cjs/tempo/TransactionRequest.js.map +1 -1
- package/_cjs/tempo/TxEnvelopeTempo.js +13 -3
- package/_cjs/tempo/TxEnvelopeTempo.js.map +1 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/tempo/AuthorizationTempo.js +24 -19
- package/_esm/tempo/AuthorizationTempo.js.map +1 -1
- package/_esm/tempo/KeyAuthorization.js +19 -4
- package/_esm/tempo/KeyAuthorization.js.map +1 -1
- package/_esm/tempo/SignatureEnvelope.js +27 -7
- package/_esm/tempo/SignatureEnvelope.js.map +1 -1
- package/_esm/tempo/TempoAddress.js +33 -3
- package/_esm/tempo/TempoAddress.js.map +1 -1
- package/_esm/tempo/TokenId.js +9 -6
- package/_esm/tempo/TokenId.js.map +1 -1
- package/_esm/tempo/TransactionRequest.js +2 -1
- package/_esm/tempo/TransactionRequest.js.map +1 -1
- package/_esm/tempo/TxEnvelopeTempo.js +26 -15
- package/_esm/tempo/TxEnvelopeTempo.js.map +1 -1
- package/_esm/tempo/index.js +9 -8
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/tempo/AuthorizationTempo.d.ts +19 -19
- package/_types/tempo/AuthorizationTempo.d.ts.map +1 -1
- package/_types/tempo/KeyAuthorization.d.ts +4 -2
- package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
- package/_types/tempo/SignatureEnvelope.d.ts +11 -2
- package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/_types/tempo/TempoAddress.d.ts +32 -4
- package/_types/tempo/TempoAddress.d.ts.map +1 -1
- package/_types/tempo/TokenId.d.ts +6 -5
- package/_types/tempo/TokenId.d.ts.map +1 -1
- package/_types/tempo/TransactionRequest.d.ts +2 -1
- package/_types/tempo/TransactionRequest.d.ts.map +1 -1
- package/_types/tempo/TxEnvelopeTempo.d.ts +19 -18
- package/_types/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +9 -8
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +1 -1
- package/tempo/AuthorizationTempo.test.ts +13 -0
- package/tempo/AuthorizationTempo.ts +27 -21
- package/tempo/KeyAuthorization.test.ts +25 -0
- package/tempo/KeyAuthorization.ts +23 -7
- package/tempo/PoolId.test.ts +9 -0
- package/tempo/SignatureEnvelope.test.ts +108 -0
- package/tempo/SignatureEnvelope.ts +47 -9
- package/tempo/TempoAddress.test.ts +21 -0
- package/tempo/TempoAddress.ts +41 -10
- package/tempo/TokenId.test.ts +14 -0
- package/tempo/TokenId.ts +13 -10
- package/tempo/TransactionRequest.ts +3 -2
- package/tempo/TxEnvelopeTempo.test.ts +72 -0
- package/tempo/TxEnvelopeTempo.ts +37 -21
- package/tempo/e2e.test.ts +10 -21
- package/tempo/index.ts +9 -8
- package/version.ts +1 -1
|
@@ -692,6 +692,32 @@ describe('from', () => {
|
|
|
692
692
|
}
|
|
693
693
|
})
|
|
694
694
|
|
|
695
|
+
test('tempo address input for calls.to', () => {
|
|
696
|
+
const hexAddr = '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
|
|
697
|
+
const tempoAddr = 'tempo1qpcfj7tsc5vp9hp6qyx86qd4pcx30hreeqlrsqqr'
|
|
698
|
+
|
|
699
|
+
const envelope = TxEnvelopeTempo.from({
|
|
700
|
+
chainId: 1,
|
|
701
|
+
calls: [{ to: tempoAddr }],
|
|
702
|
+
nonce: 0n,
|
|
703
|
+
nonceKey: 0n,
|
|
704
|
+
})
|
|
705
|
+
expect(envelope.calls[0]!.to).toBe(Address.checksum(hexAddr))
|
|
706
|
+
})
|
|
707
|
+
|
|
708
|
+
test('tempo address input for from', () => {
|
|
709
|
+
const hexAddr = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
|
|
710
|
+
const tempoAddr = 'tempo1qreel4h9r2kc3ah5ee4t3qnj088llwfzvccugvl7'
|
|
711
|
+
|
|
712
|
+
const envelope = TxEnvelopeTempo.from({
|
|
713
|
+
chainId: 1,
|
|
714
|
+
calls: [{}],
|
|
715
|
+
nonce: 0n,
|
|
716
|
+
from: tempoAddr as any,
|
|
717
|
+
})
|
|
718
|
+
expect(envelope.from).toBe(Address.checksum(hexAddr))
|
|
719
|
+
})
|
|
720
|
+
|
|
695
721
|
test('options: signature', () => {
|
|
696
722
|
const envelope = TxEnvelopeTempo.from(
|
|
697
723
|
{
|
|
@@ -1382,6 +1408,29 @@ describe('getSignPayload', () => {
|
|
|
1382
1408
|
`"0xe1222a45806457acbe3a13940aae4c34f3180659fa16613b5a45dc183adae07c"`,
|
|
1383
1409
|
)
|
|
1384
1410
|
})
|
|
1411
|
+
|
|
1412
|
+
test('tempo address input for from', () => {
|
|
1413
|
+
const hexAddr = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
|
|
1414
|
+
const tempoAddr = 'tempo1qreel4h9r2kc3ah5ee4t3qnj088llwfzvccugvl7'
|
|
1415
|
+
|
|
1416
|
+
const transaction = TxEnvelopeTempo.from({
|
|
1417
|
+
chainId: 1,
|
|
1418
|
+
calls: [
|
|
1419
|
+
{
|
|
1420
|
+
to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
1421
|
+
},
|
|
1422
|
+
],
|
|
1423
|
+
nonce: 0n,
|
|
1424
|
+
})
|
|
1425
|
+
|
|
1426
|
+
const hashHex = TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1427
|
+
from: hexAddr,
|
|
1428
|
+
})
|
|
1429
|
+
const hashTempo = TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1430
|
+
from: tempoAddr,
|
|
1431
|
+
})
|
|
1432
|
+
expect(hashTempo).toBe(hashHex)
|
|
1433
|
+
})
|
|
1385
1434
|
})
|
|
1386
1435
|
|
|
1387
1436
|
describe('getFeePayerSignPayload', () => {
|
|
@@ -1404,6 +1453,29 @@ describe('getFeePayerSignPayload', () => {
|
|
|
1404
1453
|
)
|
|
1405
1454
|
})
|
|
1406
1455
|
|
|
1456
|
+
test('tempo address input for sender', () => {
|
|
1457
|
+
const hexAddr = '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
|
|
1458
|
+
const tempoAddr = 'tempo1qreel4h9r2kc3ah5ee4t3qnj088llwfzvccugvl7'
|
|
1459
|
+
|
|
1460
|
+
const transaction = TxEnvelopeTempo.from({
|
|
1461
|
+
chainId: 1,
|
|
1462
|
+
calls: [
|
|
1463
|
+
{
|
|
1464
|
+
to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
|
1465
|
+
},
|
|
1466
|
+
],
|
|
1467
|
+
nonce: 0n,
|
|
1468
|
+
})
|
|
1469
|
+
|
|
1470
|
+
const hashHex = TxEnvelopeTempo.getFeePayerSignPayload(transaction, {
|
|
1471
|
+
sender: hexAddr,
|
|
1472
|
+
})
|
|
1473
|
+
const hashTempo = TxEnvelopeTempo.getFeePayerSignPayload(transaction, {
|
|
1474
|
+
sender: tempoAddr,
|
|
1475
|
+
})
|
|
1476
|
+
expect(hashTempo).toBe(hashHex)
|
|
1477
|
+
})
|
|
1478
|
+
|
|
1407
1479
|
test('with feeToken', () => {
|
|
1408
1480
|
const transaction = TxEnvelopeTempo.from({
|
|
1409
1481
|
chainId: 1,
|
package/tempo/TxEnvelopeTempo.ts
CHANGED
|
@@ -17,6 +17,7 @@ import * as TransactionEnvelope from '../core/TxEnvelope.js'
|
|
|
17
17
|
import * as AuthorizationTempo from './AuthorizationTempo.js'
|
|
18
18
|
import * as KeyAuthorization from './KeyAuthorization.js'
|
|
19
19
|
import * as SignatureEnvelope from './SignatureEnvelope.js'
|
|
20
|
+
import * as TempoAddress from './TempoAddress.js'
|
|
20
21
|
import * as TokenId from './TokenId.js'
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -26,11 +27,11 @@ import * as TokenId from './TokenId.js'
|
|
|
26
27
|
*
|
|
27
28
|
* [Batch Calls](https://docs.tempo.xyz/protocol/transactions#batch-calls)
|
|
28
29
|
*/
|
|
29
|
-
export type Call<bigintType = bigint> = {
|
|
30
|
+
export type Call<bigintType = bigint, addressType = Address.Address> = {
|
|
30
31
|
/** Call data. */
|
|
31
32
|
data?: Hex.Hex | undefined
|
|
32
33
|
/** The target address or contract creation. */
|
|
33
|
-
to?:
|
|
34
|
+
to?: addressType | undefined
|
|
34
35
|
/** Value to send (in wei). */
|
|
35
36
|
value?: bigintType | undefined
|
|
36
37
|
}
|
|
@@ -77,11 +78,11 @@ export type TxEnvelopeTempo<
|
|
|
77
78
|
| AuthorizationTempo.ListSigned<bigintType, numberType>
|
|
78
79
|
| undefined
|
|
79
80
|
/** Array of calls to execute. */
|
|
80
|
-
calls: readonly Call<bigintType>[]
|
|
81
|
+
calls: readonly Call<bigintType, TempoAddress.Address>[]
|
|
81
82
|
/** EIP-155 Chain ID. */
|
|
82
83
|
chainId: numberType
|
|
83
84
|
/** Sender of the transaction. */
|
|
84
|
-
from?:
|
|
85
|
+
from?: TempoAddress.Address | undefined
|
|
85
86
|
/** Gas provided for transaction execution */
|
|
86
87
|
gas?: bigintType | undefined
|
|
87
88
|
/** Fee payer signature. */
|
|
@@ -154,7 +155,7 @@ export type Type = typeof type
|
|
|
154
155
|
* import { TxEnvelopeTempo } from 'ox/tempo'
|
|
155
156
|
*
|
|
156
157
|
* TxEnvelopeTempo.assert({
|
|
157
|
-
* calls: [{ to: '
|
|
158
|
+
* calls: [{ to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme', value: 0n }],
|
|
158
159
|
* chainId: 1,
|
|
159
160
|
* maxFeePerGas: 1000000000n,
|
|
160
161
|
* })
|
|
@@ -413,7 +414,7 @@ export declare namespace deserialize {
|
|
|
413
414
|
* chainId: 1, // [!code focus]
|
|
414
415
|
* calls: [{ // [!code focus]
|
|
415
416
|
* data: '0xdeadbeef', // [!code focus]
|
|
416
|
-
* to: '
|
|
417
|
+
* to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme', // [!code focus]
|
|
417
418
|
* }], // [!code focus]
|
|
418
419
|
* maxFeePerGas: Value.fromGwei('10'), // [!code focus]
|
|
419
420
|
* maxPriorityFeePerGas: Value.fromGwei('1'), // [!code focus]
|
|
@@ -434,7 +435,7 @@ export declare namespace deserialize {
|
|
|
434
435
|
* chainId: 1,
|
|
435
436
|
* calls: [{
|
|
436
437
|
* data: '0xdeadbeef',
|
|
437
|
-
* to: '
|
|
438
|
+
* to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
|
|
438
439
|
* }],
|
|
439
440
|
* maxFeePerGas: Value.fromGwei('10'),
|
|
440
441
|
* maxPriorityFeePerGas: Value.fromGwei('1'),
|
|
@@ -497,6 +498,19 @@ export function from<
|
|
|
497
498
|
typeof envelope === 'string' ? deserialize(envelope) : envelope
|
|
498
499
|
) as TxEnvelopeTempo
|
|
499
500
|
|
|
501
|
+
// Resolve TempoAddress inputs to hex addresses.
|
|
502
|
+
if (envelope_.from)
|
|
503
|
+
envelope_.from = TempoAddress.resolve(
|
|
504
|
+
envelope_.from as TempoAddress.Address,
|
|
505
|
+
)
|
|
506
|
+
if (envelope_.calls)
|
|
507
|
+
envelope_.calls = (envelope_.calls as readonly Call[]).map((call) => ({
|
|
508
|
+
...call,
|
|
509
|
+
...(call.to
|
|
510
|
+
? { to: TempoAddress.resolve(call.to as TempoAddress.Address) }
|
|
511
|
+
: {}),
|
|
512
|
+
})) as readonly Call[]
|
|
513
|
+
|
|
500
514
|
assert(envelope_)
|
|
501
515
|
|
|
502
516
|
return {
|
|
@@ -559,7 +573,7 @@ export declare namespace from {
|
|
|
559
573
|
* chainId: 1,
|
|
560
574
|
* calls: [{
|
|
561
575
|
* data: '0xdeadbeef',
|
|
562
|
-
* to: '
|
|
576
|
+
* to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
|
|
563
577
|
* }],
|
|
564
578
|
* maxFeePerGas: Value.fromGwei('10'),
|
|
565
579
|
* })
|
|
@@ -581,7 +595,7 @@ export declare namespace from {
|
|
|
581
595
|
* chainId: 1,
|
|
582
596
|
* calls: [{
|
|
583
597
|
* data: '0xdeadbeef',
|
|
584
|
-
* to: '
|
|
598
|
+
* to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
|
|
585
599
|
* }],
|
|
586
600
|
* maxFeePerGas: Value.fromGwei('10'),
|
|
587
601
|
* })
|
|
@@ -632,7 +646,7 @@ export function serialize(
|
|
|
632
646
|
|
|
633
647
|
// Encode calls as RLP list of [to, value, data] tuples
|
|
634
648
|
const callsTupleList = calls.map((call) => [
|
|
635
|
-
call.to
|
|
649
|
+
call.to ? TempoAddress.resolve(call.to) : '0x',
|
|
636
650
|
call.value ? Hex.fromNumber(call.value) : '0x',
|
|
637
651
|
call.data ?? '0x',
|
|
638
652
|
])
|
|
@@ -766,7 +780,7 @@ export declare namespace serialize {
|
|
|
766
780
|
* chainId: 1,
|
|
767
781
|
* calls: [{
|
|
768
782
|
* data: '0xdeadbeef',
|
|
769
|
-
* to: '
|
|
783
|
+
* to: 'tempo1qpcfj7tsc5vp9hp6qyx86qd4pcx30hreeqlrsqqr',
|
|
770
784
|
* }],
|
|
771
785
|
* nonce: 0n,
|
|
772
786
|
* maxFeePerGas: 1000000000n,
|
|
@@ -796,7 +810,7 @@ export declare namespace serialize {
|
|
|
796
810
|
* chainId: 1,
|
|
797
811
|
* calls: [{
|
|
798
812
|
* data: '0xdeadbeef',
|
|
799
|
-
* to: '
|
|
813
|
+
* to: 'tempo1qpcfj7tsc5vp9hp6qyx86qd4pcx30hreeqlrsqqr',
|
|
800
814
|
* }],
|
|
801
815
|
* nonce: 0n,
|
|
802
816
|
* maxFeePerGas: 1000000000n,
|
|
@@ -825,7 +839,9 @@ export function getSignPayload(
|
|
|
825
839
|
): getSignPayload.ReturnValue {
|
|
826
840
|
const sigHash = hash(envelope, { presign: true })
|
|
827
841
|
if (options.from)
|
|
828
|
-
return Hash.keccak256(
|
|
842
|
+
return Hash.keccak256(
|
|
843
|
+
Hex.concat('0x04', sigHash, TempoAddress.resolve(options.from)),
|
|
844
|
+
)
|
|
829
845
|
return sigHash
|
|
830
846
|
}
|
|
831
847
|
|
|
@@ -837,7 +853,7 @@ export declare namespace getSignPayload {
|
|
|
837
853
|
* When provided, computes `keccak256(0x04 || sigHash || from)` instead of
|
|
838
854
|
* the raw `sigHash`, binding the access key signature to the specific user account.
|
|
839
855
|
*/
|
|
840
|
-
from?:
|
|
856
|
+
from?: TempoAddress.Address | undefined
|
|
841
857
|
}
|
|
842
858
|
|
|
843
859
|
type ReturnValue = Hex.Hex
|
|
@@ -858,7 +874,7 @@ export declare namespace getSignPayload {
|
|
|
858
874
|
* chainId: 1,
|
|
859
875
|
* calls: [{
|
|
860
876
|
* data: '0xdeadbeef',
|
|
861
|
-
* to: '
|
|
877
|
+
* to: 'tempo1qpcfj7tsc5vp9hp6qyx86qd4pcx30hreeqlrsqqr',
|
|
862
878
|
* }],
|
|
863
879
|
* nonce: 0n,
|
|
864
880
|
* maxFeePerGas: 1000000000n,
|
|
@@ -932,7 +948,7 @@ export declare namespace hash {
|
|
|
932
948
|
* chainId: 1,
|
|
933
949
|
* calls: [{
|
|
934
950
|
* data: '0xdeadbeef',
|
|
935
|
-
* to: '
|
|
951
|
+
* to: 'tempo1qpcfj7tsc5vp9hp6qyx86qd4pcx30hreeqlrsqqr',
|
|
936
952
|
* }],
|
|
937
953
|
* nonce: 0n,
|
|
938
954
|
* maxFeePerGas: 1000000000n,
|
|
@@ -940,7 +956,7 @@ export declare namespace hash {
|
|
|
940
956
|
* })
|
|
941
957
|
*
|
|
942
958
|
* const payload = TxEnvelopeTempo.getFeePayerSignPayload(envelope, {
|
|
943
|
-
* sender: '
|
|
959
|
+
* sender: 'tempo1qrvd56ljd9j2l8t7ak0q8ef5zhfh42tqg5kwwrau'
|
|
944
960
|
* }) // [!code focus]
|
|
945
961
|
* // @log: '0x...'
|
|
946
962
|
*
|
|
@@ -955,7 +971,7 @@ export function getFeePayerSignPayload(
|
|
|
955
971
|
envelope: TxEnvelopeTempo,
|
|
956
972
|
options: getFeePayerSignPayload.Options,
|
|
957
973
|
): getFeePayerSignPayload.ReturnValue {
|
|
958
|
-
const
|
|
974
|
+
const sender = TempoAddress.resolve(options.sender)
|
|
959
975
|
const serialized = serialize(
|
|
960
976
|
{ ...envelope, signature: undefined },
|
|
961
977
|
{
|
|
@@ -971,7 +987,7 @@ export declare namespace getFeePayerSignPayload {
|
|
|
971
987
|
/**
|
|
972
988
|
* Sender address to cover the fee of.
|
|
973
989
|
*/
|
|
974
|
-
sender:
|
|
990
|
+
sender: TempoAddress.Address
|
|
975
991
|
}
|
|
976
992
|
|
|
977
993
|
type ReturnValue = Hex.Hex
|
|
@@ -989,7 +1005,7 @@ export declare namespace getFeePayerSignPayload {
|
|
|
989
1005
|
* const valid = TxEnvelopeTempo.validate({
|
|
990
1006
|
* calls: [{
|
|
991
1007
|
* data: '0xdeadbeef',
|
|
992
|
-
* to: '
|
|
1008
|
+
* to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme',
|
|
993
1009
|
* }],
|
|
994
1010
|
* chainId: 1,
|
|
995
1011
|
* maxFeePerGas: 1000000000n,
|
|
@@ -1041,7 +1057,7 @@ export class CallsEmptyError extends Errors.BaseError {
|
|
|
1041
1057
|
* import { TxEnvelopeTempo } from 'ox/tempo'
|
|
1042
1058
|
*
|
|
1043
1059
|
* TxEnvelopeTempo.assert({
|
|
1044
|
-
* calls: [{ to: '
|
|
1060
|
+
* calls: [{ to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme' }],
|
|
1045
1061
|
* chainId: 1,
|
|
1046
1062
|
* validBefore: 100,
|
|
1047
1063
|
* validAfter: 200,
|
package/tempo/e2e.test.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from 'ox'
|
|
10
10
|
import { getTransactionCount } from 'viem/actions'
|
|
11
11
|
import { beforeEach, describe, expect, test } from 'vitest'
|
|
12
|
-
import { chain, client, fundAddress
|
|
12
|
+
import { chain, client, fundAddress } from '../../test/tempo/config.js'
|
|
13
13
|
import {
|
|
14
14
|
AuthorizationTempo,
|
|
15
15
|
KeyAuthorization,
|
|
@@ -20,8 +20,6 @@ import * as TransactionReceipt from './TransactionReceipt.js'
|
|
|
20
20
|
import * as TxEnvelopeTempo from './TxEnvelopeTempo.js'
|
|
21
21
|
|
|
22
22
|
const chainId = chain.id
|
|
23
|
-
// TODO: remove when v2 keychain signatures are deployed to testnet.
|
|
24
|
-
const keychainVersion = nodeEnv === 'localnet' ? 'v2' : undefined
|
|
25
23
|
|
|
26
24
|
test('behavior: default (secp256k1)', async () => {
|
|
27
25
|
const privateKey = Secp256k1.randomPrivateKey()
|
|
@@ -843,7 +841,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
843
841
|
|
|
844
842
|
const signature = Secp256k1.sign({
|
|
845
843
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
846
|
-
from:
|
|
844
|
+
from: root.address,
|
|
847
845
|
}),
|
|
848
846
|
privateKey: access.privateKey,
|
|
849
847
|
})
|
|
@@ -853,7 +851,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
853
851
|
userAddress: root.address,
|
|
854
852
|
inner: SignatureEnvelope.from(signature),
|
|
855
853
|
type: 'keychain',
|
|
856
|
-
version: keychainVersion,
|
|
857
854
|
}),
|
|
858
855
|
})
|
|
859
856
|
|
|
@@ -985,7 +982,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
985
982
|
|
|
986
983
|
const signature = Secp256k1.sign({
|
|
987
984
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
988
|
-
from:
|
|
985
|
+
from: root.address,
|
|
989
986
|
}),
|
|
990
987
|
privateKey: access.privateKey,
|
|
991
988
|
})
|
|
@@ -995,7 +992,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
995
992
|
userAddress: root.address,
|
|
996
993
|
inner: SignatureEnvelope.from(signature),
|
|
997
994
|
type: 'keychain',
|
|
998
|
-
version: keychainVersion,
|
|
999
995
|
}),
|
|
1000
996
|
})
|
|
1001
997
|
|
|
@@ -1056,7 +1052,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1056
1052
|
|
|
1057
1053
|
const signature = P256.sign({
|
|
1058
1054
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1059
|
-
from:
|
|
1055
|
+
from: root.address,
|
|
1060
1056
|
}),
|
|
1061
1057
|
privateKey: access.privateKey,
|
|
1062
1058
|
})
|
|
@@ -1071,7 +1067,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1071
1067
|
type: 'p256',
|
|
1072
1068
|
}),
|
|
1073
1069
|
type: 'keychain',
|
|
1074
|
-
version: keychainVersion,
|
|
1075
1070
|
}),
|
|
1076
1071
|
})
|
|
1077
1072
|
|
|
@@ -1204,7 +1199,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1204
1199
|
|
|
1205
1200
|
const signature = P256.sign({
|
|
1206
1201
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1207
|
-
from:
|
|
1202
|
+
from: root.address,
|
|
1208
1203
|
}),
|
|
1209
1204
|
privateKey: access.privateKey,
|
|
1210
1205
|
})
|
|
@@ -1219,7 +1214,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1219
1214
|
type: 'p256',
|
|
1220
1215
|
}),
|
|
1221
1216
|
type: 'keychain',
|
|
1222
|
-
version: keychainVersion,
|
|
1223
1217
|
}),
|
|
1224
1218
|
})
|
|
1225
1219
|
|
|
@@ -1278,7 +1272,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1278
1272
|
|
|
1279
1273
|
const signature = await WebCryptoP256.sign({
|
|
1280
1274
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1281
|
-
from:
|
|
1275
|
+
from: root.address,
|
|
1282
1276
|
}),
|
|
1283
1277
|
privateKey: keyPair.privateKey,
|
|
1284
1278
|
})
|
|
@@ -1293,7 +1287,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1293
1287
|
type: 'p256',
|
|
1294
1288
|
}),
|
|
1295
1289
|
type: 'keychain',
|
|
1296
|
-
version: keychainVersion,
|
|
1297
1290
|
}),
|
|
1298
1291
|
})
|
|
1299
1292
|
|
|
@@ -1387,7 +1380,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1387
1380
|
|
|
1388
1381
|
const signature = await WebCryptoP256.sign({
|
|
1389
1382
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1390
|
-
from:
|
|
1383
|
+
from: root.address,
|
|
1391
1384
|
}),
|
|
1392
1385
|
privateKey: keyPair.privateKey,
|
|
1393
1386
|
})
|
|
@@ -1402,7 +1395,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1402
1395
|
type: 'p256',
|
|
1403
1396
|
}),
|
|
1404
1397
|
type: 'keychain',
|
|
1405
|
-
version: keychainVersion,
|
|
1406
1398
|
}),
|
|
1407
1399
|
})
|
|
1408
1400
|
|
|
@@ -1469,7 +1461,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1469
1461
|
|
|
1470
1462
|
const signature = P256.sign({
|
|
1471
1463
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1472
|
-
from:
|
|
1464
|
+
from: root.address,
|
|
1473
1465
|
}),
|
|
1474
1466
|
privateKey: access.privateKey,
|
|
1475
1467
|
})
|
|
@@ -1484,7 +1476,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1484
1476
|
type: 'p256',
|
|
1485
1477
|
}),
|
|
1486
1478
|
type: 'keychain',
|
|
1487
|
-
version: keychainVersion,
|
|
1488
1479
|
}),
|
|
1489
1480
|
})
|
|
1490
1481
|
|
|
@@ -1566,7 +1557,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1566
1557
|
|
|
1567
1558
|
const signature = Secp256k1.sign({
|
|
1568
1559
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1569
|
-
from:
|
|
1560
|
+
from: root.address,
|
|
1570
1561
|
}),
|
|
1571
1562
|
privateKey: access.privateKey,
|
|
1572
1563
|
})
|
|
@@ -1576,7 +1567,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1576
1567
|
userAddress: root.address,
|
|
1577
1568
|
inner: SignatureEnvelope.from(signature),
|
|
1578
1569
|
type: 'keychain',
|
|
1579
|
-
version: keychainVersion,
|
|
1580
1570
|
}),
|
|
1581
1571
|
})
|
|
1582
1572
|
|
|
@@ -1653,7 +1643,7 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1653
1643
|
|
|
1654
1644
|
const signature = Secp256k1.sign({
|
|
1655
1645
|
payload: TxEnvelopeTempo.getSignPayload(transaction, {
|
|
1656
|
-
from:
|
|
1646
|
+
from: root.address,
|
|
1657
1647
|
}),
|
|
1658
1648
|
privateKey: access.privateKey,
|
|
1659
1649
|
})
|
|
@@ -1663,7 +1653,6 @@ describe('behavior: keyAuthorization', () => {
|
|
|
1663
1653
|
userAddress: root.address,
|
|
1664
1654
|
inner: SignatureEnvelope.from(signature),
|
|
1665
1655
|
type: 'keychain',
|
|
1666
|
-
version: keychainVersion,
|
|
1667
1656
|
}),
|
|
1668
1657
|
})
|
|
1669
1658
|
|
package/tempo/index.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type {}
|
|
|
17
17
|
* import { AuthorizationTempo } from 'ox/tempo'
|
|
18
18
|
*
|
|
19
19
|
* const authorization = AuthorizationTempo.from({
|
|
20
|
-
* address: '
|
|
20
|
+
* address: 'tempo1qzlftsl42n5lep0v2xlxng7cq7sd2k709sxlwnsu',
|
|
21
21
|
* chainId: 1,
|
|
22
22
|
* nonce: 40n,
|
|
23
23
|
* })
|
|
@@ -55,10 +55,11 @@ export * as AuthorizationTempo from './AuthorizationTempo.js'
|
|
|
55
55
|
*
|
|
56
56
|
* const authorization = KeyAuthorization.from({
|
|
57
57
|
* address,
|
|
58
|
+
* chainId: 4217n,
|
|
58
59
|
* expiry: 1234567890,
|
|
59
60
|
* type: 'p256',
|
|
60
61
|
* limits: [{
|
|
61
|
-
* token: '
|
|
62
|
+
* token: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
|
|
62
63
|
* limit: Value.from('10', 6),
|
|
63
64
|
* }],
|
|
64
65
|
* })
|
|
@@ -179,7 +180,7 @@ export * as Tick from './Tick.js'
|
|
|
179
180
|
*
|
|
180
181
|
* const tokenId = TokenId.from(1n)
|
|
181
182
|
* const address = TokenId.toAddress(1n)
|
|
182
|
-
* // '
|
|
183
|
+
* // 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd'
|
|
183
184
|
* ```
|
|
184
185
|
*
|
|
185
186
|
* @category Reference
|
|
@@ -231,7 +232,7 @@ export * as TokenRole from './TokenRole.js'
|
|
|
231
232
|
* value: '0x9b6e64a8ec60000',
|
|
232
233
|
* },
|
|
233
234
|
* ],
|
|
234
|
-
* feeToken: '
|
|
235
|
+
* feeToken: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv0ywuh',
|
|
235
236
|
* transactionIndex: '0x2',
|
|
236
237
|
* from: '0x814e5e0e31016b9a7f138c76b7e7b2bb5c1ab6a6',
|
|
237
238
|
* value: '0x9b6e64a8ec60000',
|
|
@@ -270,7 +271,7 @@ export * as Transaction from './Transaction.js'
|
|
|
270
271
|
* const receipt = TransactionReceipt.fromRpc({
|
|
271
272
|
* status: '0x1',
|
|
272
273
|
* feePayer: '0x...',
|
|
273
|
-
* feeToken: '
|
|
274
|
+
* feeToken: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqyr9xgnd',
|
|
274
275
|
* // ... other fields
|
|
275
276
|
* } as any)
|
|
276
277
|
* ```
|
|
@@ -291,8 +292,8 @@ export * as TransactionReceipt from './TransactionReceipt.js'
|
|
|
291
292
|
* import { TransactionRequest } from 'ox/tempo'
|
|
292
293
|
*
|
|
293
294
|
* const request = TransactionRequest.toRpc({
|
|
294
|
-
* calls: [{ to: '
|
|
295
|
-
* feeToken: '
|
|
295
|
+
* calls: [{ to: 'tempo1qr90aw47etlt40k2l6atajh7h2lv4l46hcx5uwlp', data: '0xdeadbeef' }],
|
|
296
|
+
* feeToken: 'tempo1qqsvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqv0ywuh',
|
|
296
297
|
* })
|
|
297
298
|
* ```
|
|
298
299
|
*
|
|
@@ -314,7 +315,7 @@ export * as TransactionRequest from './TransactionRequest.js'
|
|
|
314
315
|
*
|
|
315
316
|
* const envelope = TxEnvelopeTempo.from({
|
|
316
317
|
* chainId: 1,
|
|
317
|
-
* calls: [{ to: '
|
|
318
|
+
* calls: [{ to: 'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj97hme', data: '0xdeadbeef' }],
|
|
318
319
|
* maxFeePerGas: Value.fromGwei('10'),
|
|
319
320
|
* })
|
|
320
321
|
*
|
package/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal */
|
|
2
|
-
export const version = '0.14.
|
|
2
|
+
export const version = '0.14.1'
|