@fuel-ts/account 0.0.0-rc-2021-20240409111335 → 0.0.0-rc-1976-20240409133547
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/README.md +1 -1
- package/dist/account.d.ts +4 -5
- package/dist/account.d.ts.map +1 -1
- package/dist/configs.d.ts.map +1 -1
- package/dist/configs.global.js +1 -1
- package/dist/configs.global.js.map +1 -1
- package/dist/configs.js +1 -1
- package/dist/configs.js.map +1 -1
- package/dist/configs.mjs +1 -1
- package/dist/configs.mjs.map +1 -1
- package/dist/index.global.js +616 -868
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +610 -848
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +453 -690
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +2 -10
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +328 -894
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/coin-quantity.d.ts +3 -3
- package/dist/providers/coin-quantity.d.ts.map +1 -1
- package/dist/providers/coin.d.ts +2 -4
- package/dist/providers/coin.d.ts.map +1 -1
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
- package/dist/providers/message.d.ts +1 -3
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +34 -45
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/input.d.ts +2 -2
- package/dist/providers/transaction-request/input.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +29 -9
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/utils.d.ts +0 -3
- package/dist/providers/transaction-request/utils.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +0 -2
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +2 -3
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -1
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
- package/dist/providers/utils/gas.d.ts +2 -8
- package/dist/providers/utils/gas.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils.global.js +1117 -1583
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +607 -824
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +465 -682
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +17 -17
@@ -280,7 +280,7 @@
|
|
280
280
|
}
|
281
281
|
return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words);
|
282
282
|
};
|
283
|
-
BN2.max = function
|
283
|
+
BN2.max = function max2(left, right) {
|
284
284
|
if (left.cmp(right) > 0)
|
285
285
|
return left;
|
286
286
|
return right;
|
@@ -5104,7 +5104,7 @@
|
|
5104
5104
|
function isBlob(obj) {
|
5105
5105
|
return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
|
5106
5106
|
}
|
5107
|
-
function
|
5107
|
+
function clone(instance) {
|
5108
5108
|
let p1, p2;
|
5109
5109
|
let body = instance.body;
|
5110
5110
|
if (instance.bodyUsed) {
|
@@ -6038,7 +6038,7 @@
|
|
6038
6038
|
* @return Response
|
6039
6039
|
*/
|
6040
6040
|
clone() {
|
6041
|
-
return new Response2(
|
6041
|
+
return new Response2(clone(this), {
|
6042
6042
|
url: this.url,
|
6043
6043
|
status: this.status,
|
6044
6044
|
statusText: this.statusText,
|
@@ -6088,7 +6088,7 @@
|
|
6088
6088
|
if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
6089
6089
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
6090
6090
|
}
|
6091
|
-
let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ?
|
6091
|
+
let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
|
6092
6092
|
Body.call(this, inputBody, {
|
6093
6093
|
timeout: init.timeout || input.timeout || 0,
|
6094
6094
|
size: init.size || input.size || 0
|
@@ -31914,8 +31914,8 @@ spurious results.`);
|
|
31914
31914
|
// ../versions/dist/index.mjs
|
31915
31915
|
function getBuiltinVersions() {
|
31916
31916
|
return {
|
31917
|
-
FORC: "0.
|
31918
|
-
FUEL_CORE: "0.
|
31917
|
+
FORC: "0.49.3",
|
31918
|
+
FUEL_CORE: "0.22.1",
|
31919
31919
|
FUELS: "0.79.0"
|
31920
31920
|
};
|
31921
31921
|
}
|
@@ -32192,757 +32192,525 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32192
32192
|
__publicField3(DateTime, "TAI64_NULL", "");
|
32193
32193
|
var chainConfig_default = {
|
32194
32194
|
chain_name: "local_testnet",
|
32195
|
-
|
32196
|
-
|
32197
|
-
|
32198
|
-
|
32199
|
-
|
32200
|
-
|
32201
|
-
|
32202
|
-
max_gas_per_tx: 3e7,
|
32203
|
-
max_size: 112640
|
32204
|
-
}
|
32205
|
-
},
|
32206
|
-
predicate_params: {
|
32207
|
-
V1: {
|
32208
|
-
max_predicate_length: 102400,
|
32209
|
-
max_predicate_data_length: 102400,
|
32210
|
-
max_message_data_length: 102400,
|
32211
|
-
max_gas_per_predicate: 3e7
|
32212
|
-
}
|
32213
|
-
},
|
32214
|
-
script_params: {
|
32215
|
-
V1: {
|
32216
|
-
max_script_length: 102400,
|
32217
|
-
max_script_data_length: 102400
|
32218
|
-
}
|
32219
|
-
},
|
32220
|
-
contract_params: {
|
32221
|
-
V1: {
|
32222
|
-
contract_max_size: 102400,
|
32223
|
-
max_storage_slots: 1760
|
32224
|
-
}
|
32225
|
-
},
|
32226
|
-
fee_params: {
|
32227
|
-
V1: {
|
32228
|
-
gas_price_factor: 92,
|
32229
|
-
gas_per_byte: 63
|
32230
|
-
}
|
32231
|
-
},
|
32232
|
-
chain_id: 0,
|
32233
|
-
gas_costs: {
|
32234
|
-
V1: {
|
32235
|
-
add: 2,
|
32236
|
-
addi: 2,
|
32237
|
-
aloc: 1,
|
32238
|
-
and: 2,
|
32239
|
-
andi: 2,
|
32240
|
-
bal: 366,
|
32241
|
-
bhei: 2,
|
32242
|
-
bhsh: 2,
|
32243
|
-
burn: 33949,
|
32244
|
-
cb: 2,
|
32245
|
-
cfei: 2,
|
32246
|
-
cfsi: 2,
|
32247
|
-
div: 2,
|
32248
|
-
divi: 2,
|
32249
|
-
eck1: 3347,
|
32250
|
-
ecr1: 46165,
|
32251
|
-
ed19: 4210,
|
32252
|
-
eq: 2,
|
32253
|
-
exp: 2,
|
32254
|
-
expi: 2,
|
32255
|
-
flag: 1,
|
32256
|
-
gm: 2,
|
32257
|
-
gt: 2,
|
32258
|
-
gtf: 16,
|
32259
|
-
ji: 2,
|
32260
|
-
jmp: 2,
|
32261
|
-
jne: 2,
|
32262
|
-
jnei: 2,
|
32263
|
-
jnzi: 2,
|
32264
|
-
jmpf: 2,
|
32265
|
-
jmpb: 2,
|
32266
|
-
jnzf: 2,
|
32267
|
-
jnzb: 2,
|
32268
|
-
jnef: 2,
|
32269
|
-
jneb: 2,
|
32270
|
-
lb: 2,
|
32271
|
-
log: 754,
|
32272
|
-
lt: 2,
|
32273
|
-
lw: 2,
|
32274
|
-
mint: 35718,
|
32275
|
-
mlog: 2,
|
32276
|
-
mod: 2,
|
32277
|
-
modi: 2,
|
32278
|
-
move: 2,
|
32279
|
-
movi: 2,
|
32280
|
-
mroo: 5,
|
32281
|
-
mul: 2,
|
32282
|
-
muli: 2,
|
32283
|
-
mldv: 4,
|
32284
|
-
noop: 1,
|
32285
|
-
not: 2,
|
32286
|
-
or: 2,
|
32287
|
-
ori: 2,
|
32288
|
-
poph: 3,
|
32289
|
-
popl: 3,
|
32290
|
-
pshh: 4,
|
32291
|
-
pshl: 4,
|
32292
|
-
ret_contract: 733,
|
32293
|
-
rvrt_contract: 722,
|
32294
|
-
sb: 2,
|
32295
|
-
sll: 2,
|
32296
|
-
slli: 2,
|
32297
|
-
srl: 2,
|
32298
|
-
srli: 2,
|
32299
|
-
srw: 253,
|
32300
|
-
sub: 2,
|
32301
|
-
subi: 2,
|
32302
|
-
sw: 2,
|
32303
|
-
sww: 29053,
|
32304
|
-
time: 79,
|
32305
|
-
tr: 46242,
|
32306
|
-
tro: 33251,
|
32307
|
-
wdcm: 3,
|
32308
|
-
wqcm: 3,
|
32309
|
-
wdop: 3,
|
32310
|
-
wqop: 3,
|
32311
|
-
wdml: 3,
|
32312
|
-
wqml: 4,
|
32313
|
-
wddv: 5,
|
32314
|
-
wqdv: 7,
|
32315
|
-
wdmd: 11,
|
32316
|
-
wqmd: 18,
|
32317
|
-
wdam: 9,
|
32318
|
-
wqam: 12,
|
32319
|
-
wdmm: 11,
|
32320
|
-
wqmm: 11,
|
32321
|
-
xor: 2,
|
32322
|
-
xori: 2,
|
32323
|
-
call: {
|
32324
|
-
LightOperation: {
|
32325
|
-
base: 21687,
|
32326
|
-
units_per_gas: 4
|
32327
|
-
}
|
32328
|
-
},
|
32329
|
-
ccp: {
|
32330
|
-
LightOperation: {
|
32331
|
-
base: 59,
|
32332
|
-
units_per_gas: 20
|
32333
|
-
}
|
32334
|
-
},
|
32335
|
-
croo: {
|
32336
|
-
LightOperation: {
|
32337
|
-
base: 1,
|
32338
|
-
units_per_gas: 1
|
32339
|
-
}
|
32340
|
-
},
|
32341
|
-
csiz: {
|
32342
|
-
LightOperation: {
|
32343
|
-
base: 59,
|
32344
|
-
units_per_gas: 195
|
32345
|
-
}
|
32346
|
-
},
|
32347
|
-
k256: {
|
32348
|
-
LightOperation: {
|
32349
|
-
base: 282,
|
32350
|
-
units_per_gas: 3
|
32351
|
-
}
|
32352
|
-
},
|
32353
|
-
ldc: {
|
32354
|
-
LightOperation: {
|
32355
|
-
base: 45,
|
32356
|
-
units_per_gas: 65
|
32357
|
-
}
|
32358
|
-
},
|
32359
|
-
logd: {
|
32360
|
-
LightOperation: {
|
32361
|
-
base: 1134,
|
32362
|
-
units_per_gas: 2
|
32363
|
-
}
|
32364
|
-
},
|
32365
|
-
mcl: {
|
32366
|
-
LightOperation: {
|
32367
|
-
base: 3,
|
32368
|
-
units_per_gas: 523
|
32369
|
-
}
|
32370
|
-
},
|
32371
|
-
mcli: {
|
32372
|
-
LightOperation: {
|
32373
|
-
base: 3,
|
32374
|
-
units_per_gas: 526
|
32375
|
-
}
|
32376
|
-
},
|
32377
|
-
mcp: {
|
32378
|
-
LightOperation: {
|
32379
|
-
base: 3,
|
32380
|
-
units_per_gas: 448
|
32381
|
-
}
|
32382
|
-
},
|
32383
|
-
mcpi: {
|
32384
|
-
LightOperation: {
|
32385
|
-
base: 7,
|
32386
|
-
units_per_gas: 585
|
32387
|
-
}
|
32388
|
-
},
|
32389
|
-
meq: {
|
32390
|
-
LightOperation: {
|
32391
|
-
base: 11,
|
32392
|
-
units_per_gas: 1097
|
32393
|
-
}
|
32394
|
-
},
|
32395
|
-
retd_contract: {
|
32396
|
-
LightOperation: {
|
32397
|
-
base: 1086,
|
32398
|
-
units_per_gas: 2
|
32399
|
-
}
|
32400
|
-
},
|
32401
|
-
s256: {
|
32402
|
-
LightOperation: {
|
32403
|
-
base: 45,
|
32404
|
-
units_per_gas: 3
|
32405
|
-
}
|
32406
|
-
},
|
32407
|
-
scwq: {
|
32408
|
-
HeavyOperation: {
|
32409
|
-
base: 30375,
|
32410
|
-
gas_per_unit: 28628
|
32411
|
-
}
|
32412
|
-
},
|
32413
|
-
smo: {
|
32414
|
-
LightOperation: {
|
32415
|
-
base: 64196,
|
32416
|
-
units_per_gas: 1
|
32417
|
-
}
|
32418
|
-
},
|
32419
|
-
srwq: {
|
32420
|
-
HeavyOperation: {
|
32421
|
-
base: 262,
|
32422
|
-
gas_per_unit: 249
|
32423
|
-
}
|
32424
|
-
},
|
32425
|
-
swwq: {
|
32426
|
-
HeavyOperation: {
|
32427
|
-
base: 28484,
|
32428
|
-
gas_per_unit: 26613
|
32429
|
-
}
|
32430
|
-
},
|
32431
|
-
contract_root: {
|
32432
|
-
LightOperation: {
|
32433
|
-
base: 45,
|
32434
|
-
units_per_gas: 1
|
32435
|
-
}
|
32436
|
-
},
|
32437
|
-
state_root: {
|
32438
|
-
HeavyOperation: {
|
32439
|
-
base: 350,
|
32440
|
-
gas_per_unit: 176
|
32441
|
-
}
|
32442
|
-
},
|
32443
|
-
new_storage_per_byte: 63,
|
32444
|
-
vm_initialization: {
|
32445
|
-
LightOperation: {
|
32446
|
-
base: 1645,
|
32447
|
-
units_per_gas: 14
|
32448
|
-
}
|
32449
|
-
}
|
32450
|
-
}
|
32195
|
+
block_gas_limit: 5e9,
|
32196
|
+
initial_state: {
|
32197
|
+
coins: [
|
32198
|
+
{
|
32199
|
+
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32200
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32201
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32451
32202
|
},
|
32452
|
-
|
32453
|
-
|
32454
|
-
|
32455
|
-
|
32203
|
+
{
|
32204
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32205
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32206
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32207
|
+
},
|
32208
|
+
{
|
32209
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32210
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32211
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32212
|
+
},
|
32213
|
+
{
|
32214
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32215
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32216
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32217
|
+
},
|
32218
|
+
{
|
32219
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32220
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32221
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32222
|
+
},
|
32223
|
+
{
|
32224
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32225
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32226
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32227
|
+
},
|
32228
|
+
{
|
32229
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32230
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32231
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32232
|
+
},
|
32233
|
+
{
|
32234
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32235
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32236
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32237
|
+
},
|
32238
|
+
{
|
32239
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32240
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32241
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32242
|
+
},
|
32243
|
+
{
|
32244
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32245
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32246
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32247
|
+
},
|
32248
|
+
{
|
32249
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32250
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32251
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32252
|
+
},
|
32253
|
+
{
|
32254
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32255
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32256
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32257
|
+
},
|
32258
|
+
{
|
32259
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32260
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32261
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32262
|
+
},
|
32263
|
+
{
|
32264
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32265
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32266
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32267
|
+
},
|
32268
|
+
{
|
32269
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32270
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32271
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32272
|
+
},
|
32273
|
+
{
|
32274
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32275
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32276
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32277
|
+
},
|
32278
|
+
{
|
32279
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32280
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32281
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32282
|
+
},
|
32283
|
+
{
|
32284
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32285
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32286
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32287
|
+
},
|
32288
|
+
{
|
32289
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32290
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32291
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32292
|
+
},
|
32293
|
+
{
|
32294
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32295
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32296
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32297
|
+
},
|
32298
|
+
{
|
32299
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32300
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32301
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32302
|
+
},
|
32303
|
+
{
|
32304
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32305
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32306
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32307
|
+
},
|
32308
|
+
{
|
32309
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32310
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32311
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32312
|
+
},
|
32313
|
+
{
|
32314
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32315
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32316
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32317
|
+
},
|
32318
|
+
{
|
32319
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32320
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32321
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32322
|
+
},
|
32323
|
+
{
|
32324
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32325
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32326
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32327
|
+
},
|
32328
|
+
{
|
32329
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32330
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32331
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32332
|
+
},
|
32333
|
+
{
|
32334
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32335
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32336
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32337
|
+
},
|
32338
|
+
{
|
32339
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32340
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32341
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32342
|
+
},
|
32343
|
+
{
|
32344
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32345
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32346
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32347
|
+
},
|
32348
|
+
{
|
32349
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32350
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32351
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32352
|
+
},
|
32353
|
+
{
|
32354
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32355
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32356
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32357
|
+
},
|
32358
|
+
{
|
32359
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32360
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32361
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32362
|
+
},
|
32363
|
+
{
|
32364
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32365
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32366
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32367
|
+
},
|
32368
|
+
{
|
32369
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32370
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32371
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32372
|
+
},
|
32373
|
+
{
|
32374
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32375
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32376
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32377
|
+
},
|
32378
|
+
{
|
32379
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32380
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32381
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32382
|
+
},
|
32383
|
+
{
|
32384
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32385
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32386
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32387
|
+
},
|
32388
|
+
{
|
32389
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32390
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32391
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32392
|
+
},
|
32393
|
+
{
|
32394
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32395
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32396
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32397
|
+
},
|
32398
|
+
{
|
32399
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32400
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32401
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32402
|
+
},
|
32403
|
+
{
|
32404
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32405
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32406
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32407
|
+
},
|
32408
|
+
{
|
32409
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32410
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32411
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32412
|
+
},
|
32413
|
+
{
|
32414
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32415
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32416
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32417
|
+
},
|
32418
|
+
{
|
32419
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32420
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32421
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32422
|
+
},
|
32423
|
+
{
|
32424
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32425
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32426
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32427
|
+
},
|
32428
|
+
{
|
32429
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32430
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32431
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32432
|
+
},
|
32433
|
+
{
|
32434
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32435
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32436
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32437
|
+
},
|
32438
|
+
{
|
32439
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32440
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32441
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32442
|
+
}
|
32443
|
+
],
|
32444
|
+
messages: [
|
32445
|
+
{
|
32446
|
+
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32447
|
+
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32448
|
+
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32449
|
+
amount: "0x000000000000FFFF",
|
32450
|
+
data: "",
|
32451
|
+
da_height: "0x00"
|
32452
|
+
},
|
32453
|
+
{
|
32454
|
+
sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32455
|
+
recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32456
|
+
nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
|
32457
|
+
amount: "0xb04f3c08f59b309e",
|
32458
|
+
data: "",
|
32459
|
+
da_height: "0x00"
|
32460
|
+
}
|
32461
|
+
]
|
32456
32462
|
},
|
32457
|
-
|
32458
|
-
|
32459
|
-
|
32460
|
-
|
32461
|
-
|
32462
|
-
|
32463
|
-
|
32464
|
-
chain_config: "chainConfig.json",
|
32465
|
-
table_encoding: {
|
32466
|
-
Json: {
|
32467
|
-
filepath: "stateConfig.json"
|
32468
|
-
}
|
32469
|
-
}
|
32470
|
-
};
|
32471
|
-
var stateConfig_default = {
|
32472
|
-
coins: [
|
32473
|
-
{
|
32474
|
-
tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
|
32475
|
-
output_index: 0,
|
32476
|
-
tx_pointer_block_height: 0,
|
32477
|
-
tx_pointer_tx_idx: 0,
|
32478
|
-
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32479
|
-
amount: 18446744073709552e3,
|
32480
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32481
|
-
},
|
32482
|
-
{
|
32483
|
-
tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
|
32484
|
-
output_index: 0,
|
32485
|
-
tx_pointer_block_height: 0,
|
32486
|
-
tx_pointer_tx_idx: 0,
|
32487
|
-
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32488
|
-
amount: 18446744073709552e3,
|
32489
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32490
|
-
},
|
32491
|
-
{
|
32492
|
-
tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
|
32493
|
-
output_index: 0,
|
32494
|
-
tx_pointer_block_height: 0,
|
32495
|
-
tx_pointer_tx_idx: 0,
|
32496
|
-
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32497
|
-
amount: 18446744073709552e3,
|
32498
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32499
|
-
},
|
32500
|
-
{
|
32501
|
-
tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
|
32502
|
-
output_index: 0,
|
32503
|
-
tx_pointer_block_height: 0,
|
32504
|
-
tx_pointer_tx_idx: 0,
|
32505
|
-
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32506
|
-
amount: 18446744073709552e3,
|
32507
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32508
|
-
},
|
32509
|
-
{
|
32510
|
-
tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
|
32511
|
-
output_index: 0,
|
32512
|
-
tx_pointer_block_height: 0,
|
32513
|
-
tx_pointer_tx_idx: 0,
|
32514
|
-
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32515
|
-
amount: 18446744073709552e3,
|
32516
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32517
|
-
},
|
32518
|
-
{
|
32519
|
-
tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
|
32520
|
-
output_index: 0,
|
32521
|
-
tx_pointer_block_height: 0,
|
32522
|
-
tx_pointer_tx_idx: 0,
|
32523
|
-
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32524
|
-
amount: 18446744073709552e3,
|
32525
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32526
|
-
},
|
32527
|
-
{
|
32528
|
-
tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
|
32529
|
-
output_index: 0,
|
32530
|
-
tx_pointer_block_height: 0,
|
32531
|
-
tx_pointer_tx_idx: 0,
|
32532
|
-
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32533
|
-
amount: 18446744073709552e3,
|
32534
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32535
|
-
},
|
32536
|
-
{
|
32537
|
-
tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
|
32538
|
-
output_index: 0,
|
32539
|
-
tx_pointer_block_height: 0,
|
32540
|
-
tx_pointer_tx_idx: 0,
|
32541
|
-
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32542
|
-
amount: 18446744073709552e3,
|
32543
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32544
|
-
},
|
32545
|
-
{
|
32546
|
-
tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
|
32547
|
-
output_index: 0,
|
32548
|
-
tx_pointer_block_height: 0,
|
32549
|
-
tx_pointer_tx_idx: 0,
|
32550
|
-
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32551
|
-
amount: 18446744073709552e3,
|
32552
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32553
|
-
},
|
32554
|
-
{
|
32555
|
-
tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
|
32556
|
-
output_index: 0,
|
32557
|
-
tx_pointer_block_height: 0,
|
32558
|
-
tx_pointer_tx_idx: 0,
|
32559
|
-
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32560
|
-
amount: 18446744073709552e3,
|
32561
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32562
|
-
},
|
32563
|
-
{
|
32564
|
-
tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
|
32565
|
-
output_index: 0,
|
32566
|
-
tx_pointer_block_height: 0,
|
32567
|
-
tx_pointer_tx_idx: 0,
|
32568
|
-
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32569
|
-
amount: 18446744073709552e3,
|
32570
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32571
|
-
},
|
32572
|
-
{
|
32573
|
-
tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
|
32574
|
-
output_index: 0,
|
32575
|
-
tx_pointer_block_height: 0,
|
32576
|
-
tx_pointer_tx_idx: 0,
|
32577
|
-
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32578
|
-
amount: 18446744073709552e3,
|
32579
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32580
|
-
},
|
32581
|
-
{
|
32582
|
-
tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
|
32583
|
-
output_index: 0,
|
32584
|
-
tx_pointer_block_height: 0,
|
32585
|
-
tx_pointer_tx_idx: 0,
|
32586
|
-
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32587
|
-
amount: 18446744073709552e3,
|
32588
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32589
|
-
},
|
32590
|
-
{
|
32591
|
-
tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
|
32592
|
-
output_index: 0,
|
32593
|
-
tx_pointer_block_height: 0,
|
32594
|
-
tx_pointer_tx_idx: 0,
|
32595
|
-
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32596
|
-
amount: 18446744073709552e3,
|
32597
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32598
|
-
},
|
32599
|
-
{
|
32600
|
-
tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
|
32601
|
-
output_index: 0,
|
32602
|
-
tx_pointer_block_height: 0,
|
32603
|
-
tx_pointer_tx_idx: 0,
|
32604
|
-
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32605
|
-
amount: 18446744073709552e3,
|
32606
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32607
|
-
},
|
32608
|
-
{
|
32609
|
-
tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
|
32610
|
-
output_index: 0,
|
32611
|
-
tx_pointer_block_height: 0,
|
32612
|
-
tx_pointer_tx_idx: 0,
|
32613
|
-
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32614
|
-
amount: 18446744073709552e3,
|
32615
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32616
|
-
},
|
32617
|
-
{
|
32618
|
-
tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
|
32619
|
-
output_index: 0,
|
32620
|
-
tx_pointer_block_height: 0,
|
32621
|
-
tx_pointer_tx_idx: 0,
|
32622
|
-
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32623
|
-
amount: 18446744073709552e3,
|
32624
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32625
|
-
},
|
32626
|
-
{
|
32627
|
-
tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
|
32628
|
-
output_index: 0,
|
32629
|
-
tx_pointer_block_height: 0,
|
32630
|
-
tx_pointer_tx_idx: 0,
|
32631
|
-
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32632
|
-
amount: 18446744073709552e3,
|
32633
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32634
|
-
},
|
32635
|
-
{
|
32636
|
-
tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
|
32637
|
-
output_index: 0,
|
32638
|
-
tx_pointer_block_height: 0,
|
32639
|
-
tx_pointer_tx_idx: 0,
|
32640
|
-
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32641
|
-
amount: 18446744073709552e3,
|
32642
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32643
|
-
},
|
32644
|
-
{
|
32645
|
-
tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
|
32646
|
-
output_index: 0,
|
32647
|
-
tx_pointer_block_height: 0,
|
32648
|
-
tx_pointer_tx_idx: 0,
|
32649
|
-
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32650
|
-
amount: 18446744073709552e3,
|
32651
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32652
|
-
},
|
32653
|
-
{
|
32654
|
-
tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
|
32655
|
-
output_index: 0,
|
32656
|
-
tx_pointer_block_height: 0,
|
32657
|
-
tx_pointer_tx_idx: 0,
|
32658
|
-
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32659
|
-
amount: 18446744073709552e3,
|
32660
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32661
|
-
},
|
32662
|
-
{
|
32663
|
-
tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
|
32664
|
-
output_index: 0,
|
32665
|
-
tx_pointer_block_height: 0,
|
32666
|
-
tx_pointer_tx_idx: 0,
|
32667
|
-
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32668
|
-
amount: 18446744073709552e3,
|
32669
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32670
|
-
},
|
32671
|
-
{
|
32672
|
-
tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
|
32673
|
-
output_index: 0,
|
32674
|
-
tx_pointer_block_height: 0,
|
32675
|
-
tx_pointer_tx_idx: 0,
|
32676
|
-
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32677
|
-
amount: 18446744073709552e3,
|
32678
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32679
|
-
},
|
32680
|
-
{
|
32681
|
-
tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
|
32682
|
-
output_index: 0,
|
32683
|
-
tx_pointer_block_height: 0,
|
32684
|
-
tx_pointer_tx_idx: 0,
|
32685
|
-
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32686
|
-
amount: 18446744073709552e3,
|
32687
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32688
|
-
},
|
32689
|
-
{
|
32690
|
-
tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
|
32691
|
-
output_index: 0,
|
32692
|
-
tx_pointer_block_height: 0,
|
32693
|
-
tx_pointer_tx_idx: 0,
|
32694
|
-
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32695
|
-
amount: 18446744073709552e3,
|
32696
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32463
|
+
consensus_parameters: {
|
32464
|
+
tx_params: {
|
32465
|
+
max_inputs: 255,
|
32466
|
+
max_outputs: 255,
|
32467
|
+
max_witnesses: 255,
|
32468
|
+
max_gas_per_tx: 1e7,
|
32469
|
+
max_size: 17825792
|
32697
32470
|
},
|
32698
|
-
{
|
32699
|
-
|
32700
|
-
|
32701
|
-
|
32702
|
-
|
32703
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32704
|
-
amount: 18446744073709552e3,
|
32705
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32471
|
+
predicate_params: {
|
32472
|
+
max_predicate_length: 1048576,
|
32473
|
+
max_predicate_data_length: 1048576,
|
32474
|
+
max_gas_per_predicate: 1e7,
|
32475
|
+
max_message_data_length: 1048576
|
32706
32476
|
},
|
32707
|
-
{
|
32708
|
-
|
32709
|
-
|
32710
|
-
tx_pointer_block_height: 0,
|
32711
|
-
tx_pointer_tx_idx: 0,
|
32712
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32713
|
-
amount: 18446744073709552e3,
|
32714
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32477
|
+
script_params: {
|
32478
|
+
max_script_length: 1048576,
|
32479
|
+
max_script_data_length: 1048576
|
32715
32480
|
},
|
32716
|
-
{
|
32717
|
-
|
32718
|
-
|
32719
|
-
tx_pointer_block_height: 0,
|
32720
|
-
tx_pointer_tx_idx: 0,
|
32721
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32722
|
-
amount: 18446744073709552e3,
|
32723
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32481
|
+
contract_params: {
|
32482
|
+
contract_max_size: 16777216,
|
32483
|
+
max_storage_slots: 255
|
32724
32484
|
},
|
32725
|
-
{
|
32726
|
-
|
32727
|
-
|
32728
|
-
tx_pointer_block_height: 0,
|
32729
|
-
tx_pointer_tx_idx: 0,
|
32730
|
-
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32731
|
-
amount: 18446744073709552e3,
|
32732
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32485
|
+
fee_params: {
|
32486
|
+
gas_price_factor: 92,
|
32487
|
+
gas_per_byte: 4
|
32733
32488
|
},
|
32734
|
-
|
32735
|
-
|
32736
|
-
|
32737
|
-
|
32738
|
-
|
32739
|
-
|
32740
|
-
|
32741
|
-
|
32489
|
+
base_asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32490
|
+
},
|
32491
|
+
gas_costs: {
|
32492
|
+
add: 1,
|
32493
|
+
addi: 1,
|
32494
|
+
aloc: 1,
|
32495
|
+
and: 1,
|
32496
|
+
andi: 1,
|
32497
|
+
bal: 13,
|
32498
|
+
bhei: 1,
|
32499
|
+
bhsh: 1,
|
32500
|
+
burn: 132,
|
32501
|
+
cb: 1,
|
32502
|
+
cfei: 1,
|
32503
|
+
cfsi: 1,
|
32504
|
+
croo: 16,
|
32505
|
+
div: 1,
|
32506
|
+
divi: 1,
|
32507
|
+
ecr1: 3e3,
|
32508
|
+
eck1: 951,
|
32509
|
+
ed19: 3e3,
|
32510
|
+
eq: 1,
|
32511
|
+
exp: 1,
|
32512
|
+
expi: 1,
|
32513
|
+
flag: 1,
|
32514
|
+
gm: 1,
|
32515
|
+
gt: 1,
|
32516
|
+
gtf: 1,
|
32517
|
+
ji: 1,
|
32518
|
+
jmp: 1,
|
32519
|
+
jne: 1,
|
32520
|
+
jnei: 1,
|
32521
|
+
jnzi: 1,
|
32522
|
+
jmpf: 1,
|
32523
|
+
jmpb: 1,
|
32524
|
+
jnzf: 1,
|
32525
|
+
jnzb: 1,
|
32526
|
+
jnef: 1,
|
32527
|
+
jneb: 1,
|
32528
|
+
lb: 1,
|
32529
|
+
log: 9,
|
32530
|
+
lt: 1,
|
32531
|
+
lw: 1,
|
32532
|
+
mint: 135,
|
32533
|
+
mlog: 1,
|
32534
|
+
modOp: 1,
|
32535
|
+
modi: 1,
|
32536
|
+
moveOp: 1,
|
32537
|
+
movi: 1,
|
32538
|
+
mroo: 2,
|
32539
|
+
mul: 1,
|
32540
|
+
muli: 1,
|
32541
|
+
mldv: 1,
|
32542
|
+
noop: 1,
|
32543
|
+
not: 1,
|
32544
|
+
or: 1,
|
32545
|
+
ori: 1,
|
32546
|
+
poph: 2,
|
32547
|
+
popl: 2,
|
32548
|
+
pshh: 2,
|
32549
|
+
pshl: 2,
|
32550
|
+
ret: 13,
|
32551
|
+
rvrt: 13,
|
32552
|
+
sb: 1,
|
32553
|
+
sll: 1,
|
32554
|
+
slli: 1,
|
32555
|
+
srl: 1,
|
32556
|
+
srli: 1,
|
32557
|
+
srw: 12,
|
32558
|
+
sub: 1,
|
32559
|
+
subi: 1,
|
32560
|
+
sw: 1,
|
32561
|
+
sww: 67,
|
32562
|
+
time: 1,
|
32563
|
+
tr: 105,
|
32564
|
+
tro: 60,
|
32565
|
+
wdcm: 1,
|
32566
|
+
wqcm: 1,
|
32567
|
+
wdop: 1,
|
32568
|
+
wqop: 1,
|
32569
|
+
wdml: 1,
|
32570
|
+
wqml: 1,
|
32571
|
+
wddv: 1,
|
32572
|
+
wqdv: 2,
|
32573
|
+
wdmd: 3,
|
32574
|
+
wqmd: 4,
|
32575
|
+
wdam: 2,
|
32576
|
+
wqam: 3,
|
32577
|
+
wdmm: 3,
|
32578
|
+
wqmm: 3,
|
32579
|
+
xor: 1,
|
32580
|
+
xori: 1,
|
32581
|
+
call: {
|
32582
|
+
LightOperation: {
|
32583
|
+
base: 144,
|
32584
|
+
units_per_gas: 214
|
32585
|
+
}
|
32742
32586
|
},
|
32743
|
-
{
|
32744
|
-
|
32745
|
-
|
32746
|
-
|
32747
|
-
|
32748
|
-
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32749
|
-
amount: 18446744073709552e3,
|
32750
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32587
|
+
ccp: {
|
32588
|
+
LightOperation: {
|
32589
|
+
base: 15,
|
32590
|
+
units_per_gas: 103
|
32591
|
+
}
|
32751
32592
|
},
|
32752
|
-
{
|
32753
|
-
|
32754
|
-
|
32755
|
-
|
32756
|
-
|
32757
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32758
|
-
amount: 18446744073709552e3,
|
32759
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32593
|
+
csiz: {
|
32594
|
+
LightOperation: {
|
32595
|
+
base: 17,
|
32596
|
+
units_per_gas: 790
|
32597
|
+
}
|
32760
32598
|
},
|
32761
|
-
{
|
32762
|
-
|
32763
|
-
|
32764
|
-
|
32765
|
-
|
32766
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32767
|
-
amount: 18446744073709552e3,
|
32768
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32599
|
+
k256: {
|
32600
|
+
LightOperation: {
|
32601
|
+
base: 11,
|
32602
|
+
units_per_gas: 214
|
32603
|
+
}
|
32769
32604
|
},
|
32770
|
-
{
|
32771
|
-
|
32772
|
-
|
32773
|
-
|
32774
|
-
|
32775
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32776
|
-
amount: 18446744073709552e3,
|
32777
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32605
|
+
ldc: {
|
32606
|
+
LightOperation: {
|
32607
|
+
base: 15,
|
32608
|
+
units_per_gas: 272
|
32609
|
+
}
|
32778
32610
|
},
|
32779
|
-
{
|
32780
|
-
|
32781
|
-
|
32782
|
-
|
32783
|
-
|
32784
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32785
|
-
amount: 18446744073709552e3,
|
32786
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32611
|
+
logd: {
|
32612
|
+
LightOperation: {
|
32613
|
+
base: 26,
|
32614
|
+
units_per_gas: 64
|
32615
|
+
}
|
32787
32616
|
},
|
32788
|
-
{
|
32789
|
-
|
32790
|
-
|
32791
|
-
|
32792
|
-
|
32793
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32794
|
-
amount: 18446744073709552e3,
|
32795
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32617
|
+
mcl: {
|
32618
|
+
LightOperation: {
|
32619
|
+
base: 1,
|
32620
|
+
units_per_gas: 3333
|
32621
|
+
}
|
32796
32622
|
},
|
32797
|
-
{
|
32798
|
-
|
32799
|
-
|
32800
|
-
|
32801
|
-
|
32802
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32803
|
-
amount: 18446744073709552e3,
|
32804
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32623
|
+
mcli: {
|
32624
|
+
LightOperation: {
|
32625
|
+
base: 1,
|
32626
|
+
units_per_gas: 3333
|
32627
|
+
}
|
32805
32628
|
},
|
32806
|
-
{
|
32807
|
-
|
32808
|
-
|
32809
|
-
|
32810
|
-
|
32811
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32812
|
-
amount: 18446744073709552e3,
|
32813
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32629
|
+
mcp: {
|
32630
|
+
LightOperation: {
|
32631
|
+
base: 1,
|
32632
|
+
units_per_gas: 2e3
|
32633
|
+
}
|
32814
32634
|
},
|
32815
|
-
{
|
32816
|
-
|
32817
|
-
|
32818
|
-
|
32819
|
-
|
32820
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32821
|
-
amount: 18446744073709552e3,
|
32822
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32635
|
+
mcpi: {
|
32636
|
+
LightOperation: {
|
32637
|
+
base: 3,
|
32638
|
+
units_per_gas: 2e3
|
32639
|
+
}
|
32823
32640
|
},
|
32824
|
-
{
|
32825
|
-
|
32826
|
-
|
32827
|
-
|
32828
|
-
|
32829
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32830
|
-
amount: 18446744073709552e3,
|
32831
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32641
|
+
meq: {
|
32642
|
+
LightOperation: {
|
32643
|
+
base: 1,
|
32644
|
+
units_per_gas: 2500
|
32645
|
+
}
|
32832
32646
|
},
|
32833
|
-
{
|
32834
|
-
|
32835
|
-
|
32836
|
-
|
32837
|
-
|
32838
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32839
|
-
amount: 18446744073709552e3,
|
32840
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32647
|
+
retd: {
|
32648
|
+
LightOperation: {
|
32649
|
+
base: 29,
|
32650
|
+
units_per_gas: 62
|
32651
|
+
}
|
32841
32652
|
},
|
32842
|
-
{
|
32843
|
-
|
32844
|
-
|
32845
|
-
|
32846
|
-
|
32847
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32848
|
-
amount: 18446744073709552e3,
|
32849
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32653
|
+
s256: {
|
32654
|
+
LightOperation: {
|
32655
|
+
base: 2,
|
32656
|
+
units_per_gas: 214
|
32657
|
+
}
|
32850
32658
|
},
|
32851
|
-
{
|
32852
|
-
|
32853
|
-
|
32854
|
-
|
32855
|
-
|
32856
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32857
|
-
amount: 18446744073709552e3,
|
32858
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32659
|
+
scwq: {
|
32660
|
+
LightOperation: {
|
32661
|
+
base: 13,
|
32662
|
+
units_per_gas: 5
|
32663
|
+
}
|
32859
32664
|
},
|
32860
|
-
{
|
32861
|
-
|
32862
|
-
|
32863
|
-
|
32864
|
-
|
32865
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32866
|
-
amount: 18446744073709552e3,
|
32867
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32665
|
+
smo: {
|
32666
|
+
LightOperation: {
|
32667
|
+
base: 209,
|
32668
|
+
units_per_gas: 55
|
32669
|
+
}
|
32868
32670
|
},
|
32869
|
-
{
|
32870
|
-
|
32871
|
-
|
32872
|
-
|
32873
|
-
|
32874
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32875
|
-
amount: 18446744073709552e3,
|
32876
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32671
|
+
srwq: {
|
32672
|
+
LightOperation: {
|
32673
|
+
base: 47,
|
32674
|
+
units_per_gas: 5
|
32675
|
+
}
|
32877
32676
|
},
|
32878
|
-
{
|
32879
|
-
|
32880
|
-
|
32881
|
-
|
32882
|
-
|
32883
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32884
|
-
amount: 18446744073709552e3,
|
32885
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32677
|
+
swwq: {
|
32678
|
+
LightOperation: {
|
32679
|
+
base: 44,
|
32680
|
+
units_per_gas: 5
|
32681
|
+
}
|
32886
32682
|
},
|
32887
|
-
{
|
32888
|
-
|
32889
|
-
|
32890
|
-
|
32891
|
-
|
32892
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32893
|
-
amount: 18446744073709552e3,
|
32894
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32683
|
+
contract_root: {
|
32684
|
+
LightOperation: {
|
32685
|
+
base: 75,
|
32686
|
+
units_per_gas: 1
|
32687
|
+
}
|
32895
32688
|
},
|
32896
|
-
{
|
32897
|
-
|
32898
|
-
|
32899
|
-
|
32900
|
-
|
32901
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32902
|
-
amount: 18446744073709552e3,
|
32903
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32689
|
+
state_root: {
|
32690
|
+
LightOperation: {
|
32691
|
+
base: 412,
|
32692
|
+
units_per_gas: 1
|
32693
|
+
}
|
32904
32694
|
},
|
32905
|
-
{
|
32906
|
-
|
32907
|
-
|
32908
|
-
|
32909
|
-
|
32910
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32911
|
-
amount: 18446744073709552e3,
|
32912
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32913
|
-
}
|
32914
|
-
],
|
32915
|
-
messages: [
|
32916
|
-
{
|
32917
|
-
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32918
|
-
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32919
|
-
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32920
|
-
amount: 18446744073709552e3,
|
32921
|
-
data: "",
|
32922
|
-
da_height: 0
|
32695
|
+
vm_initialization: {
|
32696
|
+
HeavyOperation: {
|
32697
|
+
base: 2e3,
|
32698
|
+
gas_per_unit: 0
|
32699
|
+
}
|
32923
32700
|
},
|
32924
|
-
|
32925
|
-
|
32926
|
-
|
32927
|
-
|
32928
|
-
|
32929
|
-
data: "",
|
32930
|
-
da_height: 0
|
32701
|
+
new_storage_per_byte: 1
|
32702
|
+
},
|
32703
|
+
consensus: {
|
32704
|
+
PoA: {
|
32705
|
+
signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
|
32931
32706
|
}
|
32932
|
-
|
32933
|
-
contracts: [],
|
32934
|
-
block_height: 0,
|
32935
|
-
da_block_height: 0
|
32936
|
-
};
|
32937
|
-
var defaultChainConfigs = {
|
32938
|
-
chainConfigJson: chainConfig_default,
|
32939
|
-
metadataJson: metadata_default,
|
32940
|
-
stateConfigJson: stateConfig_default
|
32707
|
+
}
|
32941
32708
|
};
|
32709
|
+
var defaultChainConfig = chainConfig_default;
|
32942
32710
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32943
32711
|
|
32944
32712
|
// ../crypto/dist/index.mjs
|
32945
|
-
var
|
32713
|
+
var import_crypto8 = __toESM(__require("crypto"), 1);
|
32946
32714
|
|
32947
32715
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
|
32948
32716
|
var version = "6.7.1";
|
@@ -34014,27 +33782,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34014
33782
|
};
|
34015
33783
|
Object.freeze(pbkdf22);
|
34016
33784
|
|
34017
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/random.js
|
34018
|
-
var locked5 = false;
|
34019
|
-
var _randomBytes = function(length) {
|
34020
|
-
return new Uint8Array((0, import_crypto2.randomBytes)(length));
|
34021
|
-
};
|
34022
|
-
var __randomBytes = _randomBytes;
|
34023
|
-
function randomBytes3(length) {
|
34024
|
-
return __randomBytes(length);
|
34025
|
-
}
|
34026
|
-
randomBytes3._ = _randomBytes;
|
34027
|
-
randomBytes3.lock = function() {
|
34028
|
-
locked5 = true;
|
34029
|
-
};
|
34030
|
-
randomBytes3.register = function(func) {
|
34031
|
-
if (locked5) {
|
34032
|
-
throw new Error("randomBytes is locked");
|
34033
|
-
}
|
34034
|
-
__randomBytes = func;
|
34035
|
-
};
|
34036
|
-
Object.freeze(randomBytes3);
|
34037
|
-
|
34038
33785
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
|
34039
33786
|
var BN_03 = BigInt(0);
|
34040
33787
|
var BN_36 = BigInt(36);
|
@@ -34619,8 +34366,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34619
34366
|
}
|
34620
34367
|
|
34621
34368
|
// ../crypto/dist/index.mjs
|
34369
|
+
var import_crypto9 = __toESM(__require("crypto"), 1);
|
34622
34370
|
var import_crypto10 = __toESM(__require("crypto"), 1);
|
34623
|
-
var import_crypto11 = __toESM(__require("crypto"), 1);
|
34624
34371
|
var scrypt3 = (params) => {
|
34625
34372
|
const { password, salt, n, p, r, dklen } = params;
|
34626
34373
|
const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
|
@@ -34629,7 +34376,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34629
34376
|
var keccak2562 = (data) => keccak_256(data);
|
34630
34377
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
34631
34378
|
var randomBytes4 = (length) => {
|
34632
|
-
const randomValues = Uint8Array.from(
|
34379
|
+
const randomValues = Uint8Array.from(import_crypto9.default.randomBytes(length));
|
34633
34380
|
return randomValues;
|
34634
34381
|
};
|
34635
34382
|
var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
|
@@ -34644,7 +34391,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34644
34391
|
const salt = randomBytes4(32);
|
34645
34392
|
const secret = keyFromPassword(password, salt);
|
34646
34393
|
const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
|
34647
|
-
const cipher = await
|
34394
|
+
const cipher = await import_crypto8.default.createCipheriv(ALGORITHM, secret, iv);
|
34648
34395
|
let cipherData = cipher.update(dataBuffer);
|
34649
34396
|
cipherData = Buffer.concat([cipherData, cipher.final()]);
|
34650
34397
|
return {
|
@@ -34658,7 +34405,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34658
34405
|
const salt = bufferFromString(keystore.salt);
|
34659
34406
|
const secret = keyFromPassword(password, salt);
|
34660
34407
|
const encryptedText = bufferFromString(keystore.data);
|
34661
|
-
const decipher = await
|
34408
|
+
const decipher = await import_crypto8.default.createDecipheriv(ALGORITHM, secret, iv);
|
34662
34409
|
const decrypted = decipher.update(encryptedText);
|
34663
34410
|
const deBuff = Buffer.concat([decrypted, decipher.final()]);
|
34664
34411
|
const decryptedData = Buffer.from(deBuff).toString("utf-8");
|
@@ -34669,12 +34416,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34669
34416
|
}
|
34670
34417
|
};
|
34671
34418
|
async function encryptJsonWalletData(data, key, iv) {
|
34672
|
-
const cipher = await
|
34419
|
+
const cipher = await import_crypto10.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
34673
34420
|
const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
|
34674
34421
|
return new Uint8Array(encrypted);
|
34675
34422
|
}
|
34676
34423
|
async function decryptJsonWalletData(data, key, iv) {
|
34677
|
-
const decipher =
|
34424
|
+
const decipher = import_crypto10.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
34678
34425
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
34679
34426
|
return new Uint8Array(decrypted);
|
34680
34427
|
}
|
@@ -35008,10 +34755,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35008
34755
|
}
|
35009
34756
|
};
|
35010
34757
|
|
35011
|
-
// ../address/dist/configs.mjs
|
35012
|
-
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
35013
|
-
var BaseAssetId = ZeroBytes32;
|
35014
|
-
|
35015
34758
|
// ../math/dist/index.mjs
|
35016
34759
|
var import_bn = __toESM(require_bn(), 1);
|
35017
34760
|
var DEFAULT_PRECISION = 9;
|
@@ -35231,182 +34974,32 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35231
34974
|
function toBytes3(value, bytesPadding) {
|
35232
34975
|
return bn(value).toBytes(bytesPadding);
|
35233
34976
|
}
|
35234
|
-
|
35235
|
-
|
35236
|
-
function _isPlaceholder(a) {
|
35237
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
35238
|
-
}
|
35239
|
-
|
35240
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
35241
|
-
function _curry1(fn) {
|
35242
|
-
return function f1(a) {
|
35243
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
35244
|
-
return f1;
|
35245
|
-
} else {
|
35246
|
-
return fn.apply(this, arguments);
|
35247
|
-
}
|
35248
|
-
};
|
35249
|
-
}
|
35250
|
-
|
35251
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
35252
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
35253
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
35254
|
-
};
|
35255
|
-
|
35256
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
35257
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
35258
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
35259
|
-
});
|
35260
|
-
var type_default = type;
|
35261
|
-
|
35262
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
35263
|
-
var pad = function pad2(n) {
|
35264
|
-
return (n < 10 ? "0" : "") + n;
|
35265
|
-
};
|
35266
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
35267
|
-
return d.toISOString();
|
35268
|
-
} : function _toISOString3(d) {
|
35269
|
-
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
|
35270
|
-
};
|
35271
|
-
|
35272
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
35273
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
35274
|
-
return n << 0 === n;
|
35275
|
-
};
|
35276
|
-
|
35277
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
35278
|
-
function _cloneRegExp(pattern) {
|
35279
|
-
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
35280
|
-
}
|
35281
|
-
|
35282
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
35283
|
-
function _clone(value, deep, map) {
|
35284
|
-
map || (map = new _ObjectMap());
|
35285
|
-
if (_isPrimitive(value)) {
|
35286
|
-
return value;
|
35287
|
-
}
|
35288
|
-
var copy = function copy2(copiedValue) {
|
35289
|
-
var cachedCopy = map.get(value);
|
35290
|
-
if (cachedCopy) {
|
35291
|
-
return cachedCopy;
|
35292
|
-
}
|
35293
|
-
map.set(value, copiedValue);
|
35294
|
-
for (var key in value) {
|
35295
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
35296
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
35297
|
-
}
|
35298
|
-
}
|
35299
|
-
return copiedValue;
|
35300
|
-
};
|
35301
|
-
switch (type_default(value)) {
|
35302
|
-
case "Object":
|
35303
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
35304
|
-
case "Array":
|
35305
|
-
return copy([]);
|
35306
|
-
case "Date":
|
35307
|
-
return new Date(value.valueOf());
|
35308
|
-
case "RegExp":
|
35309
|
-
return _cloneRegExp(value);
|
35310
|
-
case "Int8Array":
|
35311
|
-
case "Uint8Array":
|
35312
|
-
case "Uint8ClampedArray":
|
35313
|
-
case "Int16Array":
|
35314
|
-
case "Uint16Array":
|
35315
|
-
case "Int32Array":
|
35316
|
-
case "Uint32Array":
|
35317
|
-
case "Float32Array":
|
35318
|
-
case "Float64Array":
|
35319
|
-
case "BigInt64Array":
|
35320
|
-
case "BigUint64Array":
|
35321
|
-
return value.slice();
|
35322
|
-
default:
|
35323
|
-
return value;
|
35324
|
-
}
|
35325
|
-
}
|
35326
|
-
function _isPrimitive(param) {
|
35327
|
-
var type3 = typeof param;
|
35328
|
-
return param == null || type3 != "object" && type3 != "function";
|
34977
|
+
function max(...numbers) {
|
34978
|
+
return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
|
35329
34979
|
}
|
35330
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
35331
|
-
function _ObjectMap2() {
|
35332
|
-
this.map = {};
|
35333
|
-
this.length = 0;
|
35334
|
-
}
|
35335
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
35336
|
-
const hashedKey = this.hash(key);
|
35337
|
-
let bucket = this.map[hashedKey];
|
35338
|
-
if (!bucket) {
|
35339
|
-
this.map[hashedKey] = bucket = [];
|
35340
|
-
}
|
35341
|
-
bucket.push([key, value]);
|
35342
|
-
this.length += 1;
|
35343
|
-
};
|
35344
|
-
_ObjectMap2.prototype.hash = function(key) {
|
35345
|
-
let hashedKey = [];
|
35346
|
-
for (var value in key) {
|
35347
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
35348
|
-
}
|
35349
|
-
return hashedKey.join();
|
35350
|
-
};
|
35351
|
-
_ObjectMap2.prototype.get = function(key) {
|
35352
|
-
if (this.length <= 180) {
|
35353
|
-
for (const p in this.map) {
|
35354
|
-
const bucket2 = this.map[p];
|
35355
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
35356
|
-
const element = bucket2[i];
|
35357
|
-
if (element[0] === key) {
|
35358
|
-
return element[1];
|
35359
|
-
}
|
35360
|
-
}
|
35361
|
-
}
|
35362
|
-
return;
|
35363
|
-
}
|
35364
|
-
const hashedKey = this.hash(key);
|
35365
|
-
const bucket = this.map[hashedKey];
|
35366
|
-
if (!bucket) {
|
35367
|
-
return;
|
35368
|
-
}
|
35369
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
35370
|
-
const element = bucket[i];
|
35371
|
-
if (element[0] === key) {
|
35372
|
-
return element[1];
|
35373
|
-
}
|
35374
|
-
}
|
35375
|
-
};
|
35376
|
-
return _ObjectMap2;
|
35377
|
-
}();
|
35378
|
-
|
35379
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
35380
|
-
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
35381
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
35382
|
-
});
|
35383
|
-
var clone_default = clone;
|
35384
|
-
|
35385
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
35386
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
35387
34980
|
|
35388
34981
|
// src/providers/coin-quantity.ts
|
35389
34982
|
var coinQuantityfy = (coinQuantityLike) => {
|
35390
34983
|
let assetId;
|
35391
34984
|
let amount;
|
35392
|
-
let
|
34985
|
+
let max2;
|
35393
34986
|
if (Array.isArray(coinQuantityLike)) {
|
35394
34987
|
amount = coinQuantityLike[0];
|
35395
|
-
assetId = coinQuantityLike[1]
|
35396
|
-
|
34988
|
+
assetId = coinQuantityLike[1];
|
34989
|
+
max2 = coinQuantityLike[2];
|
35397
34990
|
} else {
|
35398
34991
|
amount = coinQuantityLike.amount;
|
35399
|
-
assetId = coinQuantityLike.assetId
|
35400
|
-
|
34992
|
+
assetId = coinQuantityLike.assetId;
|
34993
|
+
max2 = coinQuantityLike.max ?? void 0;
|
35401
34994
|
}
|
35402
34995
|
const bnAmount = bn(amount);
|
35403
34996
|
return {
|
35404
34997
|
assetId: hexlify(assetId),
|
35405
34998
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35406
|
-
max:
|
34999
|
+
max: max2 ? bn(max2) : void 0
|
35407
35000
|
};
|
35408
35001
|
};
|
35409
|
-
var
|
35002
|
+
var addAmountToAsset = (params) => {
|
35410
35003
|
const { amount, assetId } = params;
|
35411
35004
|
const coinQuantities = [...params.coinQuantities];
|
35412
35005
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35480,9 +35073,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35480
35073
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35481
35074
|
var MAX_BYTES = 2 ** 32 - 1;
|
35482
35075
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35483
|
-
|
35076
|
+
WORD_SIZE + // Tx size
|
35484
35077
|
// Asset ID/Balance coin input pairs
|
35485
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE)
|
35078
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35486
35079
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35487
35080
|
WORD_SIZE + // Gas limit
|
35488
35081
|
WORD_SIZE + // Script size
|
@@ -35500,6 +35093,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35500
35093
|
ASSET_ID_LEN + // Asset id
|
35501
35094
|
TX_POINTER_LEN + // TxPointer
|
35502
35095
|
WORD_SIZE + // Witnesses index
|
35096
|
+
WORD_SIZE + // Maturity
|
35503
35097
|
WORD_SIZE + // Predicate size
|
35504
35098
|
WORD_SIZE + // Predicate data size
|
35505
35099
|
WORD_SIZE;
|
@@ -35829,7 +35423,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35829
35423
|
constructor(name, coders) {
|
35830
35424
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35831
35425
|
const encodedValueSize = Object.values(coders).reduce(
|
35832
|
-
(
|
35426
|
+
(max2, coder) => Math.max(max2, coder.encodedLength),
|
35833
35427
|
0
|
35834
35428
|
);
|
35835
35429
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36516,7 +36110,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36516
36110
|
constructor(name, coders) {
|
36517
36111
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36518
36112
|
const encodedValueSize = Object.values(coders).reduce(
|
36519
|
-
(
|
36113
|
+
(max2, coder) => Math.max(max2, coder.encodedLength),
|
36520
36114
|
0
|
36521
36115
|
);
|
36522
36116
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -37239,19 +36833,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37239
36833
|
encode(value) {
|
37240
36834
|
const parts = [];
|
37241
36835
|
parts.push(new B256Coder().encode(value.txID));
|
37242
|
-
parts.push(new NumberCoder("
|
36836
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37243
36837
|
parts.push(new B256Coder().encode(value.owner));
|
37244
36838
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37245
36839
|
parts.push(new B256Coder().encode(value.assetId));
|
37246
36840
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
37247
|
-
parts.push(new NumberCoder("
|
36841
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
36842
|
+
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37248
36843
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37249
|
-
parts.push(new
|
37250
|
-
parts.push(new
|
37251
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37252
|
-
parts.push(
|
37253
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37254
|
-
);
|
36844
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36845
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
36846
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36847
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37255
36848
|
return concat(parts);
|
37256
36849
|
}
|
37257
36850
|
decode(data, offset) {
|
@@ -37259,7 +36852,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37259
36852
|
let o = offset;
|
37260
36853
|
[decoded, o] = new B256Coder().decode(data, o);
|
37261
36854
|
const txID = decoded;
|
37262
|
-
[decoded, o] = new NumberCoder("
|
36855
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37263
36856
|
const outputIndex = decoded;
|
37264
36857
|
[decoded, o] = new B256Coder().decode(data, o);
|
37265
36858
|
const owner = decoded;
|
@@ -37269,17 +36862,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37269
36862
|
const assetId = decoded;
|
37270
36863
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
37271
36864
|
const txPointer = decoded;
|
37272
|
-
[decoded, o] = new NumberCoder("
|
36865
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37273
36866
|
const witnessIndex = Number(decoded);
|
36867
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36868
|
+
const maturity = decoded;
|
37274
36869
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37275
36870
|
const predicateGasUsed = decoded;
|
37276
|
-
[decoded, o] = new
|
36871
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37277
36872
|
const predicateLength = decoded;
|
37278
|
-
[decoded, o] = new
|
36873
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37279
36874
|
const predicateDataLength = decoded;
|
37280
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
36875
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37281
36876
|
const predicate = decoded;
|
37282
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
36877
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37283
36878
|
const predicateData = decoded;
|
37284
36879
|
return [
|
37285
36880
|
{
|
@@ -37291,6 +36886,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37291
36886
|
assetId,
|
37292
36887
|
txPointer,
|
37293
36888
|
witnessIndex,
|
36889
|
+
maturity,
|
37294
36890
|
predicateGasUsed,
|
37295
36891
|
predicateLength,
|
37296
36892
|
predicateDataLength,
|
@@ -37308,7 +36904,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37308
36904
|
encode(value) {
|
37309
36905
|
const parts = [];
|
37310
36906
|
parts.push(new B256Coder().encode(value.txID));
|
37311
|
-
parts.push(new NumberCoder("
|
36907
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37312
36908
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
37313
36909
|
parts.push(new B256Coder().encode(value.stateRoot));
|
37314
36910
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -37320,7 +36916,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37320
36916
|
let o = offset;
|
37321
36917
|
[decoded, o] = new B256Coder().decode(data, o);
|
37322
36918
|
const txID = decoded;
|
37323
|
-
[decoded, o] = new NumberCoder("
|
36919
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37324
36920
|
const outputIndex = decoded;
|
37325
36921
|
[decoded, o] = new B256Coder().decode(data, o);
|
37326
36922
|
const balanceRoot = decoded;
|
@@ -37369,16 +36965,14 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37369
36965
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
37370
36966
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37371
36967
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
37372
|
-
parts.push(new NumberCoder("
|
36968
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
37373
36969
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37374
|
-
parts.push(new
|
37375
|
-
parts.push(new
|
37376
|
-
parts.push(new
|
36970
|
+
parts.push(new NumberCoder("u32").encode(data.length));
|
36971
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36972
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
37377
36973
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
37378
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37379
|
-
parts.push(
|
37380
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37381
|
-
);
|
36974
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36975
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37382
36976
|
return concat(parts);
|
37383
36977
|
}
|
37384
36978
|
static decodeData(messageData) {
|
@@ -37398,21 +36992,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37398
36992
|
const amount = decoded;
|
37399
36993
|
[decoded, o] = new B256Coder().decode(data, o);
|
37400
36994
|
const nonce = decoded;
|
37401
|
-
[decoded, o] = new NumberCoder("
|
36995
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37402
36996
|
const witnessIndex = Number(decoded);
|
37403
36997
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37404
36998
|
const predicateGasUsed = decoded;
|
37405
36999
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37406
37000
|
const dataLength2 = decoded;
|
37407
|
-
[decoded, o] = new
|
37001
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37408
37002
|
const predicateLength = decoded;
|
37409
|
-
[decoded, o] = new
|
37003
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37410
37004
|
const predicateDataLength = decoded;
|
37411
37005
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37412
37006
|
const messageData = decoded;
|
37413
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
37007
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37414
37008
|
const predicate = decoded;
|
37415
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
37009
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37416
37010
|
const predicateData = decoded;
|
37417
37011
|
return [
|
37418
37012
|
{
|
@@ -37724,7 +37318,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37724
37318
|
}
|
37725
37319
|
};
|
37726
37320
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37727
|
-
PolicyType2[PolicyType2["
|
37321
|
+
PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
|
37728
37322
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37729
37323
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37730
37324
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37772,9 +37366,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37772
37366
|
let o = offset;
|
37773
37367
|
const policies = [];
|
37774
37368
|
if (policyTypes & 1) {
|
37775
|
-
const [
|
37369
|
+
const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37776
37370
|
o = nextOffset;
|
37777
|
-
policies.push({ type: 1, data:
|
37371
|
+
policies.push({ type: 1, data: gasPrice });
|
37778
37372
|
}
|
37779
37373
|
if (policyTypes & 2) {
|
37780
37374
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -38006,15 +37600,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38006
37600
|
encode(value) {
|
38007
37601
|
const parts = [];
|
38008
37602
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
38009
|
-
parts.push(new
|
38010
|
-
parts.push(new
|
38011
|
-
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
37603
|
+
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37604
|
+
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
38012
37605
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38013
|
-
parts.push(new NumberCoder("
|
38014
|
-
parts.push(new NumberCoder("
|
38015
|
-
parts.push(new NumberCoder("
|
38016
|
-
parts.push(new
|
38017
|
-
parts.push(new ByteArrayCoder(value.
|
37606
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37607
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37608
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37609
|
+
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37610
|
+
parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
|
37611
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
|
38018
37612
|
parts.push(new PoliciesCoder().encode(value.policies));
|
38019
37613
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38020
37614
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -38026,23 +37620,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38026
37620
|
let o = offset;
|
38027
37621
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38028
37622
|
const scriptGasLimit = decoded;
|
38029
|
-
[decoded, o] = new
|
38030
|
-
const receiptsRoot = decoded;
|
38031
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37623
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38032
37624
|
const scriptLength = decoded;
|
38033
|
-
[decoded, o] = new
|
37625
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38034
37626
|
const scriptDataLength = decoded;
|
38035
37627
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38036
37628
|
const policyTypes = decoded;
|
38037
|
-
[decoded, o] = new NumberCoder("
|
37629
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38038
37630
|
const inputsCount = decoded;
|
38039
|
-
[decoded, o] = new NumberCoder("
|
37631
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38040
37632
|
const outputsCount = decoded;
|
38041
|
-
[decoded, o] = new NumberCoder("
|
37633
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38042
37634
|
const witnessesCount = decoded;
|
38043
|
-
[decoded, o] = new
|
37635
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37636
|
+
const receiptsRoot = decoded;
|
37637
|
+
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38044
37638
|
const script = decoded;
|
38045
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength
|
37639
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38046
37640
|
const scriptData = decoded;
|
38047
37641
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38048
37642
|
const policies = decoded;
|
@@ -38080,19 +37674,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38080
37674
|
}
|
38081
37675
|
encode(value) {
|
38082
37676
|
const parts = [];
|
38083
|
-
parts.push(new NumberCoder("
|
38084
|
-
parts.push(new
|
38085
|
-
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
37677
|
+
parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
|
37678
|
+
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
38086
37679
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38087
|
-
parts.push(new NumberCoder("u16").encode(value.
|
38088
|
-
parts.push(new NumberCoder("
|
38089
|
-
parts.push(new NumberCoder("
|
37680
|
+
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37681
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37682
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37683
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37684
|
+
parts.push(new B256Coder().encode(value.salt));
|
37685
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
38090
37686
|
parts.push(
|
38091
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount
|
38092
|
-
value.storageSlots
|
38093
|
-
)
|
37687
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
|
38094
37688
|
);
|
38095
|
-
parts.push(new PoliciesCoder().encode(value.policies));
|
38096
37689
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38097
37690
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
38098
37691
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -38101,27 +37694,26 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38101
37694
|
decode(data, offset) {
|
38102
37695
|
let decoded;
|
38103
37696
|
let o = offset;
|
38104
|
-
[decoded, o] = new NumberCoder("
|
37697
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37698
|
+
const bytecodeLength = decoded;
|
37699
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38105
37700
|
const bytecodeWitnessIndex = decoded;
|
38106
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38107
|
-
const salt = decoded;
|
38108
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38109
|
-
const storageSlotsCount = decoded;
|
38110
37701
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38111
37702
|
const policyTypes = decoded;
|
38112
37703
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37704
|
+
const storageSlotsCount = decoded;
|
37705
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38113
37706
|
const inputsCount = decoded;
|
38114
|
-
[decoded, o] = new NumberCoder("
|
37707
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38115
37708
|
const outputsCount = decoded;
|
38116
|
-
[decoded, o] = new NumberCoder("
|
37709
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38117
37710
|
const witnessesCount = decoded;
|
38118
|
-
[decoded, o] = new
|
38119
|
-
|
38120
|
-
o
|
38121
|
-
);
|
38122
|
-
const storageSlots = decoded;
|
37711
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37712
|
+
const salt = decoded;
|
38123
37713
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38124
37714
|
const policies = decoded;
|
37715
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37716
|
+
const storageSlots = decoded;
|
38125
37717
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
38126
37718
|
const inputs = decoded;
|
38127
37719
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -38131,6 +37723,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38131
37723
|
return [
|
38132
37724
|
{
|
38133
37725
|
type: 1,
|
37726
|
+
bytecodeLength,
|
38134
37727
|
bytecodeWitnessIndex,
|
38135
37728
|
policyTypes,
|
38136
37729
|
storageSlotsCount,
|
@@ -38159,7 +37752,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38159
37752
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
38160
37753
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
38161
37754
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38162
|
-
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
38163
37755
|
return concat(parts);
|
38164
37756
|
}
|
38165
37757
|
decode(data, offset) {
|
@@ -38175,8 +37767,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38175
37767
|
const mintAmount = decoded;
|
38176
37768
|
[decoded, o] = new B256Coder().decode(data, o);
|
38177
37769
|
const mintAssetId = decoded;
|
38178
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38179
|
-
const gasPrice = decoded;
|
38180
37770
|
return [
|
38181
37771
|
{
|
38182
37772
|
type: 2,
|
@@ -38184,8 +37774,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38184
37774
|
inputContract,
|
38185
37775
|
outputContract,
|
38186
37776
|
mintAmount,
|
38187
|
-
mintAssetId
|
38188
|
-
gasPrice
|
37777
|
+
mintAssetId
|
38189
37778
|
},
|
38190
37779
|
o
|
38191
37780
|
];
|
@@ -38492,6 +38081,159 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38492
38081
|
// src/providers/provider.ts
|
38493
38082
|
var import_graphql_request = __toESM(require_dist2());
|
38494
38083
|
|
38084
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38085
|
+
function _isPlaceholder(a) {
|
38086
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38087
|
+
}
|
38088
|
+
|
38089
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38090
|
+
function _curry1(fn) {
|
38091
|
+
return function f1(a) {
|
38092
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38093
|
+
return f1;
|
38094
|
+
} else {
|
38095
|
+
return fn.apply(this, arguments);
|
38096
|
+
}
|
38097
|
+
};
|
38098
|
+
}
|
38099
|
+
|
38100
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38101
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
38102
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38103
|
+
};
|
38104
|
+
|
38105
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38106
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38107
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38108
|
+
});
|
38109
|
+
var type_default = type;
|
38110
|
+
|
38111
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38112
|
+
var pad = function pad2(n) {
|
38113
|
+
return (n < 10 ? "0" : "") + n;
|
38114
|
+
};
|
38115
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38116
|
+
return d.toISOString();
|
38117
|
+
} : function _toISOString3(d) {
|
38118
|
+
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
|
38119
|
+
};
|
38120
|
+
|
38121
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38122
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38123
|
+
return n << 0 === n;
|
38124
|
+
};
|
38125
|
+
|
38126
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38127
|
+
function _cloneRegExp(pattern) {
|
38128
|
+
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
38129
|
+
}
|
38130
|
+
|
38131
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38132
|
+
function _clone(value, deep, map) {
|
38133
|
+
map || (map = new _ObjectMap());
|
38134
|
+
if (_isPrimitive(value)) {
|
38135
|
+
return value;
|
38136
|
+
}
|
38137
|
+
var copy = function copy2(copiedValue) {
|
38138
|
+
var cachedCopy = map.get(value);
|
38139
|
+
if (cachedCopy) {
|
38140
|
+
return cachedCopy;
|
38141
|
+
}
|
38142
|
+
map.set(value, copiedValue);
|
38143
|
+
for (var key in value) {
|
38144
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38145
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38146
|
+
}
|
38147
|
+
}
|
38148
|
+
return copiedValue;
|
38149
|
+
};
|
38150
|
+
switch (type_default(value)) {
|
38151
|
+
case "Object":
|
38152
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
38153
|
+
case "Array":
|
38154
|
+
return copy([]);
|
38155
|
+
case "Date":
|
38156
|
+
return new Date(value.valueOf());
|
38157
|
+
case "RegExp":
|
38158
|
+
return _cloneRegExp(value);
|
38159
|
+
case "Int8Array":
|
38160
|
+
case "Uint8Array":
|
38161
|
+
case "Uint8ClampedArray":
|
38162
|
+
case "Int16Array":
|
38163
|
+
case "Uint16Array":
|
38164
|
+
case "Int32Array":
|
38165
|
+
case "Uint32Array":
|
38166
|
+
case "Float32Array":
|
38167
|
+
case "Float64Array":
|
38168
|
+
case "BigInt64Array":
|
38169
|
+
case "BigUint64Array":
|
38170
|
+
return value.slice();
|
38171
|
+
default:
|
38172
|
+
return value;
|
38173
|
+
}
|
38174
|
+
}
|
38175
|
+
function _isPrimitive(param) {
|
38176
|
+
var type3 = typeof param;
|
38177
|
+
return param == null || type3 != "object" && type3 != "function";
|
38178
|
+
}
|
38179
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
38180
|
+
function _ObjectMap2() {
|
38181
|
+
this.map = {};
|
38182
|
+
this.length = 0;
|
38183
|
+
}
|
38184
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
38185
|
+
const hashedKey = this.hash(key);
|
38186
|
+
let bucket = this.map[hashedKey];
|
38187
|
+
if (!bucket) {
|
38188
|
+
this.map[hashedKey] = bucket = [];
|
38189
|
+
}
|
38190
|
+
bucket.push([key, value]);
|
38191
|
+
this.length += 1;
|
38192
|
+
};
|
38193
|
+
_ObjectMap2.prototype.hash = function(key) {
|
38194
|
+
let hashedKey = [];
|
38195
|
+
for (var value in key) {
|
38196
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38197
|
+
}
|
38198
|
+
return hashedKey.join();
|
38199
|
+
};
|
38200
|
+
_ObjectMap2.prototype.get = function(key) {
|
38201
|
+
if (this.length <= 180) {
|
38202
|
+
for (const p in this.map) {
|
38203
|
+
const bucket2 = this.map[p];
|
38204
|
+
for (let i = 0; i < bucket2.length; i += 1) {
|
38205
|
+
const element = bucket2[i];
|
38206
|
+
if (element[0] === key) {
|
38207
|
+
return element[1];
|
38208
|
+
}
|
38209
|
+
}
|
38210
|
+
}
|
38211
|
+
return;
|
38212
|
+
}
|
38213
|
+
const hashedKey = this.hash(key);
|
38214
|
+
const bucket = this.map[hashedKey];
|
38215
|
+
if (!bucket) {
|
38216
|
+
return;
|
38217
|
+
}
|
38218
|
+
for (let i = 0; i < bucket.length; i += 1) {
|
38219
|
+
const element = bucket[i];
|
38220
|
+
if (element[0] === key) {
|
38221
|
+
return element[1];
|
38222
|
+
}
|
38223
|
+
}
|
38224
|
+
};
|
38225
|
+
return _ObjectMap2;
|
38226
|
+
}();
|
38227
|
+
|
38228
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38229
|
+
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38230
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38231
|
+
});
|
38232
|
+
var clone_default = clone2;
|
38233
|
+
|
38234
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38235
|
+
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38236
|
+
|
38495
38237
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38496
38238
|
var __assign = function() {
|
38497
38239
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41659,10 +41401,14 @@ spurious results.`);
|
|
41659
41401
|
// src/providers/__generated__/operations.ts
|
41660
41402
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41661
41403
|
fragment receiptFragment on Receipt {
|
41662
|
-
|
41404
|
+
contract {
|
41405
|
+
id
|
41406
|
+
}
|
41663
41407
|
pc
|
41664
41408
|
is
|
41665
|
-
to
|
41409
|
+
to {
|
41410
|
+
id
|
41411
|
+
}
|
41666
41412
|
toAddress
|
41667
41413
|
amount
|
41668
41414
|
assetId
|
@@ -41700,16 +41446,10 @@ spurious results.`);
|
|
41700
41446
|
id
|
41701
41447
|
}
|
41702
41448
|
time
|
41703
|
-
receipts {
|
41704
|
-
...receiptFragment
|
41705
|
-
}
|
41706
41449
|
programState {
|
41707
41450
|
returnType
|
41708
41451
|
data
|
41709
41452
|
}
|
41710
|
-
receipts {
|
41711
|
-
...receiptFragment
|
41712
|
-
}
|
41713
41453
|
}
|
41714
41454
|
... on FailureStatus {
|
41715
41455
|
block {
|
@@ -41717,24 +41457,26 @@ spurious results.`);
|
|
41717
41457
|
}
|
41718
41458
|
time
|
41719
41459
|
reason
|
41720
|
-
receipts {
|
41721
|
-
...receiptFragment
|
41722
|
-
}
|
41723
41460
|
}
|
41724
41461
|
... on SqueezedOutStatus {
|
41725
41462
|
reason
|
41726
41463
|
}
|
41727
41464
|
}
|
41728
|
-
|
41465
|
+
`;
|
41729
41466
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41730
41467
|
fragment transactionFragment on Transaction {
|
41731
41468
|
id
|
41732
41469
|
rawPayload
|
41470
|
+
gasPrice
|
41471
|
+
receipts {
|
41472
|
+
...receiptFragment
|
41473
|
+
}
|
41733
41474
|
status {
|
41734
41475
|
...transactionStatusFragment
|
41735
41476
|
}
|
41736
41477
|
}
|
41737
|
-
${
|
41478
|
+
${ReceiptFragmentFragmentDoc}
|
41479
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41738
41480
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41739
41481
|
fragment inputEstimatePredicatesFragment on Input {
|
41740
41482
|
... on InputCoin {
|
@@ -41752,46 +41494,6 @@ spurious results.`);
|
|
41752
41494
|
}
|
41753
41495
|
}
|
41754
41496
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41755
|
-
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41756
|
-
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41757
|
-
reason
|
41758
|
-
programState {
|
41759
|
-
returnType
|
41760
|
-
data
|
41761
|
-
}
|
41762
|
-
}
|
41763
|
-
`;
|
41764
|
-
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41765
|
-
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41766
|
-
programState {
|
41767
|
-
returnType
|
41768
|
-
data
|
41769
|
-
}
|
41770
|
-
}
|
41771
|
-
`;
|
41772
|
-
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41773
|
-
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41774
|
-
... on DryRunFailureStatus {
|
41775
|
-
...dryRunFailureStatusFragment
|
41776
|
-
}
|
41777
|
-
... on DryRunSuccessStatus {
|
41778
|
-
...dryRunSuccessStatusFragment
|
41779
|
-
}
|
41780
|
-
}
|
41781
|
-
${DryRunFailureStatusFragmentFragmentDoc}
|
41782
|
-
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41783
|
-
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41784
|
-
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41785
|
-
id
|
41786
|
-
status {
|
41787
|
-
...dryRunTransactionStatusFragment
|
41788
|
-
}
|
41789
|
-
receipts {
|
41790
|
-
...receiptFragment
|
41791
|
-
}
|
41792
|
-
}
|
41793
|
-
${DryRunTransactionStatusFragmentFragmentDoc}
|
41794
|
-
${ReceiptFragmentFragmentDoc}`;
|
41795
41497
|
var CoinFragmentFragmentDoc = lib_default2`
|
41796
41498
|
fragment coinFragment on Coin {
|
41797
41499
|
__typename
|
@@ -41799,6 +41501,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41799
41501
|
owner
|
41800
41502
|
amount
|
41801
41503
|
assetId
|
41504
|
+
maturity
|
41802
41505
|
blockCreated
|
41803
41506
|
txCreatedIdx
|
41804
41507
|
}
|
@@ -41843,6 +41546,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41843
41546
|
prevRoot
|
41844
41547
|
time
|
41845
41548
|
applicationHash
|
41549
|
+
messageReceiptRoot
|
41846
41550
|
messageReceiptCount
|
41847
41551
|
}
|
41848
41552
|
commitBlockHeader {
|
@@ -41854,6 +41558,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41854
41558
|
prevRoot
|
41855
41559
|
time
|
41856
41560
|
applicationHash
|
41561
|
+
messageReceiptRoot
|
41857
41562
|
messageReceiptCount
|
41858
41563
|
}
|
41859
41564
|
sender
|
@@ -41873,8 +41578,8 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41873
41578
|
var BlockFragmentFragmentDoc = lib_default2`
|
41874
41579
|
fragment blockFragment on Block {
|
41875
41580
|
id
|
41876
|
-
height
|
41877
41581
|
header {
|
41582
|
+
height
|
41878
41583
|
time
|
41879
41584
|
}
|
41880
41585
|
transactions {
|
@@ -41932,11 +41637,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41932
41637
|
`;
|
41933
41638
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41934
41639
|
fragment GasCostsFragment on GasCosts {
|
41935
|
-
version {
|
41936
|
-
... on Version {
|
41937
|
-
value
|
41938
|
-
}
|
41939
|
-
}
|
41940
41640
|
add
|
41941
41641
|
addi
|
41942
41642
|
aloc
|
@@ -41949,6 +41649,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41949
41649
|
cb
|
41950
41650
|
cfei
|
41951
41651
|
cfsi
|
41652
|
+
croo
|
41952
41653
|
div
|
41953
41654
|
divi
|
41954
41655
|
ecr1
|
@@ -42031,9 +41732,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42031
41732
|
ccp {
|
42032
41733
|
...DependentCostFragment
|
42033
41734
|
}
|
42034
|
-
croo {
|
42035
|
-
...DependentCostFragment
|
42036
|
-
}
|
42037
41735
|
csiz {
|
42038
41736
|
...DependentCostFragment
|
42039
41737
|
}
|
@@ -42093,11 +41791,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42093
41791
|
${DependentCostFragmentFragmentDoc}`;
|
42094
41792
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
42095
41793
|
fragment consensusParametersFragment on ConsensusParameters {
|
42096
|
-
version {
|
42097
|
-
... on Version {
|
42098
|
-
value
|
42099
|
-
}
|
42100
|
-
}
|
42101
41794
|
txParams {
|
42102
41795
|
...TxParametersFragment
|
42103
41796
|
}
|
@@ -42157,9 +41850,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42157
41850
|
fragment nodeInfoFragment on NodeInfo {
|
42158
41851
|
utxoValidation
|
42159
41852
|
vmBacktrace
|
41853
|
+
minGasPrice
|
42160
41854
|
maxTx
|
42161
41855
|
maxDepth
|
42162
41856
|
nodeVersion
|
41857
|
+
peers {
|
41858
|
+
id
|
41859
|
+
addresses
|
41860
|
+
clientVersion
|
41861
|
+
blockHeight
|
41862
|
+
lastHeartbeatMs
|
41863
|
+
appScore
|
41864
|
+
}
|
42163
41865
|
}
|
42164
41866
|
`;
|
42165
41867
|
var GetVersionDocument = lib_default2`
|
@@ -42194,9 +41896,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42194
41896
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
42195
41897
|
transaction(id: $transactionId) {
|
42196
41898
|
...transactionFragment
|
41899
|
+
receipts {
|
41900
|
+
...receiptFragment
|
41901
|
+
}
|
42197
41902
|
}
|
42198
41903
|
}
|
42199
|
-
${TransactionFragmentFragmentDoc}
|
41904
|
+
${TransactionFragmentFragmentDoc}
|
41905
|
+
${ReceiptFragmentFragmentDoc}`;
|
42200
41906
|
var GetTransactionsDocument = lib_default2`
|
42201
41907
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
42202
41908
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42324,20 +42030,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42324
42030
|
}
|
42325
42031
|
}
|
42326
42032
|
${BalanceFragmentFragmentDoc}`;
|
42327
|
-
var GetLatestGasPriceDocument = lib_default2`
|
42328
|
-
query getLatestGasPrice {
|
42329
|
-
latestGasPrice {
|
42330
|
-
gasPrice
|
42331
|
-
}
|
42332
|
-
}
|
42333
|
-
`;
|
42334
|
-
var EstimateGasPriceDocument = lib_default2`
|
42335
|
-
query estimateGasPrice($blockHorizon: U32!) {
|
42336
|
-
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42337
|
-
gasPrice
|
42338
|
-
}
|
42339
|
-
}
|
42340
|
-
`;
|
42341
42033
|
var GetBalancesDocument = lib_default2`
|
42342
42034
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42343
42035
|
balances(
|
@@ -42392,12 +42084,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42392
42084
|
}
|
42393
42085
|
`;
|
42394
42086
|
var DryRunDocument = lib_default2`
|
42395
|
-
mutation dryRun($
|
42396
|
-
dryRun(
|
42397
|
-
...
|
42087
|
+
mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
|
42088
|
+
dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
|
42089
|
+
...receiptFragment
|
42398
42090
|
}
|
42399
42091
|
}
|
42400
|
-
${
|
42092
|
+
${ReceiptFragmentFragmentDoc}`;
|
42401
42093
|
var SubmitDocument = lib_default2`
|
42402
42094
|
mutation submit($encodedTransaction: HexString!) {
|
42403
42095
|
submit(tx: $encodedTransaction) {
|
@@ -42480,12 +42172,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42480
42172
|
getBalance(variables, options) {
|
42481
42173
|
return requester(GetBalanceDocument, variables, options);
|
42482
42174
|
},
|
42483
|
-
getLatestGasPrice(variables, options) {
|
42484
|
-
return requester(GetLatestGasPriceDocument, variables, options);
|
42485
|
-
},
|
42486
|
-
estimateGasPrice(variables, options) {
|
42487
|
-
return requester(EstimateGasPriceDocument, variables, options);
|
42488
|
-
},
|
42489
42175
|
getBalances(variables, options) {
|
42490
42176
|
return requester(GetBalancesDocument, variables, options);
|
42491
42177
|
},
|
@@ -42557,9 +42243,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42557
42243
|
} catch (e) {
|
42558
42244
|
throw new FuelError(
|
42559
42245
|
ErrorCode.STREAM_PARSING_ERROR,
|
42560
|
-
`Error while parsing stream data response: ${text}
|
42561
|
-
|
42562
|
-
Thrown error: ${e}`
|
42246
|
+
`Error while parsing stream data response: ${text}`
|
42563
42247
|
);
|
42564
42248
|
}
|
42565
42249
|
if (Array.isArray(errors)) {
|
@@ -42643,6 +42327,9 @@ Thrown error: ${e}`
|
|
42643
42327
|
}
|
42644
42328
|
};
|
42645
42329
|
|
42330
|
+
// ../address/dist/configs.mjs
|
42331
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42332
|
+
|
42646
42333
|
// src/providers/transaction-request/input.ts
|
42647
42334
|
var inputify = (value) => {
|
42648
42335
|
const { type: type3 } = value;
|
@@ -42653,7 +42340,7 @@ Thrown error: ${e}`
|
|
42653
42340
|
return {
|
42654
42341
|
type: InputType.Coin,
|
42655
42342
|
txID: hexlify(arrayify(value.id).slice(0, 32)),
|
42656
|
-
outputIndex:
|
42343
|
+
outputIndex: arrayify(value.id)[32],
|
42657
42344
|
owner: hexlify(value.owner),
|
42658
42345
|
amount: bn(value.amount),
|
42659
42346
|
assetId: hexlify(value.assetId),
|
@@ -42662,9 +42349,10 @@ Thrown error: ${e}`
|
|
42662
42349
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42663
42350
|
},
|
42664
42351
|
witnessIndex: value.witnessIndex,
|
42352
|
+
maturity: value.maturity ?? 0,
|
42665
42353
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42666
|
-
predicateLength:
|
42667
|
-
predicateDataLength:
|
42354
|
+
predicateLength: predicate.length,
|
42355
|
+
predicateDataLength: predicateData.length,
|
42668
42356
|
predicate: hexlify(predicate),
|
42669
42357
|
predicateData: hexlify(predicateData)
|
42670
42358
|
};
|
@@ -42695,8 +42383,8 @@ Thrown error: ${e}`
|
|
42695
42383
|
nonce: hexlify(value.nonce),
|
42696
42384
|
witnessIndex: value.witnessIndex,
|
42697
42385
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42698
|
-
predicateLength:
|
42699
|
-
predicateDataLength:
|
42386
|
+
predicateLength: predicate.length,
|
42387
|
+
predicateDataLength: predicateData.length,
|
42700
42388
|
predicate: hexlify(predicate),
|
42701
42389
|
predicateData: hexlify(predicateData),
|
42702
42390
|
data: hexlify(data),
|
@@ -42853,8 +42541,8 @@ Thrown error: ${e}`
|
|
42853
42541
|
case "CALL" /* Call */: {
|
42854
42542
|
const callReceipt = {
|
42855
42543
|
type: ReceiptType.Call,
|
42856
|
-
from: hexOrZero(receipt.id
|
42857
|
-
to: hexOrZero(receipt?.to),
|
42544
|
+
from: hexOrZero(receipt.contract?.id),
|
42545
|
+
to: hexOrZero(receipt?.to?.id),
|
42858
42546
|
amount: bn(receipt.amount),
|
42859
42547
|
assetId: hexOrZero(receipt.assetId),
|
42860
42548
|
gas: bn(receipt.gas),
|
@@ -42868,7 +42556,7 @@ Thrown error: ${e}`
|
|
42868
42556
|
case "RETURN" /* Return */: {
|
42869
42557
|
const returnReceipt = {
|
42870
42558
|
type: ReceiptType.Return,
|
42871
|
-
id: hexOrZero(receipt.id
|
42559
|
+
id: hexOrZero(receipt.contract?.id),
|
42872
42560
|
val: bn(receipt.val),
|
42873
42561
|
pc: bn(receipt.pc),
|
42874
42562
|
is: bn(receipt.is)
|
@@ -42878,7 +42566,7 @@ Thrown error: ${e}`
|
|
42878
42566
|
case "RETURN_DATA" /* ReturnData */: {
|
42879
42567
|
const returnDataReceipt = {
|
42880
42568
|
type: ReceiptType.ReturnData,
|
42881
|
-
id: hexOrZero(receipt.id
|
42569
|
+
id: hexOrZero(receipt.contract?.id),
|
42882
42570
|
ptr: bn(receipt.ptr),
|
42883
42571
|
len: bn(receipt.len),
|
42884
42572
|
digest: hexOrZero(receipt.digest),
|
@@ -42890,7 +42578,7 @@ Thrown error: ${e}`
|
|
42890
42578
|
case "PANIC" /* Panic */: {
|
42891
42579
|
const panicReceipt = {
|
42892
42580
|
type: ReceiptType.Panic,
|
42893
|
-
id: hexOrZero(receipt.id),
|
42581
|
+
id: hexOrZero(receipt.contract?.id),
|
42894
42582
|
reason: bn(receipt.reason),
|
42895
42583
|
pc: bn(receipt.pc),
|
42896
42584
|
is: bn(receipt.is),
|
@@ -42901,7 +42589,7 @@ Thrown error: ${e}`
|
|
42901
42589
|
case "REVERT" /* Revert */: {
|
42902
42590
|
const revertReceipt = {
|
42903
42591
|
type: ReceiptType.Revert,
|
42904
|
-
id: hexOrZero(receipt.id
|
42592
|
+
id: hexOrZero(receipt.contract?.id),
|
42905
42593
|
val: bn(receipt.ra),
|
42906
42594
|
pc: bn(receipt.pc),
|
42907
42595
|
is: bn(receipt.is)
|
@@ -42911,7 +42599,7 @@ Thrown error: ${e}`
|
|
42911
42599
|
case "LOG" /* Log */: {
|
42912
42600
|
const logReceipt = {
|
42913
42601
|
type: ReceiptType.Log,
|
42914
|
-
id: hexOrZero(receipt.id
|
42602
|
+
id: hexOrZero(receipt.contract?.id),
|
42915
42603
|
val0: bn(receipt.ra),
|
42916
42604
|
val1: bn(receipt.rb),
|
42917
42605
|
val2: bn(receipt.rc),
|
@@ -42924,7 +42612,7 @@ Thrown error: ${e}`
|
|
42924
42612
|
case "LOG_DATA" /* LogData */: {
|
42925
42613
|
const logDataReceipt = {
|
42926
42614
|
type: ReceiptType.LogData,
|
42927
|
-
id: hexOrZero(receipt.id
|
42615
|
+
id: hexOrZero(receipt.contract?.id),
|
42928
42616
|
val0: bn(receipt.ra),
|
42929
42617
|
val1: bn(receipt.rb),
|
42930
42618
|
ptr: bn(receipt.ptr),
|
@@ -42938,8 +42626,8 @@ Thrown error: ${e}`
|
|
42938
42626
|
case "TRANSFER" /* Transfer */: {
|
42939
42627
|
const transferReceipt = {
|
42940
42628
|
type: ReceiptType.Transfer,
|
42941
|
-
from: hexOrZero(receipt.id
|
42942
|
-
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42629
|
+
from: hexOrZero(receipt.contract?.id),
|
42630
|
+
to: hexOrZero(receipt.toAddress || receipt?.to?.id),
|
42943
42631
|
amount: bn(receipt.amount),
|
42944
42632
|
assetId: hexOrZero(receipt.assetId),
|
42945
42633
|
pc: bn(receipt.pc),
|
@@ -42950,8 +42638,8 @@ Thrown error: ${e}`
|
|
42950
42638
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42951
42639
|
const transferOutReceipt = {
|
42952
42640
|
type: ReceiptType.TransferOut,
|
42953
|
-
from: hexOrZero(receipt.id
|
42954
|
-
to: hexOrZero(receipt.toAddress || receipt.to),
|
42641
|
+
from: hexOrZero(receipt.contract?.id),
|
42642
|
+
to: hexOrZero(receipt.toAddress || receipt.to?.id),
|
42955
42643
|
amount: bn(receipt.amount),
|
42956
42644
|
assetId: hexOrZero(receipt.assetId),
|
42957
42645
|
pc: bn(receipt.pc),
|
@@ -42994,7 +42682,7 @@ Thrown error: ${e}`
|
|
42994
42682
|
return receiptMessageOut;
|
42995
42683
|
}
|
42996
42684
|
case "MINT" /* Mint */: {
|
42997
|
-
const contractId = hexOrZero(receipt.id
|
42685
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
42998
42686
|
const subId = hexOrZero(receipt.subId);
|
42999
42687
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
43000
42688
|
const mintReceipt = {
|
@@ -43009,7 +42697,7 @@ Thrown error: ${e}`
|
|
43009
42697
|
return mintReceipt;
|
43010
42698
|
}
|
43011
42699
|
case "BURN" /* Burn */: {
|
43012
|
-
const contractId = hexOrZero(receipt.id
|
42700
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
43013
42701
|
const subId = hexOrZero(receipt.subId);
|
43014
42702
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
43015
42703
|
const burnReceipt = {
|
@@ -43029,6 +42717,7 @@ Thrown error: ${e}`
|
|
43029
42717
|
}
|
43030
42718
|
|
43031
42719
|
// src/providers/utils/gas.ts
|
42720
|
+
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
43032
42721
|
var getGasUsedFromReceipts = (receipts) => {
|
43033
42722
|
const scriptResult = receipts.filter(
|
43034
42723
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -43049,28 +42738,18 @@ Thrown error: ${e}`
|
|
43049
42738
|
}
|
43050
42739
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
43051
42740
|
const witnessCache = [];
|
43052
|
-
const
|
43053
|
-
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43054
|
-
if (isCoinOrMessage) {
|
43055
|
-
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43056
|
-
return true;
|
43057
|
-
}
|
43058
|
-
if (!witnessCache.includes(input.witnessIndex)) {
|
43059
|
-
witnessCache.push(input.witnessIndex);
|
43060
|
-
return true;
|
43061
|
-
}
|
43062
|
-
}
|
43063
|
-
return false;
|
43064
|
-
});
|
43065
|
-
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43066
|
-
const totalGas = chargeableInputs.reduce((total, input) => {
|
42741
|
+
const totalGas = inputs.reduce((total, input) => {
|
43067
42742
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43068
42743
|
return total.add(
|
43069
|
-
|
42744
|
+
resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
43070
42745
|
);
|
43071
42746
|
}
|
43072
|
-
|
43073
|
-
|
42747
|
+
if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
|
42748
|
+
witnessCache.push(input.witnessIndex);
|
42749
|
+
return total.add(gasCosts.ecr1);
|
42750
|
+
}
|
42751
|
+
return total;
|
42752
|
+
}, bn());
|
43074
42753
|
return totalGas;
|
43075
42754
|
}
|
43076
42755
|
function getMinGas(params) {
|
@@ -43082,20 +42761,12 @@ Thrown error: ${e}`
|
|
43082
42761
|
return minGas;
|
43083
42762
|
}
|
43084
42763
|
function getMaxGas(params) {
|
43085
|
-
const {
|
43086
|
-
gasPerByte,
|
43087
|
-
witnessesLength,
|
43088
|
-
witnessLimit,
|
43089
|
-
minGas,
|
43090
|
-
gasLimit = bn(0),
|
43091
|
-
maxGasPerTx
|
43092
|
-
} = params;
|
42764
|
+
const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
|
43093
42765
|
let remainingAllowedWitnessGas = bn(0);
|
43094
42766
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
43095
42767
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
43096
42768
|
}
|
43097
|
-
|
43098
|
-
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42769
|
+
return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43099
42770
|
}
|
43100
42771
|
function calculateMetadataGasForTxCreate({
|
43101
42772
|
gasCosts,
|
@@ -43117,10 +42788,6 @@ Thrown error: ${e}`
|
|
43117
42788
|
}) {
|
43118
42789
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
43119
42790
|
}
|
43120
|
-
var calculateGasFee = (params) => {
|
43121
|
-
const { gas, gasPrice, priceFactor, tip } = params;
|
43122
|
-
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43123
|
-
};
|
43124
42791
|
|
43125
42792
|
// src/providers/utils/json.ts
|
43126
42793
|
function normalize2(object) {
|
@@ -43250,7 +42917,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43250
42917
|
// src/providers/transaction-request/transaction-request.ts
|
43251
42918
|
var BaseTransactionRequest = class {
|
43252
42919
|
/** Gas price for transaction */
|
43253
|
-
|
42920
|
+
gasPrice;
|
43254
42921
|
/** Block until which tx cannot be included */
|
43255
42922
|
maturity;
|
43256
42923
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -43263,34 +42930,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43263
42930
|
outputs = [];
|
43264
42931
|
/** List of witnesses */
|
43265
42932
|
witnesses = [];
|
42933
|
+
/** Base asset ID - should be fetched from the chain */
|
42934
|
+
baseAssetId = ZeroBytes32;
|
43266
42935
|
/**
|
43267
42936
|
* Constructor for initializing a base transaction request.
|
43268
42937
|
*
|
43269
42938
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
43270
42939
|
*/
|
43271
42940
|
constructor({
|
43272
|
-
|
42941
|
+
gasPrice,
|
43273
42942
|
maturity,
|
43274
42943
|
maxFee,
|
43275
42944
|
witnessLimit,
|
43276
42945
|
inputs,
|
43277
42946
|
outputs,
|
43278
|
-
witnesses
|
42947
|
+
witnesses,
|
42948
|
+
baseAssetId
|
43279
42949
|
} = {}) {
|
43280
|
-
this.
|
42950
|
+
this.gasPrice = bn(gasPrice);
|
43281
42951
|
this.maturity = maturity ?? 0;
|
43282
42952
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
43283
42953
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
43284
42954
|
this.inputs = inputs ?? [];
|
43285
42955
|
this.outputs = outputs ?? [];
|
43286
42956
|
this.witnesses = witnesses ?? [];
|
42957
|
+
this.baseAssetId = baseAssetId ?? ZeroBytes32;
|
43287
42958
|
}
|
43288
42959
|
static getPolicyMeta(req) {
|
43289
42960
|
let policyTypes = 0;
|
43290
42961
|
const policies = [];
|
43291
|
-
if (req.
|
43292
|
-
policyTypes += PolicyType.
|
43293
|
-
policies.push({ data: req.
|
42962
|
+
if (req.gasPrice) {
|
42963
|
+
policyTypes += PolicyType.GasPrice;
|
42964
|
+
policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
|
43294
42965
|
}
|
43295
42966
|
if (req.witnessLimit) {
|
43296
42967
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43477,10 +43148,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43477
43148
|
* @param predicate - Predicate bytes.
|
43478
43149
|
* @param predicateData - Predicate data bytes.
|
43479
43150
|
*/
|
43480
|
-
addCoinInput(coin) {
|
43151
|
+
addCoinInput(coin, predicate) {
|
43481
43152
|
const { assetId, owner, amount } = coin;
|
43482
43153
|
let witnessIndex;
|
43483
|
-
if (
|
43154
|
+
if (predicate) {
|
43484
43155
|
witnessIndex = 0;
|
43485
43156
|
} else {
|
43486
43157
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43495,7 +43166,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43495
43166
|
amount,
|
43496
43167
|
assetId,
|
43497
43168
|
txPointer: "0x00000000000000000000000000000000",
|
43498
|
-
witnessIndex
|
43169
|
+
witnessIndex,
|
43170
|
+
predicate: predicate?.bytes,
|
43171
|
+
predicateData: predicate?.predicateDataBytes
|
43499
43172
|
};
|
43500
43173
|
this.pushInput(input);
|
43501
43174
|
this.addChangeOutput(owner, assetId);
|
@@ -43506,13 +43179,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43506
43179
|
*
|
43507
43180
|
* @param message - Message resource.
|
43508
43181
|
* @param predicate - Predicate bytes.
|
43509
|
-
* @param predicateData - Predicate data bytes.
|
43510
43182
|
*/
|
43511
|
-
addMessageInput(message) {
|
43183
|
+
addMessageInput(message, predicate) {
|
43512
43184
|
const { recipient, sender, amount } = message;
|
43513
|
-
const assetId = BaseAssetId;
|
43514
43185
|
let witnessIndex;
|
43515
|
-
if (
|
43186
|
+
if (predicate) {
|
43516
43187
|
witnessIndex = 0;
|
43517
43188
|
} else {
|
43518
43189
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43526,10 +43197,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43526
43197
|
sender: sender.toB256(),
|
43527
43198
|
recipient: recipient.toB256(),
|
43528
43199
|
amount,
|
43529
|
-
witnessIndex
|
43200
|
+
witnessIndex,
|
43201
|
+
predicate: predicate?.bytes,
|
43202
|
+
predicateData: predicate?.predicateDataBytes
|
43530
43203
|
};
|
43531
43204
|
this.pushInput(input);
|
43532
|
-
this.addChangeOutput(recipient,
|
43205
|
+
this.addChangeOutput(recipient, this.baseAssetId);
|
43533
43206
|
}
|
43534
43207
|
/**
|
43535
43208
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -43557,6 +43230,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43557
43230
|
resources.forEach((resource) => this.addResource(resource));
|
43558
43231
|
return this;
|
43559
43232
|
}
|
43233
|
+
/**
|
43234
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43235
|
+
* outputs from the related assetIds.
|
43236
|
+
*
|
43237
|
+
* @param resources - The resources to add.
|
43238
|
+
* @returns This transaction.
|
43239
|
+
*/
|
43240
|
+
addPredicateResource(resource, predicate) {
|
43241
|
+
if (isCoin(resource)) {
|
43242
|
+
this.addCoinInput(resource, predicate);
|
43243
|
+
} else {
|
43244
|
+
this.addMessageInput(resource, predicate);
|
43245
|
+
}
|
43246
|
+
return this;
|
43247
|
+
}
|
43248
|
+
/**
|
43249
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43250
|
+
* from the related assetIds.
|
43251
|
+
*
|
43252
|
+
* @param resources - The resources to add.
|
43253
|
+
* @returns This transaction.
|
43254
|
+
*/
|
43255
|
+
addPredicateResources(resources, predicate) {
|
43256
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43257
|
+
return this;
|
43258
|
+
}
|
43560
43259
|
/**
|
43561
43260
|
* Adds a coin output to the transaction.
|
43562
43261
|
*
|
@@ -43564,12 +43263,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43564
43263
|
* @param amount - Amount of coin.
|
43565
43264
|
* @param assetId - Asset ID of coin.
|
43566
43265
|
*/
|
43567
|
-
addCoinOutput(to, amount, assetId
|
43266
|
+
addCoinOutput(to, amount, assetId) {
|
43568
43267
|
this.pushOutput({
|
43569
43268
|
type: OutputType.Coin,
|
43570
43269
|
to: addressify(to).toB256(),
|
43571
43270
|
amount,
|
43572
|
-
assetId
|
43271
|
+
assetId: assetId ?? this.baseAssetId
|
43573
43272
|
});
|
43574
43273
|
return this;
|
43575
43274
|
}
|
@@ -43596,7 +43295,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43596
43295
|
* @param to - Address of the owner.
|
43597
43296
|
* @param assetId - Asset ID of coin.
|
43598
43297
|
*/
|
43599
|
-
addChangeOutput(to, assetId
|
43298
|
+
addChangeOutput(to, assetId) {
|
43600
43299
|
const changeOutput = this.getChangeOutputs().find(
|
43601
43300
|
(output3) => hexlify(output3.assetId) === assetId
|
43602
43301
|
);
|
@@ -43604,7 +43303,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43604
43303
|
this.pushOutput({
|
43605
43304
|
type: OutputType.Change,
|
43606
43305
|
to: addressify(to).toB256(),
|
43607
|
-
assetId
|
43306
|
+
assetId: assetId ?? this.baseAssetId
|
43608
43307
|
});
|
43609
43308
|
}
|
43610
43309
|
}
|
@@ -43636,7 +43335,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43636
43335
|
}
|
43637
43336
|
calculateMaxGas(chainInfo, minGas) {
|
43638
43337
|
const { consensusParameters } = chainInfo;
|
43639
|
-
const { gasPerByte
|
43338
|
+
const { gasPerByte } = consensusParameters;
|
43640
43339
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43641
43340
|
(acc, wit) => acc + wit.dataLength,
|
43642
43341
|
0
|
@@ -43645,8 +43344,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43645
43344
|
gasPerByte,
|
43646
43345
|
minGas,
|
43647
43346
|
witnessesLength,
|
43648
|
-
witnessLimit: this.witnessLimit
|
43649
|
-
maxGasPerTx
|
43347
|
+
witnessLimit: this.witnessLimit
|
43650
43348
|
});
|
43651
43349
|
}
|
43652
43350
|
/**
|
@@ -43656,6 +43354,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43656
43354
|
* @param quantities - CoinQuantity Array.
|
43657
43355
|
*/
|
43658
43356
|
fundWithFakeUtxos(quantities, resourcesOwner) {
|
43357
|
+
let idCounter = 0;
|
43358
|
+
const generateId = () => {
|
43359
|
+
const counterString = String(idCounter++);
|
43360
|
+
const id = ZeroBytes32.slice(0, -counterString.length).concat(counterString);
|
43361
|
+
return id;
|
43362
|
+
};
|
43659
43363
|
const findAssetInput = (assetId) => this.inputs.find((input) => {
|
43660
43364
|
if ("assetId" in input) {
|
43661
43365
|
return input.assetId === assetId;
|
@@ -43664,27 +43368,24 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43664
43368
|
});
|
43665
43369
|
const updateAssetInput = (assetId, quantity) => {
|
43666
43370
|
const assetInput = findAssetInput(assetId);
|
43667
|
-
let usedQuantity = quantity;
|
43668
|
-
if (assetId === BaseAssetId) {
|
43669
|
-
usedQuantity = bn("1000000000000000000");
|
43670
|
-
}
|
43671
43371
|
if (assetInput && "assetId" in assetInput) {
|
43672
|
-
assetInput.id =
|
43673
|
-
assetInput.amount =
|
43372
|
+
assetInput.id = generateId();
|
43373
|
+
assetInput.amount = quantity;
|
43674
43374
|
} else {
|
43675
43375
|
this.addResources([
|
43676
43376
|
{
|
43677
|
-
id:
|
43678
|
-
amount:
|
43377
|
+
id: generateId(),
|
43378
|
+
amount: quantity,
|
43679
43379
|
assetId,
|
43680
43380
|
owner: resourcesOwner || Address.fromRandom(),
|
43381
|
+
maturity: 0,
|
43681
43382
|
blockCreated: bn(1),
|
43682
43383
|
txCreatedIdx: bn(1)
|
43683
43384
|
}
|
43684
43385
|
]);
|
43685
43386
|
}
|
43686
43387
|
};
|
43687
|
-
updateAssetInput(
|
43388
|
+
updateAssetInput(this.baseAssetId, bn(1e11));
|
43688
43389
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43689
43390
|
}
|
43690
43391
|
/**
|
@@ -43709,7 +43410,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43709
43410
|
toJSON() {
|
43710
43411
|
return normalizeJSON(this);
|
43711
43412
|
}
|
43712
|
-
|
43413
|
+
updatePredicateInputs(inputs) {
|
43713
43414
|
this.inputs.forEach((i) => {
|
43714
43415
|
let correspondingInput;
|
43715
43416
|
switch (i.type) {
|
@@ -43731,15 +43432,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43731
43432
|
}
|
43732
43433
|
});
|
43733
43434
|
}
|
43734
|
-
shiftPredicateData() {
|
43735
|
-
this.inputs.forEach((input) => {
|
43736
|
-
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43737
|
-
input.predicateData = input.paddPredicateData(
|
43738
|
-
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43739
|
-
);
|
43740
|
-
}
|
43741
|
-
});
|
43742
|
-
}
|
43743
43435
|
};
|
43744
43436
|
|
43745
43437
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43873,8 +43565,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43873
43565
|
return {
|
43874
43566
|
type: TransactionType.Create,
|
43875
43567
|
...baseTransaction,
|
43568
|
+
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43876
43569
|
bytecodeWitnessIndex,
|
43877
|
-
storageSlotsCount:
|
43570
|
+
storageSlotsCount: storageSlots.length,
|
43878
43571
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43879
43572
|
storageSlots
|
43880
43573
|
};
|
@@ -43988,8 +43681,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43988
43681
|
type: TransactionType.Script,
|
43989
43682
|
scriptGasLimit: this.gasLimit,
|
43990
43683
|
...super.getBaseTransaction(),
|
43991
|
-
scriptLength:
|
43992
|
-
scriptDataLength:
|
43684
|
+
scriptLength: script.length,
|
43685
|
+
scriptDataLength: scriptData.length,
|
43993
43686
|
receiptsRoot: ZeroBytes32,
|
43994
43687
|
script: hexlify(script),
|
43995
43688
|
scriptData: hexlify(scriptData)
|
@@ -44053,7 +43746,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44053
43746
|
}
|
44054
43747
|
calculateMaxGas(chainInfo, minGas) {
|
44055
43748
|
const { consensusParameters } = chainInfo;
|
44056
|
-
const { gasPerByte
|
43749
|
+
const { gasPerByte } = consensusParameters;
|
44057
43750
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
44058
43751
|
(acc, wit) => acc + wit.dataLength,
|
44059
43752
|
0
|
@@ -44063,8 +43756,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44063
43756
|
minGas,
|
44064
43757
|
witnessesLength,
|
44065
43758
|
witnessLimit: this.witnessLimit,
|
44066
|
-
gasLimit: this.gasLimit
|
44067
|
-
maxGasPerTx
|
43759
|
+
gasLimit: this.gasLimit
|
44068
43760
|
});
|
44069
43761
|
}
|
44070
43762
|
/**
|
@@ -44137,29 +43829,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44137
43829
|
}
|
44138
43830
|
}
|
44139
43831
|
};
|
44140
|
-
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44141
|
-
(acc, input) => {
|
44142
|
-
if (input.type === InputType.Coin && input.owner === owner) {
|
44143
|
-
acc.utxos.push(input.id);
|
44144
|
-
}
|
44145
|
-
if (input.type === InputType.Message && input.recipient === owner) {
|
44146
|
-
acc.messages.push(input.nonce);
|
44147
|
-
}
|
44148
|
-
return acc;
|
44149
|
-
},
|
44150
|
-
{
|
44151
|
-
utxos: [],
|
44152
|
-
messages: []
|
44153
|
-
}
|
44154
|
-
);
|
44155
43832
|
|
44156
43833
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
44157
43834
|
var calculateTransactionFee = (params) => {
|
44158
43835
|
const {
|
44159
|
-
|
43836
|
+
gasUsed,
|
44160
43837
|
rawPayload,
|
44161
|
-
|
44162
|
-
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43838
|
+
consensusParameters: { gasCosts, feeParams }
|
44163
43839
|
} = params;
|
44164
43840
|
const gasPerByte = bn(feeParams.gasPerByte);
|
44165
43841
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -44169,7 +43845,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44169
43845
|
return {
|
44170
43846
|
fee: bn(0),
|
44171
43847
|
minFee: bn(0),
|
44172
|
-
maxFee: bn(0)
|
43848
|
+
maxFee: bn(0),
|
43849
|
+
feeFromGasUsed: bn(0)
|
44173
43850
|
};
|
44174
43851
|
}
|
44175
43852
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -44201,6 +43878,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44201
43878
|
metadataGas,
|
44202
43879
|
txBytesSize: transactionBytes.length
|
44203
43880
|
});
|
43881
|
+
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
44204
43882
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
44205
43883
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
44206
43884
|
const maxGas = getMaxGas({
|
@@ -44208,25 +43886,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44208
43886
|
minGas,
|
44209
43887
|
witnessesLength,
|
44210
43888
|
gasLimit,
|
44211
|
-
witnessLimit
|
44212
|
-
maxGasPerTx
|
44213
|
-
});
|
44214
|
-
const minFee = calculateGasFee({
|
44215
|
-
gasPrice,
|
44216
|
-
gas: minGas,
|
44217
|
-
priceFactor: gasPriceFactor,
|
44218
|
-
tip
|
44219
|
-
});
|
44220
|
-
const maxFee = calculateGasFee({
|
44221
|
-
gasPrice,
|
44222
|
-
gas: maxGas,
|
44223
|
-
priceFactor: gasPriceFactor,
|
44224
|
-
tip
|
43889
|
+
witnessLimit
|
44225
43890
|
});
|
43891
|
+
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43892
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43893
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43894
|
+
const fee = minFee.add(feeFromGasUsed);
|
44226
43895
|
return {
|
43896
|
+
fee,
|
44227
43897
|
minFee,
|
44228
43898
|
maxFee,
|
44229
|
-
|
43899
|
+
feeFromGasUsed
|
44230
43900
|
};
|
44231
43901
|
};
|
44232
43902
|
|
@@ -44780,9 +44450,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44780
44450
|
gqlTransactionStatus,
|
44781
44451
|
abiMap = {},
|
44782
44452
|
maxInputs,
|
44783
|
-
gasCosts
|
44784
|
-
maxGasPerTx,
|
44785
|
-
gasPrice
|
44453
|
+
gasCosts
|
44786
44454
|
} = params;
|
44787
44455
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44788
44456
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44796,14 +44464,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44796
44464
|
maxInputs
|
44797
44465
|
});
|
44798
44466
|
const typeName = getTransactionTypeName(transaction.type);
|
44799
|
-
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44800
44467
|
const { fee } = calculateTransactionFee({
|
44801
|
-
|
44468
|
+
gasUsed,
|
44802
44469
|
rawPayload,
|
44803
|
-
tip,
|
44804
44470
|
consensusParameters: {
|
44805
44471
|
gasCosts,
|
44806
|
-
maxGasPerTx,
|
44807
44472
|
feeParams: {
|
44808
44473
|
gasPerByte,
|
44809
44474
|
gasPriceFactor
|
@@ -44939,13 +44604,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44939
44604
|
const decodedTransaction = this.decodeTransaction(
|
44940
44605
|
transaction
|
44941
44606
|
);
|
44942
|
-
|
44943
|
-
|
44944
|
-
txReceipts = transaction.status.receipts;
|
44945
|
-
}
|
44946
|
-
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44947
|
-
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44948
|
-
const gasPrice = await this.provider.getLatestGasPrice();
|
44607
|
+
const receipts = transaction.receipts?.map(processGqlReceipt) || [];
|
44608
|
+
const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
|
44949
44609
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44950
44610
|
const transactionSummary = assembleTransactionSummary({
|
44951
44611
|
id: this.id,
|
@@ -44957,9 +44617,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44957
44617
|
gasPriceFactor,
|
44958
44618
|
abiMap: contractsAbiMap,
|
44959
44619
|
maxInputs,
|
44960
|
-
gasCosts
|
44961
|
-
maxGasPerTx,
|
44962
|
-
gasPrice
|
44620
|
+
gasCosts
|
44963
44621
|
});
|
44964
44622
|
return transactionSummary;
|
44965
44623
|
}
|
@@ -45103,12 +44761,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45103
44761
|
gasPerByte: bn(feeParams.gasPerByte),
|
45104
44762
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
45105
44763
|
chainId: bn(consensusParameters.chainId),
|
44764
|
+
baseAssetId: consensusParameters.baseAssetId,
|
45106
44765
|
gasCosts
|
45107
44766
|
},
|
45108
44767
|
gasCosts,
|
45109
44768
|
latestBlock: {
|
45110
44769
|
id: latestBlock.id,
|
45111
|
-
height: bn(latestBlock.height),
|
44770
|
+
height: bn(latestBlock.header.height),
|
45112
44771
|
time: latestBlock.header.time,
|
45113
44772
|
transactions: latestBlock.transactions.map((i) => ({
|
45114
44773
|
id: i.id
|
@@ -45202,8 +44861,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45202
44861
|
* Returns some helpful parameters related to gas fees.
|
45203
44862
|
*/
|
45204
44863
|
getGasConfig() {
|
44864
|
+
const { minGasPrice } = this.getNode();
|
45205
44865
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
45206
44866
|
return {
|
44867
|
+
minGasPrice,
|
45207
44868
|
maxGasPerTx,
|
45208
44869
|
maxGasPerPredicate,
|
45209
44870
|
gasPriceFactor,
|
@@ -45301,7 +44962,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45301
44962
|
*/
|
45302
44963
|
async getBlockNumber() {
|
45303
44964
|
const { chain } = await this.operations.getChain();
|
45304
|
-
return bn(chain.latestBlock.height, 10);
|
44965
|
+
return bn(chain.latestBlock.header.height, 10);
|
45305
44966
|
}
|
45306
44967
|
/**
|
45307
44968
|
* Returns the chain information.
|
@@ -45313,9 +44974,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45313
44974
|
const processedNodeInfo = {
|
45314
44975
|
maxDepth: bn(nodeInfo.maxDepth),
|
45315
44976
|
maxTx: bn(nodeInfo.maxTx),
|
44977
|
+
minGasPrice: bn(nodeInfo.minGasPrice),
|
45316
44978
|
nodeVersion: nodeInfo.nodeVersion,
|
45317
44979
|
utxoValidation: nodeInfo.utxoValidation,
|
45318
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44980
|
+
vmBacktrace: nodeInfo.vmBacktrace,
|
44981
|
+
peers: nodeInfo.peers
|
45319
44982
|
};
|
45320
44983
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
45321
44984
|
return processedNodeInfo;
|
@@ -45341,6 +45004,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45341
45004
|
} = this.getChain();
|
45342
45005
|
return chainId.toNumber();
|
45343
45006
|
}
|
45007
|
+
/**
|
45008
|
+
* Returns the base asset ID
|
45009
|
+
*
|
45010
|
+
* @returns A promise that resolves to the base asset ID
|
45011
|
+
*/
|
45012
|
+
getBaseAssetId() {
|
45013
|
+
const {
|
45014
|
+
consensusParameters: { baseAssetId }
|
45015
|
+
} = this.getChain();
|
45016
|
+
return baseAssetId;
|
45017
|
+
}
|
45344
45018
|
/**
|
45345
45019
|
* Submits a transaction to the chain to be executed.
|
45346
45020
|
*
|
@@ -45401,13 +45075,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45401
45075
|
return this.estimateTxDependencies(transactionRequest);
|
45402
45076
|
}
|
45403
45077
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45404
|
-
const { dryRun:
|
45405
|
-
|
45078
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45079
|
+
encodedTransaction,
|
45406
45080
|
utxoValidation: utxoValidation || false
|
45407
45081
|
});
|
45408
|
-
const
|
45409
|
-
|
45410
|
-
|
45082
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45083
|
+
return {
|
45084
|
+
receipts
|
45085
|
+
};
|
45411
45086
|
}
|
45412
45087
|
/**
|
45413
45088
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45446,6 +45121,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45446
45121
|
* If there are missing variable outputs,
|
45447
45122
|
* `addVariableOutputs` is called on the transaction.
|
45448
45123
|
*
|
45124
|
+
* @privateRemarks
|
45125
|
+
* TODO: Investigate support for missing contract IDs
|
45126
|
+
* TODO: Add support for missing output messages
|
45449
45127
|
*
|
45450
45128
|
* @param transactionRequest - The transaction request object.
|
45451
45129
|
* @returns A promise.
|
@@ -45458,19 +45136,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45458
45136
|
missingContractIds: []
|
45459
45137
|
};
|
45460
45138
|
}
|
45139
|
+
await this.estimatePredicates(transactionRequest);
|
45461
45140
|
let receipts = [];
|
45462
45141
|
const missingContractIds = [];
|
45463
45142
|
let outputVariables = 0;
|
45464
|
-
let dryrunStatus;
|
45465
45143
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45466
|
-
const {
|
45467
|
-
|
45468
|
-
} = await this.operations.dryRun({
|
45469
|
-
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45144
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45145
|
+
encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
|
45470
45146
|
utxoValidation: false
|
45471
45147
|
});
|
45472
|
-
receipts =
|
45473
|
-
dryrunStatus = status;
|
45148
|
+
receipts = gqlReceipts.map(processGqlReceipt);
|
45474
45149
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45475
45150
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45476
45151
|
if (hasMissingOutputs) {
|
@@ -45480,11 +45155,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45480
45155
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45481
45156
|
missingContractIds.push(contractId);
|
45482
45157
|
});
|
45483
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45484
|
-
transactionRequest,
|
45485
|
-
optimizeGas: false
|
45486
|
-
});
|
45487
|
-
transactionRequest.maxFee = maxFee;
|
45488
45158
|
} else {
|
45489
45159
|
break;
|
45490
45160
|
}
|
@@ -45492,133 +45162,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45492
45162
|
return {
|
45493
45163
|
receipts,
|
45494
45164
|
outputVariables,
|
45495
|
-
missingContractIds
|
45496
|
-
dryrunStatus
|
45497
|
-
};
|
45498
|
-
}
|
45499
|
-
/**
|
45500
|
-
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45501
|
-
*
|
45502
|
-
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45503
|
-
* further modifications are identified. The method iteratively updates these transactions
|
45504
|
-
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45505
|
-
*
|
45506
|
-
* @param transactionRequests - Array of transaction request objects.
|
45507
|
-
* @returns A promise that resolves to an array of results for each transaction.
|
45508
|
-
*/
|
45509
|
-
async estimateMultipleTxDependencies(transactionRequests) {
|
45510
|
-
const results = transactionRequests.map(() => ({
|
45511
|
-
receipts: [],
|
45512
|
-
outputVariables: 0,
|
45513
|
-
missingContractIds: [],
|
45514
|
-
dryrunStatus: void 0
|
45515
|
-
}));
|
45516
|
-
const allRequests = clone_default(transactionRequests);
|
45517
|
-
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45518
|
-
allRequests.forEach((req, index) => {
|
45519
|
-
if (req.type === TransactionType.Script) {
|
45520
|
-
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45521
|
-
}
|
45522
|
-
});
|
45523
|
-
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45524
|
-
let attempt = 0;
|
45525
|
-
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45526
|
-
const encodedTransactions = transactionsToProcess.map(
|
45527
|
-
(index) => serializedTransactionsMap.get(index)
|
45528
|
-
);
|
45529
|
-
const dryRunResults = await this.operations.dryRun({
|
45530
|
-
encodedTransactions,
|
45531
|
-
utxoValidation: false
|
45532
|
-
});
|
45533
|
-
const nextRoundTransactions = [];
|
45534
|
-
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45535
|
-
const currentResultIndex = transactionsToProcess[i];
|
45536
|
-
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45537
|
-
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45538
|
-
results[currentResultIndex].dryrunStatus = status;
|
45539
|
-
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45540
|
-
results[currentResultIndex].receipts
|
45541
|
-
);
|
45542
|
-
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45543
|
-
const requestToProcess = allRequests[currentResultIndex];
|
45544
|
-
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45545
|
-
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45546
|
-
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45547
|
-
missingOutputContractIds.forEach(({ contractId }) => {
|
45548
|
-
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45549
|
-
results[currentResultIndex].missingContractIds.push(contractId);
|
45550
|
-
});
|
45551
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45552
|
-
transactionRequest: requestToProcess,
|
45553
|
-
optimizeGas: false
|
45554
|
-
});
|
45555
|
-
requestToProcess.maxFee = maxFee;
|
45556
|
-
serializedTransactionsMap.set(
|
45557
|
-
currentResultIndex,
|
45558
|
-
hexlify(requestToProcess.toTransactionBytes())
|
45559
|
-
);
|
45560
|
-
nextRoundTransactions.push(currentResultIndex);
|
45561
|
-
allRequests[currentResultIndex] = requestToProcess;
|
45562
|
-
}
|
45563
|
-
}
|
45564
|
-
transactionsToProcess = nextRoundTransactions;
|
45565
|
-
attempt += 1;
|
45566
|
-
}
|
45567
|
-
return results;
|
45568
|
-
}
|
45569
|
-
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45570
|
-
if (estimateTxDependencies) {
|
45571
|
-
return this.estimateMultipleTxDependencies(transactionRequests);
|
45572
|
-
}
|
45573
|
-
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45574
|
-
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45575
|
-
encodedTransactions,
|
45576
|
-
utxoValidation: utxoValidation || false
|
45577
|
-
});
|
45578
|
-
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45579
|
-
const receipts = rawReceipts.map(processGqlReceipt);
|
45580
|
-
return { receipts, dryrunStatus: status };
|
45581
|
-
});
|
45582
|
-
return results;
|
45583
|
-
}
|
45584
|
-
async estimateTxGasAndFee(params) {
|
45585
|
-
const { transactionRequest, optimizeGas = true } = params;
|
45586
|
-
let { gasPrice } = params;
|
45587
|
-
const chainInfo = this.getChain();
|
45588
|
-
const { gasPriceFactor } = this.getGasConfig();
|
45589
|
-
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45590
|
-
if (!gasPrice) {
|
45591
|
-
gasPrice = await this.estimateGasPrice(10);
|
45592
|
-
}
|
45593
|
-
const minFee = calculateGasFee({
|
45594
|
-
gasPrice: bn(gasPrice),
|
45595
|
-
gas: minGas,
|
45596
|
-
priceFactor: gasPriceFactor,
|
45597
|
-
tip: transactionRequest.tip
|
45598
|
-
}).add(1);
|
45599
|
-
let gasLimit = bn(0);
|
45600
|
-
if (transactionRequest.type === TransactionType.Script) {
|
45601
|
-
gasLimit = transactionRequest.gasLimit;
|
45602
|
-
if (!optimizeGas) {
|
45603
|
-
transactionRequest.gasLimit = minGas;
|
45604
|
-
gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45605
|
-
transactionRequest.gasLimit = gasLimit;
|
45606
|
-
}
|
45607
|
-
}
|
45608
|
-
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45609
|
-
const maxFee = calculateGasFee({
|
45610
|
-
gasPrice: bn(gasPrice),
|
45611
|
-
gas: maxGas,
|
45612
|
-
priceFactor: gasPriceFactor,
|
45613
|
-
tip: transactionRequest.tip
|
45614
|
-
}).add(1);
|
45615
|
-
return {
|
45616
|
-
minGas,
|
45617
|
-
minFee,
|
45618
|
-
maxGas,
|
45619
|
-
maxFee,
|
45620
|
-
gasPrice,
|
45621
|
-
gasLimit
|
45165
|
+
missingContractIds
|
45622
45166
|
};
|
45623
45167
|
}
|
45624
45168
|
/**
|
@@ -45636,17 +45180,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45636
45180
|
if (estimateTxDependencies) {
|
45637
45181
|
return this.estimateTxDependencies(transactionRequest);
|
45638
45182
|
}
|
45639
|
-
const
|
45640
|
-
const { dryRun:
|
45641
|
-
|
45183
|
+
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45184
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45185
|
+
encodedTransaction,
|
45642
45186
|
utxoValidation: true
|
45643
45187
|
});
|
45644
|
-
const
|
45645
|
-
|
45646
|
-
|
45647
|
-
|
45648
|
-
});
|
45649
|
-
return { receipts: callResult[0].receipts };
|
45188
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45189
|
+
return {
|
45190
|
+
receipts
|
45191
|
+
};
|
45650
45192
|
}
|
45651
45193
|
/**
|
45652
45194
|
* Returns a transaction cost to enable user
|
@@ -45663,80 +45205,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45663
45205
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45664
45206
|
* @returns A promise that resolves to the transaction cost object.
|
45665
45207
|
*/
|
45666
|
-
async getTransactionCost(transactionRequestLike,
|
45208
|
+
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
45209
|
+
estimateTxDependencies = true,
|
45210
|
+
estimatePredicates = true,
|
45211
|
+
resourcesOwner,
|
45212
|
+
signatureCallback
|
45213
|
+
} = {}) {
|
45667
45214
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45215
|
+
const chainInfo = this.getChain();
|
45216
|
+
const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
|
45217
|
+
const gasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45668
45218
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45669
45219
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45670
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45220
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
|
45671
45221
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45672
|
-
|
45673
|
-
|
45674
|
-
|
45675
|
-
|
45676
|
-
|
45677
|
-
|
45222
|
+
if (estimatePredicates) {
|
45223
|
+
if (isScriptTransaction) {
|
45224
|
+
txRequestClone.gasLimit = bn(0);
|
45225
|
+
}
|
45226
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45227
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45228
|
+
}
|
45229
|
+
await this.estimatePredicates(txRequestClone);
|
45678
45230
|
}
|
45679
|
-
const signedRequest = clone_default(txRequestClone);
|
45680
|
-
let addedSignatures = 0;
|
45681
45231
|
if (signatureCallback && isScriptTransaction) {
|
45682
|
-
|
45683
|
-
|
45684
|
-
|
45685
|
-
|
45686
|
-
await this.estimatePredicates(signedRequest);
|
45687
|
-
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45688
|
-
transactionRequest: signedRequest,
|
45689
|
-
optimizeGas: false
|
45690
|
-
});
|
45691
|
-
txRequestClone.maxFee = maxFee;
|
45232
|
+
await signatureCallback(txRequestClone);
|
45233
|
+
}
|
45234
|
+
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
45235
|
+
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
45692
45236
|
let receipts = [];
|
45693
45237
|
let missingContractIds = [];
|
45694
45238
|
let outputVariables = 0;
|
45695
|
-
|
45696
|
-
|
45697
|
-
|
45698
|
-
if (signatureCallback) {
|
45699
|
-
await signatureCallback(txRequestClone);
|
45700
|
-
}
|
45701
|
-
txRequestClone.gasLimit = gasLimit;
|
45239
|
+
if (isScriptTransaction && estimateTxDependencies) {
|
45240
|
+
txRequestClone.gasPrice = bn(0);
|
45241
|
+
txRequestClone.gasLimit = bn(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
|
45702
45242
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45703
45243
|
receipts = result.receipts;
|
45704
45244
|
outputVariables = result.outputVariables;
|
45705
45245
|
missingContractIds = result.missingContractIds;
|
45706
|
-
gasUsed = getGasUsedFromReceipts(receipts);
|
45707
|
-
txRequestClone.gasLimit = gasUsed;
|
45708
|
-
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
45709
|
-
transactionRequest: txRequestClone,
|
45710
|
-
gasPrice
|
45711
|
-
}));
|
45712
45246
|
}
|
45247
|
+
const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
|
45248
|
+
const usedFee = calculatePriceWithFactor(
|
45249
|
+
gasUsed,
|
45250
|
+
gasPrice,
|
45251
|
+
gasPriceFactor
|
45252
|
+
).normalizeZeroToOne();
|
45253
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45254
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45713
45255
|
return {
|
45714
45256
|
requiredQuantities: allQuantities,
|
45715
45257
|
receipts,
|
45716
45258
|
gasUsed,
|
45259
|
+
minGasPrice,
|
45717
45260
|
gasPrice,
|
45718
45261
|
minGas,
|
45719
45262
|
maxGas,
|
45263
|
+
usedFee,
|
45720
45264
|
minFee,
|
45721
45265
|
maxFee,
|
45266
|
+
estimatedInputs: txRequestClone.inputs,
|
45722
45267
|
outputVariables,
|
45723
|
-
missingContractIds
|
45724
|
-
addedSignatures,
|
45725
|
-
estimatedPredicates: txRequestClone.inputs
|
45268
|
+
missingContractIds
|
45726
45269
|
};
|
45727
45270
|
}
|
45728
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45271
|
+
async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
|
45729
45272
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45730
45273
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45731
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45732
|
-
quantitiesToContract
|
45733
|
-
});
|
45274
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
|
45734
45275
|
transactionRequest.addResources(
|
45735
45276
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45736
45277
|
);
|
45737
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45738
|
-
|
45739
|
-
|
45278
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45279
|
+
transactionRequest,
|
45280
|
+
forwardingQuantities
|
45281
|
+
);
|
45740
45282
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45741
45283
|
return {
|
45742
45284
|
resources,
|
@@ -45760,6 +45302,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45760
45302
|
assetId: coin.assetId,
|
45761
45303
|
amount: bn(coin.amount),
|
45762
45304
|
owner: Address.fromAddressOrString(coin.owner),
|
45305
|
+
maturity: bn(coin.maturity).toNumber(),
|
45763
45306
|
blockCreated: bn(coin.blockCreated),
|
45764
45307
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45765
45308
|
}));
|
@@ -45811,6 +45354,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45811
45354
|
amount: bn(coin.amount),
|
45812
45355
|
assetId: coin.assetId,
|
45813
45356
|
owner: Address.fromAddressOrString(coin.owner),
|
45357
|
+
maturity: bn(coin.maturity).toNumber(),
|
45814
45358
|
blockCreated: bn(coin.blockCreated),
|
45815
45359
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45816
45360
|
};
|
@@ -45843,7 +45387,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45843
45387
|
}
|
45844
45388
|
return {
|
45845
45389
|
id: block2.id,
|
45846
|
-
height: bn(block2.height),
|
45390
|
+
height: bn(block2.header.height),
|
45847
45391
|
time: block2.header.time,
|
45848
45392
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45849
45393
|
};
|
@@ -45858,7 +45402,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45858
45402
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45859
45403
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45860
45404
|
id: block2.id,
|
45861
|
-
height: bn(block2.height),
|
45405
|
+
height: bn(block2.header.height),
|
45862
45406
|
time: block2.header.time,
|
45863
45407
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45864
45408
|
}));
|
@@ -45885,7 +45429,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45885
45429
|
}
|
45886
45430
|
return {
|
45887
45431
|
id: block2.id,
|
45888
|
-
height: bn(block2.height, 10),
|
45432
|
+
height: bn(block2.header.height, 10),
|
45889
45433
|
time: block2.header.time,
|
45890
45434
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45891
45435
|
transactions: block2.transactions.map(
|
@@ -46065,6 +45609,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46065
45609
|
prevRoot: messageBlockHeader.prevRoot,
|
46066
45610
|
time: messageBlockHeader.time,
|
46067
45611
|
applicationHash: messageBlockHeader.applicationHash,
|
45612
|
+
messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
|
46068
45613
|
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
|
46069
45614
|
},
|
46070
45615
|
commitBlockHeader: {
|
@@ -46076,6 +45621,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46076
45621
|
prevRoot: commitBlockHeader.prevRoot,
|
46077
45622
|
time: commitBlockHeader.time,
|
46078
45623
|
applicationHash: commitBlockHeader.applicationHash,
|
45624
|
+
messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
|
46079
45625
|
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
|
46080
45626
|
},
|
46081
45627
|
sender: Address.fromAddressOrString(sender),
|
@@ -46085,16 +45631,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46085
45631
|
data
|
46086
45632
|
};
|
46087
45633
|
}
|
46088
|
-
async getLatestGasPrice() {
|
46089
|
-
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46090
|
-
return bn(latestGasPrice.gasPrice);
|
46091
|
-
}
|
46092
|
-
async estimateGasPrice(blockHorizon) {
|
46093
|
-
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46094
|
-
blockHorizon: String(blockHorizon)
|
46095
|
-
});
|
46096
|
-
return bn(estimateGasPrice.gasPrice);
|
46097
|
-
}
|
46098
45634
|
/**
|
46099
45635
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
46100
45636
|
*
|
@@ -46340,8 +45876,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46340
45876
|
* @param assetId - The asset ID to check the balance for.
|
46341
45877
|
* @returns A promise that resolves to the balance amount.
|
46342
45878
|
*/
|
46343
|
-
async getBalance(assetId
|
46344
|
-
const
|
45879
|
+
async getBalance(assetId) {
|
45880
|
+
const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
|
45881
|
+
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
46345
45882
|
return amount;
|
46346
45883
|
}
|
46347
45884
|
/**
|
@@ -46378,33 +45915,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46378
45915
|
* @param fee - The estimated transaction fee.
|
46379
45916
|
* @returns A promise that resolves when the resources are added to the transaction.
|
46380
45917
|
*/
|
46381
|
-
async fund(request,
|
46382
|
-
const
|
46383
|
-
const
|
46384
|
-
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45918
|
+
async fund(request, coinQuantities, fee) {
|
45919
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
45920
|
+
const updatedQuantities = addAmountToAsset({
|
46385
45921
|
amount: bn(fee),
|
46386
|
-
assetId:
|
46387
|
-
coinQuantities
|
45922
|
+
assetId: baseAssetId,
|
45923
|
+
coinQuantities
|
46388
45924
|
});
|
46389
45925
|
const quantitiesDict = {};
|
46390
|
-
|
45926
|
+
updatedQuantities.forEach(({ amount, assetId }) => {
|
46391
45927
|
quantitiesDict[assetId] = {
|
46392
45928
|
required: amount,
|
46393
45929
|
owned: bn(0)
|
46394
45930
|
};
|
46395
45931
|
});
|
46396
|
-
|
45932
|
+
const cachedUtxos = [];
|
45933
|
+
const cachedMessages = [];
|
45934
|
+
const owner = this.address.toB256();
|
45935
|
+
request.inputs.forEach((input) => {
|
46397
45936
|
const isResource = "amount" in input;
|
46398
45937
|
if (isResource) {
|
46399
45938
|
const isCoin2 = "owner" in input;
|
46400
45939
|
if (isCoin2) {
|
46401
45940
|
const assetId = String(input.assetId);
|
46402
|
-
if (quantitiesDict[assetId]) {
|
45941
|
+
if (input.owner === owner && quantitiesDict[assetId]) {
|
46403
45942
|
const amount = bn(input.amount);
|
46404
45943
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45944
|
+
cachedUtxos.push(input.id);
|
46405
45945
|
}
|
46406
|
-
} else if (input.amount && quantitiesDict[
|
46407
|
-
quantitiesDict[
|
45946
|
+
} else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
|
45947
|
+
quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
|
45948
|
+
cachedMessages.push(input.nonce);
|
46408
45949
|
}
|
46409
45950
|
}
|
46410
45951
|
});
|
@@ -46419,23 +45960,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46419
45960
|
});
|
46420
45961
|
const needsToBeFunded = missingQuantities.length;
|
46421
45962
|
if (needsToBeFunded) {
|
46422
|
-
const
|
46423
|
-
|
46424
|
-
|
46425
|
-
|
46426
|
-
|
46427
|
-
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46428
|
-
const requestToBeReEstimate = clone_default(txRequest);
|
46429
|
-
if (addedSignatures) {
|
46430
|
-
Array.from({ length: addedSignatures }).forEach(
|
46431
|
-
() => requestToBeReEstimate.addEmptyWitness()
|
46432
|
-
);
|
45963
|
+
const resources = await this.getResourcesToSpend(missingQuantities, {
|
45964
|
+
messages: cachedMessages,
|
45965
|
+
utxos: cachedUtxos
|
45966
|
+
});
|
45967
|
+
request.addResources(resources);
|
46433
45968
|
}
|
46434
|
-
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46435
|
-
transactionRequest: requestToBeReEstimate
|
46436
|
-
});
|
46437
|
-
txRequest.maxFee = maxFee;
|
46438
|
-
return txRequest;
|
46439
45969
|
}
|
46440
45970
|
/**
|
46441
45971
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -46443,25 +45973,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46443
45973
|
* @param destination - The address of the destination.
|
46444
45974
|
* @param amount - The amount of coins to transfer.
|
46445
45975
|
* @param assetId - The asset ID of the coins to transfer.
|
46446
|
-
* @param txParams - The transaction parameters (gasLimit,
|
45976
|
+
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46447
45977
|
* @returns A promise that resolves to the prepared transaction request.
|
46448
45978
|
*/
|
46449
|
-
async createTransfer(destination, amount, assetId
|
46450
|
-
const
|
46451
|
-
|
46452
|
-
const
|
45979
|
+
async createTransfer(destination, amount, assetId, txParams = {}) {
|
45980
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
45981
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
45982
|
+
const params = { gasPrice: minGasPrice, ...txParams };
|
45983
|
+
const request = new ScriptTransactionRequest(params);
|
45984
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
45985
|
+
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46453
45986
|
estimateTxDependencies: true,
|
46454
45987
|
resourcesOwner: this
|
46455
45988
|
});
|
46456
|
-
|
46457
|
-
|
46458
|
-
|
46459
|
-
|
46460
|
-
|
46461
|
-
|
46462
|
-
|
46463
|
-
|
46464
|
-
await this.fund(request,
|
45989
|
+
request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
|
45990
|
+
request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
|
45991
|
+
this.validateGas({
|
45992
|
+
gasUsed,
|
45993
|
+
gasPrice: request.gasPrice,
|
45994
|
+
gasLimit: request.gasLimit,
|
45995
|
+
minGasPrice
|
45996
|
+
});
|
45997
|
+
await this.fund(request, requiredQuantities, maxFee);
|
45998
|
+
request.updatePredicateInputs(estimatedInputs);
|
46465
45999
|
return request;
|
46466
46000
|
}
|
46467
46001
|
/**
|
@@ -46473,14 +46007,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46473
46007
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46474
46008
|
* @returns A promise that resolves to the transaction response.
|
46475
46009
|
*/
|
46476
|
-
async transfer(destination, amount, assetId
|
46010
|
+
async transfer(destination, amount, assetId, txParams = {}) {
|
46477
46011
|
if (bn(amount).lte(0)) {
|
46478
46012
|
throw new FuelError(
|
46479
46013
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
46480
46014
|
"Transfer amount must be a positive number."
|
46481
46015
|
);
|
46482
46016
|
}
|
46483
|
-
const
|
46017
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46018
|
+
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
46484
46019
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
46485
46020
|
}
|
46486
46021
|
/**
|
@@ -46492,7 +46027,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46492
46027
|
* @param txParams - The optional transaction parameters.
|
46493
46028
|
* @returns A promise that resolves to the transaction response.
|
46494
46029
|
*/
|
46495
|
-
async transferToContract(contractId, amount, assetId
|
46030
|
+
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46496
46031
|
if (bn(amount).lte(0)) {
|
46497
46032
|
throw new FuelError(
|
46498
46033
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46500,30 +46035,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46500
46035
|
);
|
46501
46036
|
}
|
46502
46037
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46038
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46039
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46040
|
+
const params = { gasPrice: minGasPrice, ...txParams };
|
46503
46041
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46504
46042
|
hexlifiedContractId: contractAddress.toB256(),
|
46505
46043
|
amountToTransfer: bn(amount),
|
46506
|
-
assetId
|
46044
|
+
assetId: assetIdToTransfer
|
46507
46045
|
});
|
46508
46046
|
const request = new ScriptTransactionRequest({
|
46509
|
-
...
|
46047
|
+
...params,
|
46510
46048
|
script,
|
46511
46049
|
scriptData
|
46512
46050
|
});
|
46513
46051
|
request.addContractInputAndOutput(contractAddress);
|
46514
|
-
const
|
46515
|
-
|
46516
|
-
|
46052
|
+
const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
|
46053
|
+
request,
|
46054
|
+
[{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
|
46055
|
+
);
|
46056
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46057
|
+
this.validateGas({
|
46058
|
+
gasUsed,
|
46059
|
+
gasPrice: request.gasPrice,
|
46060
|
+
gasLimit: request.gasLimit,
|
46061
|
+
minGasPrice
|
46517
46062
|
});
|
46518
|
-
|
46519
|
-
this.validateGas({
|
46520
|
-
gasUsed: txCost.gasUsed,
|
46521
|
-
gasLimit: request.gasLimit
|
46522
|
-
});
|
46523
|
-
}
|
46524
|
-
request.gasLimit = txCost.gasUsed;
|
46525
|
-
request.maxFee = txCost.maxFee;
|
46526
|
-
await this.fund(request, txCost);
|
46063
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46527
46064
|
return this.sendTransaction(request);
|
46528
46065
|
}
|
46529
46066
|
/**
|
@@ -46535,6 +46072,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46535
46072
|
* @returns A promise that resolves to the transaction response.
|
46536
46073
|
*/
|
46537
46074
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46075
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46076
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46538
46077
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46539
46078
|
const recipientDataArray = arrayify(
|
46540
46079
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46547,19 +46086,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46547
46086
|
...recipientDataArray,
|
46548
46087
|
...amountDataArray
|
46549
46088
|
]);
|
46550
|
-
const params = { script, ...txParams };
|
46089
|
+
const params = { script, gasPrice: minGasPrice, ...txParams };
|
46551
46090
|
const request = new ScriptTransactionRequest(params);
|
46552
|
-
const
|
46553
|
-
const
|
46554
|
-
|
46555
|
-
|
46556
|
-
|
46557
|
-
|
46558
|
-
|
46559
|
-
|
46560
|
-
|
46561
|
-
|
46562
|
-
|
46091
|
+
const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
|
46092
|
+
const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
|
46093
|
+
request,
|
46094
|
+
forwardingQuantities
|
46095
|
+
);
|
46096
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46097
|
+
this.validateGas({
|
46098
|
+
gasUsed,
|
46099
|
+
gasPrice: request.gasPrice,
|
46100
|
+
gasLimit: request.gasLimit,
|
46101
|
+
minGasPrice
|
46102
|
+
});
|
46103
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46563
46104
|
return this.sendTransaction(request);
|
46564
46105
|
}
|
46565
46106
|
async signMessage(message) {
|
@@ -46617,7 +46158,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46617
46158
|
}
|
46618
46159
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46619
46160
|
}
|
46620
|
-
validateGas({
|
46161
|
+
validateGas({
|
46162
|
+
gasUsed,
|
46163
|
+
gasPrice,
|
46164
|
+
gasLimit,
|
46165
|
+
minGasPrice
|
46166
|
+
}) {
|
46167
|
+
if (minGasPrice.gt(gasPrice)) {
|
46168
|
+
throw new FuelError(
|
46169
|
+
ErrorCode.GAS_PRICE_TOO_LOW,
|
46170
|
+
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46171
|
+
);
|
46172
|
+
}
|
46621
46173
|
if (gasUsed.gt(gasLimit)) {
|
46622
46174
|
throw new FuelError(
|
46623
46175
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -48000,12 +47552,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48000
47552
|
};
|
48001
47553
|
|
48002
47554
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
|
48003
|
-
var
|
47555
|
+
var import_crypto15 = __toESM(__require("crypto"));
|
48004
47556
|
var rnds8Pool = new Uint8Array(256);
|
48005
47557
|
var poolPtr = rnds8Pool.length;
|
48006
47558
|
function rng() {
|
48007
47559
|
if (poolPtr > rnds8Pool.length - 16) {
|
48008
|
-
|
47560
|
+
import_crypto15.default.randomFillSync(rnds8Pool);
|
48009
47561
|
poolPtr = 0;
|
48010
47562
|
}
|
48011
47563
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
@@ -48021,9 +47573,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48021
47573
|
}
|
48022
47574
|
|
48023
47575
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
|
48024
|
-
var
|
47576
|
+
var import_crypto16 = __toESM(__require("crypto"));
|
48025
47577
|
var native_default = {
|
48026
|
-
randomUUID:
|
47578
|
+
randomUUID: import_crypto16.default.randomUUID
|
48027
47579
|
};
|
48028
47580
|
|
48029
47581
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
|
@@ -48206,7 +47758,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48206
47758
|
* @param transactionRequestLike - The transaction request to send.
|
48207
47759
|
* @returns A promise that resolves to the TransactionResponse object.
|
48208
47760
|
*/
|
48209
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
47761
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
|
48210
47762
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
48211
47763
|
if (estimateTxDependencies) {
|
48212
47764
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50966,15 +50518,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50966
50518
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50967
50519
|
wallet.provider
|
50968
50520
|
);
|
50969
|
-
const
|
50970
|
-
|
50971
|
-
|
50972
|
-
|
50521
|
+
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50522
|
+
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
50523
|
+
const request = new ScriptTransactionRequest({
|
50524
|
+
gasLimit: 1e4,
|
50525
|
+
gasPrice: minGasPrice
|
50973
50526
|
});
|
50974
|
-
|
50975
|
-
request.
|
50976
|
-
request.maxFee = txCost.maxFee;
|
50977
|
-
await genesisWallet.fund(request, txCost);
|
50527
|
+
request.addResources(resources);
|
50528
|
+
quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
|
50978
50529
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50979
50530
|
};
|
50980
50531
|
|
@@ -51004,7 +50555,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51004
50555
|
|
51005
50556
|
// src/test-utils/launchNode.ts
|
51006
50557
|
var import_child_process = __require("child_process");
|
51007
|
-
var
|
50558
|
+
var import_crypto20 = __require("crypto");
|
51008
50559
|
var import_fs2 = __require("fs");
|
51009
50560
|
var import_os = __toESM(__require("os"));
|
51010
50561
|
var import_path8 = __toESM(__require("path"));
|
@@ -51053,12 +50604,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51053
50604
|
// eslint-disable-next-line no-async-promise-executor
|
51054
50605
|
new Promise(async (resolve, reject) => {
|
51055
50606
|
const remainingArgs = extractRemainingArgs(args, [
|
51056
|
-
"--
|
50607
|
+
"--chain",
|
51057
50608
|
"--consensus-key",
|
51058
50609
|
"--db-type",
|
51059
50610
|
"--poa-instant"
|
51060
50611
|
]);
|
51061
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
50612
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--chain");
|
51062
50613
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
51063
50614
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
51064
50615
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -51076,55 +50627,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51076
50627
|
})).toString();
|
51077
50628
|
let chainConfigPathToUse;
|
51078
50629
|
const prefix = basePath || import_os.default.tmpdir();
|
51079
|
-
const suffix = basePath ? "" : (0,
|
51080
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix
|
50630
|
+
const suffix = basePath ? "" : (0, import_crypto20.randomUUID)();
|
50631
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51081
50632
|
if (chainConfigPath) {
|
51082
50633
|
chainConfigPathToUse = chainConfigPath;
|
51083
50634
|
} else {
|
51084
50635
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
51085
50636
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
51086
50637
|
}
|
51087
|
-
|
51088
|
-
|
51089
|
-
stateConfigJson = {
|
51090
|
-
...stateConfigJson,
|
51091
|
-
coins: [
|
51092
|
-
...stateConfigJson.coins.map((coin) => ({
|
51093
|
-
...coin,
|
51094
|
-
amount: "18446744073709551615"
|
51095
|
-
}))
|
51096
|
-
],
|
51097
|
-
messages: stateConfigJson.messages.map((message) => ({
|
51098
|
-
...message,
|
51099
|
-
amount: "18446744073709551615"
|
51100
|
-
}))
|
51101
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51102
|
-
};
|
50638
|
+
const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
50639
|
+
let chainConfig = defaultChainConfig;
|
51103
50640
|
if (!process.env.GENESIS_SECRET) {
|
51104
50641
|
const pk = Signer.generatePrivateKey();
|
51105
50642
|
const signer = new Signer(pk);
|
51106
50643
|
process.env.GENESIS_SECRET = hexlify(pk);
|
51107
|
-
|
51108
|
-
|
51109
|
-
|
51110
|
-
|
51111
|
-
|
51112
|
-
|
51113
|
-
|
51114
|
-
|
51115
|
-
|
51116
|
-
|
50644
|
+
chainConfig = {
|
50645
|
+
...defaultChainConfig,
|
50646
|
+
initial_state: {
|
50647
|
+
...defaultChainConfig.initial_state,
|
50648
|
+
coins: [
|
50649
|
+
...defaultChainConfig.initial_state.coins,
|
50650
|
+
{
|
50651
|
+
owner: signer.address.toHexString(),
|
50652
|
+
amount: toHex(1e9),
|
50653
|
+
asset_id: defaultChainConfig?.consensus_parameters?.base_asset_id ?? ZeroBytes32
|
50654
|
+
}
|
50655
|
+
]
|
50656
|
+
}
|
50657
|
+
};
|
51117
50658
|
}
|
51118
|
-
|
51119
|
-
|
51120
|
-
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51121
|
-
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51122
|
-
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51123
|
-
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51124
|
-
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51125
|
-
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51126
|
-
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51127
|
-
chainConfigPathToUse = tempDirPath;
|
50659
|
+
(0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
|
50660
|
+
chainConfigPathToUse = tempChainConfigFilePath;
|
51128
50661
|
}
|
51129
50662
|
const child = (0, import_child_process.spawn)(
|
51130
50663
|
command,
|
@@ -51133,10 +50666,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51133
50666
|
["--ip", ipToUse],
|
51134
50667
|
["--port", portToUse],
|
51135
50668
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
51136
|
-
["--min-gas-price", "
|
50669
|
+
["--min-gas-price", "0"],
|
51137
50670
|
poaInstant ? ["--poa-instant", "true"] : [],
|
51138
50671
|
["--consensus-key", consensusKey],
|
51139
|
-
["--
|
50672
|
+
["--chain", chainConfigPathToUse],
|
51140
50673
|
"--vm-backtrace",
|
51141
50674
|
"--utxo-validation",
|
51142
50675
|
"--debug",
|
@@ -51183,9 +50716,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51183
50716
|
})
|
51184
50717
|
);
|
51185
50718
|
var generateWallets = async (count, provider) => {
|
50719
|
+
const baseAssetId = provider.getBaseAssetId();
|
51186
50720
|
const wallets = [];
|
51187
50721
|
for (let i = 0; i < count; i += 1) {
|
51188
|
-
const wallet = await generateTestWallet(provider, [[1e3,
|
50722
|
+
const wallet = await generateTestWallet(provider, [[1e3, baseAssetId]]);
|
51189
50723
|
wallets.push(wallet);
|
51190
50724
|
}
|
51191
50725
|
return wallets;
|
@@ -51195,7 +50729,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51195
50729
|
walletCount = 10
|
51196
50730
|
} = {}) => {
|
51197
50731
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
51198
|
-
const provider = await Provider.create(`http://${ip}:${port}/
|
50732
|
+
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51199
50733
|
const wallets = await generateWallets(walletCount, provider);
|
51200
50734
|
const cleanup = () => {
|
51201
50735
|
closeNode();
|