ox 0.14.24 → 0.14.25
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/Channel.js +31 -11
- package/_cjs/tempo/Channel.js.map +1 -1
- package/_cjs/tempo/index.js +1 -2
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/tempo/Channel.js +56 -13
- package/_esm/tempo/Channel.js.map +1 -1
- package/_esm/tempo/index.js +9 -30
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/tempo/Channel.d.ts +73 -8
- package/_types/tempo/Channel.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +9 -30
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +1 -6
- package/tempo/Channel.test.ts +99 -16
- package/tempo/Channel.ts +127 -18
- package/tempo/index.ts +9 -30
- package/version.ts +1 -1
- package/_cjs/tempo/ChannelDescriptor.js +0 -24
- package/_cjs/tempo/ChannelDescriptor.js.map +0 -1
- package/_esm/tempo/ChannelDescriptor.js +0 -43
- package/_esm/tempo/ChannelDescriptor.js.map +0 -1
- package/_types/tempo/ChannelDescriptor.d.ts +0 -73
- package/_types/tempo/ChannelDescriptor.d.ts.map +0 -1
- package/tempo/ChannelDescriptor/package.json +0 -6
- package/tempo/ChannelDescriptor.test.ts +0 -93
- package/tempo/ChannelDescriptor.ts +0 -115
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# ox
|
|
2
2
|
|
|
3
|
+
## 0.14.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#256](https://github.com/wevm/ox/pull/256) [`ad7610b`](https://github.com/wevm/ox/commit/ad7610b115c1ebc20739289bfacead52652160be) Thanks [@jxom](https://github.com/jxom)! - Renamed `ChannelDescriptor.from` to `Channel.from`, made `Channel.Channel` the descriptor type, and changed `Channel.computeId` to receive channel and options separately.
|
|
8
|
+
|
|
3
9
|
## 0.14.24
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/_cjs/tempo/Channel.js
CHANGED
|
@@ -1,34 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.voucherTypehash = exports.closeGracePeriod = exports.address = void 0;
|
|
4
|
+
exports.from = from;
|
|
4
5
|
exports.computeId = computeId;
|
|
5
6
|
exports.domainSeparator = domainSeparator;
|
|
6
7
|
exports.getVoucherSignPayload = getVoucherSignPayload;
|
|
7
8
|
const AbiParameters = require("../core/AbiParameters.js");
|
|
9
|
+
const Address = require("../core/Address.js");
|
|
8
10
|
const Hash = require("../core/Hash.js");
|
|
9
11
|
const Hex = require("../core/Hex.js");
|
|
10
|
-
const
|
|
12
|
+
const TokenId = require("./TokenId.js");
|
|
11
13
|
const channelIdParameters = AbiParameters.from('address, address, address, address, bytes32, address, bytes32, address, uint256');
|
|
12
14
|
const domainSeparatorParameters = AbiParameters.from('bytes32, bytes32, bytes32, uint256, address');
|
|
13
15
|
const voucherHashParameters = AbiParameters.from('bytes32, bytes32, uint96');
|
|
14
16
|
const eip712DomainTypehash = Hash.keccak256(Hex.fromString('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'));
|
|
15
17
|
const nameHash = Hash.keccak256(Hex.fromString('TIP20 Channel Reserve'));
|
|
16
18
|
const versionHash = Hash.keccak256(Hex.fromString('1'));
|
|
19
|
+
const zeroAddress = '0x0000000000000000000000000000000000000000';
|
|
17
20
|
exports.address = '0x4d50500000000000000000000000000000000000';
|
|
18
21
|
exports.closeGracePeriod = 900n;
|
|
19
22
|
exports.voucherTypehash = Hash.keccak256(Hex.fromString('Voucher(bytes32 channelId,uint96 cumulativeAmount)'));
|
|
20
|
-
function
|
|
21
|
-
const
|
|
23
|
+
function from(value) {
|
|
24
|
+
const { authorizedSigner = zeroAddress, expiringNonceHash, operator = zeroAddress, payee, payer, salt, token, } = value;
|
|
25
|
+
return {
|
|
26
|
+
authorizedSigner: resolveAddress(authorizedSigner),
|
|
27
|
+
expiringNonceHash,
|
|
28
|
+
operator: resolveAddress(operator),
|
|
29
|
+
payee: resolveAddress(payee),
|
|
30
|
+
payer: resolveAddress(payer),
|
|
31
|
+
salt,
|
|
32
|
+
token: typeof token === 'string'
|
|
33
|
+
? resolveAddress(token)
|
|
34
|
+
: TokenId.toAddress(token),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function computeId(channel, options) {
|
|
38
|
+
const channel_ = from(channel);
|
|
22
39
|
return Hash.keccak256(AbiParameters.encode(channelIdParameters, [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
channel_.payer,
|
|
41
|
+
channel_.payee,
|
|
42
|
+
channel_.operator,
|
|
43
|
+
channel_.token,
|
|
44
|
+
channel_.salt,
|
|
45
|
+
channel_.authorizedSigner,
|
|
46
|
+
channel_.expiringNonceHash,
|
|
30
47
|
exports.address,
|
|
31
|
-
BigInt(
|
|
48
|
+
BigInt(options.chainId),
|
|
32
49
|
]));
|
|
33
50
|
}
|
|
34
51
|
function domainSeparator(value) {
|
|
@@ -48,4 +65,7 @@ function getVoucherSignPayload(value) {
|
|
|
48
65
|
]));
|
|
49
66
|
return Hash.keccak256(Hex.concat('0x1901', domainSeparator({ chainId: value.chainId }), voucherHash));
|
|
50
67
|
}
|
|
68
|
+
function resolveAddress(address) {
|
|
69
|
+
return Address.from(address);
|
|
70
|
+
}
|
|
51
71
|
//# sourceMappingURL=Channel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Channel.js","sourceRoot":"","sources":["../../tempo/Channel.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Channel.js","sourceRoot":"","sources":["../../tempo/Channel.ts"],"names":[],"mappings":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CACF,CAAA;AACH,CAAC;AAkBD,SAAS,cAAc,CAAC,OAAwB;IAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC"}
|
package/_cjs/tempo/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZoneRpcAuthentication = exports.ZoneId = exports.VirtualMaster = exports.VirtualAddress = exports.TxEnvelopeTempo = exports.TransactionRequest = exports.TransactionReceipt = exports.Transaction = exports.TokenRole = exports.TokenId = exports.Tick = exports.TempoAddress = exports.SignatureEnvelope = exports.RpcSchemaTempo = exports.PoolId = exports.Period = exports.KeyAuthorization = exports.
|
|
3
|
+
exports.ZoneRpcAuthentication = exports.ZoneId = exports.VirtualMaster = exports.VirtualAddress = exports.TxEnvelopeTempo = exports.TransactionRequest = exports.TransactionReceipt = exports.Transaction = exports.TokenRole = exports.TokenId = exports.Tick = exports.TempoAddress = exports.SignatureEnvelope = exports.RpcSchemaTempo = exports.PoolId = exports.Period = exports.KeyAuthorization = exports.Channel = exports.AuthorizationTempo = void 0;
|
|
4
4
|
exports.AuthorizationTempo = require("./AuthorizationTempo.js");
|
|
5
5
|
exports.Channel = require("./Channel.js");
|
|
6
|
-
exports.ChannelDescriptor = require("./ChannelDescriptor.js");
|
|
7
6
|
exports.KeyAuthorization = require("./KeyAuthorization.js");
|
|
8
7
|
exports.Period = require("./Period.js");
|
|
9
8
|
exports.PoolId = require("./PoolId.js");
|
package/_cjs/tempo/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":";;;AAoCA,gEAA6D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":";;;AAoCA,gEAA6D;AA2B7D,0CAAuC;AAwCvC,4DAAyD;AA6BzD,wCAAqC;AAsBrC,wCAAqC;AAoBrC,wDAAqD;AAuBrD,8DAA2D;AAmB3D,oDAAiD;AAoBjD,oCAAiC;AAqBjC,0CAAuC;AAkBvC,8CAA2C;AAkD3C,kDAA+C;AAuB/C,gEAA6D;AAqB7D,gEAA6D;AA6B7D,0DAAuD;AA4BvD,wDAAqD;AAyBrD,sDAAmD;AAqBnD,wCAAqC;AAmCrC,sEAAmE"}
|
package/_cjs/version.js
CHANGED
package/_esm/tempo/Channel.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as AbiParameters from '../core/AbiParameters.js';
|
|
2
|
+
import * as Address from '../core/Address.js';
|
|
2
3
|
import * as Hash from '../core/Hash.js';
|
|
3
4
|
import * as Hex from '../core/Hex.js';
|
|
4
|
-
import * as
|
|
5
|
+
import * as TokenId from './TokenId.js';
|
|
5
6
|
const channelIdParameters = AbiParameters.from('address, address, address, address, bytes32, address, bytes32, address, uint256');
|
|
6
7
|
const domainSeparatorParameters = AbiParameters.from('bytes32, bytes32, bytes32, uint256, address');
|
|
7
8
|
const voucherHashParameters = AbiParameters.from('bytes32, bytes32, uint96');
|
|
8
9
|
const eip712DomainTypehash = Hash.keccak256(Hex.fromString('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'));
|
|
9
10
|
const nameHash = Hash.keccak256(Hex.fromString('TIP20 Channel Reserve'));
|
|
10
11
|
const versionHash = Hash.keccak256(Hex.fromString('1'));
|
|
12
|
+
const zeroAddress = '0x0000000000000000000000000000000000000000';
|
|
11
13
|
/**
|
|
12
14
|
* TIP-20 channel reserve precompile address.
|
|
13
15
|
*/
|
|
@@ -20,6 +22,42 @@ export const closeGracePeriod = 900n;
|
|
|
20
22
|
* EIP-712 type hash for `Voucher(bytes32 channelId,uint96 cumulativeAmount)`.
|
|
21
23
|
*/
|
|
22
24
|
export const voucherTypehash = Hash.keccak256(Hex.fromString('Voucher(bytes32 channelId,uint96 cumulativeAmount)'));
|
|
25
|
+
/**
|
|
26
|
+
* Instantiates a TIP-20 channel reserve descriptor.
|
|
27
|
+
*
|
|
28
|
+
* Accepts a TIP-20 token ID or address, and defaults `operator` and
|
|
29
|
+
* `authorizedSigner` to the zero address.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts twoslash
|
|
33
|
+
* import { Channel } from 'ox/tempo'
|
|
34
|
+
*
|
|
35
|
+
* const channel = Channel.from({
|
|
36
|
+
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000002',
|
|
37
|
+
* payee: '0x2222222222222222222222222222222222222222',
|
|
38
|
+
* payer: '0x1111111111111111111111111111111111111111',
|
|
39
|
+
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
40
|
+
* token: 1n,
|
|
41
|
+
* })
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @param value - The channel descriptor input.
|
|
45
|
+
* @returns The normalized channel descriptor.
|
|
46
|
+
*/
|
|
47
|
+
export function from(value) {
|
|
48
|
+
const { authorizedSigner = zeroAddress, expiringNonceHash, operator = zeroAddress, payee, payer, salt, token, } = value;
|
|
49
|
+
return {
|
|
50
|
+
authorizedSigner: resolveAddress(authorizedSigner),
|
|
51
|
+
expiringNonceHash,
|
|
52
|
+
operator: resolveAddress(operator),
|
|
53
|
+
payee: resolveAddress(payee),
|
|
54
|
+
payer: resolveAddress(payer),
|
|
55
|
+
salt,
|
|
56
|
+
token: typeof token === 'string'
|
|
57
|
+
? resolveAddress(token)
|
|
58
|
+
: TokenId.toAddress(token),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
23
61
|
/**
|
|
24
62
|
* Computes the canonical TIP-20 channel id for a descriptor.
|
|
25
63
|
*
|
|
@@ -32,31 +70,33 @@ export const voucherTypehash = Hash.keccak256(Hex.fromString('Voucher(bytes32 ch
|
|
|
32
70
|
*
|
|
33
71
|
* const channelId = Channel.computeId({
|
|
34
72
|
* authorizedSigner: '0x0000000000000000000000000000000000000000',
|
|
35
|
-
* chainId: 4217,
|
|
36
73
|
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
37
74
|
* operator: '0x0000000000000000000000000000000000000000',
|
|
38
75
|
* payee: '0x2222222222222222222222222222222222222222',
|
|
39
76
|
* payer: '0x1111111111111111111111111111111111111111',
|
|
40
77
|
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
41
78
|
* token: 1n,
|
|
79
|
+
* }, {
|
|
80
|
+
* chainId: 4217,
|
|
42
81
|
* })
|
|
43
82
|
* ```
|
|
44
83
|
*
|
|
45
|
-
* @param
|
|
84
|
+
* @param channel - Channel descriptor.
|
|
85
|
+
* @param options - Options.
|
|
46
86
|
* @returns The channel id.
|
|
47
87
|
*/
|
|
48
|
-
export function computeId(
|
|
49
|
-
const
|
|
88
|
+
export function computeId(channel, options) {
|
|
89
|
+
const channel_ = from(channel);
|
|
50
90
|
return Hash.keccak256(AbiParameters.encode(channelIdParameters, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
91
|
+
channel_.payer,
|
|
92
|
+
channel_.payee,
|
|
93
|
+
channel_.operator,
|
|
94
|
+
channel_.token,
|
|
95
|
+
channel_.salt,
|
|
96
|
+
channel_.authorizedSigner,
|
|
97
|
+
channel_.expiringNonceHash,
|
|
58
98
|
address,
|
|
59
|
-
BigInt(
|
|
99
|
+
BigInt(options.chainId),
|
|
60
100
|
]));
|
|
61
101
|
}
|
|
62
102
|
/**
|
|
@@ -112,4 +152,7 @@ export function getVoucherSignPayload(value) {
|
|
|
112
152
|
]));
|
|
113
153
|
return Hash.keccak256(Hex.concat('0x1901', domainSeparator({ chainId: value.chainId }), voucherHash));
|
|
114
154
|
}
|
|
155
|
+
function resolveAddress(address) {
|
|
156
|
+
return Address.from(address);
|
|
157
|
+
}
|
|
115
158
|
//# sourceMappingURL=Channel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Channel.js","sourceRoot":"","sources":["../../tempo/Channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"Channel.js","sourceRoot":"","sources":["../../tempo/Channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,MAAM,mBAAmB,GAAG,aAAa,CAAC,IAAI,CAC5C,iFAAiF,CAClF,CAAA;AACD,MAAM,yBAAyB,GAAG,aAAa,CAAC,IAAI,CAClD,6CAA6C,CAC9C,CAAA;AACD,MAAM,qBAAqB,GAAG,aAAa,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA;AAE5E,MAAM,oBAAoB,GAAG,IAAI,CAAC,SAAS,CACzC,GAAG,CAAC,UAAU,CACZ,oFAAoF,CACrF,CACF,CAAA;AACD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC,CAAA;AACxE,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;AACvD,MAAM,WAAW,GACf,4CAA+E,CAAA;AAEjF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAClB,4CAA+E,CAAA;AAEjF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAC3C,GAAG,CAAC,UAAU,CAAC,oDAAoD,CAAC,CACrE,CAAA;AA4BD;;;;;;;;;;;;;;;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QAAQ;QACR,WAAW;QACX,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;QACrB,OAAO;KACR,CAAC,CACH,CAAA;AACH,CAAC;AAWD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAkC;IAElC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAChC,aAAa,CAAC,MAAM,CAAC,qBAAqB,EAAE;QAC1C,eAAe;QACf,KAAK,CAAC,SAAS;QACf,KAAK,CAAC,gBAAgB;KACvB,CAAC,CACH,CAAA;IACD,OAAO,IAAI,CAAC,SAAS,CACnB,GAAG,CAAC,MAAM,CACR,QAAQ,EACR,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAC3C,WAAW,CACZ,CACF,CAAA;AACH,CAAC;AAkBD,SAAS,cAAc,CAAC,OAAwB;IAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAC9B,CAAC"}
|
package/_esm/tempo/index.js
CHANGED
|
@@ -32,53 +32,32 @@
|
|
|
32
32
|
*/
|
|
33
33
|
export * as AuthorizationTempo from './AuthorizationTempo.js';
|
|
34
34
|
/**
|
|
35
|
-
* TIP-20 channel reserve constants and deterministic hashing utilities.
|
|
35
|
+
* TIP-20 channel reserve descriptor, constants, and deterministic hashing utilities.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* Channel descriptors are emitted by `Channel.open` and then reused to settle,
|
|
38
|
+
* top up, close, request close, withdraw, or compute the channel ID. The channel
|
|
39
|
+
* reserve precompile exposes helper methods for channel identifiers, voucher sign
|
|
40
|
+
* payloads, and its EIP-712 domain separator. These utilities compute the same
|
|
41
|
+
* values locally when the chain id and channel fields are known.
|
|
40
42
|
*
|
|
41
43
|
* @example
|
|
42
44
|
* ```ts twoslash
|
|
43
45
|
* import { Channel } from 'ox/tempo'
|
|
44
46
|
*
|
|
45
|
-
* const
|
|
46
|
-
* authorizedSigner: '0x0000000000000000000000000000000000000000',
|
|
47
|
-
* chainId: 4217,
|
|
47
|
+
* const channel = Channel.from({
|
|
48
48
|
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
49
|
-
* operator: '0x0000000000000000000000000000000000000000',
|
|
50
49
|
* payee: '0x2222222222222222222222222222222222222222',
|
|
51
50
|
* payer: '0x1111111111111111111111111111111111111111',
|
|
52
51
|
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
53
52
|
* token: 1n,
|
|
54
53
|
* })
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @category Reference
|
|
58
|
-
*/
|
|
59
|
-
export * as Channel from './Channel.js';
|
|
60
|
-
/**
|
|
61
|
-
* TIP-20 channel reserve descriptor utilities.
|
|
62
54
|
*
|
|
63
|
-
*
|
|
64
|
-
* top up, close, request close, withdraw, or compute the channel ID.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```ts twoslash
|
|
68
|
-
* import { ChannelDescriptor } from 'ox/tempo'
|
|
69
|
-
*
|
|
70
|
-
* const descriptor = ChannelDescriptor.from({
|
|
71
|
-
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
72
|
-
* payee: '0x2222222222222222222222222222222222222222',
|
|
73
|
-
* payer: '0x1111111111111111111111111111111111111111',
|
|
74
|
-
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
75
|
-
* token: 1n,
|
|
76
|
-
* })
|
|
55
|
+
* const channelId = Channel.computeId(channel, { chainId: 4217 })
|
|
77
56
|
* ```
|
|
78
57
|
*
|
|
79
58
|
* @category Reference
|
|
80
59
|
*/
|
|
81
|
-
export * as
|
|
60
|
+
export * as Channel from './Channel.js';
|
|
82
61
|
/**
|
|
83
62
|
* Tempo key authorization utilities for provisioning and signing access keys.
|
|
84
63
|
*
|
package/_esm/tempo/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA;AACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAC3D;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AACjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,eAAe,MAAM,sBAAsB,CAAA;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA"}
|
package/_esm/version.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as AbiParameters from '../core/AbiParameters.js';
|
|
2
|
+
import * as Address from '../core/Address.js';
|
|
3
|
+
import type * as Errors from '../core/Errors.js';
|
|
2
4
|
import * as Hash from '../core/Hash.js';
|
|
3
5
|
import * as Hex from '../core/Hex.js';
|
|
4
|
-
import * as
|
|
6
|
+
import * as TokenId from './TokenId.js';
|
|
5
7
|
/**
|
|
6
8
|
* TIP-20 channel reserve precompile address.
|
|
7
9
|
*/
|
|
@@ -17,7 +19,67 @@ export declare const voucherTypehash: `0x${string}`;
|
|
|
17
19
|
/**
|
|
18
20
|
* TIP-20 channel descriptor.
|
|
19
21
|
*/
|
|
20
|
-
export type
|
|
22
|
+
export type Channel<addressType = Address.Address, tokenType = TokenId.TokenIdOrAddress<addressType>> = {
|
|
23
|
+
/** Optional signer for vouchers. Zero means `payer` signs. */
|
|
24
|
+
authorizedSigner: addressType;
|
|
25
|
+
/** Transaction-derived hash assigned when the channel was opened. */
|
|
26
|
+
expiringNonceHash: Hex.Hex;
|
|
27
|
+
/** Optional relayer allowed to submit `settle` for the payee. */
|
|
28
|
+
operator: addressType;
|
|
29
|
+
/** Account that receives settled voucher payments. */
|
|
30
|
+
payee: addressType;
|
|
31
|
+
/** Account that funded the channel and receives refunds. */
|
|
32
|
+
payer: addressType;
|
|
33
|
+
/** User-supplied salt to distinguish otherwise identical channels. */
|
|
34
|
+
salt: Hex.Hex;
|
|
35
|
+
/** TIP-20 token address held by the channel. */
|
|
36
|
+
token: tokenType;
|
|
37
|
+
};
|
|
38
|
+
/** Hex-address-normalized {@link ox#Channel.Channel}. */
|
|
39
|
+
export type Resolved = Channel<Address.Address, Address.Address>;
|
|
40
|
+
/**
|
|
41
|
+
* Instantiates a TIP-20 channel reserve descriptor.
|
|
42
|
+
*
|
|
43
|
+
* Accepts a TIP-20 token ID or address, and defaults `operator` and
|
|
44
|
+
* `authorizedSigner` to the zero address.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts twoslash
|
|
48
|
+
* import { Channel } from 'ox/tempo'
|
|
49
|
+
*
|
|
50
|
+
* const channel = Channel.from({
|
|
51
|
+
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000002',
|
|
52
|
+
* payee: '0x2222222222222222222222222222222222222222',
|
|
53
|
+
* payer: '0x1111111111111111111111111111111111111111',
|
|
54
|
+
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
55
|
+
* token: 1n,
|
|
56
|
+
* })
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @param value - The channel descriptor input.
|
|
60
|
+
* @returns The normalized channel descriptor.
|
|
61
|
+
*/
|
|
62
|
+
export declare function from(value: from.Value): from.ReturnType;
|
|
63
|
+
export declare namespace from {
|
|
64
|
+
type Value = {
|
|
65
|
+
/** Optional signer for vouchers. Zero means `payer` signs. */
|
|
66
|
+
authorizedSigner?: Address.Address | undefined;
|
|
67
|
+
/** Transaction-derived hash assigned when the channel was opened. */
|
|
68
|
+
expiringNonceHash: Hex.Hex;
|
|
69
|
+
/** Optional relayer allowed to submit `settle` for the payee. */
|
|
70
|
+
operator?: Address.Address | undefined;
|
|
71
|
+
/** Account that receives settled voucher payments. */
|
|
72
|
+
payee: Address.Address;
|
|
73
|
+
/** Account that funded the channel and receives refunds. */
|
|
74
|
+
payer: Address.Address;
|
|
75
|
+
/** User-supplied salt to distinguish otherwise identical channels. */
|
|
76
|
+
salt: Hex.Hex;
|
|
77
|
+
/** TIP-20 token address or ID held by the channel. */
|
|
78
|
+
token: TokenId.TokenIdOrAddress<Address.Address>;
|
|
79
|
+
};
|
|
80
|
+
type ReturnType = Resolved;
|
|
81
|
+
type ErrorType = Address.from.ErrorType | Hex.concat.ErrorType | Hex.fromNumber.ErrorType | Errors.GlobalErrorType;
|
|
82
|
+
}
|
|
21
83
|
/**
|
|
22
84
|
* Computes the canonical TIP-20 channel id for a descriptor.
|
|
23
85
|
*
|
|
@@ -30,26 +92,29 @@ export type Descriptor = ChannelDescriptor.ChannelDescriptor;
|
|
|
30
92
|
*
|
|
31
93
|
* const channelId = Channel.computeId({
|
|
32
94
|
* authorizedSigner: '0x0000000000000000000000000000000000000000',
|
|
33
|
-
* chainId: 4217,
|
|
34
95
|
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
35
96
|
* operator: '0x0000000000000000000000000000000000000000',
|
|
36
97
|
* payee: '0x2222222222222222222222222222222222222222',
|
|
37
98
|
* payer: '0x1111111111111111111111111111111111111111',
|
|
38
99
|
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
39
100
|
* token: 1n,
|
|
101
|
+
* }, {
|
|
102
|
+
* chainId: 4217,
|
|
40
103
|
* })
|
|
41
104
|
* ```
|
|
42
105
|
*
|
|
43
|
-
* @param
|
|
106
|
+
* @param channel - Channel descriptor.
|
|
107
|
+
* @param options - Options.
|
|
44
108
|
* @returns The channel id.
|
|
45
109
|
*/
|
|
46
|
-
export declare function computeId(
|
|
110
|
+
export declare function computeId(channel: computeId.Channel, options: computeId.Options): Hex.Hex;
|
|
47
111
|
export declare namespace computeId {
|
|
48
|
-
type
|
|
49
|
-
|
|
112
|
+
type Channel = from.Value;
|
|
113
|
+
type Options = {
|
|
114
|
+
/** Chain ID used by the channel reserve precompile. */
|
|
50
115
|
chainId: number | bigint;
|
|
51
116
|
};
|
|
52
|
-
type ErrorType = AbiParameters.encode.ErrorType |
|
|
117
|
+
type ErrorType = AbiParameters.encode.ErrorType | from.ErrorType | Hash.keccak256.ErrorType;
|
|
53
118
|
}
|
|
54
119
|
/**
|
|
55
120
|
* Computes the EIP-712 domain separator for the TIP-20 channel reserve.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Channel.d.ts","sourceRoot":"","sources":["../../tempo/Channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"Channel.d.ts","sourceRoot":"","sources":["../../tempo/Channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAoBvC;;GAEG;AACH,eAAO,MAAM,OAAO,8CAC6D,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAA;AAEpC;;GAEG;AACH,eAAO,MAAM,eAAe,eAE3B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,CACjB,WAAW,GAAG,OAAO,CAAC,OAAO,EAC7B,SAAS,GAAG,OAAO,CAAC,gB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SAAS,EAAE,GAAG,CAAC,GAAG,CAAA;QAClB,mDAAmD;QACnD,gBAAgB,EAAE,MAAM,CAAA;KACzB,CAAA;IAED,KAAK,SAAS,GACV,aAAa,CAAC,MAAM,CAAC,SAAS,GAC9B,eAAe,CAAC,SAAS,GACzB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAA;CAC7B"}
|
package/_types/tempo/index.d.ts
CHANGED
|
@@ -34,53 +34,32 @@ export type {};
|
|
|
34
34
|
*/
|
|
35
35
|
export * as AuthorizationTempo from './AuthorizationTempo.js';
|
|
36
36
|
/**
|
|
37
|
-
* TIP-20 channel reserve constants and deterministic hashing utilities.
|
|
37
|
+
* TIP-20 channel reserve descriptor, constants, and deterministic hashing utilities.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* Channel descriptors are emitted by `Channel.open` and then reused to settle,
|
|
40
|
+
* top up, close, request close, withdraw, or compute the channel ID. The channel
|
|
41
|
+
* reserve precompile exposes helper methods for channel identifiers, voucher sign
|
|
42
|
+
* payloads, and its EIP-712 domain separator. These utilities compute the same
|
|
43
|
+
* values locally when the chain id and channel fields are known.
|
|
42
44
|
*
|
|
43
45
|
* @example
|
|
44
46
|
* ```ts twoslash
|
|
45
47
|
* import { Channel } from 'ox/tempo'
|
|
46
48
|
*
|
|
47
|
-
* const
|
|
48
|
-
* authorizedSigner: '0x0000000000000000000000000000000000000000',
|
|
49
|
-
* chainId: 4217,
|
|
49
|
+
* const channel = Channel.from({
|
|
50
50
|
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
51
|
-
* operator: '0x0000000000000000000000000000000000000000',
|
|
52
51
|
* payee: '0x2222222222222222222222222222222222222222',
|
|
53
52
|
* payer: '0x1111111111111111111111111111111111111111',
|
|
54
53
|
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
55
54
|
* token: 1n,
|
|
56
55
|
* })
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @category Reference
|
|
60
|
-
*/
|
|
61
|
-
export * as Channel from './Channel.js';
|
|
62
|
-
/**
|
|
63
|
-
* TIP-20 channel reserve descriptor utilities.
|
|
64
56
|
*
|
|
65
|
-
*
|
|
66
|
-
* top up, close, request close, withdraw, or compute the channel ID.
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts twoslash
|
|
70
|
-
* import { ChannelDescriptor } from 'ox/tempo'
|
|
71
|
-
*
|
|
72
|
-
* const descriptor = ChannelDescriptor.from({
|
|
73
|
-
* expiringNonceHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
74
|
-
* payee: '0x2222222222222222222222222222222222222222',
|
|
75
|
-
* payer: '0x1111111111111111111111111111111111111111',
|
|
76
|
-
* salt: '0x0000000000000000000000000000000000000000000000000000000000000001',
|
|
77
|
-
* token: 1n,
|
|
78
|
-
* })
|
|
57
|
+
* const channelId = Channel.computeId(channel, { chainId: 4217 })
|
|
79
58
|
* ```
|
|
80
59
|
*
|
|
81
60
|
* @category Reference
|
|
82
61
|
*/
|
|
83
|
-
export * as
|
|
62
|
+
export * as Channel from './Channel.js';
|
|
84
63
|
/**
|
|
85
64
|
* Tempo key authorization utilities for provisioning and signing access keys.
|
|
86
65
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,YAAY,EAAE,CAAA;AAEd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAA;AAC7D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tempo/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,YAAY,EAAE,CAAA;AAEd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,KAAK,kBAAkB,MAAM,y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BG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA;AACrD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAA"}
|
package/_types/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ox",
|
|
3
3
|
"description": "Ethereum Standard Library",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.25",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
7
7
|
"types": "./_types/index.d.ts",
|
|
@@ -509,11 +509,6 @@
|
|
|
509
509
|
"import": "./_esm/tempo/Channel.js",
|
|
510
510
|
"default": "./_cjs/tempo/Channel.js"
|
|
511
511
|
},
|
|
512
|
-
"./tempo/ChannelDescriptor": {
|
|
513
|
-
"types": "./_types/tempo/ChannelDescriptor.d.ts",
|
|
514
|
-
"import": "./_esm/tempo/ChannelDescriptor.js",
|
|
515
|
-
"default": "./_cjs/tempo/ChannelDescriptor.js"
|
|
516
|
-
},
|
|
517
512
|
"./tempo/KeyAuthorization": {
|
|
518
513
|
"types": "./_types/tempo/KeyAuthorization.d.ts",
|
|
519
514
|
"import": "./_esm/tempo/KeyAuthorization.js",
|