@rhinestone/sdk 0.2.0 → 0.3.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/README.md +7 -19
- package/dist/accounts/index.d.ts +15535 -0
- package/dist/accounts/index.d.ts.map +1 -0
- package/dist/accounts/index.js +242 -0
- package/dist/accounts/nexus.d.ts +23281 -0
- package/dist/accounts/nexus.d.ts.map +1 -0
- package/dist/accounts/nexus.js +230 -0
- package/dist/accounts/safe.d.ts +15 -0
- package/dist/accounts/safe.d.ts.map +1 -0
- package/dist/{services/account → accounts}/safe.js +36 -37
- package/dist/accounts/utils.d.ts +27 -0
- package/dist/accounts/utils.d.ts.map +1 -0
- package/dist/accounts/utils.js +155 -0
- package/dist/examples/abi/weth.d.ts +214 -0
- package/dist/examples/abi/weth.d.ts.map +1 -0
- package/dist/examples/abi/weth.js +279 -0
- package/dist/examples/cross-chain-ss.d.ts +1 -0
- package/dist/examples/cross-chain-ss.d.ts.map +1 -0
- package/dist/{example.js → examples/cross-chain-ss.js} +70 -44
- package/dist/examples/omni-account.d.ts +1 -0
- package/dist/examples/omni-account.d.ts.map +1 -0
- package/dist/examples/omni-account.js +169 -0
- package/dist/examples/smart-sessions.d.ts +1 -0
- package/dist/examples/smart-sessions.d.ts.map +1 -0
- package/dist/examples/smart-sessions.js +216 -0
- package/dist/execution/index.d.ts +31 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +222 -0
- package/dist/execution/smart-session.d.ts +14 -0
- package/dist/execution/smart-session.d.ts.map +1 -0
- package/dist/execution/smart-session.js +83 -0
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/modules/abi/smart-sessions.d.ts +42 -0
- package/dist/modules/abi/smart-sessions.d.ts.map +1 -0
- package/dist/modules/abi/smart-sessions.js +128 -0
- package/dist/modules/common.d.ts +16 -0
- package/dist/modules/common.d.ts.map +1 -0
- package/dist/modules/common.js +5 -0
- package/dist/modules/index.d.ts +33 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +129 -0
- package/dist/modules/omni-account.d.ts +9 -0
- package/dist/modules/omni-account.d.ts.map +1 -0
- package/dist/modules/omni-account.js +7 -0
- package/dist/modules/validators.d.ts +31 -0
- package/dist/modules/validators.d.ts.map +1 -0
- package/dist/modules/validators.js +518 -0
- package/dist/{services/orchestrator → orchestrator}/client.d.ts +2 -5
- package/dist/orchestrator/client.d.ts.map +1 -0
- package/dist/orchestrator/consts.d.ts +4 -0
- package/dist/orchestrator/consts.d.ts.map +1 -0
- package/dist/orchestrator/consts.js +3 -0
- package/dist/orchestrator/error.d.ts.map +1 -0
- package/dist/orchestrator/index.d.ts +9 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +10 -0
- package/dist/orchestrator/registry.d.ts +5 -0
- package/dist/orchestrator/registry.d.ts.map +1 -0
- package/dist/orchestrator/registry.js +187 -0
- package/dist/{services/orchestrator → orchestrator}/types.d.ts +39 -23
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +7 -0
- package/dist/orchestrator/utils.d.ts +11 -0
- package/dist/orchestrator/utils.d.ts.map +1 -0
- package/dist/{services/orchestrator → orchestrator}/utils.js +20 -6
- package/dist/types.d.ts +70 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/example.d.ts +0 -1
- package/dist/example.d.ts.map +0 -1
- package/dist/services/account/index.d.ts +0 -13
- package/dist/services/account/index.d.ts.map +0 -1
- package/dist/services/account/index.js +0 -54
- package/dist/services/account/nexus.d.ts +0 -9
- package/dist/services/account/nexus.d.ts.map +0 -1
- package/dist/services/account/nexus.js +0 -67
- package/dist/services/account/safe.d.ts +0 -9
- package/dist/services/account/safe.d.ts.map +0 -1
- package/dist/services/modules.d.ts +0 -32
- package/dist/services/modules.d.ts.map +0 -1
- package/dist/services/modules.js +0 -166
- package/dist/services/orchestrator/client.d.ts.map +0 -1
- package/dist/services/orchestrator/consts.d.ts +0 -6
- package/dist/services/orchestrator/consts.d.ts.map +0 -1
- package/dist/services/orchestrator/consts.js +0 -4
- package/dist/services/orchestrator/error.d.ts.map +0 -1
- package/dist/services/orchestrator/index.d.ts +0 -8
- package/dist/services/orchestrator/index.d.ts.map +0 -1
- package/dist/services/orchestrator/index.js +0 -9
- package/dist/services/orchestrator/types.d.ts.map +0 -1
- package/dist/services/orchestrator/types.js +0 -6
- package/dist/services/orchestrator/utils.d.ts +0 -7
- package/dist/services/orchestrator/utils.d.ts.map +0 -1
- package/dist/services/transaction.d.ts +0 -6
- package/dist/services/transaction.d.ts.map +0 -1
- package/dist/services/transaction.js +0 -93
- /package/dist/{services/orchestrator → orchestrator}/client.js +0 -0
- /package/dist/{services/orchestrator → orchestrator}/error.d.ts +0 -0
- /package/dist/{services/orchestrator → orchestrator}/error.js +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
export declare const abi: readonly [{
|
|
2
|
+
readonly constant: true;
|
|
3
|
+
readonly inputs: readonly [];
|
|
4
|
+
readonly name: "name";
|
|
5
|
+
readonly outputs: readonly [{
|
|
6
|
+
readonly name: "";
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
}];
|
|
9
|
+
readonly payable: false;
|
|
10
|
+
readonly stateMutability: "view";
|
|
11
|
+
readonly type: "function";
|
|
12
|
+
}, {
|
|
13
|
+
readonly constant: false;
|
|
14
|
+
readonly inputs: readonly [{
|
|
15
|
+
readonly name: "guy";
|
|
16
|
+
readonly type: "address";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "wad";
|
|
19
|
+
readonly type: "uint256";
|
|
20
|
+
}];
|
|
21
|
+
readonly name: "approve";
|
|
22
|
+
readonly outputs: readonly [{
|
|
23
|
+
readonly name: "";
|
|
24
|
+
readonly type: "bool";
|
|
25
|
+
}];
|
|
26
|
+
readonly payable: false;
|
|
27
|
+
readonly stateMutability: "nonpayable";
|
|
28
|
+
readonly type: "function";
|
|
29
|
+
}, {
|
|
30
|
+
readonly constant: true;
|
|
31
|
+
readonly inputs: readonly [];
|
|
32
|
+
readonly name: "totalSupply";
|
|
33
|
+
readonly outputs: readonly [{
|
|
34
|
+
readonly name: "";
|
|
35
|
+
readonly type: "uint256";
|
|
36
|
+
}];
|
|
37
|
+
readonly payable: false;
|
|
38
|
+
readonly stateMutability: "view";
|
|
39
|
+
readonly type: "function";
|
|
40
|
+
}, {
|
|
41
|
+
readonly constant: false;
|
|
42
|
+
readonly inputs: readonly [{
|
|
43
|
+
readonly name: "src";
|
|
44
|
+
readonly type: "address";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "dst";
|
|
47
|
+
readonly type: "address";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "wad";
|
|
50
|
+
readonly type: "uint256";
|
|
51
|
+
}];
|
|
52
|
+
readonly name: "transferFrom";
|
|
53
|
+
readonly outputs: readonly [{
|
|
54
|
+
readonly name: "";
|
|
55
|
+
readonly type: "bool";
|
|
56
|
+
}];
|
|
57
|
+
readonly payable: false;
|
|
58
|
+
readonly stateMutability: "nonpayable";
|
|
59
|
+
readonly type: "function";
|
|
60
|
+
}, {
|
|
61
|
+
readonly constant: false;
|
|
62
|
+
readonly inputs: readonly [{
|
|
63
|
+
readonly name: "wad";
|
|
64
|
+
readonly type: "uint256";
|
|
65
|
+
}];
|
|
66
|
+
readonly name: "withdraw";
|
|
67
|
+
readonly outputs: readonly [];
|
|
68
|
+
readonly payable: false;
|
|
69
|
+
readonly stateMutability: "nonpayable";
|
|
70
|
+
readonly type: "function";
|
|
71
|
+
}, {
|
|
72
|
+
readonly constant: true;
|
|
73
|
+
readonly inputs: readonly [];
|
|
74
|
+
readonly name: "decimals";
|
|
75
|
+
readonly outputs: readonly [{
|
|
76
|
+
readonly name: "";
|
|
77
|
+
readonly type: "uint8";
|
|
78
|
+
}];
|
|
79
|
+
readonly payable: false;
|
|
80
|
+
readonly stateMutability: "view";
|
|
81
|
+
readonly type: "function";
|
|
82
|
+
}, {
|
|
83
|
+
readonly constant: true;
|
|
84
|
+
readonly inputs: readonly [{
|
|
85
|
+
readonly name: "";
|
|
86
|
+
readonly type: "address";
|
|
87
|
+
}];
|
|
88
|
+
readonly name: "balanceOf";
|
|
89
|
+
readonly outputs: readonly [{
|
|
90
|
+
readonly name: "";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
}];
|
|
93
|
+
readonly payable: false;
|
|
94
|
+
readonly stateMutability: "view";
|
|
95
|
+
readonly type: "function";
|
|
96
|
+
}, {
|
|
97
|
+
readonly constant: true;
|
|
98
|
+
readonly inputs: readonly [];
|
|
99
|
+
readonly name: "symbol";
|
|
100
|
+
readonly outputs: readonly [{
|
|
101
|
+
readonly name: "";
|
|
102
|
+
readonly type: "string";
|
|
103
|
+
}];
|
|
104
|
+
readonly payable: false;
|
|
105
|
+
readonly stateMutability: "view";
|
|
106
|
+
readonly type: "function";
|
|
107
|
+
}, {
|
|
108
|
+
readonly constant: false;
|
|
109
|
+
readonly inputs: readonly [{
|
|
110
|
+
readonly name: "dst";
|
|
111
|
+
readonly type: "address";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "wad";
|
|
114
|
+
readonly type: "uint256";
|
|
115
|
+
}];
|
|
116
|
+
readonly name: "transfer";
|
|
117
|
+
readonly outputs: readonly [{
|
|
118
|
+
readonly name: "";
|
|
119
|
+
readonly type: "bool";
|
|
120
|
+
}];
|
|
121
|
+
readonly payable: false;
|
|
122
|
+
readonly stateMutability: "nonpayable";
|
|
123
|
+
readonly type: "function";
|
|
124
|
+
}, {
|
|
125
|
+
readonly constant: false;
|
|
126
|
+
readonly inputs: readonly [];
|
|
127
|
+
readonly name: "deposit";
|
|
128
|
+
readonly outputs: readonly [];
|
|
129
|
+
readonly payable: true;
|
|
130
|
+
readonly stateMutability: "payable";
|
|
131
|
+
readonly type: "function";
|
|
132
|
+
}, {
|
|
133
|
+
readonly constant: true;
|
|
134
|
+
readonly inputs: readonly [{
|
|
135
|
+
readonly name: "";
|
|
136
|
+
readonly type: "address";
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "";
|
|
139
|
+
readonly type: "address";
|
|
140
|
+
}];
|
|
141
|
+
readonly name: "allowance";
|
|
142
|
+
readonly outputs: readonly [{
|
|
143
|
+
readonly name: "";
|
|
144
|
+
readonly type: "uint256";
|
|
145
|
+
}];
|
|
146
|
+
readonly payable: false;
|
|
147
|
+
readonly stateMutability: "view";
|
|
148
|
+
readonly type: "function";
|
|
149
|
+
}, {
|
|
150
|
+
readonly payable: true;
|
|
151
|
+
readonly stateMutability: "payable";
|
|
152
|
+
readonly type: "fallback";
|
|
153
|
+
}, {
|
|
154
|
+
readonly anonymous: false;
|
|
155
|
+
readonly inputs: readonly [{
|
|
156
|
+
readonly indexed: true;
|
|
157
|
+
readonly name: "src";
|
|
158
|
+
readonly type: "address";
|
|
159
|
+
}, {
|
|
160
|
+
readonly indexed: true;
|
|
161
|
+
readonly name: "guy";
|
|
162
|
+
readonly type: "address";
|
|
163
|
+
}, {
|
|
164
|
+
readonly indexed: false;
|
|
165
|
+
readonly name: "wad";
|
|
166
|
+
readonly type: "uint256";
|
|
167
|
+
}];
|
|
168
|
+
readonly name: "Approval";
|
|
169
|
+
readonly type: "event";
|
|
170
|
+
}, {
|
|
171
|
+
readonly anonymous: false;
|
|
172
|
+
readonly inputs: readonly [{
|
|
173
|
+
readonly indexed: true;
|
|
174
|
+
readonly name: "src";
|
|
175
|
+
readonly type: "address";
|
|
176
|
+
}, {
|
|
177
|
+
readonly indexed: true;
|
|
178
|
+
readonly name: "dst";
|
|
179
|
+
readonly type: "address";
|
|
180
|
+
}, {
|
|
181
|
+
readonly indexed: false;
|
|
182
|
+
readonly name: "wad";
|
|
183
|
+
readonly type: "uint256";
|
|
184
|
+
}];
|
|
185
|
+
readonly name: "Transfer";
|
|
186
|
+
readonly type: "event";
|
|
187
|
+
}, {
|
|
188
|
+
readonly anonymous: false;
|
|
189
|
+
readonly inputs: readonly [{
|
|
190
|
+
readonly indexed: true;
|
|
191
|
+
readonly name: "dst";
|
|
192
|
+
readonly type: "address";
|
|
193
|
+
}, {
|
|
194
|
+
readonly indexed: false;
|
|
195
|
+
readonly name: "wad";
|
|
196
|
+
readonly type: "uint256";
|
|
197
|
+
}];
|
|
198
|
+
readonly name: "Deposit";
|
|
199
|
+
readonly type: "event";
|
|
200
|
+
}, {
|
|
201
|
+
readonly anonymous: false;
|
|
202
|
+
readonly inputs: readonly [{
|
|
203
|
+
readonly indexed: true;
|
|
204
|
+
readonly name: "src";
|
|
205
|
+
readonly type: "address";
|
|
206
|
+
}, {
|
|
207
|
+
readonly indexed: false;
|
|
208
|
+
readonly name: "wad";
|
|
209
|
+
readonly type: "uint256";
|
|
210
|
+
}];
|
|
211
|
+
readonly name: "Withdrawal";
|
|
212
|
+
readonly type: "event";
|
|
213
|
+
}];
|
|
214
|
+
//# sourceMappingURL=weth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weth.d.ts","sourceRoot":"","sources":["../../../examples/abi/weth.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsRN,CAAA"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
export const abi = [
|
|
2
|
+
{
|
|
3
|
+
constant: true,
|
|
4
|
+
inputs: [],
|
|
5
|
+
name: 'name',
|
|
6
|
+
outputs: [
|
|
7
|
+
{
|
|
8
|
+
name: '',
|
|
9
|
+
type: 'string',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
payable: false,
|
|
13
|
+
stateMutability: 'view',
|
|
14
|
+
type: 'function',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
constant: false,
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
name: 'guy',
|
|
21
|
+
type: 'address',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'wad',
|
|
25
|
+
type: 'uint256',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
name: 'approve',
|
|
29
|
+
outputs: [
|
|
30
|
+
{
|
|
31
|
+
name: '',
|
|
32
|
+
type: 'bool',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
payable: false,
|
|
36
|
+
stateMutability: 'nonpayable',
|
|
37
|
+
type: 'function',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
constant: true,
|
|
41
|
+
inputs: [],
|
|
42
|
+
name: 'totalSupply',
|
|
43
|
+
outputs: [
|
|
44
|
+
{
|
|
45
|
+
name: '',
|
|
46
|
+
type: 'uint256',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
payable: false,
|
|
50
|
+
stateMutability: 'view',
|
|
51
|
+
type: 'function',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
constant: false,
|
|
55
|
+
inputs: [
|
|
56
|
+
{
|
|
57
|
+
name: 'src',
|
|
58
|
+
type: 'address',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'dst',
|
|
62
|
+
type: 'address',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'wad',
|
|
66
|
+
type: 'uint256',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
name: 'transferFrom',
|
|
70
|
+
outputs: [
|
|
71
|
+
{
|
|
72
|
+
name: '',
|
|
73
|
+
type: 'bool',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
payable: false,
|
|
77
|
+
stateMutability: 'nonpayable',
|
|
78
|
+
type: 'function',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
constant: false,
|
|
82
|
+
inputs: [
|
|
83
|
+
{
|
|
84
|
+
name: 'wad',
|
|
85
|
+
type: 'uint256',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
name: 'withdraw',
|
|
89
|
+
outputs: [],
|
|
90
|
+
payable: false,
|
|
91
|
+
stateMutability: 'nonpayable',
|
|
92
|
+
type: 'function',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
constant: true,
|
|
96
|
+
inputs: [],
|
|
97
|
+
name: 'decimals',
|
|
98
|
+
outputs: [
|
|
99
|
+
{
|
|
100
|
+
name: '',
|
|
101
|
+
type: 'uint8',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
payable: false,
|
|
105
|
+
stateMutability: 'view',
|
|
106
|
+
type: 'function',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
constant: true,
|
|
110
|
+
inputs: [
|
|
111
|
+
{
|
|
112
|
+
name: '',
|
|
113
|
+
type: 'address',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
name: 'balanceOf',
|
|
117
|
+
outputs: [
|
|
118
|
+
{
|
|
119
|
+
name: '',
|
|
120
|
+
type: 'uint256',
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
payable: false,
|
|
124
|
+
stateMutability: 'view',
|
|
125
|
+
type: 'function',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
constant: true,
|
|
129
|
+
inputs: [],
|
|
130
|
+
name: 'symbol',
|
|
131
|
+
outputs: [
|
|
132
|
+
{
|
|
133
|
+
name: '',
|
|
134
|
+
type: 'string',
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
payable: false,
|
|
138
|
+
stateMutability: 'view',
|
|
139
|
+
type: 'function',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
constant: false,
|
|
143
|
+
inputs: [
|
|
144
|
+
{
|
|
145
|
+
name: 'dst',
|
|
146
|
+
type: 'address',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'wad',
|
|
150
|
+
type: 'uint256',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
name: 'transfer',
|
|
154
|
+
outputs: [
|
|
155
|
+
{
|
|
156
|
+
name: '',
|
|
157
|
+
type: 'bool',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
payable: false,
|
|
161
|
+
stateMutability: 'nonpayable',
|
|
162
|
+
type: 'function',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
constant: false,
|
|
166
|
+
inputs: [],
|
|
167
|
+
name: 'deposit',
|
|
168
|
+
outputs: [],
|
|
169
|
+
payable: true,
|
|
170
|
+
stateMutability: 'payable',
|
|
171
|
+
type: 'function',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
constant: true,
|
|
175
|
+
inputs: [
|
|
176
|
+
{
|
|
177
|
+
name: '',
|
|
178
|
+
type: 'address',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: '',
|
|
182
|
+
type: 'address',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
name: 'allowance',
|
|
186
|
+
outputs: [
|
|
187
|
+
{
|
|
188
|
+
name: '',
|
|
189
|
+
type: 'uint256',
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
payable: false,
|
|
193
|
+
stateMutability: 'view',
|
|
194
|
+
type: 'function',
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
payable: true,
|
|
198
|
+
stateMutability: 'payable',
|
|
199
|
+
type: 'fallback',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
anonymous: false,
|
|
203
|
+
inputs: [
|
|
204
|
+
{
|
|
205
|
+
indexed: true,
|
|
206
|
+
name: 'src',
|
|
207
|
+
type: 'address',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
indexed: true,
|
|
211
|
+
name: 'guy',
|
|
212
|
+
type: 'address',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
indexed: false,
|
|
216
|
+
name: 'wad',
|
|
217
|
+
type: 'uint256',
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
name: 'Approval',
|
|
221
|
+
type: 'event',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
anonymous: false,
|
|
225
|
+
inputs: [
|
|
226
|
+
{
|
|
227
|
+
indexed: true,
|
|
228
|
+
name: 'src',
|
|
229
|
+
type: 'address',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
indexed: true,
|
|
233
|
+
name: 'dst',
|
|
234
|
+
type: 'address',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
indexed: false,
|
|
238
|
+
name: 'wad',
|
|
239
|
+
type: 'uint256',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
name: 'Transfer',
|
|
243
|
+
type: 'event',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
anonymous: false,
|
|
247
|
+
inputs: [
|
|
248
|
+
{
|
|
249
|
+
indexed: true,
|
|
250
|
+
name: 'dst',
|
|
251
|
+
type: 'address',
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
indexed: false,
|
|
255
|
+
name: 'wad',
|
|
256
|
+
type: 'uint256',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
name: 'Deposit',
|
|
260
|
+
type: 'event',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
anonymous: false,
|
|
264
|
+
inputs: [
|
|
265
|
+
{
|
|
266
|
+
indexed: true,
|
|
267
|
+
name: 'src',
|
|
268
|
+
type: 'address',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
indexed: false,
|
|
272
|
+
name: 'wad',
|
|
273
|
+
type: 'uint256',
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
name: 'Withdrawal',
|
|
277
|
+
type: 'event',
|
|
278
|
+
},
|
|
279
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=cross-chain-ss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-chain-ss.d.ts","sourceRoot":"","sources":["../../examples/cross-chain-ss.ts"],"names":[],"mappings":""}
|
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
// baseSepolia,
|
|
5
5
|
// arbitrumSepolia,
|
|
6
6
|
// optimismSepolia,
|
|
7
|
-
//
|
|
8
|
-
// base,
|
|
7
|
+
// sepolia,
|
|
9
8
|
// optimism,
|
|
9
|
+
// base,
|
|
10
|
+
// arbitrum,
|
|
10
11
|
// } from 'viem/chains'
|
|
11
12
|
// import {
|
|
12
13
|
// Chain,
|
|
@@ -14,11 +15,14 @@
|
|
|
14
15
|
// createWalletClient,
|
|
15
16
|
// encodeFunctionData,
|
|
16
17
|
// erc20Abi,
|
|
18
|
+
// getAbiItem,
|
|
17
19
|
// Hex,
|
|
18
20
|
// http,
|
|
19
21
|
// parseEther,
|
|
22
|
+
// toFunctionSelector,
|
|
20
23
|
// } from 'viem'
|
|
21
|
-
// import { createRhinestoneAccount } from '
|
|
24
|
+
// import { createRhinestoneAccount } from '../index'
|
|
25
|
+
// import { Session } from '../types'
|
|
22
26
|
// const fundingPrivateKey = process.env.FUNDING_PRIVATE_KEY
|
|
23
27
|
// if (!fundingPrivateKey) {
|
|
24
28
|
// throw new Error('FUNDING_PRIVATE_KEY is not set')
|
|
@@ -27,49 +31,78 @@
|
|
|
27
31
|
// if (!rhinestoneApiKey) {
|
|
28
32
|
// throw new Error('RHINESTONE_API_KEY is not set')
|
|
29
33
|
// }
|
|
30
|
-
//
|
|
31
|
-
//
|
|
34
|
+
// const pimlicoApiKey = process.env.PIMLICO_API_KEY
|
|
35
|
+
// if (!pimlicoApiKey) {
|
|
36
|
+
// throw new Error('PIMLICO_API_KEY is not set')
|
|
37
|
+
// }
|
|
32
38
|
// const sourceChain = baseSepolia
|
|
33
|
-
// const targetChain =
|
|
34
|
-
// // const usdc = getTokenAddress(sourceChain)
|
|
39
|
+
// const targetChain = optimismSepolia
|
|
35
40
|
// const usdcTarget = getTokenAddress(targetChain)
|
|
36
41
|
// const usdcAmount = 1n
|
|
37
42
|
// const fundingAccount = privateKeyToAccount(fundingPrivateKey as Hex)
|
|
38
43
|
// const publicClient = createPublicClient({
|
|
39
44
|
// chain: sourceChain,
|
|
40
|
-
// transport:
|
|
45
|
+
// transport: getTransport(sourceChain),
|
|
41
46
|
// })
|
|
42
47
|
// const fundingClient = createWalletClient({
|
|
43
48
|
// account: fundingAccount,
|
|
44
49
|
// chain: sourceChain,
|
|
45
|
-
// transport:
|
|
50
|
+
// transport: getTransport(sourceChain),
|
|
46
51
|
// })
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
52
|
+
// const useNewKeys = true
|
|
53
|
+
// if (!useNewKeys) {
|
|
54
|
+
// console.log('new pks', [
|
|
55
|
+
// generatePrivateKey(),
|
|
56
|
+
// generatePrivateKey(),
|
|
57
|
+
// generatePrivateKey(),
|
|
58
|
+
// ])
|
|
59
|
+
// }
|
|
60
|
+
// const privateKeyA = useNewKeys
|
|
61
|
+
// ? generatePrivateKey()
|
|
62
|
+
// : '0x2abb7571751edee246e21179db22388dda1fd623e1aad66552f4a3838920eb3d'
|
|
54
63
|
// const accountA = privateKeyToAccount(privateKeyA)
|
|
55
|
-
// const privateKeyB =
|
|
56
|
-
//
|
|
64
|
+
// const privateKeyB = useNewKeys
|
|
65
|
+
// ? generatePrivateKey()
|
|
66
|
+
// : '0xd30440894e60fbc1d17d5967c476ab9128c19e186077c042c6d1de592075a0d9'
|
|
57
67
|
// const accountB = privateKeyToAccount(privateKeyB)
|
|
58
|
-
// const privateKeyC =
|
|
59
|
-
//
|
|
68
|
+
// const privateKeyC = useNewKeys
|
|
69
|
+
// ? generatePrivateKey()
|
|
70
|
+
// : '0xb63c74af219a3949cf95f5e3a3d20b0137425de053bb03e5cc0f46fe0d19f22f'
|
|
60
71
|
// const accountC = privateKeyToAccount(privateKeyC)
|
|
72
|
+
// const session: Session = {
|
|
73
|
+
// owners: {
|
|
74
|
+
// type: 'ecdsa',
|
|
75
|
+
// accounts: [accountA],
|
|
76
|
+
// },
|
|
77
|
+
// // actions: [],
|
|
78
|
+
// actions: [
|
|
79
|
+
// {
|
|
80
|
+
// target: usdcTarget,
|
|
81
|
+
// selector: toFunctionSelector(
|
|
82
|
+
// getAbiItem({
|
|
83
|
+
// abi: erc20Abi,
|
|
84
|
+
// name: 'transfer',
|
|
85
|
+
// }),
|
|
86
|
+
// ),
|
|
87
|
+
// },
|
|
88
|
+
// ],
|
|
89
|
+
// }
|
|
61
90
|
// const rhinestoneAccount = await createRhinestoneAccount({
|
|
62
91
|
// account: {
|
|
63
|
-
// type: '
|
|
92
|
+
// type: 'nexus',
|
|
64
93
|
// },
|
|
65
94
|
// owners: {
|
|
66
95
|
// type: 'ecdsa',
|
|
67
96
|
// accounts: [accountA, accountB, accountC],
|
|
68
97
|
// threshold: 2,
|
|
69
|
-
// // accounts: [accountA],
|
|
70
98
|
// },
|
|
99
|
+
// sessions: [session],
|
|
71
100
|
// rhinestoneApiKey,
|
|
72
101
|
// deployerAccount: fundingAccount,
|
|
102
|
+
// bundler: {
|
|
103
|
+
// type: 'pimlico',
|
|
104
|
+
// apiKey: pimlicoApiKey,
|
|
105
|
+
// },
|
|
73
106
|
// })
|
|
74
107
|
// const address = await rhinestoneAccount.getAddress()
|
|
75
108
|
// console.log(address)
|
|
@@ -84,30 +117,12 @@
|
|
|
84
117
|
// })
|
|
85
118
|
// await publicClient.waitForTransactionReceipt({ hash: txHash })
|
|
86
119
|
// }
|
|
87
|
-
//
|
|
88
|
-
// // address: usdc,
|
|
89
|
-
// // abi: erc20Abi,
|
|
90
|
-
// // functionName: 'balanceOf',
|
|
91
|
-
// // args: [address],
|
|
92
|
-
// // })
|
|
93
|
-
// // if (usdcBalance < usdcAmount) {
|
|
94
|
-
// // const txHash2 = await fundingClient.sendTransaction({
|
|
95
|
-
// // to: usdc,
|
|
96
|
-
// // data: encodeFunctionData({
|
|
97
|
-
// // abi: erc20Abi,
|
|
98
|
-
// // functionName: 'transfer',
|
|
99
|
-
// // args: [address, usdcAmount],
|
|
100
|
-
// // }),
|
|
101
|
-
// // })
|
|
102
|
-
// // await publicClient.waitForTransactionReceipt({ hash: txHash2 })
|
|
103
|
-
// // }
|
|
104
|
-
// const bundleId = await rhinestoneAccount.sendTransactions({
|
|
120
|
+
// const transactionResult = await rhinestoneAccount.sendTransactions({
|
|
105
121
|
// sourceChain,
|
|
106
122
|
// targetChain,
|
|
107
123
|
// calls: [
|
|
108
124
|
// {
|
|
109
125
|
// to: usdcTarget,
|
|
110
|
-
// value: 0n,
|
|
111
126
|
// data: encodeFunctionData({
|
|
112
127
|
// abi: erc20Abi,
|
|
113
128
|
// functionName: 'transfer',
|
|
@@ -121,12 +136,17 @@
|
|
|
121
136
|
// amount: usdcAmount,
|
|
122
137
|
// },
|
|
123
138
|
// ],
|
|
139
|
+
// signers: {
|
|
140
|
+
// type: 'session',
|
|
141
|
+
// session,
|
|
142
|
+
// },
|
|
124
143
|
// })
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
// console.log('status', bundleResult.status)
|
|
144
|
+
// const result = await rhinestoneAccount.waitForExecution(transactionResult)
|
|
145
|
+
// console.log('status', result)
|
|
128
146
|
// function getTokenAddress(chain: Chain) {
|
|
129
147
|
// switch (chain.id) {
|
|
148
|
+
// case sepolia.id:
|
|
149
|
+
// return '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238'
|
|
130
150
|
// case baseSepolia.id:
|
|
131
151
|
// return '0x036cbd53842c5426634e7929541ec2318f3dcf7e'
|
|
132
152
|
// case arbitrumSepolia.id:
|
|
@@ -143,3 +163,9 @@
|
|
|
143
163
|
// throw new Error('Unsupported chain')
|
|
144
164
|
// }
|
|
145
165
|
// }
|
|
166
|
+
// function getTransport(chain: Chain) {
|
|
167
|
+
// if (chain.id === sepolia.id) {
|
|
168
|
+
// return http('https://ethereum-sepolia-rpc.publicnode.com')
|
|
169
|
+
// }
|
|
170
|
+
// return http()
|
|
171
|
+
// }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=omni-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omni-account.d.ts","sourceRoot":"","sources":["../../examples/omni-account.ts"],"names":[],"mappings":""}
|