@towns-labs/relayer 2.0.12 → 2.1.0
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/dist/README.md +1 -1
- package/dist/index.js +3339 -1780
- package/dist/index.js.map +4 -4
- package/package.json +3 -2
- package/src/rpc/schema/intentTypes.ts +27 -0
- package/src/rpc/schema/prepareCalls.ts +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towns-labs/relayer",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"@hono/zod-validator": "0.7.6",
|
|
37
37
|
"@scure/bip32": "2.0.1",
|
|
38
38
|
"@scure/bip39": "2.0.1",
|
|
39
|
-
"@
|
|
39
|
+
"@slicekit/erc8128": "^0.1.0",
|
|
40
|
+
"@towns-labs/contracts": "^2.1.0",
|
|
40
41
|
"hono": "^4.11.7",
|
|
41
42
|
"oxlint": "^1.41.0",
|
|
42
43
|
"pino": "10.2.0",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical EIP-712 type definitions for intent signing/hashing.
|
|
3
|
+
*
|
|
4
|
+
* Must match Orchestrator contract's INTENT_TYPEHASH and CALL_TYPEHASH:
|
|
5
|
+
* "Intent(bool multichain,address eoa,Call[] calls,uint256 nonce,address payer,address paymentToken,uint256 paymentMaxAmount,uint256 combinedGas,bytes[] encodedPreCalls,bytes[] encodedFundTransfers,address settler,uint256 expiry)Call(address to,uint256 value,bytes data)"
|
|
6
|
+
*/
|
|
7
|
+
export const INTENT_TYPES = {
|
|
8
|
+
Intent: [
|
|
9
|
+
{ name: 'multichain', type: 'bool' },
|
|
10
|
+
{ name: 'eoa', type: 'address' },
|
|
11
|
+
{ name: 'calls', type: 'Call[]' },
|
|
12
|
+
{ name: 'nonce', type: 'uint256' },
|
|
13
|
+
{ name: 'payer', type: 'address' },
|
|
14
|
+
{ name: 'paymentToken', type: 'address' },
|
|
15
|
+
{ name: 'paymentMaxAmount', type: 'uint256' },
|
|
16
|
+
{ name: 'combinedGas', type: 'uint256' },
|
|
17
|
+
{ name: 'encodedPreCalls', type: 'bytes[]' },
|
|
18
|
+
{ name: 'encodedFundTransfers', type: 'bytes[]' },
|
|
19
|
+
{ name: 'settler', type: 'address' },
|
|
20
|
+
{ name: 'expiry', type: 'uint256' },
|
|
21
|
+
],
|
|
22
|
+
Call: [
|
|
23
|
+
{ name: 'to', type: 'address' },
|
|
24
|
+
{ name: 'value', type: 'uint256' },
|
|
25
|
+
{ name: 'data', type: 'bytes' },
|
|
26
|
+
],
|
|
27
|
+
} as const
|
|
@@ -42,6 +42,8 @@ export interface PrepareCallsParams {
|
|
|
42
42
|
fee_max_amount?: string
|
|
43
43
|
nonce?: string
|
|
44
44
|
seq_key?: string
|
|
45
|
+
prepare_key?: string
|
|
46
|
+
expiry?: string
|
|
45
47
|
settler?: Address
|
|
46
48
|
settler_context?: Hex
|
|
47
49
|
}
|
|
@@ -143,7 +145,15 @@ export interface AssetDiff {
|
|
|
143
145
|
/**
|
|
144
146
|
* Context returned by prepareCalls, used in sendPreparedCalls (spec-compliant)
|
|
145
147
|
*/
|
|
146
|
-
export type PrepareCallsContext = {
|
|
148
|
+
export type PrepareCallsContext = {
|
|
149
|
+
quote: SignedQuotes
|
|
150
|
+
draft?: {
|
|
151
|
+
id: string
|
|
152
|
+
seqKey: string
|
|
153
|
+
expiresAtMs: number
|
|
154
|
+
fromCache: boolean
|
|
155
|
+
}
|
|
156
|
+
}
|
|
147
157
|
|
|
148
158
|
/**
|
|
149
159
|
* Capabilities in the prepareCalls response
|