@cfxdevkit/core 1.0.9 → 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.
@@ -1,7 +1,7 @@
1
- export { C as CoreClient, a as CoreTestClient, b as CoreWalletClient, E as EspaceClient, c as EspaceTestClient, d as EspaceWalletClient } from '../core-RZA4aKwj.cjs';
2
- export { C as ClientManager } from '../index-BhCpy6Fz.cjs';
1
+ export { C as CoreClient, a as CoreTestClient, b as CoreWalletClient, E as EspaceClient, c as EspaceTestClient, d as EspaceWalletClient } from '../core-BoZtBSQ9.cjs';
2
+ export { C as ClientManager } from '../index-CHbyA0dg.cjs';
3
3
  import '../config/index.cjs';
4
4
  import 'cive';
5
5
  import 'viem';
6
- import '../config-BMtaWM0X.cjs';
6
+ import '../config-D0bE1-tS.cjs';
7
7
  import 'node:events';
@@ -1,7 +1,7 @@
1
- export { C as CoreClient, a as CoreTestClient, b as CoreWalletClient, E as EspaceClient, c as EspaceTestClient, d as EspaceWalletClient } from '../core-C5qe16RS.js';
2
- export { C as ClientManager } from '../index-Qz84U9Oq.js';
1
+ export { C as CoreClient, a as CoreTestClient, b as CoreWalletClient, E as EspaceClient, c as EspaceTestClient, d as EspaceWalletClient } from '../core-DpNIxn65.js';
2
+ export { C as ClientManager } from '../index-BeRor1-U.js';
3
3
  import '../config/index.js';
4
4
  import 'cive';
5
5
  import 'viem';
6
- import '../config-BMtaWM0X.js';
6
+ import '../config-D0bE1-tS.js';
7
7
  import 'node:events';
@@ -162,4 +162,4 @@ interface AccountInfo {
162
162
  readonly evmPath?: string;
163
163
  }
164
164
 
165
- export { type Address as A, type BaseTransaction as B, type ChainType as C, type EventCallback as E, type Hash as H, type Log as L, type MiningConfig as M, type NodeConfig as N, type ServerConfig as S, type TransactionReceipt as T, type UnwatchFunction as U, type BlockEvent as a, type TransactionEvent as b, type AccountInfo as c, type ConfluxNodeError as d, type CoreAddress as e, type EvmAddress as f, type ExtendedNodeConfig as g, NodeError as h, type NodeStatus as i, type ServerStatus as j, type UnifiedAccount as k };
165
+ export { type Address as A, type BaseTransaction as B, type ChainType as C, type EvmAddress as E, type Hash as H, type Log as L, type MiningConfig as M, type NodeConfig as N, type ServerConfig as S, type TransactionReceipt as T, type UnifiedAccount as U, type CoreAddress as a, type EventCallback as b, type BlockEvent as c, type UnwatchFunction as d, type TransactionEvent as e, type AccountInfo as f, type ConfluxNodeError as g, type ExtendedNodeConfig as h, NodeError as i, type NodeStatus as j, type ServerStatus as k };
@@ -162,4 +162,4 @@ interface AccountInfo {
162
162
  readonly evmPath?: string;
163
163
  }
164
164
 
165
- export { type Address as A, type BaseTransaction as B, type ChainType as C, type EventCallback as E, type Hash as H, type Log as L, type MiningConfig as M, type NodeConfig as N, type ServerConfig as S, type TransactionReceipt as T, type UnwatchFunction as U, type BlockEvent as a, type TransactionEvent as b, type AccountInfo as c, type ConfluxNodeError as d, type CoreAddress as e, type EvmAddress as f, type ExtendedNodeConfig as g, NodeError as h, type NodeStatus as i, type ServerStatus as j, type UnifiedAccount as k };
165
+ export { type Address as A, type BaseTransaction as B, type ChainType as C, type EvmAddress as E, type Hash as H, type Log as L, type MiningConfig as M, type NodeConfig as N, type ServerConfig as S, type TransactionReceipt as T, type UnifiedAccount as U, type CoreAddress as a, type EventCallback as b, type BlockEvent as c, type UnwatchFunction as d, type TransactionEvent as e, type AccountInfo as f, type ConfluxNodeError as g, type ExtendedNodeConfig as h, NodeError as i, type NodeStatus as j, type ServerStatus as k };
@@ -1,5 +1,5 @@
1
1
  import './config/index.cjs';
2
- import { C as ChainType, A as Address, B as BaseTransaction, T as TransactionReceipt, E as EventCallback, a as BlockEvent, U as UnwatchFunction, b as TransactionEvent } from './config-BMtaWM0X.cjs';
2
+ import { C as ChainType, A as Address, B as BaseTransaction, T as TransactionReceipt, b as EventCallback, c as BlockEvent, d as UnwatchFunction, e as TransactionEvent } from './config-D0bE1-tS.cjs';
3
3
  import { Address as Address$2, PublicClient as PublicClient$1, WalletClient as WalletClient$2, TestClient as TestClient$1 } from 'cive';
4
4
  import { PublicClient, Chain, Address as Address$1, WalletClient as WalletClient$1 } from 'viem';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import './config/index.js';
2
- import { C as ChainType, A as Address, B as BaseTransaction, T as TransactionReceipt, E as EventCallback, a as BlockEvent, U as UnwatchFunction, b as TransactionEvent } from './config-BMtaWM0X.js';
2
+ import { C as ChainType, A as Address, B as BaseTransaction, T as TransactionReceipt, b as EventCallback, c as BlockEvent, d as UnwatchFunction, e as TransactionEvent } from './config-D0bE1-tS.js';
3
3
  import { Address as Address$2, PublicClient as PublicClient$1, WalletClient as WalletClient$2, TestClient as TestClient$1 } from 'cive';
4
4
  import { PublicClient, Chain, Address as Address$1, WalletClient as WalletClient$1 } from 'viem';
5
5
 
@@ -1,6 +1,6 @@
1
- import { H as HealthStatus, e as ClientConfig, f as CoreClientInstance, g as EspaceClientInstance } from './core-C5qe16RS.js';
1
+ import { H as HealthStatus, e as ClientConfig, f as CoreClientInstance, g as EspaceClientInstance } from './core-DpNIxn65.js';
2
2
  import { EventEmitter } from 'node:events';
3
- import { C as ChainType } from './config-BMtaWM0X.js';
3
+ import { C as ChainType } from './config-D0bE1-tS.js';
4
4
  import { SupportedChainId } from './config/index.js';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { H as HealthStatus, e as ClientConfig, f as CoreClientInstance, g as EspaceClientInstance } from './core-RZA4aKwj.cjs';
1
+ import { H as HealthStatus, e as ClientConfig, f as CoreClientInstance, g as EspaceClientInstance } from './core-BoZtBSQ9.cjs';
2
2
  import { EventEmitter } from 'node:events';
3
- import { C as ChainType } from './config-BMtaWM0X.cjs';
3
+ import { C as ChainType } from './config-D0bE1-tS.cjs';
4
4
  import { SupportedChainId } from './config/index.cjs';
5
5
 
6
6
  /**
package/dist/index.cjs CHANGED
@@ -33,9 +33,9 @@ __export(src_exports, {
33
33
  CoreTestClient: () => CoreTestClient,
34
34
  CoreWalletClient: () => CoreWalletClient,
35
35
  DeploymentError: () => DeploymentError,
36
- ERC1155_ABI: () => ERC1155_ABI,
37
- ERC20_ABI: () => ERC20_ABI,
38
- ERC721_ABI: () => ERC721_ABI,
36
+ ERC1155_ABI: () => import_contracts3.ERC1155_ABI,
37
+ ERC20_ABI: () => import_contracts.ERC20_ABI,
38
+ ERC721_ABI: () => import_contracts2.ERC721_ABI,
39
39
  EVM_LOCAL: () => EVM_LOCAL,
40
40
  EVM_MAINNET: () => EVM_MAINNET,
41
41
  EVM_TESTNET: () => EVM_TESTNET,
@@ -2097,387 +2097,13 @@ var ClientManager = class extends import_node_events.EventEmitter {
2097
2097
  };
2098
2098
 
2099
2099
  // src/contracts/abis/erc20.ts
2100
- var ERC20_ABI = [
2101
- // Read functions
2102
- {
2103
- inputs: [],
2104
- name: "name",
2105
- outputs: [{ name: "", type: "string" }],
2106
- stateMutability: "view",
2107
- type: "function"
2108
- },
2109
- {
2110
- inputs: [],
2111
- name: "symbol",
2112
- outputs: [{ name: "", type: "string" }],
2113
- stateMutability: "view",
2114
- type: "function"
2115
- },
2116
- {
2117
- inputs: [],
2118
- name: "decimals",
2119
- outputs: [{ name: "", type: "uint8" }],
2120
- stateMutability: "view",
2121
- type: "function"
2122
- },
2123
- {
2124
- inputs: [],
2125
- name: "totalSupply",
2126
- outputs: [{ name: "", type: "uint256" }],
2127
- stateMutability: "view",
2128
- type: "function"
2129
- },
2130
- {
2131
- inputs: [{ name: "account", type: "address" }],
2132
- name: "balanceOf",
2133
- outputs: [{ name: "", type: "uint256" }],
2134
- stateMutability: "view",
2135
- type: "function"
2136
- },
2137
- {
2138
- inputs: [
2139
- { name: "owner", type: "address" },
2140
- { name: "spender", type: "address" }
2141
- ],
2142
- name: "allowance",
2143
- outputs: [{ name: "", type: "uint256" }],
2144
- stateMutability: "view",
2145
- type: "function"
2146
- },
2147
- // Write functions
2148
- {
2149
- inputs: [
2150
- { name: "to", type: "address" },
2151
- { name: "amount", type: "uint256" }
2152
- ],
2153
- name: "transfer",
2154
- outputs: [{ name: "", type: "bool" }],
2155
- stateMutability: "nonpayable",
2156
- type: "function"
2157
- },
2158
- {
2159
- inputs: [
2160
- { name: "spender", type: "address" },
2161
- { name: "amount", type: "uint256" }
2162
- ],
2163
- name: "approve",
2164
- outputs: [{ name: "", type: "bool" }],
2165
- stateMutability: "nonpayable",
2166
- type: "function"
2167
- },
2168
- {
2169
- inputs: [
2170
- { name: "from", type: "address" },
2171
- { name: "to", type: "address" },
2172
- { name: "amount", type: "uint256" }
2173
- ],
2174
- name: "transferFrom",
2175
- outputs: [{ name: "", type: "bool" }],
2176
- stateMutability: "nonpayable",
2177
- type: "function"
2178
- },
2179
- // Events
2180
- {
2181
- anonymous: false,
2182
- inputs: [
2183
- { indexed: true, name: "from", type: "address" },
2184
- { indexed: true, name: "to", type: "address" },
2185
- { indexed: false, name: "value", type: "uint256" }
2186
- ],
2187
- name: "Transfer",
2188
- type: "event"
2189
- },
2190
- {
2191
- anonymous: false,
2192
- inputs: [
2193
- { indexed: true, name: "owner", type: "address" },
2194
- { indexed: true, name: "spender", type: "address" },
2195
- { indexed: false, name: "value", type: "uint256" }
2196
- ],
2197
- name: "Approval",
2198
- type: "event"
2199
- }
2200
- ];
2100
+ var import_contracts = require("@cfxdevkit/contracts");
2201
2101
 
2202
2102
  // src/contracts/abis/erc721.ts
2203
- var ERC721_ABI = [
2204
- // Read functions
2205
- {
2206
- inputs: [],
2207
- name: "name",
2208
- outputs: [{ name: "", type: "string" }],
2209
- stateMutability: "view",
2210
- type: "function"
2211
- },
2212
- {
2213
- inputs: [],
2214
- name: "symbol",
2215
- outputs: [{ name: "", type: "string" }],
2216
- stateMutability: "view",
2217
- type: "function"
2218
- },
2219
- {
2220
- inputs: [{ name: "tokenId", type: "uint256" }],
2221
- name: "tokenURI",
2222
- outputs: [{ name: "", type: "string" }],
2223
- stateMutability: "view",
2224
- type: "function"
2225
- },
2226
- {
2227
- inputs: [{ name: "owner", type: "address" }],
2228
- name: "balanceOf",
2229
- outputs: [{ name: "", type: "uint256" }],
2230
- stateMutability: "view",
2231
- type: "function"
2232
- },
2233
- {
2234
- inputs: [{ name: "tokenId", type: "uint256" }],
2235
- name: "ownerOf",
2236
- outputs: [{ name: "", type: "address" }],
2237
- stateMutability: "view",
2238
- type: "function"
2239
- },
2240
- {
2241
- inputs: [
2242
- { name: "owner", type: "address" },
2243
- { name: "operator", type: "address" }
2244
- ],
2245
- name: "isApprovedForAll",
2246
- outputs: [{ name: "", type: "bool" }],
2247
- stateMutability: "view",
2248
- type: "function"
2249
- },
2250
- {
2251
- inputs: [{ name: "tokenId", type: "uint256" }],
2252
- name: "getApproved",
2253
- outputs: [{ name: "", type: "address" }],
2254
- stateMutability: "view",
2255
- type: "function"
2256
- },
2257
- {
2258
- inputs: [{ name: "interfaceId", type: "bytes4" }],
2259
- name: "supportsInterface",
2260
- outputs: [{ name: "", type: "bool" }],
2261
- stateMutability: "view",
2262
- type: "function"
2263
- },
2264
- // Write functions
2265
- {
2266
- inputs: [
2267
- { name: "from", type: "address" },
2268
- { name: "to", type: "address" },
2269
- { name: "tokenId", type: "uint256" }
2270
- ],
2271
- name: "transferFrom",
2272
- outputs: [],
2273
- stateMutability: "nonpayable",
2274
- type: "function"
2275
- },
2276
- {
2277
- inputs: [
2278
- { name: "from", type: "address" },
2279
- { name: "to", type: "address" },
2280
- { name: "tokenId", type: "uint256" }
2281
- ],
2282
- name: "safeTransferFrom",
2283
- outputs: [],
2284
- stateMutability: "nonpayable",
2285
- type: "function"
2286
- },
2287
- {
2288
- inputs: [
2289
- { name: "from", type: "address" },
2290
- { name: "to", type: "address" },
2291
- { name: "tokenId", type: "uint256" },
2292
- { name: "data", type: "bytes" }
2293
- ],
2294
- name: "safeTransferFrom",
2295
- outputs: [],
2296
- stateMutability: "nonpayable",
2297
- type: "function"
2298
- },
2299
- {
2300
- inputs: [
2301
- { name: "to", type: "address" },
2302
- { name: "tokenId", type: "uint256" }
2303
- ],
2304
- name: "approve",
2305
- outputs: [],
2306
- stateMutability: "nonpayable",
2307
- type: "function"
2308
- },
2309
- {
2310
- inputs: [
2311
- { name: "operator", type: "address" },
2312
- { name: "approved", type: "bool" }
2313
- ],
2314
- name: "setApprovalForAll",
2315
- outputs: [],
2316
- stateMutability: "nonpayable",
2317
- type: "function"
2318
- },
2319
- // Events
2320
- {
2321
- anonymous: false,
2322
- inputs: [
2323
- { indexed: true, name: "from", type: "address" },
2324
- { indexed: true, name: "to", type: "address" },
2325
- { indexed: true, name: "tokenId", type: "uint256" }
2326
- ],
2327
- name: "Transfer",
2328
- type: "event"
2329
- },
2330
- {
2331
- anonymous: false,
2332
- inputs: [
2333
- { indexed: true, name: "owner", type: "address" },
2334
- { indexed: true, name: "approved", type: "address" },
2335
- { indexed: true, name: "tokenId", type: "uint256" }
2336
- ],
2337
- name: "Approval",
2338
- type: "event"
2339
- },
2340
- {
2341
- anonymous: false,
2342
- inputs: [
2343
- { indexed: true, name: "owner", type: "address" },
2344
- { indexed: true, name: "operator", type: "address" },
2345
- { indexed: false, name: "approved", type: "bool" }
2346
- ],
2347
- name: "ApprovalForAll",
2348
- type: "event"
2349
- }
2350
- ];
2103
+ var import_contracts2 = require("@cfxdevkit/contracts");
2351
2104
 
2352
2105
  // src/contracts/abis/erc1155.ts
2353
- var ERC1155_ABI = [
2354
- // Read functions
2355
- {
2356
- inputs: [{ name: "id", type: "uint256" }],
2357
- name: "uri",
2358
- outputs: [{ name: "", type: "string" }],
2359
- stateMutability: "view",
2360
- type: "function"
2361
- },
2362
- {
2363
- inputs: [
2364
- { name: "account", type: "address" },
2365
- { name: "id", type: "uint256" }
2366
- ],
2367
- name: "balanceOf",
2368
- outputs: [{ name: "", type: "uint256" }],
2369
- stateMutability: "view",
2370
- type: "function"
2371
- },
2372
- {
2373
- inputs: [
2374
- { name: "accounts", type: "address[]" },
2375
- { name: "ids", type: "uint256[]" }
2376
- ],
2377
- name: "balanceOfBatch",
2378
- outputs: [{ name: "", type: "uint256[]" }],
2379
- stateMutability: "view",
2380
- type: "function"
2381
- },
2382
- {
2383
- inputs: [
2384
- { name: "account", type: "address" },
2385
- { name: "operator", type: "address" }
2386
- ],
2387
- name: "isApprovedForAll",
2388
- outputs: [{ name: "", type: "bool" }],
2389
- stateMutability: "view",
2390
- type: "function"
2391
- },
2392
- {
2393
- inputs: [{ name: "interfaceId", type: "bytes4" }],
2394
- name: "supportsInterface",
2395
- outputs: [{ name: "", type: "bool" }],
2396
- stateMutability: "view",
2397
- type: "function"
2398
- },
2399
- // Write functions
2400
- {
2401
- inputs: [
2402
- { name: "operator", type: "address" },
2403
- { name: "approved", type: "bool" }
2404
- ],
2405
- name: "setApprovalForAll",
2406
- outputs: [],
2407
- stateMutability: "nonpayable",
2408
- type: "function"
2409
- },
2410
- {
2411
- inputs: [
2412
- { name: "from", type: "address" },
2413
- { name: "to", type: "address" },
2414
- { name: "id", type: "uint256" },
2415
- { name: "amount", type: "uint256" },
2416
- { name: "data", type: "bytes" }
2417
- ],
2418
- name: "safeTransferFrom",
2419
- outputs: [],
2420
- stateMutability: "nonpayable",
2421
- type: "function"
2422
- },
2423
- {
2424
- inputs: [
2425
- { name: "from", type: "address" },
2426
- { name: "to", type: "address" },
2427
- { name: "ids", type: "uint256[]" },
2428
- { name: "amounts", type: "uint256[]" },
2429
- { name: "data", type: "bytes" }
2430
- ],
2431
- name: "safeBatchTransferFrom",
2432
- outputs: [],
2433
- stateMutability: "nonpayable",
2434
- type: "function"
2435
- },
2436
- // Events
2437
- {
2438
- anonymous: false,
2439
- inputs: [
2440
- { indexed: true, name: "operator", type: "address" },
2441
- { indexed: true, name: "from", type: "address" },
2442
- { indexed: true, name: "to", type: "address" },
2443
- { indexed: false, name: "id", type: "uint256" },
2444
- { indexed: false, name: "value", type: "uint256" }
2445
- ],
2446
- name: "TransferSingle",
2447
- type: "event"
2448
- },
2449
- {
2450
- anonymous: false,
2451
- inputs: [
2452
- { indexed: true, name: "operator", type: "address" },
2453
- { indexed: true, name: "from", type: "address" },
2454
- { indexed: true, name: "to", type: "address" },
2455
- { indexed: false, name: "ids", type: "uint256[]" },
2456
- { indexed: false, name: "values", type: "uint256[]" }
2457
- ],
2458
- name: "TransferBatch",
2459
- type: "event"
2460
- },
2461
- {
2462
- anonymous: false,
2463
- inputs: [
2464
- { indexed: true, name: "account", type: "address" },
2465
- { indexed: true, name: "operator", type: "address" },
2466
- { indexed: false, name: "approved", type: "bool" }
2467
- ],
2468
- name: "ApprovalForAll",
2469
- type: "event"
2470
- },
2471
- {
2472
- anonymous: false,
2473
- inputs: [
2474
- { indexed: false, name: "value", type: "string" },
2475
- { indexed: true, name: "id", type: "uint256" }
2476
- ],
2477
- name: "URI",
2478
- type: "event"
2479
- }
2480
- ];
2106
+ var import_contracts3 = require("@cfxdevkit/contracts");
2481
2107
 
2482
2108
  // src/contracts/types/index.ts
2483
2109
  var ContractError = class extends Error {