@funkit/core 1.0.15 → 1.0.17
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/src/abis/ApproveAndExec.json +70 -1
- package/dist/src/abis/EntryPoint.json +546 -2
- package/dist/src/abis/EstimationPaymaster.json +156 -1
- package/dist/src/abis/FeePercentOracle.json +142 -1
- package/dist/src/abis/FunWallet.json +534 -2
- package/dist/src/abis/FunWalletFactory.json +141 -1
- package/dist/src/abis/GaslessPaymaster.json +329 -1
- package/dist/src/abis/RoleBasedAccessControl.json +2 -1
- package/dist/src/abis/TestNFT.json +170 -1
- package/dist/src/abis/TokenPaymaster.json +696 -1
- package/dist/src/abis/TokenPriceOracle.json +44 -1
- package/dist/src/abis/UserAuthentication.json +223 -1
- package/dist/src/apis/AccessControlApis.js +4 -5
- package/dist/src/apis/AccessControlApis.js.map +1 -1
- package/dist/src/apis/BridgeApis.js +4 -5
- package/dist/src/apis/BridgeApis.js.map +1 -1
- package/dist/src/apis/ContractApis.js +1 -2
- package/dist/src/apis/ContractApis.js.map +1 -1
- package/dist/src/apis/GroupApis.js +2 -3
- package/dist/src/apis/GroupApis.js.map +1 -1
- package/dist/src/apis/InfoApis.js +5 -6
- package/dist/src/apis/InfoApis.js.map +1 -1
- package/dist/src/apis/ListenerApis.js +2 -3
- package/dist/src/apis/ListenerApis.js.map +1 -1
- package/dist/src/apis/NFTApis.js +2 -3
- package/dist/src/apis/NFTApis.js.map +1 -1
- package/dist/src/apis/OperationApis.js +10 -10
- package/dist/src/apis/OperationApis.js.map +1 -1
- package/dist/src/apis/PaymasterApis.js +1 -2
- package/dist/src/apis/PaymasterApis.js.map +1 -1
- package/dist/src/apis/SwapApis.js +3 -4
- package/dist/src/apis/SwapApis.js.map +1 -1
- package/dist/src/apis/UserApis.js +7 -8
- package/dist/src/apis/UserApis.js.map +1 -1
- package/dist/src/apis/types.d.ts +0 -117
- package/dist/src/apis/types.js +0 -18
- package/dist/src/apis/types.js.map +1 -1
- package/dist/src/common/constants.d.ts +1646 -1509
- package/dist/src/common/constants.js +32 -2
- package/dist/src/common/constants.js.map +1 -1
- package/dist/src/config/Config.js +3 -4
- package/dist/src/config/Config.js.map +1 -1
- package/dist/src/data/SolidityData.js +5 -6
- package/dist/src/data/SolidityData.js.map +1 -1
- package/dist/src/data/Token.js +1 -1
- package/dist/src/data/Token.js.map +1 -1
- package/dist/src/utils/ApiUtils.js +5 -5
- package/dist/src/utils/ApiUtils.js.map +1 -1
- package/dist/src/utils/CheckoutUtils.js +3 -4
- package/dist/src/utils/CheckoutUtils.js.map +1 -1
- package/dist/src/utils/GroupUtils.js +1 -2
- package/dist/src/utils/GroupUtils.js.map +1 -1
- package/dist/src/utils/SwapUtils.js +3 -4
- package/dist/src/utils/SwapUtils.js.map +1 -1
- package/dist/src/utils/UserOpUtils.js +3 -3
- package/dist/src/utils/UserOpUtils.js.map +1 -1
- package/dist/src/utils/ViemUtils.js +3 -3
- package/dist/src/utils/ViemUtils.js.map +1 -1
- package/dist/src/viem/Converter.d.ts +188 -5654
- package/dist/src/wallet/FunWallet.d.ts +1 -1
- package/package.json +3 -2
|
@@ -1 +1,44 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "TokenPriceOracle",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"inputs": [],
|
|
6
|
+
"name": "MAX_DELAY",
|
|
7
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
8
|
+
"stateMutability": "view",
|
|
9
|
+
"type": "function"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"inputs": [],
|
|
13
|
+
"name": "WEI_IN_ETH",
|
|
14
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
15
|
+
"stateMutability": "view",
|
|
16
|
+
"type": "function"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"inputs": [
|
|
20
|
+
{ "internalType": "address", "name": "aggregatorOrToken", "type": "address" },
|
|
21
|
+
{ "internalType": "uint256", "name": "ethAmount", "type": "uint256" },
|
|
22
|
+
{ "internalType": "uint8", "name": "tokenDecimals", "type": "uint8" }
|
|
23
|
+
],
|
|
24
|
+
"name": "getTokenValueOfEth",
|
|
25
|
+
"outputs": [
|
|
26
|
+
{ "internalType": "uint256", "name": "tokenValueOfEth", "type": "uint256" },
|
|
27
|
+
{ "internalType": "uint256", "name": "oracleValidUntil", "type": "uint256" }
|
|
28
|
+
],
|
|
29
|
+
"stateMutability": "view",
|
|
30
|
+
"type": "function"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"addresses": {
|
|
34
|
+
"1": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
35
|
+
"5": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
36
|
+
"10": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
37
|
+
"137": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
38
|
+
"8453": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
39
|
+
"36865": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
40
|
+
"42161": "0x302275dcF9919c5449F2d53253ACD06315385272",
|
|
41
|
+
"421614": "0x33CE83528023d9aee4e6321250514741F00976DB",
|
|
42
|
+
"5000": "0x46B1Aee819Af33fa9617059A3D54e5352793473B"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1 +1,223 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "UserAuthentication",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"anonymous": false,
|
|
6
|
+
"inputs": [
|
|
7
|
+
{ "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
|
|
8
|
+
{ "indexed": true, "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
|
|
9
|
+
{
|
|
10
|
+
"components": [
|
|
11
|
+
{ "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
|
|
12
|
+
{ "internalType": "uint256", "name": "threshold", "type": "uint256" }
|
|
13
|
+
],
|
|
14
|
+
"indexed": false,
|
|
15
|
+
"internalType": "structMultiSigGroup",
|
|
16
|
+
"name": "group",
|
|
17
|
+
"type": "tuple"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"name": "MultiSigGroupCreated",
|
|
21
|
+
"type": "event"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"anonymous": false,
|
|
25
|
+
"inputs": [
|
|
26
|
+
{ "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
|
|
27
|
+
{ "indexed": true, "internalType": "bytes32", "name": "groupId", "type": "bytes32" }
|
|
28
|
+
],
|
|
29
|
+
"name": "MultiSigGroupDeleted",
|
|
30
|
+
"type": "event"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"anonymous": false,
|
|
34
|
+
"inputs": [
|
|
35
|
+
{ "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
|
|
36
|
+
{ "indexed": true, "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
|
|
37
|
+
{
|
|
38
|
+
"components": [
|
|
39
|
+
{ "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
|
|
40
|
+
{ "internalType": "uint256", "name": "threshold", "type": "uint256" }
|
|
41
|
+
],
|
|
42
|
+
"indexed": false,
|
|
43
|
+
"internalType": "structMultiSigGroup",
|
|
44
|
+
"name": "group",
|
|
45
|
+
"type": "tuple"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"name": "MultiSigGroupUpdated",
|
|
49
|
+
"type": "event"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"anonymous": false,
|
|
53
|
+
"inputs": [
|
|
54
|
+
{ "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
|
|
55
|
+
{ "indexed": false, "internalType": "bytes", "name": "multiSigInitData", "type": "bytes" }
|
|
56
|
+
],
|
|
57
|
+
"name": "UserAuthenticationInitialized",
|
|
58
|
+
"type": "event"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"inputs": [],
|
|
62
|
+
"name": "ADMIN_ROLE",
|
|
63
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
64
|
+
"stateMutability": "view",
|
|
65
|
+
"type": "function"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"inputs": [],
|
|
69
|
+
"name": "INIT_HASH",
|
|
70
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
71
|
+
"stateMutability": "view",
|
|
72
|
+
"type": "function"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"inputs": [],
|
|
76
|
+
"name": "VERSION",
|
|
77
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
78
|
+
"stateMutability": "view",
|
|
79
|
+
"type": "function"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"inputs": [
|
|
83
|
+
{
|
|
84
|
+
"components": [
|
|
85
|
+
{ "internalType": "address", "name": "sender", "type": "address" },
|
|
86
|
+
{ "internalType": "uint256", "name": "nonce", "type": "uint256" },
|
|
87
|
+
{ "internalType": "bytes", "name": "initCode", "type": "bytes" },
|
|
88
|
+
{ "internalType": "bytes", "name": "callData", "type": "bytes" },
|
|
89
|
+
{ "internalType": "uint256", "name": "callGasLimit", "type": "uint256" },
|
|
90
|
+
{ "internalType": "uint256", "name": "verificationGasLimit", "type": "uint256" },
|
|
91
|
+
{ "internalType": "uint256", "name": "preVerificationGas", "type": "uint256" },
|
|
92
|
+
{ "internalType": "uint256", "name": "maxFeePerGas", "type": "uint256" },
|
|
93
|
+
{ "internalType": "uint256", "name": "maxPriorityFeePerGas", "type": "uint256" },
|
|
94
|
+
{ "internalType": "bytes", "name": "paymasterAndData", "type": "bytes" },
|
|
95
|
+
{ "internalType": "bytes", "name": "signature", "type": "bytes" }
|
|
96
|
+
],
|
|
97
|
+
"internalType": "structUserOperation",
|
|
98
|
+
"name": "userOp",
|
|
99
|
+
"type": "tuple"
|
|
100
|
+
},
|
|
101
|
+
{ "internalType": "bytes32", "name": "userOpHash", "type": "bytes32" },
|
|
102
|
+
{ "internalType": "bytes", "name": "", "type": "bytes" }
|
|
103
|
+
],
|
|
104
|
+
"name": "authenticateUserOp",
|
|
105
|
+
"outputs": [{ "internalType": "uint256", "name": "sigTimeRange", "type": "uint256" }],
|
|
106
|
+
"stateMutability": "view",
|
|
107
|
+
"type": "function"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"inputs": [
|
|
111
|
+
{ "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
|
|
112
|
+
{
|
|
113
|
+
"components": [
|
|
114
|
+
{ "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
|
|
115
|
+
{ "internalType": "uint256", "name": "threshold", "type": "uint256" }
|
|
116
|
+
],
|
|
117
|
+
"internalType": "structMultiSigGroup",
|
|
118
|
+
"name": "group",
|
|
119
|
+
"type": "tuple"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"name": "createMultiSigGroup",
|
|
123
|
+
"outputs": [],
|
|
124
|
+
"stateMutability": "nonpayable",
|
|
125
|
+
"type": "function"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"inputs": [{ "internalType": "bytes32", "name": "groupId", "type": "bytes32" }],
|
|
129
|
+
"name": "deleteMultiSigGroup",
|
|
130
|
+
"outputs": [],
|
|
131
|
+
"stateMutability": "nonpayable",
|
|
132
|
+
"type": "function"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"inputs": [{ "internalType": "bytes32", "name": "key", "type": "bytes32" }],
|
|
136
|
+
"name": "getState",
|
|
137
|
+
"outputs": [{ "internalType": "bytes", "name": "state", "type": "bytes" }],
|
|
138
|
+
"stateMutability": "view",
|
|
139
|
+
"type": "function"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"inputs": [{ "internalType": "bytes32", "name": "key", "type": "bytes32" }],
|
|
143
|
+
"name": "getState32",
|
|
144
|
+
"outputs": [{ "internalType": "bytes32", "name": "state", "type": "bytes32" }],
|
|
145
|
+
"stateMutability": "view",
|
|
146
|
+
"type": "function"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"inputs": [{ "internalType": "bytes", "name": "multiSigInitData", "type": "bytes" }],
|
|
150
|
+
"name": "init",
|
|
151
|
+
"outputs": [],
|
|
152
|
+
"stateMutability": "nonpayable",
|
|
153
|
+
"type": "function"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"inputs": [
|
|
157
|
+
{ "internalType": "address", "name": "", "type": "address" },
|
|
158
|
+
{ "internalType": "uint256", "name": "", "type": "uint256" },
|
|
159
|
+
{ "internalType": "bytes", "name": "", "type": "bytes" },
|
|
160
|
+
{ "internalType": "bytes", "name": "_signature", "type": "bytes" },
|
|
161
|
+
{ "internalType": "bytes32", "name": "_hash", "type": "bytes32" }
|
|
162
|
+
],
|
|
163
|
+
"name": "isValidAction",
|
|
164
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
|
165
|
+
"stateMutability": "view",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"inputs": [],
|
|
170
|
+
"name": "moduleId",
|
|
171
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
172
|
+
"stateMutability": "view",
|
|
173
|
+
"type": "function"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"inputs": [{ "internalType": "bytes[]", "name": "calls", "type": "bytes[]" }],
|
|
177
|
+
"name": "multiCall",
|
|
178
|
+
"outputs": [],
|
|
179
|
+
"stateMutability": "nonpayable",
|
|
180
|
+
"type": "function"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"inputs": [
|
|
184
|
+
{ "internalType": "bytes", "name": "signature", "type": "bytes" },
|
|
185
|
+
{ "internalType": "bytes32", "name": "userOpHash", "type": "bytes32" },
|
|
186
|
+
{ "internalType": "bytes32", "name": "userId", "type": "bytes32" }
|
|
187
|
+
],
|
|
188
|
+
"name": "subValidateSignatureECDSA",
|
|
189
|
+
"outputs": [{ "internalType": "uint256", "name": "sigTimeRange", "type": "uint256" }],
|
|
190
|
+
"stateMutability": "pure",
|
|
191
|
+
"type": "function"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"inputs": [
|
|
195
|
+
{ "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
|
|
196
|
+
{
|
|
197
|
+
"components": [
|
|
198
|
+
{ "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
|
|
199
|
+
{ "internalType": "uint256", "name": "threshold", "type": "uint256" }
|
|
200
|
+
],
|
|
201
|
+
"internalType": "structMultiSigGroup",
|
|
202
|
+
"name": "group",
|
|
203
|
+
"type": "tuple"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"name": "updateMultiSigGroup",
|
|
207
|
+
"outputs": [],
|
|
208
|
+
"stateMutability": "nonpayable",
|
|
209
|
+
"type": "function"
|
|
210
|
+
}
|
|
211
|
+
],
|
|
212
|
+
"addresses": {
|
|
213
|
+
"1": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
214
|
+
"5": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
215
|
+
"10": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
216
|
+
"137": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
217
|
+
"8453": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
218
|
+
"36865": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
219
|
+
"42161": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
|
|
220
|
+
"421614": "0x81C464389b2ac51D39aD934732bd172c4126773b",
|
|
221
|
+
"5000": "0x73dBAFFa2B1E93D4c824B70DE8CA8926b9F18339"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.initializeWalletAccess = initializeWalletAccess;
|
|
4
|
+
exports.checkWalletAccessInitialization = checkWalletAccessInitialization;
|
|
5
|
+
exports.addAccessToWallet = addAccessToWallet;
|
|
6
|
+
exports.addAccessToUser = addAccessToUser;
|
|
4
7
|
const constants_1 = require("../common/constants");
|
|
5
8
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
9
|
async function initializeWalletAccess(walletAddr, creatorAddr) {
|
|
7
10
|
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'access/wallet', { walletAddr, creatorAddr });
|
|
8
11
|
}
|
|
9
|
-
exports.initializeWalletAccess = initializeWalletAccess;
|
|
10
12
|
async function checkWalletAccessInitialization(walletAddr) {
|
|
11
13
|
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `access/wallet/${walletAddr}`))
|
|
12
14
|
.initialized;
|
|
13
15
|
}
|
|
14
|
-
exports.checkWalletAccessInitialization = checkWalletAccessInitialization;
|
|
15
16
|
async function addAccessToWallet(walletAddr, nonce, signature) {
|
|
16
17
|
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `access/wallet/${walletAddr}`, {
|
|
17
18
|
nonce,
|
|
18
19
|
signature,
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
exports.addAccessToWallet = addAccessToWallet;
|
|
22
22
|
async function addAccessToUser(authId, nonce, signature) {
|
|
23
23
|
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `access/user/${authId}`, { nonce, signature });
|
|
24
24
|
}
|
|
25
|
-
exports.addAccessToUser = addAccessToUser;
|
|
26
25
|
//# sourceMappingURL=AccessControlApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessControlApis.js","sourceRoot":"","sources":["../../../src/apis/AccessControlApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AccessControlApis.js","sourceRoot":"","sources":["../../../src/apis/AccessControlApis.ts"],"names":[],"mappings":";;AAKA,wDAKC;AAED,0EAKC;AAED,8CASC;AAED,0CAMC;AAlCD,mDAA6C;AAC7C,gDAAmE;AAE5D,KAAK,UAAU,sBAAsB,CAC1C,UAAmB,EACnB,WAAoB;IAEpB,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAA;AAC9E,CAAC;AAEM,KAAK,UAAU,+BAA+B,CACnD,UAAmB;IAEnB,OAAO,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,iBAAiB,UAAU,EAAE,CAAC,CAAC;SAClE,WAAW,CAAA;AAChB,CAAC;AAEM,KAAK,UAAU,iBAAiB,CACrC,UAAmB,EACnB,KAAa,EACb,SAAc;IAEd,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,iBAAiB,UAAU,EAAE,EAAE;QAC5D,KAAK;QACL,SAAS;KACV,CAAC,CAAA;AACJ,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,MAAc,EACd,KAAa,EACb,SAAc;IAEd,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,eAAe,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;AAC/E,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSocketBridgeQuote = getSocketBridgeQuote;
|
|
4
|
+
exports.getSocketBridgeTransaction = getSocketBridgeTransaction;
|
|
5
|
+
exports.getSocketBridgeAllowance = getSocketBridgeAllowance;
|
|
6
|
+
exports.getSocketBridgeApproveTransaction = getSocketBridgeApproveTransaction;
|
|
4
7
|
const constants_1 = require("../common/constants");
|
|
5
8
|
const errors_1 = require("../errors");
|
|
6
9
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
@@ -24,11 +27,9 @@ async function getSocketBridgeQuote(recipient, walletAddress, fromChain, toChain
|
|
|
24
27
|
const route = quote.result.routes[0];
|
|
25
28
|
return route;
|
|
26
29
|
}
|
|
27
|
-
exports.getSocketBridgeQuote = getSocketBridgeQuote;
|
|
28
30
|
async function getSocketBridgeTransaction(route) {
|
|
29
31
|
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'bridge/build-tx/', { route });
|
|
30
32
|
}
|
|
31
|
-
exports.getSocketBridgeTransaction = getSocketBridgeTransaction;
|
|
32
33
|
async function getSocketBridgeAllowance(chainId, sender, allowanceTarget, token) {
|
|
33
34
|
const params = new URLSearchParams({
|
|
34
35
|
chainId,
|
|
@@ -42,7 +43,6 @@ async function getSocketBridgeAllowance(chainId, sender, allowanceTarget, token)
|
|
|
42
43
|
}
|
|
43
44
|
return json;
|
|
44
45
|
}
|
|
45
|
-
exports.getSocketBridgeAllowance = getSocketBridgeAllowance;
|
|
46
46
|
async function getSocketBridgeApproveTransaction(chainId, sender, allowanceTarget, token, amount) {
|
|
47
47
|
const params = new URLSearchParams({
|
|
48
48
|
chainId,
|
|
@@ -57,5 +57,4 @@ async function getSocketBridgeApproveTransaction(chainId, sender, allowanceTarge
|
|
|
57
57
|
}
|
|
58
58
|
return json;
|
|
59
59
|
}
|
|
60
|
-
exports.getSocketBridgeApproveTransaction = getSocketBridgeApproveTransaction;
|
|
61
60
|
//# sourceMappingURL=BridgeApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeApis.js","sourceRoot":"","sources":["../../../src/apis/BridgeApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BridgeApis.js","sourceRoot":"","sources":["../../../src/apis/BridgeApis.ts"],"names":[],"mappings":";;AAMA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"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getContractAbi =
|
|
3
|
+
exports.getContractAbi = getContractAbi;
|
|
4
4
|
const constants_1 = require("../common/constants");
|
|
5
5
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
6
|
async function getContractAbi(contractName, mode = 'abi') {
|
|
7
7
|
const { name, abi, addresses } = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `contract/${contractName}?mode=${mode}`);
|
|
8
8
|
return { name, abi, addresses };
|
|
9
9
|
}
|
|
10
|
-
exports.getContractAbi = getContractAbi;
|
|
11
10
|
//# sourceMappingURL=ContractApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractApis.js","sourceRoot":"","sources":["../../../src/apis/ContractApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContractApis.js","sourceRoot":"","sources":["../../../src/apis/ContractApis.ts"],"names":[],"mappings":";;AAGA,wCASC;AAZD,mDAA6C;AAC7C,gDAAkD;AAE3C,KAAK,UAAU,cAAc,CAClC,YAAoB,EACpB,IAAI,GAAG,KAAK;IAEZ,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,yBAAc,EACnD,mBAAO,EACP,YAAY,YAAY,SAAS,IAAI,EAAE,CACxC,CAAA;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA;AACjC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGroups = getGroups;
|
|
4
|
+
exports.getGroupsByWallet = getGroupsByWallet;
|
|
4
5
|
const constants_1 = require("../common/constants");
|
|
5
6
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
7
|
async function getGroups(groupIds, chainId) {
|
|
@@ -9,12 +10,10 @@ async function getGroups(groupIds, chainId) {
|
|
|
9
10
|
chainId,
|
|
10
11
|
})).groups;
|
|
11
12
|
}
|
|
12
|
-
exports.getGroups = getGroups;
|
|
13
13
|
async function getGroupsByWallet(walletAddr, chainId) {
|
|
14
14
|
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, `group/wallet/${walletAddr}/chain/${chainId}`, {
|
|
15
15
|
walletAddr,
|
|
16
16
|
chainId,
|
|
17
17
|
})).groups;
|
|
18
18
|
}
|
|
19
|
-
exports.getGroupsByWallet = getGroupsByWallet;
|
|
20
19
|
//# sourceMappingURL=GroupApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupApis.js","sourceRoot":"","sources":["../../../src/apis/GroupApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroupApis.js","sourceRoot":"","sources":["../../../src/apis/GroupApis.ts"],"names":[],"mappings":";;AAMA,8BAUC;AAED,8CAcC;AA9BD,mDAA6C;AAC7C,gDAAmD;AAG5C,KAAK,UAAU,SAAS,CAC7B,QAAe,EACf,OAAe;IAEf,OAAO,CACL,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,kBAAkB,EAAE;QACjD,QAAQ;QACR,OAAO;KACR,CAAC,CACH,CAAC,MAAM,CAAA;AACV,CAAC;AAEM,KAAK,UAAU,iBAAiB,CACrC,UAAmB,EACnB,OAAe;IAEf,OAAO,CACL,MAAM,IAAA,0BAAe,EACnB,mBAAO,EACP,gBAAgB,UAAU,UAAU,OAAO,EAAE,EAC7C;QACE,UAAU;QACV,OAAO;KACR,CACF,CACF,CAAC,MAAM,CAAA;AACV,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getTokenInfo = getTokenInfo;
|
|
4
|
+
exports.getChainFromId = getChainFromId;
|
|
5
|
+
exports.getChainFromName = getChainFromName;
|
|
6
|
+
exports.getModuleInfo = getModuleInfo;
|
|
7
|
+
exports.getPaymasterAddress = getPaymasterAddress;
|
|
4
8
|
const constants_1 = require("../common/constants");
|
|
5
9
|
const errors_1 = require("../errors");
|
|
6
10
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
@@ -24,7 +28,6 @@ async function getTokenInfo(symbol, chainId) {
|
|
|
24
28
|
}
|
|
25
29
|
throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.TokenNotFound, 'token symbol does not exist on provided chain', { symbol, chainId }, 'Provide correct symbol and chainId.', 'https://docs.fun.xyz');
|
|
26
30
|
}
|
|
27
|
-
exports.getTokenInfo = getTokenInfo;
|
|
28
31
|
async function getChainFromId(chainId) {
|
|
29
32
|
return await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `chain-info/${chainId}`).then((r) => {
|
|
30
33
|
if (!r) {
|
|
@@ -33,7 +36,6 @@ async function getChainFromId(chainId) {
|
|
|
33
36
|
return r;
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
|
-
exports.getChainFromId = getChainFromId;
|
|
37
39
|
async function getChainFromName(name) {
|
|
38
40
|
return await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `chain-info?name=${name}`).then((r) => {
|
|
39
41
|
if (!r) {
|
|
@@ -42,7 +44,6 @@ async function getChainFromName(name) {
|
|
|
42
44
|
return r;
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
|
-
exports.getChainFromName = getChainFromName;
|
|
46
47
|
async function getModuleInfo(moduleName, chainId) {
|
|
47
48
|
const body = {
|
|
48
49
|
module: moduleName,
|
|
@@ -52,10 +53,8 @@ async function getModuleInfo(moduleName, chainId) {
|
|
|
52
53
|
return r.data;
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
exports.getModuleInfo = getModuleInfo;
|
|
56
56
|
async function getPaymasterAddress(chainId) {
|
|
57
57
|
const { moduleAddresses: { paymaster: { paymasterAddress }, }, } = await getChainFromId(chainId);
|
|
58
58
|
return paymasterAddress;
|
|
59
59
|
}
|
|
60
|
-
exports.getPaymasterAddress = getPaymasterAddress;
|
|
61
60
|
//# sourceMappingURL=InfoApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoApis.js","sourceRoot":"","sources":["../../../src/apis/InfoApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfoApis.js","sourceRoot":"","sources":["../../../src/apis/InfoApis.ts"],"names":[],"mappings":";;AAMA,oCAkCC;AAED,wCAOC;AAED,4CAOC;AAED,sCAYC;AAED,kDAQC;AAhFD,mDAAmE;AACnE,sCAA4D;AAC5D,gDAAmE;AAE5D,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,OAAe;IAEf,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;IAC7B,MAAM,IAAI,GAAG;QACX,MAAM;QACN,KAAK,EAAE,OAAO;KACf,CAAA;IACD,IACE,MAAM,KAAK,MAAM;QACjB,OAAO,KAAK,KAAK;QACjB,MAAM,CAAC,IAAI,CAAC,gCAAoB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EACnD,CAAC;QACD,OAAQ,gCAA4B,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;IACvD,CAAC;SAAM,IAAI,MAAM,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACpD,OAAQ,gCAA4B,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,IAAA,yBAAc,EACpC,mBAAO,EACP,eAAe,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAC3C,CAAA;IAED,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,SAAS,CAAC,OAAO,CAAA;IAC1B,CAAC;IACD,MAAM,IAAI,8BAAqB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,GAChC,GACF,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAA;IAEjC,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createListener = createListener;
|
|
4
|
+
exports.deleteListener = deleteListener;
|
|
4
5
|
const constants_1 = require("../common/constants");
|
|
5
6
|
const errors_1 = require("../errors");
|
|
6
7
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
@@ -18,7 +19,6 @@ async function createListener(walletAddresses, chains, webhookUrl) {
|
|
|
18
19
|
}
|
|
19
20
|
return result;
|
|
20
21
|
}
|
|
21
|
-
exports.createListener = createListener;
|
|
22
22
|
async function deleteListener(walletAddress, chain) {
|
|
23
23
|
const body = {
|
|
24
24
|
walletAddress,
|
|
@@ -32,5 +32,4 @@ async function deleteListener(walletAddress, chain) {
|
|
|
32
32
|
}
|
|
33
33
|
return result;
|
|
34
34
|
}
|
|
35
|
-
exports.deleteListener = deleteListener;
|
|
36
35
|
//# sourceMappingURL=ListenerApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListenerApis.js","sourceRoot":"","sources":["../../../src/apis/ListenerApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListenerApis.js","sourceRoot":"","sources":["../../../src/apis/ListenerApis.ts"],"names":[],"mappings":";;AAMA,wCAyBC;AAED,wCAuBC;AAtDD,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAmD;AAE5C,KAAK,UAAU,cAAc,CAClC,eAA0B,EAC1B,MAAgB,EAChB,UAAkB;IAElB,MAAM,IAAI,GAAG;QACX,eAAe;QACf,MAAM;QACN,UAAU;KACX,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,CACpE,CAAC,CAAC,EAAE,EAAE;QACJ,OAAO,CAAC,CAAA;IACV,CAAC,CACF,CAAA;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,EACvC,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAEM,KAAK,UAAU,cAAc,CAClC,aAAsB,EACtB,KAAa;IAEb,MAAM,IAAI,GAAG;QACX,aAAa;QACb,KAAK;KACN,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAe,EAAC,mBAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC,IAAI,CAC1E,CAAC,CAAC,EAAE,EAAE;QACJ,OAAO,CAAC,CAAA;IACV,CAAC,CACF,CAAA;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,uBAAuB,EACvB,EAAE,aAAa,EAAE,KAAK,EAAE,EACxB,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/src/apis/NFTApis.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getNftName = getNftName;
|
|
4
|
+
exports.getNftAddress = getNftAddress;
|
|
4
5
|
const constants_1 = require("../common/constants");
|
|
5
6
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
6
7
|
/**
|
|
@@ -16,7 +17,6 @@ const ApiUtils_1 = require("../utils/ApiUtils");
|
|
|
16
17
|
async function getNftName(chainId, nftAddress) {
|
|
17
18
|
return await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `asset/nft/${chainId}/${nftAddress}`);
|
|
18
19
|
}
|
|
19
|
-
exports.getNftName = getNftName;
|
|
20
20
|
/**
|
|
21
21
|
* Get the address and chainId of an NFT collection
|
|
22
22
|
* @param {string} name Name of NFT
|
|
@@ -30,5 +30,4 @@ exports.getNftName = getNftName;
|
|
|
30
30
|
async function getNftAddress(name) {
|
|
31
31
|
return await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `asset/nft?name=${name}`);
|
|
32
32
|
}
|
|
33
|
-
exports.getNftAddress = getNftAddress;
|
|
34
33
|
//# sourceMappingURL=NFTApis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFTApis.js","sourceRoot":"","sources":["../../../src/apis/NFTApis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NFTApis.js","sourceRoot":"","sources":["../../../src/apis/NFTApis.ts"],"names":[],"mappings":";;AAaA,gCAKC;AAYD,sCAEC;AAhCD,mDAA6C;AAC7C,gDAAkD;AAElD;;;;;;;;;GASG;AACI,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,UAAkB;IAElB,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,aAAa,OAAO,IAAI,UAAU,EAAE,CAAC,CAAA;AAC5E,CAAC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,OAAO,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,kBAAkB,IAAI,EAAE,CAAC,CAAA;AAChE,CAAC"}
|
|
@@ -1,38 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGasPrice = exports.getFullReceipt =
|
|
3
|
+
exports.getGasPrice = exports.getFullReceipt = void 0;
|
|
4
|
+
exports.createOp = createOp;
|
|
5
|
+
exports.getOpsOfGroup = getOpsOfGroup;
|
|
6
|
+
exports.getOpsOfWallet = getOpsOfWallet;
|
|
7
|
+
exports.getOps = getOps;
|
|
8
|
+
exports.deleteOp = deleteOp;
|
|
9
|
+
exports.signOp = signOp;
|
|
10
|
+
exports.executeOp = executeOp;
|
|
11
|
+
exports.estimateOp = estimateOp;
|
|
12
|
+
exports.scheduleOp = scheduleOp;
|
|
4
13
|
const constants_1 = require("../common/constants");
|
|
5
14
|
const data_1 = require("../data");
|
|
6
15
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
7
16
|
async function createOp(op) {
|
|
8
17
|
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation', { ...op })).opId;
|
|
9
18
|
}
|
|
10
|
-
exports.createOp = createOp;
|
|
11
19
|
async function getOpsOfGroup(groupId, chainId, status) {
|
|
12
20
|
const endpoint = status === data_1.OperationStatus.ALL
|
|
13
21
|
? `operation/group/${groupId}/${chainId}`
|
|
14
22
|
: `operation/group/${groupId}/chain/${chainId}?status=${status}`;
|
|
15
23
|
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, endpoint)).operations;
|
|
16
24
|
}
|
|
17
|
-
exports.getOpsOfGroup = getOpsOfGroup;
|
|
18
25
|
async function getOpsOfWallet(walletAddr, chainId, status) {
|
|
19
26
|
const endpoint = status
|
|
20
27
|
? `operation/wallet/${walletAddr}/chain/${chainId}?status=${status}`
|
|
21
28
|
: `operation/wallet/${walletAddr}/chain/${chainId}`;
|
|
22
29
|
return (await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, endpoint)).operations;
|
|
23
30
|
}
|
|
24
|
-
exports.getOpsOfWallet = getOpsOfWallet;
|
|
25
31
|
async function getOps(opIds, chainId) {
|
|
26
32
|
return (await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/get-operations', {
|
|
27
33
|
opIds,
|
|
28
34
|
chainId,
|
|
29
35
|
})).operations;
|
|
30
36
|
}
|
|
31
|
-
exports.getOps = getOps;
|
|
32
37
|
async function deleteOp(opId, chainId) {
|
|
33
38
|
await (0, ApiUtils_1.sendDeleteRequest)(constants_1.API_URL, `operation/${opId}/chain/${chainId}`);
|
|
34
39
|
}
|
|
35
|
-
exports.deleteOp = deleteOp;
|
|
36
40
|
async function signOp(opId, chainId, signature, signedBy, threshold) {
|
|
37
41
|
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/sign', {
|
|
38
42
|
opId,
|
|
@@ -42,19 +46,15 @@ async function signOp(opId, chainId, signature, signedBy, threshold) {
|
|
|
42
46
|
threshold,
|
|
43
47
|
});
|
|
44
48
|
}
|
|
45
|
-
exports.signOp = signOp;
|
|
46
49
|
async function executeOp(executeOpInput) {
|
|
47
50
|
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/execute', executeOpInput);
|
|
48
51
|
}
|
|
49
|
-
exports.executeOp = executeOp;
|
|
50
52
|
async function estimateOp(estimateOpInput) {
|
|
51
53
|
return await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/estimate', estimateOpInput);
|
|
52
54
|
}
|
|
53
|
-
exports.estimateOp = estimateOp;
|
|
54
55
|
async function scheduleOp(scheduleOpInput) {
|
|
55
56
|
await (0, ApiUtils_1.sendPostRequest)(constants_1.API_URL, 'operation/schedule', scheduleOpInput);
|
|
56
57
|
}
|
|
57
|
-
exports.scheduleOp = scheduleOp;
|
|
58
58
|
const getFullReceipt = async (opId, chainId, userOpHash) => {
|
|
59
59
|
const retries = 20;
|
|
60
60
|
let result;
|