@cfxdevkit/core 1.0.8 → 1.0.10
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/clients/index.d.cts +3 -3
- package/dist/clients/index.d.ts +3 -3
- package/dist/{config-BMtaWM0X.d.cts → config-D0bE1-tS.d.cts} +1 -1
- package/dist/{config-BMtaWM0X.d.ts → config-D0bE1-tS.d.ts} +1 -1
- package/dist/{core-RZA4aKwj.d.cts → core-BoZtBSQ9.d.cts} +1 -1
- package/dist/{core-C5qe16RS.d.ts → core-DpNIxn65.d.ts} +1 -1
- package/dist/{index-Qz84U9Oq.d.ts → index-BeRor1-U.d.ts} +2 -2
- package/dist/{index-BhCpy6Fz.d.cts → index-CHbyA0dg.d.cts} +2 -2
- package/dist/index.cjs +6 -380
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -585
- package/dist/index.d.ts +7 -585
- package/dist/index.js +13 -377
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/wallet/index.d.cts +1 -1
- package/dist/wallet/index.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -2051,387 +2051,23 @@ var ClientManager = class extends EventEmitter {
|
|
|
2051
2051
|
};
|
|
2052
2052
|
|
|
2053
2053
|
// src/contracts/abis/erc20.ts
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
stateMutability: "view",
|
|
2061
|
-
type: "function"
|
|
2062
|
-
},
|
|
2063
|
-
{
|
|
2064
|
-
inputs: [],
|
|
2065
|
-
name: "symbol",
|
|
2066
|
-
outputs: [{ name: "", type: "string" }],
|
|
2067
|
-
stateMutability: "view",
|
|
2068
|
-
type: "function"
|
|
2069
|
-
},
|
|
2070
|
-
{
|
|
2071
|
-
inputs: [],
|
|
2072
|
-
name: "decimals",
|
|
2073
|
-
outputs: [{ name: "", type: "uint8" }],
|
|
2074
|
-
stateMutability: "view",
|
|
2075
|
-
type: "function"
|
|
2076
|
-
},
|
|
2077
|
-
{
|
|
2078
|
-
inputs: [],
|
|
2079
|
-
name: "totalSupply",
|
|
2080
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
2081
|
-
stateMutability: "view",
|
|
2082
|
-
type: "function"
|
|
2083
|
-
},
|
|
2084
|
-
{
|
|
2085
|
-
inputs: [{ name: "account", type: "address" }],
|
|
2086
|
-
name: "balanceOf",
|
|
2087
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
2088
|
-
stateMutability: "view",
|
|
2089
|
-
type: "function"
|
|
2090
|
-
},
|
|
2091
|
-
{
|
|
2092
|
-
inputs: [
|
|
2093
|
-
{ name: "owner", type: "address" },
|
|
2094
|
-
{ name: "spender", type: "address" }
|
|
2095
|
-
],
|
|
2096
|
-
name: "allowance",
|
|
2097
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
2098
|
-
stateMutability: "view",
|
|
2099
|
-
type: "function"
|
|
2100
|
-
},
|
|
2101
|
-
// Write functions
|
|
2102
|
-
{
|
|
2103
|
-
inputs: [
|
|
2104
|
-
{ name: "to", type: "address" },
|
|
2105
|
-
{ name: "amount", type: "uint256" }
|
|
2106
|
-
],
|
|
2107
|
-
name: "transfer",
|
|
2108
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2109
|
-
stateMutability: "nonpayable",
|
|
2110
|
-
type: "function"
|
|
2111
|
-
},
|
|
2112
|
-
{
|
|
2113
|
-
inputs: [
|
|
2114
|
-
{ name: "spender", type: "address" },
|
|
2115
|
-
{ name: "amount", type: "uint256" }
|
|
2116
|
-
],
|
|
2117
|
-
name: "approve",
|
|
2118
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2119
|
-
stateMutability: "nonpayable",
|
|
2120
|
-
type: "function"
|
|
2121
|
-
},
|
|
2122
|
-
{
|
|
2123
|
-
inputs: [
|
|
2124
|
-
{ name: "from", type: "address" },
|
|
2125
|
-
{ name: "to", type: "address" },
|
|
2126
|
-
{ name: "amount", type: "uint256" }
|
|
2127
|
-
],
|
|
2128
|
-
name: "transferFrom",
|
|
2129
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2130
|
-
stateMutability: "nonpayable",
|
|
2131
|
-
type: "function"
|
|
2132
|
-
},
|
|
2133
|
-
// Events
|
|
2134
|
-
{
|
|
2135
|
-
anonymous: false,
|
|
2136
|
-
inputs: [
|
|
2137
|
-
{ indexed: true, name: "from", type: "address" },
|
|
2138
|
-
{ indexed: true, name: "to", type: "address" },
|
|
2139
|
-
{ indexed: false, name: "value", type: "uint256" }
|
|
2140
|
-
],
|
|
2141
|
-
name: "Transfer",
|
|
2142
|
-
type: "event"
|
|
2143
|
-
},
|
|
2144
|
-
{
|
|
2145
|
-
anonymous: false,
|
|
2146
|
-
inputs: [
|
|
2147
|
-
{ indexed: true, name: "owner", type: "address" },
|
|
2148
|
-
{ indexed: true, name: "spender", type: "address" },
|
|
2149
|
-
{ indexed: false, name: "value", type: "uint256" }
|
|
2150
|
-
],
|
|
2151
|
-
name: "Approval",
|
|
2152
|
-
type: "event"
|
|
2153
|
-
}
|
|
2154
|
-
];
|
|
2054
|
+
import {
|
|
2055
|
+
ERC20_ABI,
|
|
2056
|
+
ERC20_EXTENDED_ABI,
|
|
2057
|
+
erc20Abi,
|
|
2058
|
+
erc20ExtendedAbi
|
|
2059
|
+
} from "@cfxdevkit/contracts";
|
|
2155
2060
|
|
|
2156
2061
|
// src/contracts/abis/erc721.ts
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
stateMutability: "view",
|
|
2164
|
-
type: "function"
|
|
2165
|
-
},
|
|
2166
|
-
{
|
|
2167
|
-
inputs: [],
|
|
2168
|
-
name: "symbol",
|
|
2169
|
-
outputs: [{ name: "", type: "string" }],
|
|
2170
|
-
stateMutability: "view",
|
|
2171
|
-
type: "function"
|
|
2172
|
-
},
|
|
2173
|
-
{
|
|
2174
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
2175
|
-
name: "tokenURI",
|
|
2176
|
-
outputs: [{ name: "", type: "string" }],
|
|
2177
|
-
stateMutability: "view",
|
|
2178
|
-
type: "function"
|
|
2179
|
-
},
|
|
2180
|
-
{
|
|
2181
|
-
inputs: [{ name: "owner", type: "address" }],
|
|
2182
|
-
name: "balanceOf",
|
|
2183
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
2184
|
-
stateMutability: "view",
|
|
2185
|
-
type: "function"
|
|
2186
|
-
},
|
|
2187
|
-
{
|
|
2188
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
2189
|
-
name: "ownerOf",
|
|
2190
|
-
outputs: [{ name: "", type: "address" }],
|
|
2191
|
-
stateMutability: "view",
|
|
2192
|
-
type: "function"
|
|
2193
|
-
},
|
|
2194
|
-
{
|
|
2195
|
-
inputs: [
|
|
2196
|
-
{ name: "owner", type: "address" },
|
|
2197
|
-
{ name: "operator", type: "address" }
|
|
2198
|
-
],
|
|
2199
|
-
name: "isApprovedForAll",
|
|
2200
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2201
|
-
stateMutability: "view",
|
|
2202
|
-
type: "function"
|
|
2203
|
-
},
|
|
2204
|
-
{
|
|
2205
|
-
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
2206
|
-
name: "getApproved",
|
|
2207
|
-
outputs: [{ name: "", type: "address" }],
|
|
2208
|
-
stateMutability: "view",
|
|
2209
|
-
type: "function"
|
|
2210
|
-
},
|
|
2211
|
-
{
|
|
2212
|
-
inputs: [{ name: "interfaceId", type: "bytes4" }],
|
|
2213
|
-
name: "supportsInterface",
|
|
2214
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2215
|
-
stateMutability: "view",
|
|
2216
|
-
type: "function"
|
|
2217
|
-
},
|
|
2218
|
-
// Write functions
|
|
2219
|
-
{
|
|
2220
|
-
inputs: [
|
|
2221
|
-
{ name: "from", type: "address" },
|
|
2222
|
-
{ name: "to", type: "address" },
|
|
2223
|
-
{ name: "tokenId", type: "uint256" }
|
|
2224
|
-
],
|
|
2225
|
-
name: "transferFrom",
|
|
2226
|
-
outputs: [],
|
|
2227
|
-
stateMutability: "nonpayable",
|
|
2228
|
-
type: "function"
|
|
2229
|
-
},
|
|
2230
|
-
{
|
|
2231
|
-
inputs: [
|
|
2232
|
-
{ name: "from", type: "address" },
|
|
2233
|
-
{ name: "to", type: "address" },
|
|
2234
|
-
{ name: "tokenId", type: "uint256" }
|
|
2235
|
-
],
|
|
2236
|
-
name: "safeTransferFrom",
|
|
2237
|
-
outputs: [],
|
|
2238
|
-
stateMutability: "nonpayable",
|
|
2239
|
-
type: "function"
|
|
2240
|
-
},
|
|
2241
|
-
{
|
|
2242
|
-
inputs: [
|
|
2243
|
-
{ name: "from", type: "address" },
|
|
2244
|
-
{ name: "to", type: "address" },
|
|
2245
|
-
{ name: "tokenId", type: "uint256" },
|
|
2246
|
-
{ name: "data", type: "bytes" }
|
|
2247
|
-
],
|
|
2248
|
-
name: "safeTransferFrom",
|
|
2249
|
-
outputs: [],
|
|
2250
|
-
stateMutability: "nonpayable",
|
|
2251
|
-
type: "function"
|
|
2252
|
-
},
|
|
2253
|
-
{
|
|
2254
|
-
inputs: [
|
|
2255
|
-
{ name: "to", type: "address" },
|
|
2256
|
-
{ name: "tokenId", type: "uint256" }
|
|
2257
|
-
],
|
|
2258
|
-
name: "approve",
|
|
2259
|
-
outputs: [],
|
|
2260
|
-
stateMutability: "nonpayable",
|
|
2261
|
-
type: "function"
|
|
2262
|
-
},
|
|
2263
|
-
{
|
|
2264
|
-
inputs: [
|
|
2265
|
-
{ name: "operator", type: "address" },
|
|
2266
|
-
{ name: "approved", type: "bool" }
|
|
2267
|
-
],
|
|
2268
|
-
name: "setApprovalForAll",
|
|
2269
|
-
outputs: [],
|
|
2270
|
-
stateMutability: "nonpayable",
|
|
2271
|
-
type: "function"
|
|
2272
|
-
},
|
|
2273
|
-
// Events
|
|
2274
|
-
{
|
|
2275
|
-
anonymous: false,
|
|
2276
|
-
inputs: [
|
|
2277
|
-
{ indexed: true, name: "from", type: "address" },
|
|
2278
|
-
{ indexed: true, name: "to", type: "address" },
|
|
2279
|
-
{ indexed: true, name: "tokenId", type: "uint256" }
|
|
2280
|
-
],
|
|
2281
|
-
name: "Transfer",
|
|
2282
|
-
type: "event"
|
|
2283
|
-
},
|
|
2284
|
-
{
|
|
2285
|
-
anonymous: false,
|
|
2286
|
-
inputs: [
|
|
2287
|
-
{ indexed: true, name: "owner", type: "address" },
|
|
2288
|
-
{ indexed: true, name: "approved", type: "address" },
|
|
2289
|
-
{ indexed: true, name: "tokenId", type: "uint256" }
|
|
2290
|
-
],
|
|
2291
|
-
name: "Approval",
|
|
2292
|
-
type: "event"
|
|
2293
|
-
},
|
|
2294
|
-
{
|
|
2295
|
-
anonymous: false,
|
|
2296
|
-
inputs: [
|
|
2297
|
-
{ indexed: true, name: "owner", type: "address" },
|
|
2298
|
-
{ indexed: true, name: "operator", type: "address" },
|
|
2299
|
-
{ indexed: false, name: "approved", type: "bool" }
|
|
2300
|
-
],
|
|
2301
|
-
name: "ApprovalForAll",
|
|
2302
|
-
type: "event"
|
|
2303
|
-
}
|
|
2304
|
-
];
|
|
2062
|
+
import {
|
|
2063
|
+
ERC721_ABI,
|
|
2064
|
+
ERC721_EXTENDED_ABI,
|
|
2065
|
+
erc721Abi,
|
|
2066
|
+
erc721ExtendedAbi
|
|
2067
|
+
} from "@cfxdevkit/contracts";
|
|
2305
2068
|
|
|
2306
2069
|
// src/contracts/abis/erc1155.ts
|
|
2307
|
-
|
|
2308
|
-
// Read functions
|
|
2309
|
-
{
|
|
2310
|
-
inputs: [{ name: "id", type: "uint256" }],
|
|
2311
|
-
name: "uri",
|
|
2312
|
-
outputs: [{ name: "", type: "string" }],
|
|
2313
|
-
stateMutability: "view",
|
|
2314
|
-
type: "function"
|
|
2315
|
-
},
|
|
2316
|
-
{
|
|
2317
|
-
inputs: [
|
|
2318
|
-
{ name: "account", type: "address" },
|
|
2319
|
-
{ name: "id", type: "uint256" }
|
|
2320
|
-
],
|
|
2321
|
-
name: "balanceOf",
|
|
2322
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
2323
|
-
stateMutability: "view",
|
|
2324
|
-
type: "function"
|
|
2325
|
-
},
|
|
2326
|
-
{
|
|
2327
|
-
inputs: [
|
|
2328
|
-
{ name: "accounts", type: "address[]" },
|
|
2329
|
-
{ name: "ids", type: "uint256[]" }
|
|
2330
|
-
],
|
|
2331
|
-
name: "balanceOfBatch",
|
|
2332
|
-
outputs: [{ name: "", type: "uint256[]" }],
|
|
2333
|
-
stateMutability: "view",
|
|
2334
|
-
type: "function"
|
|
2335
|
-
},
|
|
2336
|
-
{
|
|
2337
|
-
inputs: [
|
|
2338
|
-
{ name: "account", type: "address" },
|
|
2339
|
-
{ name: "operator", type: "address" }
|
|
2340
|
-
],
|
|
2341
|
-
name: "isApprovedForAll",
|
|
2342
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2343
|
-
stateMutability: "view",
|
|
2344
|
-
type: "function"
|
|
2345
|
-
},
|
|
2346
|
-
{
|
|
2347
|
-
inputs: [{ name: "interfaceId", type: "bytes4" }],
|
|
2348
|
-
name: "supportsInterface",
|
|
2349
|
-
outputs: [{ name: "", type: "bool" }],
|
|
2350
|
-
stateMutability: "view",
|
|
2351
|
-
type: "function"
|
|
2352
|
-
},
|
|
2353
|
-
// Write functions
|
|
2354
|
-
{
|
|
2355
|
-
inputs: [
|
|
2356
|
-
{ name: "operator", type: "address" },
|
|
2357
|
-
{ name: "approved", type: "bool" }
|
|
2358
|
-
],
|
|
2359
|
-
name: "setApprovalForAll",
|
|
2360
|
-
outputs: [],
|
|
2361
|
-
stateMutability: "nonpayable",
|
|
2362
|
-
type: "function"
|
|
2363
|
-
},
|
|
2364
|
-
{
|
|
2365
|
-
inputs: [
|
|
2366
|
-
{ name: "from", type: "address" },
|
|
2367
|
-
{ name: "to", type: "address" },
|
|
2368
|
-
{ name: "id", type: "uint256" },
|
|
2369
|
-
{ name: "amount", type: "uint256" },
|
|
2370
|
-
{ name: "data", type: "bytes" }
|
|
2371
|
-
],
|
|
2372
|
-
name: "safeTransferFrom",
|
|
2373
|
-
outputs: [],
|
|
2374
|
-
stateMutability: "nonpayable",
|
|
2375
|
-
type: "function"
|
|
2376
|
-
},
|
|
2377
|
-
{
|
|
2378
|
-
inputs: [
|
|
2379
|
-
{ name: "from", type: "address" },
|
|
2380
|
-
{ name: "to", type: "address" },
|
|
2381
|
-
{ name: "ids", type: "uint256[]" },
|
|
2382
|
-
{ name: "amounts", type: "uint256[]" },
|
|
2383
|
-
{ name: "data", type: "bytes" }
|
|
2384
|
-
],
|
|
2385
|
-
name: "safeBatchTransferFrom",
|
|
2386
|
-
outputs: [],
|
|
2387
|
-
stateMutability: "nonpayable",
|
|
2388
|
-
type: "function"
|
|
2389
|
-
},
|
|
2390
|
-
// Events
|
|
2391
|
-
{
|
|
2392
|
-
anonymous: false,
|
|
2393
|
-
inputs: [
|
|
2394
|
-
{ indexed: true, name: "operator", type: "address" },
|
|
2395
|
-
{ indexed: true, name: "from", type: "address" },
|
|
2396
|
-
{ indexed: true, name: "to", type: "address" },
|
|
2397
|
-
{ indexed: false, name: "id", type: "uint256" },
|
|
2398
|
-
{ indexed: false, name: "value", type: "uint256" }
|
|
2399
|
-
],
|
|
2400
|
-
name: "TransferSingle",
|
|
2401
|
-
type: "event"
|
|
2402
|
-
},
|
|
2403
|
-
{
|
|
2404
|
-
anonymous: false,
|
|
2405
|
-
inputs: [
|
|
2406
|
-
{ indexed: true, name: "operator", type: "address" },
|
|
2407
|
-
{ indexed: true, name: "from", type: "address" },
|
|
2408
|
-
{ indexed: true, name: "to", type: "address" },
|
|
2409
|
-
{ indexed: false, name: "ids", type: "uint256[]" },
|
|
2410
|
-
{ indexed: false, name: "values", type: "uint256[]" }
|
|
2411
|
-
],
|
|
2412
|
-
name: "TransferBatch",
|
|
2413
|
-
type: "event"
|
|
2414
|
-
},
|
|
2415
|
-
{
|
|
2416
|
-
anonymous: false,
|
|
2417
|
-
inputs: [
|
|
2418
|
-
{ indexed: true, name: "account", type: "address" },
|
|
2419
|
-
{ indexed: true, name: "operator", type: "address" },
|
|
2420
|
-
{ indexed: false, name: "approved", type: "bool" }
|
|
2421
|
-
],
|
|
2422
|
-
name: "ApprovalForAll",
|
|
2423
|
-
type: "event"
|
|
2424
|
-
},
|
|
2425
|
-
{
|
|
2426
|
-
anonymous: false,
|
|
2427
|
-
inputs: [
|
|
2428
|
-
{ indexed: false, name: "value", type: "string" },
|
|
2429
|
-
{ indexed: true, name: "id", type: "uint256" }
|
|
2430
|
-
],
|
|
2431
|
-
name: "URI",
|
|
2432
|
-
type: "event"
|
|
2433
|
-
}
|
|
2434
|
-
];
|
|
2070
|
+
import { ERC1155_ABI, erc1155Abi } from "@cfxdevkit/contracts";
|
|
2435
2071
|
|
|
2436
2072
|
// src/contracts/types/index.ts
|
|
2437
2073
|
var ContractError = class extends Error {
|