@turnkey/gas-station 0.2.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/LICENSE +201 -0
- package/README.md +726 -0
- package/dist/abi/gas-station.d.ts +546 -0
- package/dist/abi/gas-station.d.ts.map +1 -0
- package/dist/abi/gas-station.js +275 -0
- package/dist/abi/gas-station.js.map +1 -0
- package/dist/abi/gas-station.mjs +273 -0
- package/dist/abi/gas-station.mjs.map +1 -0
- package/dist/config.d.ts +44 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/config.mjs +51 -0
- package/dist/config.mjs.map +1 -0
- package/dist/gasStationClient.d.ts +71 -0
- package/dist/gasStationClient.d.ts.map +1 -0
- package/dist/gasStationClient.js +237 -0
- package/dist/gasStationClient.js.map +1 -0
- package/dist/gasStationClient.mjs +235 -0
- package/dist/gasStationClient.mjs.map +1 -0
- package/dist/gasStationUtils.d.ts +7069 -0
- package/dist/gasStationUtils.d.ts.map +1 -0
- package/dist/gasStationUtils.js +129 -0
- package/dist/gasStationUtils.js.map +1 -0
- package/dist/gasStationUtils.mjs +120 -0
- package/dist/gasStationUtils.mjs.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -0
- package/dist/intentBuilder.d.ts +61 -0
- package/dist/intentBuilder.d.ts.map +1 -0
- package/dist/intentBuilder.js +153 -0
- package/dist/intentBuilder.js.map +1 -0
- package/dist/intentBuilder.mjs +151 -0
- package/dist/intentBuilder.mjs.map +1 -0
- package/dist/policyUtils.d.ts +271 -0
- package/dist/policyUtils.d.ts.map +1 -0
- package/dist/policyUtils.js +387 -0
- package/dist/policyUtils.js.map +1 -0
- package/dist/policyUtils.mjs +381 -0
- package/dist/policyUtils.mjs.map +1 -0
- package/package.json +47 -0
|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KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,GAAG,CAAC;CACX,GAAG,GAAG,CAON"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var viem = require('viem');
|
|
4
|
+
|
|
5
|
+
function createPublicClientForChain(chain, rpcUrl) {
|
|
6
|
+
return viem.createPublicClient({
|
|
7
|
+
chain,
|
|
8
|
+
transport: viem.http(rpcUrl),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
// ERC20 ABI for token transfers
|
|
12
|
+
const ERC20_ABI = [
|
|
13
|
+
{
|
|
14
|
+
type: "function",
|
|
15
|
+
name: "transfer",
|
|
16
|
+
stateMutability: "nonpayable",
|
|
17
|
+
inputs: [
|
|
18
|
+
{ name: "to", type: "address" },
|
|
19
|
+
{ name: "amount", type: "uint256" },
|
|
20
|
+
],
|
|
21
|
+
outputs: [{ name: "success", type: "bool" }],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: "function",
|
|
25
|
+
name: "balanceOf",
|
|
26
|
+
stateMutability: "view",
|
|
27
|
+
inputs: [{ name: "account", type: "address" }],
|
|
28
|
+
outputs: [{ name: "balance", type: "uint256" }],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: "function",
|
|
32
|
+
name: "approve",
|
|
33
|
+
stateMutability: "nonpayable",
|
|
34
|
+
inputs: [
|
|
35
|
+
{ name: "spender", type: "address" },
|
|
36
|
+
{ name: "amount", type: "uint256" },
|
|
37
|
+
],
|
|
38
|
+
outputs: [{ name: "success", type: "bool" }],
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* Build parameters for an ERC20 token transfer
|
|
43
|
+
*/
|
|
44
|
+
function buildTokenTransfer(token, to, amount) {
|
|
45
|
+
return {
|
|
46
|
+
outputContract: token,
|
|
47
|
+
callData: viem.encodeFunctionData({
|
|
48
|
+
abi: ERC20_ABI,
|
|
49
|
+
functionName: "transfer",
|
|
50
|
+
args: [to, amount],
|
|
51
|
+
}),
|
|
52
|
+
value: 0n,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Build parameters for a native ETH transfer
|
|
57
|
+
*/
|
|
58
|
+
function buildETHTransfer(to, amount) {
|
|
59
|
+
return {
|
|
60
|
+
outputContract: to,
|
|
61
|
+
callData: "0x",
|
|
62
|
+
value: amount,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Build parameters for an ERC20 token approval
|
|
67
|
+
*/
|
|
68
|
+
function buildTokenApproval(token, spender, amount) {
|
|
69
|
+
return {
|
|
70
|
+
outputContract: token,
|
|
71
|
+
callData: viem.encodeFunctionData({
|
|
72
|
+
abi: ERC20_ABI,
|
|
73
|
+
functionName: "approve",
|
|
74
|
+
args: [spender, amount],
|
|
75
|
+
}),
|
|
76
|
+
value: 0n,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Build parameters for a generic contract call
|
|
81
|
+
*/
|
|
82
|
+
function buildContractCall(params) {
|
|
83
|
+
return {
|
|
84
|
+
outputContract: params.contract,
|
|
85
|
+
callData: viem.encodeFunctionData({
|
|
86
|
+
abi: params.abi,
|
|
87
|
+
functionName: params.functionName,
|
|
88
|
+
args: params.args,
|
|
89
|
+
}),
|
|
90
|
+
value: params.value ?? 0n,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Convenience: Build ETH transfer with ether string parsing
|
|
95
|
+
*/
|
|
96
|
+
function buildETHTransferFromEther(to, etherAmount) {
|
|
97
|
+
return buildETHTransfer(to, viem.parseEther(etherAmount));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Packs execution data for the gas station delegate contract.
|
|
101
|
+
* Packs signature, nonce, deadline, and calldata args.
|
|
102
|
+
* The output contract address and ETH amount are explicit parameters
|
|
103
|
+
* in the execute() function signature, not part of the packed bytes.
|
|
104
|
+
*
|
|
105
|
+
* Packed data format:
|
|
106
|
+
* Layout: [signature(65)][nonce(16)][deadline(4)][arguments(variable)]
|
|
107
|
+
* - signature: bytes 0-64 (65 bytes)
|
|
108
|
+
* - nonce: bytes 65-80 (16 bytes, uint128)
|
|
109
|
+
* - deadline: bytes 81-84 (4 bytes, uint32)
|
|
110
|
+
* - arguments: bytes 85 onwards (variable length)
|
|
111
|
+
*/
|
|
112
|
+
function packExecutionData({ signature, nonce, deadline, args, }) {
|
|
113
|
+
return viem.concat([
|
|
114
|
+
signature, // 65 bytes
|
|
115
|
+
viem.pad(viem.toHex(nonce), { size: 16 }), // 16 bytes (uint128)
|
|
116
|
+
viem.pad(viem.toHex(deadline), { size: 4 }), // 4 bytes (uint32)
|
|
117
|
+
args, // variable length
|
|
118
|
+
]);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
exports.ERC20_ABI = ERC20_ABI;
|
|
122
|
+
exports.buildContractCall = buildContractCall;
|
|
123
|
+
exports.buildETHTransfer = buildETHTransfer;
|
|
124
|
+
exports.buildETHTransferFromEther = buildETHTransferFromEther;
|
|
125
|
+
exports.buildTokenApproval = buildTokenApproval;
|
|
126
|
+
exports.buildTokenTransfer = buildTokenTransfer;
|
|
127
|
+
exports.createPublicClientForChain = createPublicClientForChain;
|
|
128
|
+
exports.packExecutionData = packExecutionData;
|
|
129
|
+
//# sourceMappingURL=gasStationUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasStationUtils.js","sources":["../src/gasStationUtils.ts"],"sourcesContent":[null],"names":["createPublicClient","http","encodeFunctionData","parseEther","concat","pad","toHex"],"mappings":";;;;AAkBM,SAAU,0BAA0B,CAAC,KAAY,EAAE,MAAc,EAAA;AACrE,IAAA,OAAOA,uBAAkB,CAAC;QACxB,KAAK;AACL,QAAA,SAAS,EAAEC,SAAI,CAAC,MAAM,CAAC;AACxB,KAAA,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T,QAAAC,QAAG,CAACC,UAAK,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAAD,QAAG,CAACC,UAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACjC,QAAA,IAAI;AACL,KAAA,CAAC;AACJ;;;;;;;;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { encodeFunctionData, parseEther, concat, pad, toHex, createPublicClient, http } from 'viem';
|
|
2
|
+
|
|
3
|
+
function createPublicClientForChain(chain, rpcUrl) {
|
|
4
|
+
return createPublicClient({
|
|
5
|
+
chain,
|
|
6
|
+
transport: http(rpcUrl),
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
// ERC20 ABI for token transfers
|
|
10
|
+
const ERC20_ABI = [
|
|
11
|
+
{
|
|
12
|
+
type: "function",
|
|
13
|
+
name: "transfer",
|
|
14
|
+
stateMutability: "nonpayable",
|
|
15
|
+
inputs: [
|
|
16
|
+
{ name: "to", type: "address" },
|
|
17
|
+
{ name: "amount", type: "uint256" },
|
|
18
|
+
],
|
|
19
|
+
outputs: [{ name: "success", type: "bool" }],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: "function",
|
|
23
|
+
name: "balanceOf",
|
|
24
|
+
stateMutability: "view",
|
|
25
|
+
inputs: [{ name: "account", type: "address" }],
|
|
26
|
+
outputs: [{ name: "balance", type: "uint256" }],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "function",
|
|
30
|
+
name: "approve",
|
|
31
|
+
stateMutability: "nonpayable",
|
|
32
|
+
inputs: [
|
|
33
|
+
{ name: "spender", type: "address" },
|
|
34
|
+
{ name: "amount", type: "uint256" },
|
|
35
|
+
],
|
|
36
|
+
outputs: [{ name: "success", type: "bool" }],
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* Build parameters for an ERC20 token transfer
|
|
41
|
+
*/
|
|
42
|
+
function buildTokenTransfer(token, to, amount) {
|
|
43
|
+
return {
|
|
44
|
+
outputContract: token,
|
|
45
|
+
callData: encodeFunctionData({
|
|
46
|
+
abi: ERC20_ABI,
|
|
47
|
+
functionName: "transfer",
|
|
48
|
+
args: [to, amount],
|
|
49
|
+
}),
|
|
50
|
+
value: 0n,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build parameters for a native ETH transfer
|
|
55
|
+
*/
|
|
56
|
+
function buildETHTransfer(to, amount) {
|
|
57
|
+
return {
|
|
58
|
+
outputContract: to,
|
|
59
|
+
callData: "0x",
|
|
60
|
+
value: amount,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build parameters for an ERC20 token approval
|
|
65
|
+
*/
|
|
66
|
+
function buildTokenApproval(token, spender, amount) {
|
|
67
|
+
return {
|
|
68
|
+
outputContract: token,
|
|
69
|
+
callData: encodeFunctionData({
|
|
70
|
+
abi: ERC20_ABI,
|
|
71
|
+
functionName: "approve",
|
|
72
|
+
args: [spender, amount],
|
|
73
|
+
}),
|
|
74
|
+
value: 0n,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Build parameters for a generic contract call
|
|
79
|
+
*/
|
|
80
|
+
function buildContractCall(params) {
|
|
81
|
+
return {
|
|
82
|
+
outputContract: params.contract,
|
|
83
|
+
callData: encodeFunctionData({
|
|
84
|
+
abi: params.abi,
|
|
85
|
+
functionName: params.functionName,
|
|
86
|
+
args: params.args,
|
|
87
|
+
}),
|
|
88
|
+
value: params.value ?? 0n,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Convenience: Build ETH transfer with ether string parsing
|
|
93
|
+
*/
|
|
94
|
+
function buildETHTransferFromEther(to, etherAmount) {
|
|
95
|
+
return buildETHTransfer(to, parseEther(etherAmount));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Packs execution data for the gas station delegate contract.
|
|
99
|
+
* Packs signature, nonce, deadline, and calldata args.
|
|
100
|
+
* The output contract address and ETH amount are explicit parameters
|
|
101
|
+
* in the execute() function signature, not part of the packed bytes.
|
|
102
|
+
*
|
|
103
|
+
* Packed data format:
|
|
104
|
+
* Layout: [signature(65)][nonce(16)][deadline(4)][arguments(variable)]
|
|
105
|
+
* - signature: bytes 0-64 (65 bytes)
|
|
106
|
+
* - nonce: bytes 65-80 (16 bytes, uint128)
|
|
107
|
+
* - deadline: bytes 81-84 (4 bytes, uint32)
|
|
108
|
+
* - arguments: bytes 85 onwards (variable length)
|
|
109
|
+
*/
|
|
110
|
+
function packExecutionData({ signature, nonce, deadline, args, }) {
|
|
111
|
+
return concat([
|
|
112
|
+
signature, // 65 bytes
|
|
113
|
+
pad(toHex(nonce), { size: 16 }), // 16 bytes (uint128)
|
|
114
|
+
pad(toHex(deadline), { size: 4 }), // 4 bytes (uint32)
|
|
115
|
+
args, // variable length
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { ERC20_ABI, buildContractCall, buildETHTransfer, buildETHTransferFromEther, buildTokenApproval, buildTokenTransfer, createPublicClientForChain, packExecutionData };
|
|
120
|
+
//# sourceMappingURL=gasStationUtils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gasStationUtils.mjs","sources":["../src/gasStationUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAkBM,SAAU,0BAA0B,CAAC,KAAY,EAAE,MAAc,EAAA;AACrE,IAAA,OAAO,kBAAkB,CAAC;QACxB,KAAK;AACL,QAAA,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;AACxB,KAAA,CAAC;AACJ;AAEA;AACO,MAAM,SAAS,GAAG;AACvB,IAAA;AACE,QAAA,IAAI,EAAE,UAAU;AAChB,QAAA,IAAI,EAAE,UAAU;AAChB,QAAA,eAAe,EAAE,YAAY;AAC7B,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EAAE,CAAC,EAAE,CAAC;AACjC,QAAA,IAAI;AACL,KAAA,CAAC;AACJ;;;;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { GasStationClient } from "./gasStationClient";
|
|
2
|
+
export { IntentBuilder } from "./intentBuilder";
|
|
3
|
+
export { buildTokenTransfer, buildETHTransfer, buildTokenApproval, buildETHTransferFromEther, buildContractCall, packExecutionData, } from "./gasStationUtils";
|
|
4
|
+
export type { ExecutionParams } from "./gasStationUtils";
|
|
5
|
+
export { CHAIN_PRESETS, getPreset, createCustomPreset, DEFAULT_EXECUTION_CONTRACT, DEFAULT_DELEGATE_CONTRACT, } from "./config";
|
|
6
|
+
export { buildIntentSigningPolicy, buildPaymasterExecutionPolicy, ensureGasStationInterface, uploadGasStationInterface, getSmartContractInterface, } from "./policyUtils";
|
|
7
|
+
export type { GasStationConfig, ChainPreset, ContractCallParams, ExecutionIntent, } from "./config";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,EACL,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,eAAe,GAChB,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var gasStationClient = require('./gasStationClient.js');
|
|
4
|
+
var intentBuilder = require('./intentBuilder.js');
|
|
5
|
+
var gasStationUtils = require('./gasStationUtils.js');
|
|
6
|
+
var config = require('./config.js');
|
|
7
|
+
var policyUtils = require('./policyUtils.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.GasStationClient = gasStationClient.GasStationClient;
|
|
12
|
+
exports.IntentBuilder = intentBuilder.IntentBuilder;
|
|
13
|
+
exports.buildContractCall = gasStationUtils.buildContractCall;
|
|
14
|
+
exports.buildETHTransfer = gasStationUtils.buildETHTransfer;
|
|
15
|
+
exports.buildETHTransferFromEther = gasStationUtils.buildETHTransferFromEther;
|
|
16
|
+
exports.buildTokenApproval = gasStationUtils.buildTokenApproval;
|
|
17
|
+
exports.buildTokenTransfer = gasStationUtils.buildTokenTransfer;
|
|
18
|
+
exports.packExecutionData = gasStationUtils.packExecutionData;
|
|
19
|
+
exports.CHAIN_PRESETS = config.CHAIN_PRESETS;
|
|
20
|
+
exports.DEFAULT_DELEGATE_CONTRACT = config.DEFAULT_DELEGATE_CONTRACT;
|
|
21
|
+
exports.DEFAULT_EXECUTION_CONTRACT = config.DEFAULT_EXECUTION_CONTRACT;
|
|
22
|
+
exports.createCustomPreset = config.createCustomPreset;
|
|
23
|
+
exports.getPreset = config.getPreset;
|
|
24
|
+
exports.buildIntentSigningPolicy = policyUtils.buildIntentSigningPolicy;
|
|
25
|
+
exports.buildPaymasterExecutionPolicy = policyUtils.buildPaymasterExecutionPolicy;
|
|
26
|
+
exports.ensureGasStationInterface = policyUtils.ensureGasStationInterface;
|
|
27
|
+
exports.getSmartContractInterface = policyUtils.getSmartContractInterface;
|
|
28
|
+
exports.uploadGasStationInterface = policyUtils.uploadGasStationInterface;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { GasStationClient } from './gasStationClient.mjs';
|
|
2
|
+
export { IntentBuilder } from './intentBuilder.mjs';
|
|
3
|
+
export { buildContractCall, buildETHTransfer, buildETHTransferFromEther, buildTokenApproval, buildTokenTransfer, packExecutionData } from './gasStationUtils.mjs';
|
|
4
|
+
export { CHAIN_PRESETS, DEFAULT_DELEGATE_CONTRACT, DEFAULT_EXECUTION_CONTRACT, createCustomPreset, getPreset } from './config.mjs';
|
|
5
|
+
export { buildIntentSigningPolicy, buildPaymasterExecutionPolicy, ensureGasStationInterface, getSmartContractInterface, uploadGasStationInterface } from './policyUtils.mjs';
|
|
6
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type WalletClient, type Account, type Chain, type Transport } from "viem";
|
|
2
|
+
import type { ContractCallParams, ExecutionIntent } from "./config";
|
|
3
|
+
interface IntentBuilderConfig {
|
|
4
|
+
eoaWalletClient: WalletClient<Transport, Chain, Account>;
|
|
5
|
+
chainId: number;
|
|
6
|
+
eoaAddress: `0x${string}`;
|
|
7
|
+
}
|
|
8
|
+
export declare class IntentBuilder {
|
|
9
|
+
private config;
|
|
10
|
+
private outputContract?;
|
|
11
|
+
private callData;
|
|
12
|
+
private ethAmount;
|
|
13
|
+
private nonce?;
|
|
14
|
+
private deadline?;
|
|
15
|
+
constructor(config: IntentBuilderConfig);
|
|
16
|
+
/**
|
|
17
|
+
* Set the target contract for this intent execution
|
|
18
|
+
*/
|
|
19
|
+
setTarget(contract: `0x${string}`): this;
|
|
20
|
+
/**
|
|
21
|
+
* Set the ETH value to send with this intent
|
|
22
|
+
*/
|
|
23
|
+
withValue(value: bigint): this;
|
|
24
|
+
/**
|
|
25
|
+
* Set a specific nonce (otherwise will be auto-fetched)
|
|
26
|
+
*/
|
|
27
|
+
withNonce(nonce: bigint): this;
|
|
28
|
+
/**
|
|
29
|
+
* Set an expiration deadline (unix timestamp in seconds)
|
|
30
|
+
* If not set, defaults to 1 hour from now
|
|
31
|
+
*/
|
|
32
|
+
withDeadline(deadline: number): this;
|
|
33
|
+
/**
|
|
34
|
+
* Set the call data directly (for pre-encoded function calls)
|
|
35
|
+
*/
|
|
36
|
+
withCallData(callData: `0x${string}`): this;
|
|
37
|
+
/**
|
|
38
|
+
* Add a contract call to this intent
|
|
39
|
+
*/
|
|
40
|
+
callContract(params: ContractCallParams): this;
|
|
41
|
+
/**
|
|
42
|
+
* Convenience method for ERC20 transfers
|
|
43
|
+
*/
|
|
44
|
+
transferToken(token: `0x${string}`, to: `0x${string}`, amount: bigint): this;
|
|
45
|
+
/**
|
|
46
|
+
* Convenience method for ERC20 approvals
|
|
47
|
+
*/
|
|
48
|
+
approveToken(token: `0x${string}`, spender: `0x${string}`, amount: bigint): this;
|
|
49
|
+
/**
|
|
50
|
+
* Convenience method for native ETH transfers
|
|
51
|
+
*/
|
|
52
|
+
transferETH(to: `0x${string}`, amount: bigint): this;
|
|
53
|
+
/**
|
|
54
|
+
* Signs the execution intent using EIP-712
|
|
55
|
+
* Returns a complete ExecutionIntent ready for execution
|
|
56
|
+
*/
|
|
57
|
+
sign(currentNonce: bigint): Promise<ExecutionIntent>;
|
|
58
|
+
static create(config: IntentBuilderConfig): IntentBuilder;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=intentBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intentBuilder.d.ts","sourceR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,EACpB,OAAO,EAAE,KAAK,MAAM,EAAE,EACtB,MAAM,EAAE,MAAM,GACb,IAAI;IASP;;OAEG;IACH,WAAW,CAAC,EAAE,EAAE,KAAK,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAOpD;;;OAGG;IACG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IA0D1D,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa;CAG1D"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var viem = require('viem');
|
|
4
|
+
var gasStationUtils = require('./gasStationUtils.js');
|
|
5
|
+
|
|
6
|
+
class IntentBuilder {
|
|
7
|
+
constructor(config) {
|
|
8
|
+
this.callData = "0x";
|
|
9
|
+
this.ethAmount = 0n;
|
|
10
|
+
this.config = config;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Set the target contract for this intent execution
|
|
14
|
+
*/
|
|
15
|
+
setTarget(contract) {
|
|
16
|
+
this.outputContract = contract;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Set the ETH value to send with this intent
|
|
21
|
+
*/
|
|
22
|
+
withValue(value) {
|
|
23
|
+
this.ethAmount = value;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Set a specific nonce (otherwise will be auto-fetched)
|
|
28
|
+
*/
|
|
29
|
+
withNonce(nonce) {
|
|
30
|
+
this.nonce = nonce;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Set an expiration deadline (unix timestamp in seconds)
|
|
35
|
+
* If not set, defaults to 1 hour from now
|
|
36
|
+
*/
|
|
37
|
+
withDeadline(deadline) {
|
|
38
|
+
this.deadline = deadline;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Set the call data directly (for pre-encoded function calls)
|
|
43
|
+
*/
|
|
44
|
+
withCallData(callData) {
|
|
45
|
+
this.callData = callData;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Add a contract call to this intent
|
|
50
|
+
*/
|
|
51
|
+
callContract(params) {
|
|
52
|
+
this.outputContract = params.contract;
|
|
53
|
+
this.callData = viem.encodeFunctionData({
|
|
54
|
+
abi: params.abi,
|
|
55
|
+
functionName: params.functionName,
|
|
56
|
+
args: params.args,
|
|
57
|
+
});
|
|
58
|
+
if (params.value) {
|
|
59
|
+
this.ethAmount = params.value;
|
|
60
|
+
}
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Convenience method for ERC20 transfers
|
|
65
|
+
*/
|
|
66
|
+
transferToken(token, to, amount) {
|
|
67
|
+
return this.callContract({
|
|
68
|
+
contract: token,
|
|
69
|
+
abi: gasStationUtils.ERC20_ABI,
|
|
70
|
+
functionName: "transfer",
|
|
71
|
+
args: [to, amount],
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Convenience method for ERC20 approvals
|
|
76
|
+
*/
|
|
77
|
+
approveToken(token, spender, amount) {
|
|
78
|
+
return this.callContract({
|
|
79
|
+
contract: token,
|
|
80
|
+
abi: gasStationUtils.ERC20_ABI,
|
|
81
|
+
functionName: "approve",
|
|
82
|
+
args: [spender, amount],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Convenience method for native ETH transfers
|
|
87
|
+
*/
|
|
88
|
+
transferETH(to, amount) {
|
|
89
|
+
this.outputContract = to;
|
|
90
|
+
this.callData = "0x";
|
|
91
|
+
this.ethAmount = amount;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Signs the execution intent using EIP-712
|
|
96
|
+
* Returns a complete ExecutionIntent ready for execution
|
|
97
|
+
*/
|
|
98
|
+
async sign(currentNonce) {
|
|
99
|
+
if (!this.outputContract) {
|
|
100
|
+
throw new Error("No target contract set. Use setTarget() or callContract()");
|
|
101
|
+
}
|
|
102
|
+
const nonce = this.nonce ?? currentNonce;
|
|
103
|
+
// Default deadline: 1 hour from now
|
|
104
|
+
const deadline = this.deadline ?? Math.floor(Date.now() / 1000) + 60 * 60;
|
|
105
|
+
// EIP-712 domain and types for gas station execution
|
|
106
|
+
const domain = {
|
|
107
|
+
name: "TKGasDelegate",
|
|
108
|
+
version: "1",
|
|
109
|
+
chainId: this.config.chainId,
|
|
110
|
+
verifyingContract: this.config.eoaAddress,
|
|
111
|
+
};
|
|
112
|
+
// Original: keccak256("Execution(uint128 nonce,uint32 deadline,address outputContract,uint256 ethAmount,bytes arguments)")
|
|
113
|
+
const types = {
|
|
114
|
+
Execution: [
|
|
115
|
+
{ name: "nonce", type: "uint128" },
|
|
116
|
+
{ name: "deadline", type: "uint32" },
|
|
117
|
+
{ name: "outputContract", type: "address" },
|
|
118
|
+
{ name: "ethAmount", type: "uint256" },
|
|
119
|
+
{ name: "arguments", type: "bytes" },
|
|
120
|
+
],
|
|
121
|
+
};
|
|
122
|
+
const message = {
|
|
123
|
+
nonce,
|
|
124
|
+
deadline,
|
|
125
|
+
outputContract: this.outputContract,
|
|
126
|
+
ethAmount: this.ethAmount,
|
|
127
|
+
arguments: this.callData,
|
|
128
|
+
};
|
|
129
|
+
const signature = await this.config.eoaWalletClient.signTypedData({
|
|
130
|
+
account: this.config.eoaWalletClient.account,
|
|
131
|
+
domain,
|
|
132
|
+
types,
|
|
133
|
+
primaryType: "Execution",
|
|
134
|
+
message,
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
nonce,
|
|
138
|
+
deadline,
|
|
139
|
+
outputContract: this.outputContract,
|
|
140
|
+
ethAmount: this.ethAmount,
|
|
141
|
+
callData: this.callData,
|
|
142
|
+
signature,
|
|
143
|
+
eoaAddress: this.config.eoaAddress,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
// Static factory method for quick intent creation
|
|
147
|
+
static create(config) {
|
|
148
|
+
return new IntentBuilder(config);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
exports.IntentBuilder = IntentBuilder;
|
|
153
|
+
//# sourceMappingURL=intentBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intentBuilder.js","sources":["../src/intentBuilder.ts"],"sourcesContent":[null],"names":["encodeFunctionData","ERC20_ABI"],"mappings":";;;;;MAgBa,aAAa,CAAA;AAQxB,IAAA,WAAA,CAAY,MAA2B,EAAA;QAL/B,IAAA,CAAA,QAAQ,GAAkB,IAAI;QAC9B,IAAA,CAAA,SAAS,GAAW,EAAE;AAK5B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;IACtB;AAEA;;AAEG;AACH,IAAA,SAAS,CAAC,QAAuB,EAAA;AAC/B,QAAA,IAAI,CAAC,cAAc,GAAG,QAAQ;AAC9B,QAAA,OAAO,IAAI;IACb;AAEA;;AAEG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,CAAC,SAAS,GAAG,KAAK;AACtB,QAAA,OAAO,IAAI;IACb;AAEA;;AAEG;AACH,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,OAAO,IAAI;IACb;AAEA;;;AAGG;AACH,IAAA,YAAY,CAAC,QAAgB,EAAA;AAC3B,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,OAAO,IAAI;IACb;AAEA;;AAEG;AACH,IAAA,YAAY,CAAC,QAAuB,EAAA;AAClC,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,OAAO,IAAI;IACb;AAEA;;AAEG;AACH,IAAA,YAAY,CAAC,MAA0B,EAAA;AACrC,QAAA,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC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