@fuel-ts/account 0.0.0-rc-1976-20240411153008 → 0.0.0-rc-2021-20240411154255
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 +5 -4
- 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 +896 -629
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +874 -621
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +716 -464
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +10 -2
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +906 -324
- 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 +4 -2
- 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 +7 -1
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +45 -34
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts +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 +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +9 -29
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/utils.d.ts +3 -0
- 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 +2 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +3 -2
- 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 +8 -2
- package/dist/providers/utils/gas.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils.global.js +1613 -1132
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +852 -620
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +710 -478
- 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 max(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 clone3(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(clone3(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 ? clone3(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.51.1",
|
31918
|
+
FUEL_CORE: "0.24.2",
|
31919
31919
|
FUELS: "0.79.0"
|
31920
31920
|
};
|
31921
31921
|
}
|
@@ -32193,525 +32193,757 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32193
32193
|
__publicField3(DateTime, "TAI64_NULL", "");
|
32194
32194
|
var chainConfig_default = {
|
32195
32195
|
chain_name: "local_testnet",
|
32196
|
-
|
32197
|
-
|
32198
|
-
|
32199
|
-
|
32200
|
-
|
32201
|
-
|
32202
|
-
|
32203
|
-
|
32204
|
-
|
32205
|
-
|
32206
|
-
|
32207
|
-
|
32208
|
-
|
32209
|
-
|
32210
|
-
|
32211
|
-
|
32212
|
-
|
32213
|
-
|
32214
|
-
|
32215
|
-
|
32216
|
-
|
32217
|
-
|
32218
|
-
|
32219
|
-
|
32220
|
-
|
32221
|
-
|
32222
|
-
|
32223
|
-
|
32224
|
-
|
32225
|
-
|
32226
|
-
|
32227
|
-
|
32228
|
-
|
32229
|
-
|
32230
|
-
|
32231
|
-
|
32232
|
-
|
32233
|
-
|
32234
|
-
{
|
32235
|
-
|
32236
|
-
|
32237
|
-
|
32238
|
-
|
32239
|
-
|
32240
|
-
|
32241
|
-
|
32242
|
-
|
32243
|
-
|
32244
|
-
|
32245
|
-
|
32246
|
-
|
32247
|
-
|
32248
|
-
|
32249
|
-
|
32250
|
-
|
32251
|
-
|
32252
|
-
|
32253
|
-
|
32254
|
-
|
32255
|
-
|
32256
|
-
|
32257
|
-
|
32258
|
-
|
32259
|
-
|
32260
|
-
|
32261
|
-
|
32262
|
-
|
32263
|
-
|
32264
|
-
|
32265
|
-
|
32266
|
-
|
32267
|
-
|
32268
|
-
|
32269
|
-
|
32270
|
-
|
32271
|
-
|
32272
|
-
|
32273
|
-
|
32274
|
-
|
32275
|
-
|
32276
|
-
|
32277
|
-
|
32278
|
-
|
32279
|
-
|
32280
|
-
|
32281
|
-
|
32282
|
-
|
32283
|
-
|
32284
|
-
|
32285
|
-
|
32286
|
-
|
32287
|
-
|
32288
|
-
|
32289
|
-
|
32290
|
-
|
32291
|
-
|
32292
|
-
|
32293
|
-
|
32294
|
-
|
32295
|
-
|
32296
|
-
|
32297
|
-
|
32298
|
-
|
32299
|
-
|
32300
|
-
|
32301
|
-
|
32302
|
-
|
32303
|
-
|
32304
|
-
|
32305
|
-
|
32306
|
-
|
32307
|
-
|
32308
|
-
|
32309
|
-
|
32310
|
-
|
32311
|
-
|
32312
|
-
|
32313
|
-
|
32314
|
-
|
32315
|
-
|
32316
|
-
|
32317
|
-
|
32318
|
-
|
32319
|
-
|
32320
|
-
|
32321
|
-
|
32322
|
-
|
32323
|
-
|
32324
|
-
|
32325
|
-
|
32326
|
-
|
32327
|
-
|
32328
|
-
|
32329
|
-
|
32330
|
-
|
32331
|
-
|
32332
|
-
|
32333
|
-
|
32334
|
-
|
32335
|
-
|
32336
|
-
|
32337
|
-
|
32338
|
-
|
32339
|
-
|
32340
|
-
|
32341
|
-
|
32342
|
-
|
32343
|
-
|
32344
|
-
|
32345
|
-
|
32346
|
-
|
32347
|
-
|
32348
|
-
|
32349
|
-
|
32350
|
-
|
32351
|
-
|
32352
|
-
|
32353
|
-
|
32354
|
-
|
32355
|
-
|
32356
|
-
|
32357
|
-
|
32358
|
-
|
32359
|
-
|
32360
|
-
|
32361
|
-
|
32362
|
-
|
32363
|
-
|
32364
|
-
|
32365
|
-
|
32366
|
-
|
32367
|
-
|
32368
|
-
|
32369
|
-
|
32370
|
-
|
32371
|
-
|
32372
|
-
|
32373
|
-
|
32374
|
-
|
32375
|
-
|
32376
|
-
|
32377
|
-
|
32378
|
-
|
32379
|
-
|
32380
|
-
|
32381
|
-
|
32382
|
-
|
32383
|
-
|
32384
|
-
|
32385
|
-
|
32386
|
-
|
32387
|
-
|
32388
|
-
|
32389
|
-
|
32390
|
-
|
32391
|
-
|
32392
|
-
|
32393
|
-
|
32394
|
-
|
32395
|
-
|
32396
|
-
|
32397
|
-
|
32398
|
-
|
32399
|
-
|
32400
|
-
|
32401
|
-
|
32402
|
-
|
32403
|
-
|
32404
|
-
|
32405
|
-
|
32406
|
-
|
32407
|
-
|
32408
|
-
|
32409
|
-
|
32410
|
-
|
32411
|
-
|
32412
|
-
|
32413
|
-
|
32414
|
-
|
32415
|
-
|
32416
|
-
|
32417
|
-
|
32418
|
-
|
32419
|
-
|
32420
|
-
|
32421
|
-
|
32422
|
-
|
32423
|
-
|
32424
|
-
|
32425
|
-
|
32426
|
-
|
32427
|
-
|
32428
|
-
|
32429
|
-
|
32430
|
-
|
32431
|
-
|
32432
|
-
|
32433
|
-
|
32434
|
-
|
32435
|
-
|
32436
|
-
|
32437
|
-
|
32438
|
-
|
32439
|
-
|
32440
|
-
|
32441
|
-
|
32442
|
-
|
32443
|
-
|
32444
|
-
|
32445
|
-
|
32446
|
-
|
32447
|
-
|
32448
|
-
|
32449
|
-
|
32450
|
-
|
32451
|
-
|
32452
|
-
da_height: "0x00"
|
32196
|
+
consensus_parameters: {
|
32197
|
+
V1: {
|
32198
|
+
tx_params: {
|
32199
|
+
V1: {
|
32200
|
+
max_inputs: 255,
|
32201
|
+
max_outputs: 255,
|
32202
|
+
max_witnesses: 255,
|
32203
|
+
max_gas_per_tx: 3e7,
|
32204
|
+
max_size: 112640
|
32205
|
+
}
|
32206
|
+
},
|
32207
|
+
predicate_params: {
|
32208
|
+
V1: {
|
32209
|
+
max_predicate_length: 102400,
|
32210
|
+
max_predicate_data_length: 102400,
|
32211
|
+
max_message_data_length: 102400,
|
32212
|
+
max_gas_per_predicate: 3e7
|
32213
|
+
}
|
32214
|
+
},
|
32215
|
+
script_params: {
|
32216
|
+
V1: {
|
32217
|
+
max_script_length: 102400,
|
32218
|
+
max_script_data_length: 102400
|
32219
|
+
}
|
32220
|
+
},
|
32221
|
+
contract_params: {
|
32222
|
+
V1: {
|
32223
|
+
contract_max_size: 102400,
|
32224
|
+
max_storage_slots: 1760
|
32225
|
+
}
|
32226
|
+
},
|
32227
|
+
fee_params: {
|
32228
|
+
V1: {
|
32229
|
+
gas_price_factor: 92,
|
32230
|
+
gas_per_byte: 63
|
32231
|
+
}
|
32232
|
+
},
|
32233
|
+
chain_id: 0,
|
32234
|
+
gas_costs: {
|
32235
|
+
V1: {
|
32236
|
+
add: 2,
|
32237
|
+
addi: 2,
|
32238
|
+
aloc: 1,
|
32239
|
+
and: 2,
|
32240
|
+
andi: 2,
|
32241
|
+
bal: 366,
|
32242
|
+
bhei: 2,
|
32243
|
+
bhsh: 2,
|
32244
|
+
burn: 33949,
|
32245
|
+
cb: 2,
|
32246
|
+
cfei: 2,
|
32247
|
+
cfsi: 2,
|
32248
|
+
div: 2,
|
32249
|
+
divi: 2,
|
32250
|
+
eck1: 3347,
|
32251
|
+
ecr1: 46165,
|
32252
|
+
ed19: 4210,
|
32253
|
+
eq: 2,
|
32254
|
+
exp: 2,
|
32255
|
+
expi: 2,
|
32256
|
+
flag: 1,
|
32257
|
+
gm: 2,
|
32258
|
+
gt: 2,
|
32259
|
+
gtf: 16,
|
32260
|
+
ji: 2,
|
32261
|
+
jmp: 2,
|
32262
|
+
jne: 2,
|
32263
|
+
jnei: 2,
|
32264
|
+
jnzi: 2,
|
32265
|
+
jmpf: 2,
|
32266
|
+
jmpb: 2,
|
32267
|
+
jnzf: 2,
|
32268
|
+
jnzb: 2,
|
32269
|
+
jnef: 2,
|
32270
|
+
jneb: 2,
|
32271
|
+
lb: 2,
|
32272
|
+
log: 754,
|
32273
|
+
lt: 2,
|
32274
|
+
lw: 2,
|
32275
|
+
mint: 35718,
|
32276
|
+
mlog: 2,
|
32277
|
+
mod: 2,
|
32278
|
+
modi: 2,
|
32279
|
+
move: 2,
|
32280
|
+
movi: 2,
|
32281
|
+
mroo: 5,
|
32282
|
+
mul: 2,
|
32283
|
+
muli: 2,
|
32284
|
+
mldv: 4,
|
32285
|
+
noop: 1,
|
32286
|
+
not: 2,
|
32287
|
+
or: 2,
|
32288
|
+
ori: 2,
|
32289
|
+
poph: 3,
|
32290
|
+
popl: 3,
|
32291
|
+
pshh: 4,
|
32292
|
+
pshl: 4,
|
32293
|
+
ret_contract: 733,
|
32294
|
+
rvrt_contract: 722,
|
32295
|
+
sb: 2,
|
32296
|
+
sll: 2,
|
32297
|
+
slli: 2,
|
32298
|
+
srl: 2,
|
32299
|
+
srli: 2,
|
32300
|
+
srw: 253,
|
32301
|
+
sub: 2,
|
32302
|
+
subi: 2,
|
32303
|
+
sw: 2,
|
32304
|
+
sww: 29053,
|
32305
|
+
time: 79,
|
32306
|
+
tr: 46242,
|
32307
|
+
tro: 33251,
|
32308
|
+
wdcm: 3,
|
32309
|
+
wqcm: 3,
|
32310
|
+
wdop: 3,
|
32311
|
+
wqop: 3,
|
32312
|
+
wdml: 3,
|
32313
|
+
wqml: 4,
|
32314
|
+
wddv: 5,
|
32315
|
+
wqdv: 7,
|
32316
|
+
wdmd: 11,
|
32317
|
+
wqmd: 18,
|
32318
|
+
wdam: 9,
|
32319
|
+
wqam: 12,
|
32320
|
+
wdmm: 11,
|
32321
|
+
wqmm: 11,
|
32322
|
+
xor: 2,
|
32323
|
+
xori: 2,
|
32324
|
+
call: {
|
32325
|
+
LightOperation: {
|
32326
|
+
base: 21687,
|
32327
|
+
units_per_gas: 4
|
32328
|
+
}
|
32329
|
+
},
|
32330
|
+
ccp: {
|
32331
|
+
LightOperation: {
|
32332
|
+
base: 59,
|
32333
|
+
units_per_gas: 20
|
32334
|
+
}
|
32335
|
+
},
|
32336
|
+
croo: {
|
32337
|
+
LightOperation: {
|
32338
|
+
base: 1,
|
32339
|
+
units_per_gas: 1
|
32340
|
+
}
|
32341
|
+
},
|
32342
|
+
csiz: {
|
32343
|
+
LightOperation: {
|
32344
|
+
base: 59,
|
32345
|
+
units_per_gas: 195
|
32346
|
+
}
|
32347
|
+
},
|
32348
|
+
k256: {
|
32349
|
+
LightOperation: {
|
32350
|
+
base: 282,
|
32351
|
+
units_per_gas: 3
|
32352
|
+
}
|
32353
|
+
},
|
32354
|
+
ldc: {
|
32355
|
+
LightOperation: {
|
32356
|
+
base: 45,
|
32357
|
+
units_per_gas: 65
|
32358
|
+
}
|
32359
|
+
},
|
32360
|
+
logd: {
|
32361
|
+
LightOperation: {
|
32362
|
+
base: 1134,
|
32363
|
+
units_per_gas: 2
|
32364
|
+
}
|
32365
|
+
},
|
32366
|
+
mcl: {
|
32367
|
+
LightOperation: {
|
32368
|
+
base: 3,
|
32369
|
+
units_per_gas: 523
|
32370
|
+
}
|
32371
|
+
},
|
32372
|
+
mcli: {
|
32373
|
+
LightOperation: {
|
32374
|
+
base: 3,
|
32375
|
+
units_per_gas: 526
|
32376
|
+
}
|
32377
|
+
},
|
32378
|
+
mcp: {
|
32379
|
+
LightOperation: {
|
32380
|
+
base: 3,
|
32381
|
+
units_per_gas: 448
|
32382
|
+
}
|
32383
|
+
},
|
32384
|
+
mcpi: {
|
32385
|
+
LightOperation: {
|
32386
|
+
base: 7,
|
32387
|
+
units_per_gas: 585
|
32388
|
+
}
|
32389
|
+
},
|
32390
|
+
meq: {
|
32391
|
+
LightOperation: {
|
32392
|
+
base: 11,
|
32393
|
+
units_per_gas: 1097
|
32394
|
+
}
|
32395
|
+
},
|
32396
|
+
retd_contract: {
|
32397
|
+
LightOperation: {
|
32398
|
+
base: 1086,
|
32399
|
+
units_per_gas: 2
|
32400
|
+
}
|
32401
|
+
},
|
32402
|
+
s256: {
|
32403
|
+
LightOperation: {
|
32404
|
+
base: 45,
|
32405
|
+
units_per_gas: 3
|
32406
|
+
}
|
32407
|
+
},
|
32408
|
+
scwq: {
|
32409
|
+
HeavyOperation: {
|
32410
|
+
base: 30375,
|
32411
|
+
gas_per_unit: 28628
|
32412
|
+
}
|
32413
|
+
},
|
32414
|
+
smo: {
|
32415
|
+
LightOperation: {
|
32416
|
+
base: 64196,
|
32417
|
+
units_per_gas: 1
|
32418
|
+
}
|
32419
|
+
},
|
32420
|
+
srwq: {
|
32421
|
+
HeavyOperation: {
|
32422
|
+
base: 262,
|
32423
|
+
gas_per_unit: 249
|
32424
|
+
}
|
32425
|
+
},
|
32426
|
+
swwq: {
|
32427
|
+
HeavyOperation: {
|
32428
|
+
base: 28484,
|
32429
|
+
gas_per_unit: 26613
|
32430
|
+
}
|
32431
|
+
},
|
32432
|
+
contract_root: {
|
32433
|
+
LightOperation: {
|
32434
|
+
base: 45,
|
32435
|
+
units_per_gas: 1
|
32436
|
+
}
|
32437
|
+
},
|
32438
|
+
state_root: {
|
32439
|
+
HeavyOperation: {
|
32440
|
+
base: 350,
|
32441
|
+
gas_per_unit: 176
|
32442
|
+
}
|
32443
|
+
},
|
32444
|
+
new_storage_per_byte: 63,
|
32445
|
+
vm_initialization: {
|
32446
|
+
LightOperation: {
|
32447
|
+
base: 1645,
|
32448
|
+
units_per_gas: 14
|
32449
|
+
}
|
32450
|
+
}
|
32451
|
+
}
|
32453
32452
|
},
|
32454
|
-
|
32455
|
-
|
32456
|
-
|
32457
|
-
|
32458
|
-
amount: "0xb04f3c08f59b309e",
|
32459
|
-
data: "",
|
32460
|
-
da_height: "0x00"
|
32461
|
-
}
|
32462
|
-
]
|
32453
|
+
base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
|
32454
|
+
block_gas_limit: 3e7,
|
32455
|
+
privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
|
32456
|
+
}
|
32463
32457
|
},
|
32464
|
-
|
32465
|
-
|
32466
|
-
|
32467
|
-
|
32468
|
-
|
32469
|
-
|
32470
|
-
|
32458
|
+
consensus: {
|
32459
|
+
PoA: {
|
32460
|
+
signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
|
32461
|
+
}
|
32462
|
+
}
|
32463
|
+
};
|
32464
|
+
var metadata_default = {
|
32465
|
+
chain_config: "chainConfig.json",
|
32466
|
+
table_encoding: {
|
32467
|
+
Json: {
|
32468
|
+
filepath: "stateConfig.json"
|
32469
|
+
}
|
32470
|
+
}
|
32471
|
+
};
|
32472
|
+
var stateConfig_default = {
|
32473
|
+
coins: [
|
32474
|
+
{
|
32475
|
+
tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
|
32476
|
+
output_index: 0,
|
32477
|
+
tx_pointer_block_height: 0,
|
32478
|
+
tx_pointer_tx_idx: 0,
|
32479
|
+
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32480
|
+
amount: 18446744073709552e3,
|
32481
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32471
32482
|
},
|
32472
|
-
|
32473
|
-
|
32474
|
-
|
32475
|
-
|
32476
|
-
|
32483
|
+
{
|
32484
|
+
tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
|
32485
|
+
output_index: 0,
|
32486
|
+
tx_pointer_block_height: 0,
|
32487
|
+
tx_pointer_tx_idx: 0,
|
32488
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32489
|
+
amount: 18446744073709552e3,
|
32490
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32477
32491
|
},
|
32478
|
-
|
32479
|
-
|
32480
|
-
|
32492
|
+
{
|
32493
|
+
tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
|
32494
|
+
output_index: 0,
|
32495
|
+
tx_pointer_block_height: 0,
|
32496
|
+
tx_pointer_tx_idx: 0,
|
32497
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32498
|
+
amount: 18446744073709552e3,
|
32499
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32481
32500
|
},
|
32482
|
-
|
32483
|
-
|
32484
|
-
|
32501
|
+
{
|
32502
|
+
tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
|
32503
|
+
output_index: 0,
|
32504
|
+
tx_pointer_block_height: 0,
|
32505
|
+
tx_pointer_tx_idx: 0,
|
32506
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32507
|
+
amount: 18446744073709552e3,
|
32508
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32485
32509
|
},
|
32486
|
-
|
32487
|
-
|
32488
|
-
|
32510
|
+
{
|
32511
|
+
tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
|
32512
|
+
output_index: 0,
|
32513
|
+
tx_pointer_block_height: 0,
|
32514
|
+
tx_pointer_tx_idx: 0,
|
32515
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32516
|
+
amount: 18446744073709552e3,
|
32517
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32489
32518
|
},
|
32490
|
-
|
32491
|
-
|
32492
|
-
|
32493
|
-
|
32494
|
-
|
32495
|
-
|
32496
|
-
|
32497
|
-
|
32498
|
-
bal: 13,
|
32499
|
-
bhei: 1,
|
32500
|
-
bhsh: 1,
|
32501
|
-
burn: 132,
|
32502
|
-
cb: 1,
|
32503
|
-
cfei: 1,
|
32504
|
-
cfsi: 1,
|
32505
|
-
croo: 16,
|
32506
|
-
div: 1,
|
32507
|
-
divi: 1,
|
32508
|
-
ecr1: 3e3,
|
32509
|
-
eck1: 951,
|
32510
|
-
ed19: 3e3,
|
32511
|
-
eq: 1,
|
32512
|
-
exp: 1,
|
32513
|
-
expi: 1,
|
32514
|
-
flag: 1,
|
32515
|
-
gm: 1,
|
32516
|
-
gt: 1,
|
32517
|
-
gtf: 1,
|
32518
|
-
ji: 1,
|
32519
|
-
jmp: 1,
|
32520
|
-
jne: 1,
|
32521
|
-
jnei: 1,
|
32522
|
-
jnzi: 1,
|
32523
|
-
jmpf: 1,
|
32524
|
-
jmpb: 1,
|
32525
|
-
jnzf: 1,
|
32526
|
-
jnzb: 1,
|
32527
|
-
jnef: 1,
|
32528
|
-
jneb: 1,
|
32529
|
-
lb: 1,
|
32530
|
-
log: 9,
|
32531
|
-
lt: 1,
|
32532
|
-
lw: 1,
|
32533
|
-
mint: 135,
|
32534
|
-
mlog: 1,
|
32535
|
-
modOp: 1,
|
32536
|
-
modi: 1,
|
32537
|
-
moveOp: 1,
|
32538
|
-
movi: 1,
|
32539
|
-
mroo: 2,
|
32540
|
-
mul: 1,
|
32541
|
-
muli: 1,
|
32542
|
-
mldv: 1,
|
32543
|
-
noop: 1,
|
32544
|
-
not: 1,
|
32545
|
-
or: 1,
|
32546
|
-
ori: 1,
|
32547
|
-
poph: 2,
|
32548
|
-
popl: 2,
|
32549
|
-
pshh: 2,
|
32550
|
-
pshl: 2,
|
32551
|
-
ret: 13,
|
32552
|
-
rvrt: 13,
|
32553
|
-
sb: 1,
|
32554
|
-
sll: 1,
|
32555
|
-
slli: 1,
|
32556
|
-
srl: 1,
|
32557
|
-
srli: 1,
|
32558
|
-
srw: 12,
|
32559
|
-
sub: 1,
|
32560
|
-
subi: 1,
|
32561
|
-
sw: 1,
|
32562
|
-
sww: 67,
|
32563
|
-
time: 1,
|
32564
|
-
tr: 105,
|
32565
|
-
tro: 60,
|
32566
|
-
wdcm: 1,
|
32567
|
-
wqcm: 1,
|
32568
|
-
wdop: 1,
|
32569
|
-
wqop: 1,
|
32570
|
-
wdml: 1,
|
32571
|
-
wqml: 1,
|
32572
|
-
wddv: 1,
|
32573
|
-
wqdv: 2,
|
32574
|
-
wdmd: 3,
|
32575
|
-
wqmd: 4,
|
32576
|
-
wdam: 2,
|
32577
|
-
wqam: 3,
|
32578
|
-
wdmm: 3,
|
32579
|
-
wqmm: 3,
|
32580
|
-
xor: 1,
|
32581
|
-
xori: 1,
|
32582
|
-
call: {
|
32583
|
-
LightOperation: {
|
32584
|
-
base: 144,
|
32585
|
-
units_per_gas: 214
|
32586
|
-
}
|
32519
|
+
{
|
32520
|
+
tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
|
32521
|
+
output_index: 0,
|
32522
|
+
tx_pointer_block_height: 0,
|
32523
|
+
tx_pointer_tx_idx: 0,
|
32524
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32525
|
+
amount: 18446744073709552e3,
|
32526
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32587
32527
|
},
|
32588
|
-
|
32589
|
-
|
32590
|
-
|
32591
|
-
|
32592
|
-
|
32528
|
+
{
|
32529
|
+
tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
|
32530
|
+
output_index: 0,
|
32531
|
+
tx_pointer_block_height: 0,
|
32532
|
+
tx_pointer_tx_idx: 0,
|
32533
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32534
|
+
amount: 18446744073709552e3,
|
32535
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32593
32536
|
},
|
32594
|
-
|
32595
|
-
|
32596
|
-
|
32597
|
-
|
32598
|
-
|
32537
|
+
{
|
32538
|
+
tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
|
32539
|
+
output_index: 0,
|
32540
|
+
tx_pointer_block_height: 0,
|
32541
|
+
tx_pointer_tx_idx: 0,
|
32542
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32543
|
+
amount: 18446744073709552e3,
|
32544
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32599
32545
|
},
|
32600
|
-
|
32601
|
-
|
32602
|
-
|
32603
|
-
|
32604
|
-
|
32546
|
+
{
|
32547
|
+
tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
|
32548
|
+
output_index: 0,
|
32549
|
+
tx_pointer_block_height: 0,
|
32550
|
+
tx_pointer_tx_idx: 0,
|
32551
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32552
|
+
amount: 18446744073709552e3,
|
32553
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32605
32554
|
},
|
32606
|
-
|
32607
|
-
|
32608
|
-
|
32609
|
-
|
32610
|
-
|
32555
|
+
{
|
32556
|
+
tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
|
32557
|
+
output_index: 0,
|
32558
|
+
tx_pointer_block_height: 0,
|
32559
|
+
tx_pointer_tx_idx: 0,
|
32560
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32561
|
+
amount: 18446744073709552e3,
|
32562
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32611
32563
|
},
|
32612
|
-
|
32613
|
-
|
32614
|
-
|
32615
|
-
|
32616
|
-
|
32564
|
+
{
|
32565
|
+
tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
|
32566
|
+
output_index: 0,
|
32567
|
+
tx_pointer_block_height: 0,
|
32568
|
+
tx_pointer_tx_idx: 0,
|
32569
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32570
|
+
amount: 18446744073709552e3,
|
32571
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32617
32572
|
},
|
32618
|
-
|
32619
|
-
|
32620
|
-
|
32621
|
-
|
32622
|
-
|
32573
|
+
{
|
32574
|
+
tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
|
32575
|
+
output_index: 0,
|
32576
|
+
tx_pointer_block_height: 0,
|
32577
|
+
tx_pointer_tx_idx: 0,
|
32578
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32579
|
+
amount: 18446744073709552e3,
|
32580
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32623
32581
|
},
|
32624
|
-
|
32625
|
-
|
32626
|
-
|
32627
|
-
|
32628
|
-
|
32582
|
+
{
|
32583
|
+
tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
|
32584
|
+
output_index: 0,
|
32585
|
+
tx_pointer_block_height: 0,
|
32586
|
+
tx_pointer_tx_idx: 0,
|
32587
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32588
|
+
amount: 18446744073709552e3,
|
32589
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32629
32590
|
},
|
32630
|
-
|
32631
|
-
|
32632
|
-
|
32633
|
-
|
32634
|
-
|
32591
|
+
{
|
32592
|
+
tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
|
32593
|
+
output_index: 0,
|
32594
|
+
tx_pointer_block_height: 0,
|
32595
|
+
tx_pointer_tx_idx: 0,
|
32596
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32597
|
+
amount: 18446744073709552e3,
|
32598
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32635
32599
|
},
|
32636
|
-
|
32637
|
-
|
32638
|
-
|
32639
|
-
|
32640
|
-
|
32600
|
+
{
|
32601
|
+
tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
|
32602
|
+
output_index: 0,
|
32603
|
+
tx_pointer_block_height: 0,
|
32604
|
+
tx_pointer_tx_idx: 0,
|
32605
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32606
|
+
amount: 18446744073709552e3,
|
32607
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32641
32608
|
},
|
32642
|
-
|
32643
|
-
|
32644
|
-
|
32645
|
-
|
32646
|
-
|
32609
|
+
{
|
32610
|
+
tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
|
32611
|
+
output_index: 0,
|
32612
|
+
tx_pointer_block_height: 0,
|
32613
|
+
tx_pointer_tx_idx: 0,
|
32614
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32615
|
+
amount: 18446744073709552e3,
|
32616
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32647
32617
|
},
|
32648
|
-
|
32649
|
-
|
32650
|
-
|
32651
|
-
|
32652
|
-
|
32618
|
+
{
|
32619
|
+
tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
|
32620
|
+
output_index: 0,
|
32621
|
+
tx_pointer_block_height: 0,
|
32622
|
+
tx_pointer_tx_idx: 0,
|
32623
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32624
|
+
amount: 18446744073709552e3,
|
32625
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32653
32626
|
},
|
32654
|
-
|
32655
|
-
|
32656
|
-
|
32657
|
-
|
32658
|
-
|
32627
|
+
{
|
32628
|
+
tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
|
32629
|
+
output_index: 0,
|
32630
|
+
tx_pointer_block_height: 0,
|
32631
|
+
tx_pointer_tx_idx: 0,
|
32632
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32633
|
+
amount: 18446744073709552e3,
|
32634
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32659
32635
|
},
|
32660
|
-
|
32661
|
-
|
32662
|
-
|
32663
|
-
|
32664
|
-
|
32636
|
+
{
|
32637
|
+
tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
|
32638
|
+
output_index: 0,
|
32639
|
+
tx_pointer_block_height: 0,
|
32640
|
+
tx_pointer_tx_idx: 0,
|
32641
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32642
|
+
amount: 18446744073709552e3,
|
32643
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32665
32644
|
},
|
32666
|
-
|
32667
|
-
|
32668
|
-
|
32669
|
-
|
32670
|
-
|
32645
|
+
{
|
32646
|
+
tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
|
32647
|
+
output_index: 0,
|
32648
|
+
tx_pointer_block_height: 0,
|
32649
|
+
tx_pointer_tx_idx: 0,
|
32650
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32651
|
+
amount: 18446744073709552e3,
|
32652
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32671
32653
|
},
|
32672
|
-
|
32673
|
-
|
32674
|
-
|
32675
|
-
|
32676
|
-
|
32654
|
+
{
|
32655
|
+
tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
|
32656
|
+
output_index: 0,
|
32657
|
+
tx_pointer_block_height: 0,
|
32658
|
+
tx_pointer_tx_idx: 0,
|
32659
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32660
|
+
amount: 18446744073709552e3,
|
32661
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32677
32662
|
},
|
32678
|
-
|
32679
|
-
|
32680
|
-
|
32681
|
-
|
32682
|
-
|
32663
|
+
{
|
32664
|
+
tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
|
32665
|
+
output_index: 0,
|
32666
|
+
tx_pointer_block_height: 0,
|
32667
|
+
tx_pointer_tx_idx: 0,
|
32668
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32669
|
+
amount: 18446744073709552e3,
|
32670
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32683
32671
|
},
|
32684
|
-
|
32685
|
-
|
32686
|
-
|
32687
|
-
|
32688
|
-
|
32672
|
+
{
|
32673
|
+
tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
|
32674
|
+
output_index: 0,
|
32675
|
+
tx_pointer_block_height: 0,
|
32676
|
+
tx_pointer_tx_idx: 0,
|
32677
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32678
|
+
amount: 18446744073709552e3,
|
32679
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32689
32680
|
},
|
32690
|
-
|
32691
|
-
|
32692
|
-
|
32693
|
-
|
32694
|
-
|
32681
|
+
{
|
32682
|
+
tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
|
32683
|
+
output_index: 0,
|
32684
|
+
tx_pointer_block_height: 0,
|
32685
|
+
tx_pointer_tx_idx: 0,
|
32686
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32687
|
+
amount: 18446744073709552e3,
|
32688
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32695
32689
|
},
|
32696
|
-
|
32697
|
-
|
32698
|
-
|
32699
|
-
|
32700
|
-
|
32690
|
+
{
|
32691
|
+
tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
|
32692
|
+
output_index: 0,
|
32693
|
+
tx_pointer_block_height: 0,
|
32694
|
+
tx_pointer_tx_idx: 0,
|
32695
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32696
|
+
amount: 18446744073709552e3,
|
32697
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32701
32698
|
},
|
32702
|
-
|
32703
|
-
|
32704
|
-
|
32705
|
-
|
32706
|
-
|
32699
|
+
{
|
32700
|
+
tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
|
32701
|
+
output_index: 0,
|
32702
|
+
tx_pointer_block_height: 0,
|
32703
|
+
tx_pointer_tx_idx: 0,
|
32704
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32705
|
+
amount: 18446744073709552e3,
|
32706
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32707
|
+
},
|
32708
|
+
{
|
32709
|
+
tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
|
32710
|
+
output_index: 0,
|
32711
|
+
tx_pointer_block_height: 0,
|
32712
|
+
tx_pointer_tx_idx: 0,
|
32713
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32714
|
+
amount: 18446744073709552e3,
|
32715
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32716
|
+
},
|
32717
|
+
{
|
32718
|
+
tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
|
32719
|
+
output_index: 0,
|
32720
|
+
tx_pointer_block_height: 0,
|
32721
|
+
tx_pointer_tx_idx: 0,
|
32722
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32723
|
+
amount: 18446744073709552e3,
|
32724
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32725
|
+
},
|
32726
|
+
{
|
32727
|
+
tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
|
32728
|
+
output_index: 0,
|
32729
|
+
tx_pointer_block_height: 0,
|
32730
|
+
tx_pointer_tx_idx: 0,
|
32731
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32732
|
+
amount: 18446744073709552e3,
|
32733
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32734
|
+
},
|
32735
|
+
{
|
32736
|
+
tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
|
32737
|
+
output_index: 0,
|
32738
|
+
tx_pointer_block_height: 0,
|
32739
|
+
tx_pointer_tx_idx: 0,
|
32740
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32741
|
+
amount: 18446744073709552e3,
|
32742
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32743
|
+
},
|
32744
|
+
{
|
32745
|
+
tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
|
32746
|
+
output_index: 0,
|
32747
|
+
tx_pointer_block_height: 0,
|
32748
|
+
tx_pointer_tx_idx: 0,
|
32749
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32750
|
+
amount: 18446744073709552e3,
|
32751
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32752
|
+
},
|
32753
|
+
{
|
32754
|
+
tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
|
32755
|
+
output_index: 0,
|
32756
|
+
tx_pointer_block_height: 0,
|
32757
|
+
tx_pointer_tx_idx: 0,
|
32758
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32759
|
+
amount: 18446744073709552e3,
|
32760
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32761
|
+
},
|
32762
|
+
{
|
32763
|
+
tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
|
32764
|
+
output_index: 0,
|
32765
|
+
tx_pointer_block_height: 0,
|
32766
|
+
tx_pointer_tx_idx: 0,
|
32767
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32768
|
+
amount: 18446744073709552e3,
|
32769
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32770
|
+
},
|
32771
|
+
{
|
32772
|
+
tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
|
32773
|
+
output_index: 0,
|
32774
|
+
tx_pointer_block_height: 0,
|
32775
|
+
tx_pointer_tx_idx: 0,
|
32776
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32777
|
+
amount: 18446744073709552e3,
|
32778
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32779
|
+
},
|
32780
|
+
{
|
32781
|
+
tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
|
32782
|
+
output_index: 0,
|
32783
|
+
tx_pointer_block_height: 0,
|
32784
|
+
tx_pointer_tx_idx: 0,
|
32785
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32786
|
+
amount: 18446744073709552e3,
|
32787
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32788
|
+
},
|
32789
|
+
{
|
32790
|
+
tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
|
32791
|
+
output_index: 0,
|
32792
|
+
tx_pointer_block_height: 0,
|
32793
|
+
tx_pointer_tx_idx: 0,
|
32794
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32795
|
+
amount: 18446744073709552e3,
|
32796
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32797
|
+
},
|
32798
|
+
{
|
32799
|
+
tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
|
32800
|
+
output_index: 0,
|
32801
|
+
tx_pointer_block_height: 0,
|
32802
|
+
tx_pointer_tx_idx: 0,
|
32803
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32804
|
+
amount: 18446744073709552e3,
|
32805
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32806
|
+
},
|
32807
|
+
{
|
32808
|
+
tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
|
32809
|
+
output_index: 0,
|
32810
|
+
tx_pointer_block_height: 0,
|
32811
|
+
tx_pointer_tx_idx: 0,
|
32812
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32813
|
+
amount: 18446744073709552e3,
|
32814
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32815
|
+
},
|
32816
|
+
{
|
32817
|
+
tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
|
32818
|
+
output_index: 0,
|
32819
|
+
tx_pointer_block_height: 0,
|
32820
|
+
tx_pointer_tx_idx: 0,
|
32821
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32822
|
+
amount: 18446744073709552e3,
|
32823
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32824
|
+
},
|
32825
|
+
{
|
32826
|
+
tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
|
32827
|
+
output_index: 0,
|
32828
|
+
tx_pointer_block_height: 0,
|
32829
|
+
tx_pointer_tx_idx: 0,
|
32830
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32831
|
+
amount: 18446744073709552e3,
|
32832
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32833
|
+
},
|
32834
|
+
{
|
32835
|
+
tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
|
32836
|
+
output_index: 0,
|
32837
|
+
tx_pointer_block_height: 0,
|
32838
|
+
tx_pointer_tx_idx: 0,
|
32839
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32840
|
+
amount: 18446744073709552e3,
|
32841
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32842
|
+
},
|
32843
|
+
{
|
32844
|
+
tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
|
32845
|
+
output_index: 0,
|
32846
|
+
tx_pointer_block_height: 0,
|
32847
|
+
tx_pointer_tx_idx: 0,
|
32848
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32849
|
+
amount: 18446744073709552e3,
|
32850
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32851
|
+
},
|
32852
|
+
{
|
32853
|
+
tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
|
32854
|
+
output_index: 0,
|
32855
|
+
tx_pointer_block_height: 0,
|
32856
|
+
tx_pointer_tx_idx: 0,
|
32857
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32858
|
+
amount: 18446744073709552e3,
|
32859
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32860
|
+
},
|
32861
|
+
{
|
32862
|
+
tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
|
32863
|
+
output_index: 0,
|
32864
|
+
tx_pointer_block_height: 0,
|
32865
|
+
tx_pointer_tx_idx: 0,
|
32866
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32867
|
+
amount: 18446744073709552e3,
|
32868
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32869
|
+
},
|
32870
|
+
{
|
32871
|
+
tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
|
32872
|
+
output_index: 0,
|
32873
|
+
tx_pointer_block_height: 0,
|
32874
|
+
tx_pointer_tx_idx: 0,
|
32875
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32876
|
+
amount: 18446744073709552e3,
|
32877
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32878
|
+
},
|
32879
|
+
{
|
32880
|
+
tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
|
32881
|
+
output_index: 0,
|
32882
|
+
tx_pointer_block_height: 0,
|
32883
|
+
tx_pointer_tx_idx: 0,
|
32884
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32885
|
+
amount: 18446744073709552e3,
|
32886
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32887
|
+
},
|
32888
|
+
{
|
32889
|
+
tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
|
32890
|
+
output_index: 0,
|
32891
|
+
tx_pointer_block_height: 0,
|
32892
|
+
tx_pointer_tx_idx: 0,
|
32893
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32894
|
+
amount: 18446744073709552e3,
|
32895
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32896
|
+
},
|
32897
|
+
{
|
32898
|
+
tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
|
32899
|
+
output_index: 0,
|
32900
|
+
tx_pointer_block_height: 0,
|
32901
|
+
tx_pointer_tx_idx: 0,
|
32902
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32903
|
+
amount: 18446744073709552e3,
|
32904
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32905
|
+
},
|
32906
|
+
{
|
32907
|
+
tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
|
32908
|
+
output_index: 0,
|
32909
|
+
tx_pointer_block_height: 0,
|
32910
|
+
tx_pointer_tx_idx: 0,
|
32911
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32912
|
+
amount: 18446744073709552e3,
|
32913
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32707
32914
|
}
|
32708
|
-
|
32915
|
+
],
|
32916
|
+
messages: [
|
32917
|
+
{
|
32918
|
+
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32919
|
+
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32920
|
+
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32921
|
+
amount: 18446744073709552e3,
|
32922
|
+
data: "",
|
32923
|
+
da_height: 0
|
32924
|
+
},
|
32925
|
+
{
|
32926
|
+
sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32927
|
+
recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32928
|
+
nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
|
32929
|
+
amount: 12704439083013452e3,
|
32930
|
+
data: "",
|
32931
|
+
da_height: 0
|
32932
|
+
}
|
32933
|
+
],
|
32934
|
+
contracts: [],
|
32935
|
+
block_height: 0,
|
32936
|
+
da_block_height: 0
|
32937
|
+
};
|
32938
|
+
var defaultChainConfigs = {
|
32939
|
+
chainConfigJson: chainConfig_default,
|
32940
|
+
metadataJson: metadata_default,
|
32941
|
+
stateConfigJson: stateConfig_default
|
32709
32942
|
};
|
32710
|
-
var defaultChainConfig = chainConfig_default;
|
32711
32943
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32712
32944
|
|
32713
32945
|
// ../crypto/dist/index.mjs
|
32714
|
-
var
|
32946
|
+
var import_crypto9 = __toESM(__require("crypto"), 1);
|
32715
32947
|
|
32716
32948
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
|
32717
32949
|
var version = "6.7.1";
|
@@ -33783,6 +34015,27 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
33783
34015
|
};
|
33784
34016
|
Object.freeze(pbkdf22);
|
33785
34017
|
|
34018
|
+
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/random.js
|
34019
|
+
var locked5 = false;
|
34020
|
+
var _randomBytes = function(length) {
|
34021
|
+
return new Uint8Array((0, import_crypto2.randomBytes)(length));
|
34022
|
+
};
|
34023
|
+
var __randomBytes = _randomBytes;
|
34024
|
+
function randomBytes3(length) {
|
34025
|
+
return __randomBytes(length);
|
34026
|
+
}
|
34027
|
+
randomBytes3._ = _randomBytes;
|
34028
|
+
randomBytes3.lock = function() {
|
34029
|
+
locked5 = true;
|
34030
|
+
};
|
34031
|
+
randomBytes3.register = function(func) {
|
34032
|
+
if (locked5) {
|
34033
|
+
throw new Error("randomBytes is locked");
|
34034
|
+
}
|
34035
|
+
__randomBytes = func;
|
34036
|
+
};
|
34037
|
+
Object.freeze(randomBytes3);
|
34038
|
+
|
33786
34039
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
|
33787
34040
|
var BN_03 = BigInt(0);
|
33788
34041
|
var BN_36 = BigInt(36);
|
@@ -34367,8 +34620,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34367
34620
|
}
|
34368
34621
|
|
34369
34622
|
// ../crypto/dist/index.mjs
|
34370
|
-
var import_crypto9 = __toESM(__require("crypto"), 1);
|
34371
34623
|
var import_crypto10 = __toESM(__require("crypto"), 1);
|
34624
|
+
var import_crypto11 = __toESM(__require("crypto"), 1);
|
34372
34625
|
var scrypt3 = (params) => {
|
34373
34626
|
const { password, salt, n, p, r, dklen } = params;
|
34374
34627
|
const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
|
@@ -34377,7 +34630,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34377
34630
|
var keccak2562 = (data) => keccak_256(data);
|
34378
34631
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
34379
34632
|
var randomBytes4 = (length) => {
|
34380
|
-
const randomValues = Uint8Array.from(
|
34633
|
+
const randomValues = Uint8Array.from(import_crypto10.default.randomBytes(length));
|
34381
34634
|
return randomValues;
|
34382
34635
|
};
|
34383
34636
|
var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
|
@@ -34392,7 +34645,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34392
34645
|
const salt = randomBytes4(32);
|
34393
34646
|
const secret = keyFromPassword(password, salt);
|
34394
34647
|
const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
|
34395
|
-
const cipher = await
|
34648
|
+
const cipher = await import_crypto9.default.createCipheriv(ALGORITHM, secret, iv);
|
34396
34649
|
let cipherData = cipher.update(dataBuffer);
|
34397
34650
|
cipherData = Buffer.concat([cipherData, cipher.final()]);
|
34398
34651
|
return {
|
@@ -34406,7 +34659,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34406
34659
|
const salt = bufferFromString(keystore.salt);
|
34407
34660
|
const secret = keyFromPassword(password, salt);
|
34408
34661
|
const encryptedText = bufferFromString(keystore.data);
|
34409
|
-
const decipher = await
|
34662
|
+
const decipher = await import_crypto9.default.createDecipheriv(ALGORITHM, secret, iv);
|
34410
34663
|
const decrypted = decipher.update(encryptedText);
|
34411
34664
|
const deBuff = Buffer.concat([decrypted, decipher.final()]);
|
34412
34665
|
const decryptedData = Buffer.from(deBuff).toString("utf-8");
|
@@ -34417,12 +34670,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34417
34670
|
}
|
34418
34671
|
};
|
34419
34672
|
async function encryptJsonWalletData(data, key, iv) {
|
34420
|
-
const cipher = await
|
34673
|
+
const cipher = await import_crypto11.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
34421
34674
|
const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
|
34422
34675
|
return new Uint8Array(encrypted);
|
34423
34676
|
}
|
34424
34677
|
async function decryptJsonWalletData(data, key, iv) {
|
34425
|
-
const decipher =
|
34678
|
+
const decipher = import_crypto11.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
34426
34679
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
34427
34680
|
return new Uint8Array(decrypted);
|
34428
34681
|
}
|
@@ -34756,6 +35009,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34756
35009
|
}
|
34757
35010
|
};
|
34758
35011
|
|
35012
|
+
// ../address/dist/configs.mjs
|
35013
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
35014
|
+
var BaseAssetId = ZeroBytes32;
|
35015
|
+
|
34759
35016
|
// ../math/dist/index.mjs
|
34760
35017
|
var import_bn = __toESM(require_bn(), 1);
|
34761
35018
|
var DEFAULT_PRECISION = 9;
|
@@ -34975,32 +35232,182 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34975
35232
|
function toBytes3(value, bytesPadding) {
|
34976
35233
|
return bn(value).toBytes(bytesPadding);
|
34977
35234
|
}
|
34978
|
-
|
34979
|
-
|
35235
|
+
|
35236
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
35237
|
+
function _isPlaceholder(a) {
|
35238
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
35239
|
+
}
|
35240
|
+
|
35241
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
35242
|
+
function _curry1(fn) {
|
35243
|
+
return function f1(a) {
|
35244
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
35245
|
+
return f1;
|
35246
|
+
} else {
|
35247
|
+
return fn.apply(this, arguments);
|
35248
|
+
}
|
35249
|
+
};
|
35250
|
+
}
|
35251
|
+
|
35252
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
35253
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
35254
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
35255
|
+
};
|
35256
|
+
|
35257
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
35258
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
35259
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
35260
|
+
});
|
35261
|
+
var type_default = type;
|
35262
|
+
|
35263
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
35264
|
+
var pad = function pad2(n) {
|
35265
|
+
return (n < 10 ? "0" : "") + n;
|
35266
|
+
};
|
35267
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
35268
|
+
return d.toISOString();
|
35269
|
+
} : function _toISOString3(d) {
|
35270
|
+
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";
|
35271
|
+
};
|
35272
|
+
|
35273
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
35274
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
35275
|
+
return n << 0 === n;
|
35276
|
+
};
|
35277
|
+
|
35278
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
35279
|
+
function _cloneRegExp(pattern) {
|
35280
|
+
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" : ""));
|
35281
|
+
}
|
35282
|
+
|
35283
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
35284
|
+
function _clone(value, deep, map) {
|
35285
|
+
map || (map = new _ObjectMap());
|
35286
|
+
if (_isPrimitive(value)) {
|
35287
|
+
return value;
|
35288
|
+
}
|
35289
|
+
var copy = function copy2(copiedValue) {
|
35290
|
+
var cachedCopy = map.get(value);
|
35291
|
+
if (cachedCopy) {
|
35292
|
+
return cachedCopy;
|
35293
|
+
}
|
35294
|
+
map.set(value, copiedValue);
|
35295
|
+
for (var key in value) {
|
35296
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
35297
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
35298
|
+
}
|
35299
|
+
}
|
35300
|
+
return copiedValue;
|
35301
|
+
};
|
35302
|
+
switch (type_default(value)) {
|
35303
|
+
case "Object":
|
35304
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
35305
|
+
case "Array":
|
35306
|
+
return copy([]);
|
35307
|
+
case "Date":
|
35308
|
+
return new Date(value.valueOf());
|
35309
|
+
case "RegExp":
|
35310
|
+
return _cloneRegExp(value);
|
35311
|
+
case "Int8Array":
|
35312
|
+
case "Uint8Array":
|
35313
|
+
case "Uint8ClampedArray":
|
35314
|
+
case "Int16Array":
|
35315
|
+
case "Uint16Array":
|
35316
|
+
case "Int32Array":
|
35317
|
+
case "Uint32Array":
|
35318
|
+
case "Float32Array":
|
35319
|
+
case "Float64Array":
|
35320
|
+
case "BigInt64Array":
|
35321
|
+
case "BigUint64Array":
|
35322
|
+
return value.slice();
|
35323
|
+
default:
|
35324
|
+
return value;
|
35325
|
+
}
|
35326
|
+
}
|
35327
|
+
function _isPrimitive(param) {
|
35328
|
+
var type3 = typeof param;
|
35329
|
+
return param == null || type3 != "object" && type3 != "function";
|
34980
35330
|
}
|
35331
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
35332
|
+
function _ObjectMap2() {
|
35333
|
+
this.map = {};
|
35334
|
+
this.length = 0;
|
35335
|
+
}
|
35336
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
35337
|
+
const hashedKey = this.hash(key);
|
35338
|
+
let bucket = this.map[hashedKey];
|
35339
|
+
if (!bucket) {
|
35340
|
+
this.map[hashedKey] = bucket = [];
|
35341
|
+
}
|
35342
|
+
bucket.push([key, value]);
|
35343
|
+
this.length += 1;
|
35344
|
+
};
|
35345
|
+
_ObjectMap2.prototype.hash = function(key) {
|
35346
|
+
let hashedKey = [];
|
35347
|
+
for (var value in key) {
|
35348
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
35349
|
+
}
|
35350
|
+
return hashedKey.join();
|
35351
|
+
};
|
35352
|
+
_ObjectMap2.prototype.get = function(key) {
|
35353
|
+
if (this.length <= 180) {
|
35354
|
+
for (const p in this.map) {
|
35355
|
+
const bucket2 = this.map[p];
|
35356
|
+
for (let i = 0; i < bucket2.length; i += 1) {
|
35357
|
+
const element = bucket2[i];
|
35358
|
+
if (element[0] === key) {
|
35359
|
+
return element[1];
|
35360
|
+
}
|
35361
|
+
}
|
35362
|
+
}
|
35363
|
+
return;
|
35364
|
+
}
|
35365
|
+
const hashedKey = this.hash(key);
|
35366
|
+
const bucket = this.map[hashedKey];
|
35367
|
+
if (!bucket) {
|
35368
|
+
return;
|
35369
|
+
}
|
35370
|
+
for (let i = 0; i < bucket.length; i += 1) {
|
35371
|
+
const element = bucket[i];
|
35372
|
+
if (element[0] === key) {
|
35373
|
+
return element[1];
|
35374
|
+
}
|
35375
|
+
}
|
35376
|
+
};
|
35377
|
+
return _ObjectMap2;
|
35378
|
+
}();
|
35379
|
+
|
35380
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
35381
|
+
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
35382
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
35383
|
+
});
|
35384
|
+
var clone_default = clone;
|
35385
|
+
|
35386
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
35387
|
+
var hasProtoTrim = typeof String.prototype.trim === "function";
|
34981
35388
|
|
34982
35389
|
// src/providers/coin-quantity.ts
|
34983
35390
|
var coinQuantityfy = (coinQuantityLike) => {
|
34984
35391
|
let assetId;
|
34985
35392
|
let amount;
|
34986
|
-
let
|
35393
|
+
let max;
|
34987
35394
|
if (Array.isArray(coinQuantityLike)) {
|
34988
35395
|
amount = coinQuantityLike[0];
|
34989
|
-
assetId = coinQuantityLike[1];
|
34990
|
-
|
35396
|
+
assetId = coinQuantityLike[1] ?? BaseAssetId;
|
35397
|
+
max = coinQuantityLike[2] ?? void 0;
|
34991
35398
|
} else {
|
34992
35399
|
amount = coinQuantityLike.amount;
|
34993
|
-
assetId = coinQuantityLike.assetId;
|
34994
|
-
|
35400
|
+
assetId = coinQuantityLike.assetId ?? BaseAssetId;
|
35401
|
+
max = coinQuantityLike.max ?? void 0;
|
34995
35402
|
}
|
34996
35403
|
const bnAmount = bn(amount);
|
34997
35404
|
return {
|
34998
35405
|
assetId: hexlify(assetId),
|
34999
35406
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35000
|
-
max:
|
35407
|
+
max: max ? bn(max) : void 0
|
35001
35408
|
};
|
35002
35409
|
};
|
35003
|
-
var
|
35410
|
+
var addAmountToCoinQuantities = (params) => {
|
35004
35411
|
const { amount, assetId } = params;
|
35005
35412
|
const coinQuantities = [...params.coinQuantities];
|
35006
35413
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35074,9 +35481,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35074
35481
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35075
35482
|
var MAX_BYTES = 2 ** 32 - 1;
|
35076
35483
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35077
|
-
|
35484
|
+
ASSET_ID_LEN + // Base asset ID
|
35078
35485
|
// Asset ID/Balance coin input pairs
|
35079
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35486
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
|
35080
35487
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35081
35488
|
WORD_SIZE + // Gas limit
|
35082
35489
|
WORD_SIZE + // Script size
|
@@ -35094,7 +35501,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35094
35501
|
ASSET_ID_LEN + // Asset id
|
35095
35502
|
TX_POINTER_LEN + // TxPointer
|
35096
35503
|
WORD_SIZE + // Witnesses index
|
35097
|
-
WORD_SIZE + // Maturity
|
35098
35504
|
WORD_SIZE + // Predicate size
|
35099
35505
|
WORD_SIZE + // Predicate data size
|
35100
35506
|
WORD_SIZE;
|
@@ -35416,7 +35822,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35416
35822
|
constructor(name, coders) {
|
35417
35823
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35418
35824
|
const encodedValueSize = Object.values(coders).reduce(
|
35419
|
-
(
|
35825
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
35420
35826
|
0
|
35421
35827
|
);
|
35422
35828
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36120,7 +36526,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36120
36526
|
constructor(name, coders) {
|
36121
36527
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36122
36528
|
const encodedValueSize = Object.values(coders).reduce(
|
36123
|
-
(
|
36529
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
36124
36530
|
0
|
36125
36531
|
);
|
36126
36532
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36832,18 +37238,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36832
37238
|
encode(value) {
|
36833
37239
|
const parts = [];
|
36834
37240
|
parts.push(new B256Coder().encode(value.txID));
|
36835
|
-
parts.push(new NumberCoder("
|
37241
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36836
37242
|
parts.push(new B256Coder().encode(value.owner));
|
36837
37243
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36838
37244
|
parts.push(new B256Coder().encode(value.assetId));
|
36839
37245
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
36840
|
-
parts.push(new NumberCoder("
|
36841
|
-
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37246
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36842
37247
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36843
|
-
parts.push(new
|
36844
|
-
parts.push(new
|
36845
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36846
|
-
parts.push(
|
37248
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37249
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
37250
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37251
|
+
parts.push(
|
37252
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37253
|
+
);
|
36847
37254
|
return concat(parts);
|
36848
37255
|
}
|
36849
37256
|
decode(data, offset) {
|
@@ -36851,7 +37258,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36851
37258
|
let o = offset;
|
36852
37259
|
[decoded, o] = new B256Coder().decode(data, o);
|
36853
37260
|
const txID = decoded;
|
36854
|
-
[decoded, o] = new NumberCoder("
|
37261
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36855
37262
|
const outputIndex = decoded;
|
36856
37263
|
[decoded, o] = new B256Coder().decode(data, o);
|
36857
37264
|
const owner = decoded;
|
@@ -36861,19 +37268,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36861
37268
|
const assetId = decoded;
|
36862
37269
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
36863
37270
|
const txPointer = decoded;
|
36864
|
-
[decoded, o] = new NumberCoder("
|
37271
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36865
37272
|
const witnessIndex = Number(decoded);
|
36866
|
-
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36867
|
-
const maturity = decoded;
|
36868
37273
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36869
37274
|
const predicateGasUsed = decoded;
|
36870
|
-
[decoded, o] = new
|
37275
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36871
37276
|
const predicateLength = decoded;
|
36872
|
-
[decoded, o] = new
|
37277
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36873
37278
|
const predicateDataLength = decoded;
|
36874
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37279
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
36875
37280
|
const predicate = decoded;
|
36876
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37281
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
36877
37282
|
const predicateData = decoded;
|
36878
37283
|
return [
|
36879
37284
|
{
|
@@ -36885,7 +37290,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36885
37290
|
assetId,
|
36886
37291
|
txPointer,
|
36887
37292
|
witnessIndex,
|
36888
|
-
maturity,
|
36889
37293
|
predicateGasUsed,
|
36890
37294
|
predicateLength,
|
36891
37295
|
predicateDataLength,
|
@@ -36903,7 +37307,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36903
37307
|
encode(value) {
|
36904
37308
|
const parts = [];
|
36905
37309
|
parts.push(new B256Coder().encode(value.txID));
|
36906
|
-
parts.push(new NumberCoder("
|
37310
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36907
37311
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
36908
37312
|
parts.push(new B256Coder().encode(value.stateRoot));
|
36909
37313
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -36915,7 +37319,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36915
37319
|
let o = offset;
|
36916
37320
|
[decoded, o] = new B256Coder().decode(data, o);
|
36917
37321
|
const txID = decoded;
|
36918
|
-
[decoded, o] = new NumberCoder("
|
37322
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36919
37323
|
const outputIndex = decoded;
|
36920
37324
|
[decoded, o] = new B256Coder().decode(data, o);
|
36921
37325
|
const balanceRoot = decoded;
|
@@ -36964,14 +37368,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36964
37368
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
36965
37369
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36966
37370
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
36967
|
-
parts.push(new NumberCoder("
|
37371
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36968
37372
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36969
|
-
parts.push(new
|
36970
|
-
parts.push(new
|
36971
|
-
parts.push(new
|
37373
|
+
parts.push(new BigNumberCoder("u64").encode(data.length));
|
37374
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37375
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
36972
37376
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
36973
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36974
|
-
parts.push(
|
37377
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37378
|
+
parts.push(
|
37379
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37380
|
+
);
|
36975
37381
|
return concat(parts);
|
36976
37382
|
}
|
36977
37383
|
static decodeData(messageData) {
|
@@ -36991,21 +37397,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36991
37397
|
const amount = decoded;
|
36992
37398
|
[decoded, o] = new B256Coder().decode(data, o);
|
36993
37399
|
const nonce = decoded;
|
36994
|
-
[decoded, o] = new NumberCoder("
|
37400
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36995
37401
|
const witnessIndex = Number(decoded);
|
36996
37402
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36997
37403
|
const predicateGasUsed = decoded;
|
36998
37404
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36999
37405
|
const dataLength2 = decoded;
|
37000
|
-
[decoded, o] = new
|
37406
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37001
37407
|
const predicateLength = decoded;
|
37002
|
-
[decoded, o] = new
|
37408
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37003
37409
|
const predicateDataLength = decoded;
|
37004
37410
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37005
37411
|
const messageData = decoded;
|
37006
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37412
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
37007
37413
|
const predicate = decoded;
|
37008
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37414
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
37009
37415
|
const predicateData = decoded;
|
37010
37416
|
return [
|
37011
37417
|
{
|
@@ -37317,7 +37723,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37317
37723
|
}
|
37318
37724
|
};
|
37319
37725
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37320
|
-
PolicyType2[PolicyType2["
|
37726
|
+
PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
|
37321
37727
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37322
37728
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37323
37729
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37365,9 +37771,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37365
37771
|
let o = offset;
|
37366
37772
|
const policies = [];
|
37367
37773
|
if (policyTypes & 1) {
|
37368
|
-
const [
|
37774
|
+
const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37369
37775
|
o = nextOffset;
|
37370
|
-
policies.push({ type: 1, data:
|
37776
|
+
policies.push({ type: 1, data: tip });
|
37371
37777
|
}
|
37372
37778
|
if (policyTypes & 2) {
|
37373
37779
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -37599,15 +38005,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37599
38005
|
encode(value) {
|
37600
38006
|
const parts = [];
|
37601
38007
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
37602
|
-
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37603
|
-
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
37604
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37605
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37606
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37607
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37608
38008
|
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37609
|
-
parts.push(new
|
37610
|
-
parts.push(new
|
38009
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
|
38010
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
38011
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38012
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38013
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38014
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
38015
|
+
parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
|
38016
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
|
37611
38017
|
parts.push(new PoliciesCoder().encode(value.policies));
|
37612
38018
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37613
38019
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -37619,23 +38025,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37619
38025
|
let o = offset;
|
37620
38026
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37621
38027
|
const scriptGasLimit = decoded;
|
37622
|
-
[decoded, o] = new
|
38028
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38029
|
+
const receiptsRoot = decoded;
|
38030
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37623
38031
|
const scriptLength = decoded;
|
37624
|
-
[decoded, o] = new
|
38032
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37625
38033
|
const scriptDataLength = decoded;
|
37626
38034
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37627
38035
|
const policyTypes = decoded;
|
37628
|
-
[decoded, o] = new NumberCoder("
|
38036
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37629
38037
|
const inputsCount = decoded;
|
37630
|
-
[decoded, o] = new NumberCoder("
|
38038
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37631
38039
|
const outputsCount = decoded;
|
37632
|
-
[decoded, o] = new NumberCoder("
|
38040
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37633
38041
|
const witnessesCount = decoded;
|
37634
|
-
[decoded, o] = new
|
37635
|
-
const receiptsRoot = decoded;
|
37636
|
-
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38042
|
+
[decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
|
37637
38043
|
const script = decoded;
|
37638
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38044
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
|
37639
38045
|
const scriptData = decoded;
|
37640
38046
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37641
38047
|
const policies = decoded;
|
@@ -37673,18 +38079,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37673
38079
|
}
|
37674
38080
|
encode(value) {
|
37675
38081
|
const parts = [];
|
37676
|
-
parts.push(new NumberCoder("
|
37677
|
-
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
37678
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37679
|
-
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37680
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37681
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37682
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
38082
|
+
parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
|
37683
38083
|
parts.push(new B256Coder().encode(value.salt));
|
37684
|
-
parts.push(new
|
38084
|
+
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
38085
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38086
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38087
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38088
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
37685
38089
|
parts.push(
|
37686
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(
|
38090
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
|
38091
|
+
value.storageSlots
|
38092
|
+
)
|
37687
38093
|
);
|
38094
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
37688
38095
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37689
38096
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
37690
38097
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -37693,26 +38100,27 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37693
38100
|
decode(data, offset) {
|
37694
38101
|
let decoded;
|
37695
38102
|
let o = offset;
|
37696
|
-
[decoded, o] = new NumberCoder("
|
37697
|
-
const bytecodeLength = decoded;
|
37698
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38103
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37699
38104
|
const bytecodeWitnessIndex = decoded;
|
38105
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38106
|
+
const salt = decoded;
|
38107
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38108
|
+
const storageSlotsCount = decoded;
|
37700
38109
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37701
38110
|
const policyTypes = decoded;
|
37702
38111
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37703
|
-
const storageSlotsCount = decoded;
|
37704
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37705
38112
|
const inputsCount = decoded;
|
37706
|
-
[decoded, o] = new NumberCoder("
|
38113
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37707
38114
|
const outputsCount = decoded;
|
37708
|
-
[decoded, o] = new NumberCoder("
|
38115
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37709
38116
|
const witnessesCount = decoded;
|
37710
|
-
[decoded, o] = new
|
37711
|
-
|
38117
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
|
38118
|
+
data,
|
38119
|
+
o
|
38120
|
+
);
|
38121
|
+
const storageSlots = decoded;
|
37712
38122
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37713
38123
|
const policies = decoded;
|
37714
|
-
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37715
|
-
const storageSlots = decoded;
|
37716
38124
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
37717
38125
|
const inputs = decoded;
|
37718
38126
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -37722,7 +38130,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37722
38130
|
return [
|
37723
38131
|
{
|
37724
38132
|
type: 1,
|
37725
|
-
bytecodeLength,
|
37726
38133
|
bytecodeWitnessIndex,
|
37727
38134
|
policyTypes,
|
37728
38135
|
storageSlotsCount,
|
@@ -37751,6 +38158,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37751
38158
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
37752
38159
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
37753
38160
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38161
|
+
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
37754
38162
|
return concat(parts);
|
37755
38163
|
}
|
37756
38164
|
decode(data, offset) {
|
@@ -37766,6 +38174,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37766
38174
|
const mintAmount = decoded;
|
37767
38175
|
[decoded, o] = new B256Coder().decode(data, o);
|
37768
38176
|
const mintAssetId = decoded;
|
38177
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38178
|
+
const gasPrice = decoded;
|
37769
38179
|
return [
|
37770
38180
|
{
|
37771
38181
|
type: 2,
|
@@ -37773,7 +38183,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37773
38183
|
inputContract,
|
37774
38184
|
outputContract,
|
37775
38185
|
mintAmount,
|
37776
|
-
mintAssetId
|
38186
|
+
mintAssetId,
|
38187
|
+
gasPrice
|
37777
38188
|
},
|
37778
38189
|
o
|
37779
38190
|
];
|
@@ -38080,159 +38491,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38080
38491
|
// src/providers/provider.ts
|
38081
38492
|
var import_graphql_request = __toESM(require_dist2());
|
38082
38493
|
|
38083
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38084
|
-
function _isPlaceholder(a) {
|
38085
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38086
|
-
}
|
38087
|
-
|
38088
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38089
|
-
function _curry1(fn) {
|
38090
|
-
return function f1(a) {
|
38091
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38092
|
-
return f1;
|
38093
|
-
} else {
|
38094
|
-
return fn.apply(this, arguments);
|
38095
|
-
}
|
38096
|
-
};
|
38097
|
-
}
|
38098
|
-
|
38099
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38100
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
38101
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38102
|
-
};
|
38103
|
-
|
38104
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38105
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38106
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38107
|
-
});
|
38108
|
-
var type_default = type;
|
38109
|
-
|
38110
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38111
|
-
var pad = function pad2(n) {
|
38112
|
-
return (n < 10 ? "0" : "") + n;
|
38113
|
-
};
|
38114
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38115
|
-
return d.toISOString();
|
38116
|
-
} : function _toISOString3(d) {
|
38117
|
-
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";
|
38118
|
-
};
|
38119
|
-
|
38120
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38121
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38122
|
-
return n << 0 === n;
|
38123
|
-
};
|
38124
|
-
|
38125
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38126
|
-
function _cloneRegExp(pattern) {
|
38127
|
-
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" : ""));
|
38128
|
-
}
|
38129
|
-
|
38130
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38131
|
-
function _clone(value, deep, map) {
|
38132
|
-
map || (map = new _ObjectMap());
|
38133
|
-
if (_isPrimitive(value)) {
|
38134
|
-
return value;
|
38135
|
-
}
|
38136
|
-
var copy = function copy2(copiedValue) {
|
38137
|
-
var cachedCopy = map.get(value);
|
38138
|
-
if (cachedCopy) {
|
38139
|
-
return cachedCopy;
|
38140
|
-
}
|
38141
|
-
map.set(value, copiedValue);
|
38142
|
-
for (var key in value) {
|
38143
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38144
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38145
|
-
}
|
38146
|
-
}
|
38147
|
-
return copiedValue;
|
38148
|
-
};
|
38149
|
-
switch (type_default(value)) {
|
38150
|
-
case "Object":
|
38151
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
38152
|
-
case "Array":
|
38153
|
-
return copy([]);
|
38154
|
-
case "Date":
|
38155
|
-
return new Date(value.valueOf());
|
38156
|
-
case "RegExp":
|
38157
|
-
return _cloneRegExp(value);
|
38158
|
-
case "Int8Array":
|
38159
|
-
case "Uint8Array":
|
38160
|
-
case "Uint8ClampedArray":
|
38161
|
-
case "Int16Array":
|
38162
|
-
case "Uint16Array":
|
38163
|
-
case "Int32Array":
|
38164
|
-
case "Uint32Array":
|
38165
|
-
case "Float32Array":
|
38166
|
-
case "Float64Array":
|
38167
|
-
case "BigInt64Array":
|
38168
|
-
case "BigUint64Array":
|
38169
|
-
return value.slice();
|
38170
|
-
default:
|
38171
|
-
return value;
|
38172
|
-
}
|
38173
|
-
}
|
38174
|
-
function _isPrimitive(param) {
|
38175
|
-
var type3 = typeof param;
|
38176
|
-
return param == null || type3 != "object" && type3 != "function";
|
38177
|
-
}
|
38178
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
38179
|
-
function _ObjectMap2() {
|
38180
|
-
this.map = {};
|
38181
|
-
this.length = 0;
|
38182
|
-
}
|
38183
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
38184
|
-
const hashedKey = this.hash(key);
|
38185
|
-
let bucket = this.map[hashedKey];
|
38186
|
-
if (!bucket) {
|
38187
|
-
this.map[hashedKey] = bucket = [];
|
38188
|
-
}
|
38189
|
-
bucket.push([key, value]);
|
38190
|
-
this.length += 1;
|
38191
|
-
};
|
38192
|
-
_ObjectMap2.prototype.hash = function(key) {
|
38193
|
-
let hashedKey = [];
|
38194
|
-
for (var value in key) {
|
38195
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38196
|
-
}
|
38197
|
-
return hashedKey.join();
|
38198
|
-
};
|
38199
|
-
_ObjectMap2.prototype.get = function(key) {
|
38200
|
-
if (this.length <= 180) {
|
38201
|
-
for (const p in this.map) {
|
38202
|
-
const bucket2 = this.map[p];
|
38203
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
38204
|
-
const element = bucket2[i];
|
38205
|
-
if (element[0] === key) {
|
38206
|
-
return element[1];
|
38207
|
-
}
|
38208
|
-
}
|
38209
|
-
}
|
38210
|
-
return;
|
38211
|
-
}
|
38212
|
-
const hashedKey = this.hash(key);
|
38213
|
-
const bucket = this.map[hashedKey];
|
38214
|
-
if (!bucket) {
|
38215
|
-
return;
|
38216
|
-
}
|
38217
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
38218
|
-
const element = bucket[i];
|
38219
|
-
if (element[0] === key) {
|
38220
|
-
return element[1];
|
38221
|
-
}
|
38222
|
-
}
|
38223
|
-
};
|
38224
|
-
return _ObjectMap2;
|
38225
|
-
}();
|
38226
|
-
|
38227
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38228
|
-
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38229
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38230
|
-
});
|
38231
|
-
var clone_default = clone2;
|
38232
|
-
|
38233
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38234
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38235
|
-
|
38236
38494
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38237
38495
|
var __assign = function() {
|
38238
38496
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41400,14 +41658,10 @@ spurious results.`);
|
|
41400
41658
|
// src/providers/__generated__/operations.ts
|
41401
41659
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41402
41660
|
fragment receiptFragment on Receipt {
|
41403
|
-
|
41404
|
-
id
|
41405
|
-
}
|
41661
|
+
id
|
41406
41662
|
pc
|
41407
41663
|
is
|
41408
|
-
to
|
41409
|
-
id
|
41410
|
-
}
|
41664
|
+
to
|
41411
41665
|
toAddress
|
41412
41666
|
amount
|
41413
41667
|
assetId
|
@@ -41445,10 +41699,16 @@ spurious results.`);
|
|
41445
41699
|
id
|
41446
41700
|
}
|
41447
41701
|
time
|
41702
|
+
receipts {
|
41703
|
+
...receiptFragment
|
41704
|
+
}
|
41448
41705
|
programState {
|
41449
41706
|
returnType
|
41450
41707
|
data
|
41451
41708
|
}
|
41709
|
+
receipts {
|
41710
|
+
...receiptFragment
|
41711
|
+
}
|
41452
41712
|
}
|
41453
41713
|
... on FailureStatus {
|
41454
41714
|
block {
|
@@ -41456,26 +41716,24 @@ spurious results.`);
|
|
41456
41716
|
}
|
41457
41717
|
time
|
41458
41718
|
reason
|
41719
|
+
receipts {
|
41720
|
+
...receiptFragment
|
41721
|
+
}
|
41459
41722
|
}
|
41460
41723
|
... on SqueezedOutStatus {
|
41461
41724
|
reason
|
41462
41725
|
}
|
41463
41726
|
}
|
41464
|
-
`;
|
41727
|
+
${ReceiptFragmentFragmentDoc}`;
|
41465
41728
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41466
41729
|
fragment transactionFragment on Transaction {
|
41467
41730
|
id
|
41468
41731
|
rawPayload
|
41469
|
-
gasPrice
|
41470
|
-
receipts {
|
41471
|
-
...receiptFragment
|
41472
|
-
}
|
41473
41732
|
status {
|
41474
41733
|
...transactionStatusFragment
|
41475
41734
|
}
|
41476
41735
|
}
|
41477
|
-
${
|
41478
|
-
${TransactionStatusFragmentFragmentDoc}`;
|
41736
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41479
41737
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41480
41738
|
fragment inputEstimatePredicatesFragment on Input {
|
41481
41739
|
... on InputCoin {
|
@@ -41493,6 +41751,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41493
41751
|
}
|
41494
41752
|
}
|
41495
41753
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41754
|
+
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41755
|
+
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41756
|
+
reason
|
41757
|
+
programState {
|
41758
|
+
returnType
|
41759
|
+
data
|
41760
|
+
}
|
41761
|
+
}
|
41762
|
+
`;
|
41763
|
+
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41764
|
+
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41765
|
+
programState {
|
41766
|
+
returnType
|
41767
|
+
data
|
41768
|
+
}
|
41769
|
+
}
|
41770
|
+
`;
|
41771
|
+
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41772
|
+
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41773
|
+
... on DryRunFailureStatus {
|
41774
|
+
...dryRunFailureStatusFragment
|
41775
|
+
}
|
41776
|
+
... on DryRunSuccessStatus {
|
41777
|
+
...dryRunSuccessStatusFragment
|
41778
|
+
}
|
41779
|
+
}
|
41780
|
+
${DryRunFailureStatusFragmentFragmentDoc}
|
41781
|
+
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41782
|
+
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41783
|
+
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41784
|
+
id
|
41785
|
+
status {
|
41786
|
+
...dryRunTransactionStatusFragment
|
41787
|
+
}
|
41788
|
+
receipts {
|
41789
|
+
...receiptFragment
|
41790
|
+
}
|
41791
|
+
}
|
41792
|
+
${DryRunTransactionStatusFragmentFragmentDoc}
|
41793
|
+
${ReceiptFragmentFragmentDoc}`;
|
41496
41794
|
var CoinFragmentFragmentDoc = lib_default2`
|
41497
41795
|
fragment coinFragment on Coin {
|
41498
41796
|
__typename
|
@@ -41500,7 +41798,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41500
41798
|
owner
|
41501
41799
|
amount
|
41502
41800
|
assetId
|
41503
|
-
maturity
|
41504
41801
|
blockCreated
|
41505
41802
|
txCreatedIdx
|
41506
41803
|
}
|
@@ -41539,26 +41836,32 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41539
41836
|
messageBlockHeader {
|
41540
41837
|
id
|
41541
41838
|
daHeight
|
41839
|
+
consensusParametersVersion
|
41840
|
+
stateTransitionBytecodeVersion
|
41542
41841
|
transactionsCount
|
41842
|
+
messageReceiptCount
|
41543
41843
|
transactionsRoot
|
41844
|
+
messageOutboxRoot
|
41845
|
+
eventInboxRoot
|
41544
41846
|
height
|
41545
41847
|
prevRoot
|
41546
41848
|
time
|
41547
41849
|
applicationHash
|
41548
|
-
messageReceiptRoot
|
41549
|
-
messageReceiptCount
|
41550
41850
|
}
|
41551
41851
|
commitBlockHeader {
|
41552
41852
|
id
|
41553
41853
|
daHeight
|
41854
|
+
consensusParametersVersion
|
41855
|
+
stateTransitionBytecodeVersion
|
41554
41856
|
transactionsCount
|
41857
|
+
messageReceiptCount
|
41555
41858
|
transactionsRoot
|
41859
|
+
messageOutboxRoot
|
41860
|
+
eventInboxRoot
|
41556
41861
|
height
|
41557
41862
|
prevRoot
|
41558
41863
|
time
|
41559
41864
|
applicationHash
|
41560
|
-
messageReceiptRoot
|
41561
|
-
messageReceiptCount
|
41562
41865
|
}
|
41563
41866
|
sender
|
41564
41867
|
recipient
|
@@ -41577,8 +41880,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41577
41880
|
var BlockFragmentFragmentDoc = lib_default2`
|
41578
41881
|
fragment blockFragment on Block {
|
41579
41882
|
id
|
41883
|
+
height
|
41580
41884
|
header {
|
41581
|
-
height
|
41582
41885
|
time
|
41583
41886
|
}
|
41584
41887
|
transactions {
|
@@ -41636,6 +41939,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41636
41939
|
`;
|
41637
41940
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41638
41941
|
fragment GasCostsFragment on GasCosts {
|
41942
|
+
version {
|
41943
|
+
... on Version {
|
41944
|
+
value
|
41945
|
+
}
|
41946
|
+
}
|
41639
41947
|
add
|
41640
41948
|
addi
|
41641
41949
|
aloc
|
@@ -41648,7 +41956,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41648
41956
|
cb
|
41649
41957
|
cfei
|
41650
41958
|
cfsi
|
41651
|
-
croo
|
41652
41959
|
div
|
41653
41960
|
divi
|
41654
41961
|
ecr1
|
@@ -41731,6 +42038,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41731
42038
|
ccp {
|
41732
42039
|
...DependentCostFragment
|
41733
42040
|
}
|
42041
|
+
croo {
|
42042
|
+
...DependentCostFragment
|
42043
|
+
}
|
41734
42044
|
csiz {
|
41735
42045
|
...DependentCostFragment
|
41736
42046
|
}
|
@@ -41790,6 +42100,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41790
42100
|
${DependentCostFragmentFragmentDoc}`;
|
41791
42101
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
41792
42102
|
fragment consensusParametersFragment on ConsensusParameters {
|
42103
|
+
version {
|
42104
|
+
... on Version {
|
42105
|
+
value
|
42106
|
+
}
|
42107
|
+
}
|
41793
42108
|
txParams {
|
41794
42109
|
...TxParametersFragment
|
41795
42110
|
}
|
@@ -41849,18 +42164,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41849
42164
|
fragment nodeInfoFragment on NodeInfo {
|
41850
42165
|
utxoValidation
|
41851
42166
|
vmBacktrace
|
41852
|
-
minGasPrice
|
41853
42167
|
maxTx
|
41854
42168
|
maxDepth
|
41855
42169
|
nodeVersion
|
41856
|
-
peers {
|
41857
|
-
id
|
41858
|
-
addresses
|
41859
|
-
clientVersion
|
41860
|
-
blockHeight
|
41861
|
-
lastHeartbeatMs
|
41862
|
-
appScore
|
41863
|
-
}
|
41864
42170
|
}
|
41865
42171
|
`;
|
41866
42172
|
var GetVersionDocument = lib_default2`
|
@@ -41895,13 +42201,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41895
42201
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
41896
42202
|
transaction(id: $transactionId) {
|
41897
42203
|
...transactionFragment
|
41898
|
-
receipts {
|
41899
|
-
...receiptFragment
|
41900
|
-
}
|
41901
42204
|
}
|
41902
42205
|
}
|
41903
|
-
${TransactionFragmentFragmentDoc}
|
41904
|
-
${ReceiptFragmentFragmentDoc}`;
|
42206
|
+
${TransactionFragmentFragmentDoc}`;
|
41905
42207
|
var GetTransactionsDocument = lib_default2`
|
41906
42208
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
41907
42209
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42029,6 +42331,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42029
42331
|
}
|
42030
42332
|
}
|
42031
42333
|
${BalanceFragmentFragmentDoc}`;
|
42334
|
+
var GetLatestGasPriceDocument = lib_default2`
|
42335
|
+
query getLatestGasPrice {
|
42336
|
+
latestGasPrice {
|
42337
|
+
gasPrice
|
42338
|
+
}
|
42339
|
+
}
|
42340
|
+
`;
|
42341
|
+
var EstimateGasPriceDocument = lib_default2`
|
42342
|
+
query estimateGasPrice($blockHorizon: U32!) {
|
42343
|
+
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42344
|
+
gasPrice
|
42345
|
+
}
|
42346
|
+
}
|
42347
|
+
`;
|
42032
42348
|
var GetBalancesDocument = lib_default2`
|
42033
42349
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42034
42350
|
balances(
|
@@ -42083,12 +42399,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42083
42399
|
}
|
42084
42400
|
`;
|
42085
42401
|
var DryRunDocument = lib_default2`
|
42086
|
-
mutation dryRun($
|
42087
|
-
dryRun(
|
42088
|
-
...
|
42402
|
+
mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
|
42403
|
+
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
|
42404
|
+
...dryRunTransactionExecutionStatusFragment
|
42089
42405
|
}
|
42090
42406
|
}
|
42091
|
-
${
|
42407
|
+
${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
|
42092
42408
|
var SubmitDocument = lib_default2`
|
42093
42409
|
mutation submit($encodedTransaction: HexString!) {
|
42094
42410
|
submit(tx: $encodedTransaction) {
|
@@ -42171,6 +42487,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42171
42487
|
getBalance(variables, options) {
|
42172
42488
|
return requester(GetBalanceDocument, variables, options);
|
42173
42489
|
},
|
42490
|
+
getLatestGasPrice(variables, options) {
|
42491
|
+
return requester(GetLatestGasPriceDocument, variables, options);
|
42492
|
+
},
|
42493
|
+
estimateGasPrice(variables, options) {
|
42494
|
+
return requester(EstimateGasPriceDocument, variables, options);
|
42495
|
+
},
|
42174
42496
|
getBalances(variables, options) {
|
42175
42497
|
return requester(GetBalancesDocument, variables, options);
|
42176
42498
|
},
|
@@ -42238,11 +42560,14 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42238
42560
|
let data;
|
42239
42561
|
let errors;
|
42240
42562
|
try {
|
42241
|
-
|
42563
|
+
const sanitizedText = text.replace(/\s/g, "");
|
42564
|
+
({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
|
42242
42565
|
} catch (e) {
|
42243
42566
|
throw new FuelError(
|
42244
42567
|
ErrorCode.STREAM_PARSING_ERROR,
|
42245
|
-
`Error while parsing stream data response: ${text}
|
42568
|
+
`Error while parsing stream data response: ${text}
|
42569
|
+
|
42570
|
+
Thrown error: ${e}`
|
42246
42571
|
);
|
42247
42572
|
}
|
42248
42573
|
if (Array.isArray(errors)) {
|
@@ -42326,9 +42651,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42326
42651
|
}
|
42327
42652
|
};
|
42328
42653
|
|
42329
|
-
// ../address/dist/configs.mjs
|
42330
|
-
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42331
|
-
|
42332
42654
|
// src/providers/transaction-request/input.ts
|
42333
42655
|
var inputify = (value) => {
|
42334
42656
|
const { type: type3 } = value;
|
@@ -42339,7 +42661,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42339
42661
|
return {
|
42340
42662
|
type: InputType.Coin,
|
42341
42663
|
txID: hexlify(arrayify(value.id).slice(0, 32)),
|
42342
|
-
outputIndex: arrayify(value.id)
|
42664
|
+
outputIndex: toNumber2(arrayify(value.id).slice(32, 34)),
|
42343
42665
|
owner: hexlify(value.owner),
|
42344
42666
|
amount: bn(value.amount),
|
42345
42667
|
assetId: hexlify(value.assetId),
|
@@ -42348,10 +42670,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42348
42670
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42349
42671
|
},
|
42350
42672
|
witnessIndex: value.witnessIndex,
|
42351
|
-
maturity: value.maturity ?? 0,
|
42352
42673
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42353
|
-
predicateLength: predicate.length,
|
42354
|
-
predicateDataLength: predicateData.length,
|
42674
|
+
predicateLength: bn(predicate.length),
|
42675
|
+
predicateDataLength: bn(predicateData.length),
|
42355
42676
|
predicate: hexlify(predicate),
|
42356
42677
|
predicateData: hexlify(predicateData)
|
42357
42678
|
};
|
@@ -42382,8 +42703,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42382
42703
|
nonce: hexlify(value.nonce),
|
42383
42704
|
witnessIndex: value.witnessIndex,
|
42384
42705
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42385
|
-
predicateLength: predicate.length,
|
42386
|
-
predicateDataLength: predicateData.length,
|
42706
|
+
predicateLength: bn(predicate.length),
|
42707
|
+
predicateDataLength: bn(predicateData.length),
|
42387
42708
|
predicate: hexlify(predicate),
|
42388
42709
|
predicateData: hexlify(predicateData),
|
42389
42710
|
data: hexlify(data),
|
@@ -42540,8 +42861,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42540
42861
|
case "CALL" /* Call */: {
|
42541
42862
|
const callReceipt = {
|
42542
42863
|
type: ReceiptType.Call,
|
42543
|
-
from: hexOrZero(receipt.
|
42544
|
-
to: hexOrZero(receipt?.to
|
42864
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42865
|
+
to: hexOrZero(receipt?.to),
|
42545
42866
|
amount: bn(receipt.amount),
|
42546
42867
|
assetId: hexOrZero(receipt.assetId),
|
42547
42868
|
gas: bn(receipt.gas),
|
@@ -42555,7 +42876,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42555
42876
|
case "RETURN" /* Return */: {
|
42556
42877
|
const returnReceipt = {
|
42557
42878
|
type: ReceiptType.Return,
|
42558
|
-
id: hexOrZero(receipt.
|
42879
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42559
42880
|
val: bn(receipt.val),
|
42560
42881
|
pc: bn(receipt.pc),
|
42561
42882
|
is: bn(receipt.is)
|
@@ -42565,7 +42886,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42565
42886
|
case "RETURN_DATA" /* ReturnData */: {
|
42566
42887
|
const returnDataReceipt = {
|
42567
42888
|
type: ReceiptType.ReturnData,
|
42568
|
-
id: hexOrZero(receipt.
|
42889
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42569
42890
|
ptr: bn(receipt.ptr),
|
42570
42891
|
len: bn(receipt.len),
|
42571
42892
|
digest: hexOrZero(receipt.digest),
|
@@ -42577,7 +42898,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42577
42898
|
case "PANIC" /* Panic */: {
|
42578
42899
|
const panicReceipt = {
|
42579
42900
|
type: ReceiptType.Panic,
|
42580
|
-
id: hexOrZero(receipt.
|
42901
|
+
id: hexOrZero(receipt.id),
|
42581
42902
|
reason: bn(receipt.reason),
|
42582
42903
|
pc: bn(receipt.pc),
|
42583
42904
|
is: bn(receipt.is),
|
@@ -42588,7 +42909,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42588
42909
|
case "REVERT" /* Revert */: {
|
42589
42910
|
const revertReceipt = {
|
42590
42911
|
type: ReceiptType.Revert,
|
42591
|
-
id: hexOrZero(receipt.
|
42912
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42592
42913
|
val: bn(receipt.ra),
|
42593
42914
|
pc: bn(receipt.pc),
|
42594
42915
|
is: bn(receipt.is)
|
@@ -42598,7 +42919,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42598
42919
|
case "LOG" /* Log */: {
|
42599
42920
|
const logReceipt = {
|
42600
42921
|
type: ReceiptType.Log,
|
42601
|
-
id: hexOrZero(receipt.
|
42922
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42602
42923
|
val0: bn(receipt.ra),
|
42603
42924
|
val1: bn(receipt.rb),
|
42604
42925
|
val2: bn(receipt.rc),
|
@@ -42611,7 +42932,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42611
42932
|
case "LOG_DATA" /* LogData */: {
|
42612
42933
|
const logDataReceipt = {
|
42613
42934
|
type: ReceiptType.LogData,
|
42614
|
-
id: hexOrZero(receipt.
|
42935
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42615
42936
|
val0: bn(receipt.ra),
|
42616
42937
|
val1: bn(receipt.rb),
|
42617
42938
|
ptr: bn(receipt.ptr),
|
@@ -42625,8 +42946,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42625
42946
|
case "TRANSFER" /* Transfer */: {
|
42626
42947
|
const transferReceipt = {
|
42627
42948
|
type: ReceiptType.Transfer,
|
42628
|
-
from: hexOrZero(receipt.
|
42629
|
-
to: hexOrZero(receipt.toAddress || receipt?.to
|
42949
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42950
|
+
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42630
42951
|
amount: bn(receipt.amount),
|
42631
42952
|
assetId: hexOrZero(receipt.assetId),
|
42632
42953
|
pc: bn(receipt.pc),
|
@@ -42637,8 +42958,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42637
42958
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42638
42959
|
const transferOutReceipt = {
|
42639
42960
|
type: ReceiptType.TransferOut,
|
42640
|
-
from: hexOrZero(receipt.
|
42641
|
-
to: hexOrZero(receipt.toAddress || receipt.to
|
42961
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42962
|
+
to: hexOrZero(receipt.toAddress || receipt.to),
|
42642
42963
|
amount: bn(receipt.amount),
|
42643
42964
|
assetId: hexOrZero(receipt.assetId),
|
42644
42965
|
pc: bn(receipt.pc),
|
@@ -42681,7 +43002,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42681
43002
|
return receiptMessageOut;
|
42682
43003
|
}
|
42683
43004
|
case "MINT" /* Mint */: {
|
42684
|
-
const contractId = hexOrZero(receipt.
|
43005
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42685
43006
|
const subId = hexOrZero(receipt.subId);
|
42686
43007
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
42687
43008
|
const mintReceipt = {
|
@@ -42696,7 +43017,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42696
43017
|
return mintReceipt;
|
42697
43018
|
}
|
42698
43019
|
case "BURN" /* Burn */: {
|
42699
|
-
const contractId = hexOrZero(receipt.
|
43020
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42700
43021
|
const subId = hexOrZero(receipt.subId);
|
42701
43022
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
42702
43023
|
const burnReceipt = {
|
@@ -42716,7 +43037,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42716
43037
|
}
|
42717
43038
|
|
42718
43039
|
// src/providers/utils/gas.ts
|
42719
|
-
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
42720
43040
|
var getGasUsedFromReceipts = (receipts) => {
|
42721
43041
|
const scriptResult = receipts.filter(
|
42722
43042
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -42737,18 +43057,28 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42737
43057
|
}
|
42738
43058
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
42739
43059
|
const witnessCache = [];
|
42740
|
-
const
|
43060
|
+
const chargeableInputs = inputs.filter((input) => {
|
43061
|
+
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43062
|
+
if (isCoinOrMessage) {
|
43063
|
+
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43064
|
+
return true;
|
43065
|
+
}
|
43066
|
+
if (!witnessCache.includes(input.witnessIndex)) {
|
43067
|
+
witnessCache.push(input.witnessIndex);
|
43068
|
+
return true;
|
43069
|
+
}
|
43070
|
+
}
|
43071
|
+
return false;
|
43072
|
+
});
|
43073
|
+
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43074
|
+
const totalGas = chargeableInputs.reduce((total, input) => {
|
42741
43075
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
42742
43076
|
return total.add(
|
42743
|
-
|
43077
|
+
vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
42744
43078
|
);
|
42745
43079
|
}
|
42746
|
-
|
42747
|
-
|
42748
|
-
return total.add(gasCosts.ecr1);
|
42749
|
-
}
|
42750
|
-
return total;
|
42751
|
-
}, bn());
|
43080
|
+
return total.add(gasCosts.ecr1);
|
43081
|
+
}, bn(0));
|
42752
43082
|
return totalGas;
|
42753
43083
|
}
|
42754
43084
|
function getMinGas(params) {
|
@@ -42760,12 +43090,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42760
43090
|
return minGas;
|
42761
43091
|
}
|
42762
43092
|
function getMaxGas(params) {
|
42763
|
-
const {
|
43093
|
+
const {
|
43094
|
+
gasPerByte,
|
43095
|
+
witnessesLength,
|
43096
|
+
witnessLimit,
|
43097
|
+
minGas,
|
43098
|
+
gasLimit = bn(0),
|
43099
|
+
maxGasPerTx
|
43100
|
+
} = params;
|
42764
43101
|
let remainingAllowedWitnessGas = bn(0);
|
42765
43102
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
42766
43103
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
42767
43104
|
}
|
42768
|
-
|
43105
|
+
const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43106
|
+
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42769
43107
|
}
|
42770
43108
|
function calculateMetadataGasForTxCreate({
|
42771
43109
|
gasCosts,
|
@@ -42787,6 +43125,10 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42787
43125
|
}) {
|
42788
43126
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
42789
43127
|
}
|
43128
|
+
var calculateGasFee = (params) => {
|
43129
|
+
const { gas, gasPrice, priceFactor, tip } = params;
|
43130
|
+
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43131
|
+
};
|
42790
43132
|
|
42791
43133
|
// src/providers/utils/json.ts
|
42792
43134
|
function normalize2(object) {
|
@@ -42916,7 +43258,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42916
43258
|
// src/providers/transaction-request/transaction-request.ts
|
42917
43259
|
var BaseTransactionRequest = class {
|
42918
43260
|
/** Gas price for transaction */
|
42919
|
-
|
43261
|
+
tip;
|
42920
43262
|
/** Block until which tx cannot be included */
|
42921
43263
|
maturity;
|
42922
43264
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -42929,38 +43271,34 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42929
43271
|
outputs = [];
|
42930
43272
|
/** List of witnesses */
|
42931
43273
|
witnesses = [];
|
42932
|
-
/** Base asset ID - should be fetched from the chain */
|
42933
|
-
baseAssetId;
|
42934
43274
|
/**
|
42935
43275
|
* Constructor for initializing a base transaction request.
|
42936
43276
|
*
|
42937
43277
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
42938
43278
|
*/
|
42939
43279
|
constructor({
|
42940
|
-
|
43280
|
+
tip,
|
42941
43281
|
maturity,
|
42942
43282
|
maxFee,
|
42943
43283
|
witnessLimit,
|
42944
43284
|
inputs,
|
42945
43285
|
outputs,
|
42946
|
-
witnesses
|
42947
|
-
|
42948
|
-
|
42949
|
-
this.gasPrice = bn(gasPrice);
|
43286
|
+
witnesses
|
43287
|
+
} = {}) {
|
43288
|
+
this.tip = bn(tip);
|
42950
43289
|
this.maturity = maturity ?? 0;
|
42951
43290
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
42952
43291
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
42953
43292
|
this.inputs = inputs ?? [];
|
42954
43293
|
this.outputs = outputs ?? [];
|
42955
43294
|
this.witnesses = witnesses ?? [];
|
42956
|
-
this.baseAssetId = baseAssetId;
|
42957
43295
|
}
|
42958
43296
|
static getPolicyMeta(req) {
|
42959
43297
|
let policyTypes = 0;
|
42960
43298
|
const policies = [];
|
42961
|
-
if (req.
|
42962
|
-
policyTypes += PolicyType.
|
42963
|
-
policies.push({ data: req.
|
43299
|
+
if (req.tip) {
|
43300
|
+
policyTypes += PolicyType.Tip;
|
43301
|
+
policies.push({ data: req.tip, type: PolicyType.Tip });
|
42964
43302
|
}
|
42965
43303
|
if (req.witnessLimit) {
|
42966
43304
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43147,10 +43485,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43147
43485
|
* @param predicate - Predicate bytes.
|
43148
43486
|
* @param predicateData - Predicate data bytes.
|
43149
43487
|
*/
|
43150
|
-
addCoinInput(coin
|
43488
|
+
addCoinInput(coin) {
|
43151
43489
|
const { assetId, owner, amount } = coin;
|
43152
43490
|
let witnessIndex;
|
43153
|
-
if (predicate) {
|
43491
|
+
if (coin.predicate) {
|
43154
43492
|
witnessIndex = 0;
|
43155
43493
|
} else {
|
43156
43494
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43165,8 +43503,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43165
43503
|
amount,
|
43166
43504
|
assetId,
|
43167
43505
|
txPointer: "0x00000000000000000000000000000000",
|
43168
|
-
witnessIndex
|
43169
|
-
predicate: predicate?.bytes
|
43506
|
+
witnessIndex
|
43170
43507
|
};
|
43171
43508
|
this.pushInput(input);
|
43172
43509
|
this.addChangeOutput(owner, assetId);
|
@@ -43177,11 +43514,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43177
43514
|
*
|
43178
43515
|
* @param message - Message resource.
|
43179
43516
|
* @param predicate - Predicate bytes.
|
43517
|
+
* @param predicateData - Predicate data bytes.
|
43180
43518
|
*/
|
43181
|
-
addMessageInput(message
|
43519
|
+
addMessageInput(message) {
|
43182
43520
|
const { recipient, sender, amount } = message;
|
43521
|
+
const assetId = BaseAssetId;
|
43183
43522
|
let witnessIndex;
|
43184
|
-
if (predicate) {
|
43523
|
+
if (message.predicate) {
|
43185
43524
|
witnessIndex = 0;
|
43186
43525
|
} else {
|
43187
43526
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43195,11 +43534,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43195
43534
|
sender: sender.toB256(),
|
43196
43535
|
recipient: recipient.toB256(),
|
43197
43536
|
amount,
|
43198
|
-
witnessIndex
|
43199
|
-
predicate: predicate?.bytes
|
43537
|
+
witnessIndex
|
43200
43538
|
};
|
43201
43539
|
this.pushInput(input);
|
43202
|
-
this.addChangeOutput(recipient,
|
43540
|
+
this.addChangeOutput(recipient, assetId);
|
43203
43541
|
}
|
43204
43542
|
/**
|
43205
43543
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -43227,32 +43565,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43227
43565
|
resources.forEach((resource) => this.addResource(resource));
|
43228
43566
|
return this;
|
43229
43567
|
}
|
43230
|
-
/**
|
43231
|
-
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43232
|
-
* outputs from the related assetIds.
|
43233
|
-
*
|
43234
|
-
* @param resources - The resources to add.
|
43235
|
-
* @returns This transaction.
|
43236
|
-
*/
|
43237
|
-
addPredicateResource(resource, predicate) {
|
43238
|
-
if (isCoin(resource)) {
|
43239
|
-
this.addCoinInput(resource, predicate);
|
43240
|
-
} else {
|
43241
|
-
this.addMessageInput(resource, predicate);
|
43242
|
-
}
|
43243
|
-
return this;
|
43244
|
-
}
|
43245
|
-
/**
|
43246
|
-
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43247
|
-
* from the related assetIds.
|
43248
|
-
*
|
43249
|
-
* @param resources - The resources to add.
|
43250
|
-
* @returns This transaction.
|
43251
|
-
*/
|
43252
|
-
addPredicateResources(resources, predicate) {
|
43253
|
-
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43254
|
-
return this;
|
43255
|
-
}
|
43256
43568
|
/**
|
43257
43569
|
* Adds a coin output to the transaction.
|
43258
43570
|
*
|
@@ -43260,12 +43572,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43260
43572
|
* @param amount - Amount of coin.
|
43261
43573
|
* @param assetId - Asset ID of coin.
|
43262
43574
|
*/
|
43263
|
-
addCoinOutput(to, amount, assetId) {
|
43575
|
+
addCoinOutput(to, amount, assetId = BaseAssetId) {
|
43264
43576
|
this.pushOutput({
|
43265
43577
|
type: OutputType.Coin,
|
43266
43578
|
to: addressify(to).toB256(),
|
43267
43579
|
amount,
|
43268
|
-
assetId
|
43580
|
+
assetId
|
43269
43581
|
});
|
43270
43582
|
return this;
|
43271
43583
|
}
|
@@ -43292,7 +43604,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43292
43604
|
* @param to - Address of the owner.
|
43293
43605
|
* @param assetId - Asset ID of coin.
|
43294
43606
|
*/
|
43295
|
-
addChangeOutput(to, assetId) {
|
43607
|
+
addChangeOutput(to, assetId = BaseAssetId) {
|
43296
43608
|
const changeOutput = this.getChangeOutputs().find(
|
43297
43609
|
(output3) => hexlify(output3.assetId) === assetId
|
43298
43610
|
);
|
@@ -43300,7 +43612,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43300
43612
|
this.pushOutput({
|
43301
43613
|
type: OutputType.Change,
|
43302
43614
|
to: addressify(to).toB256(),
|
43303
|
-
assetId
|
43615
|
+
assetId
|
43304
43616
|
});
|
43305
43617
|
}
|
43306
43618
|
}
|
@@ -43332,7 +43644,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43332
43644
|
}
|
43333
43645
|
calculateMaxGas(chainInfo, minGas) {
|
43334
43646
|
const { consensusParameters } = chainInfo;
|
43335
|
-
const { gasPerByte } = consensusParameters;
|
43647
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43336
43648
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43337
43649
|
(acc, wit) => acc + wit.dataLength,
|
43338
43650
|
0
|
@@ -43341,7 +43653,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43341
43653
|
gasPerByte,
|
43342
43654
|
minGas,
|
43343
43655
|
witnessesLength,
|
43344
|
-
witnessLimit: this.witnessLimit
|
43656
|
+
witnessLimit: this.witnessLimit,
|
43657
|
+
maxGasPerTx
|
43345
43658
|
});
|
43346
43659
|
}
|
43347
43660
|
/**
|
@@ -43351,12 +43664,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43351
43664
|
* @param quantities - CoinQuantity Array.
|
43352
43665
|
*/
|
43353
43666
|
fundWithFakeUtxos(quantities, resourcesOwner) {
|
43354
|
-
let idCounter = 0;
|
43355
|
-
const generateId = () => {
|
43356
|
-
const counterString = String(idCounter++);
|
43357
|
-
const id = ZeroBytes32.slice(0, -counterString.length).concat(counterString);
|
43358
|
-
return id;
|
43359
|
-
};
|
43360
43667
|
const findAssetInput = (assetId) => this.inputs.find((input) => {
|
43361
43668
|
if ("assetId" in input) {
|
43362
43669
|
return input.assetId === assetId;
|
@@ -43365,24 +43672,27 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43365
43672
|
});
|
43366
43673
|
const updateAssetInput = (assetId, quantity) => {
|
43367
43674
|
const assetInput = findAssetInput(assetId);
|
43675
|
+
let usedQuantity = quantity;
|
43676
|
+
if (assetId === BaseAssetId) {
|
43677
|
+
usedQuantity = bn("1000000000000000000");
|
43678
|
+
}
|
43368
43679
|
if (assetInput && "assetId" in assetInput) {
|
43369
|
-
assetInput.id =
|
43370
|
-
assetInput.amount =
|
43680
|
+
assetInput.id = hexlify(randomBytes3(34));
|
43681
|
+
assetInput.amount = usedQuantity;
|
43371
43682
|
} else {
|
43372
43683
|
this.addResources([
|
43373
43684
|
{
|
43374
|
-
id:
|
43375
|
-
amount:
|
43685
|
+
id: hexlify(randomBytes3(34)),
|
43686
|
+
amount: usedQuantity,
|
43376
43687
|
assetId,
|
43377
43688
|
owner: resourcesOwner || Address.fromRandom(),
|
43378
|
-
maturity: 0,
|
43379
43689
|
blockCreated: bn(1),
|
43380
43690
|
txCreatedIdx: bn(1)
|
43381
43691
|
}
|
43382
43692
|
]);
|
43383
43693
|
}
|
43384
43694
|
};
|
43385
|
-
updateAssetInput(
|
43695
|
+
updateAssetInput(BaseAssetId, bn(1e11));
|
43386
43696
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43387
43697
|
}
|
43388
43698
|
/**
|
@@ -43407,7 +43717,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43407
43717
|
toJSON() {
|
43408
43718
|
return normalizeJSON(this);
|
43409
43719
|
}
|
43410
|
-
|
43720
|
+
updatePredicateGasUsed(inputs) {
|
43411
43721
|
this.inputs.forEach((i) => {
|
43412
43722
|
let correspondingInput;
|
43413
43723
|
switch (i.type) {
|
@@ -43429,6 +43739,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43429
43739
|
}
|
43430
43740
|
});
|
43431
43741
|
}
|
43742
|
+
shiftPredicateData() {
|
43743
|
+
this.inputs.forEach((input) => {
|
43744
|
+
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43745
|
+
input.predicateData = input.paddPredicateData(
|
43746
|
+
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43747
|
+
);
|
43748
|
+
}
|
43749
|
+
});
|
43750
|
+
}
|
43432
43751
|
};
|
43433
43752
|
|
43434
43753
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43539,7 +43858,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43539
43858
|
*
|
43540
43859
|
* @param createTransactionRequestLike - The initial values for the instance
|
43541
43860
|
*/
|
43542
|
-
constructor({
|
43861
|
+
constructor({
|
43862
|
+
bytecodeWitnessIndex,
|
43863
|
+
salt,
|
43864
|
+
storageSlots,
|
43865
|
+
...rest
|
43866
|
+
} = {}) {
|
43543
43867
|
super(rest);
|
43544
43868
|
this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
|
43545
43869
|
this.salt = hexlify(salt ?? ZeroBytes32);
|
@@ -43557,9 +43881,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43557
43881
|
return {
|
43558
43882
|
type: TransactionType.Create,
|
43559
43883
|
...baseTransaction,
|
43560
|
-
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43561
43884
|
bytecodeWitnessIndex,
|
43562
|
-
storageSlotsCount: storageSlots.length,
|
43885
|
+
storageSlotsCount: bn(storageSlots.length),
|
43563
43886
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43564
43887
|
storageSlots
|
43565
43888
|
};
|
@@ -43654,7 +43977,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43654
43977
|
*
|
43655
43978
|
* @param scriptTransactionRequestLike - The initial values for the instance.
|
43656
43979
|
*/
|
43657
|
-
constructor({ script, scriptData, gasLimit, ...rest }) {
|
43980
|
+
constructor({ script, scriptData, gasLimit, ...rest } = {}) {
|
43658
43981
|
super(rest);
|
43659
43982
|
this.gasLimit = bn(gasLimit);
|
43660
43983
|
this.script = arrayify(script ?? returnZeroScript.bytes);
|
@@ -43673,8 +43996,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43673
43996
|
type: TransactionType.Script,
|
43674
43997
|
scriptGasLimit: this.gasLimit,
|
43675
43998
|
...super.getBaseTransaction(),
|
43676
|
-
scriptLength: script.length,
|
43677
|
-
scriptDataLength: scriptData.length,
|
43999
|
+
scriptLength: bn(script.length),
|
44000
|
+
scriptDataLength: bn(scriptData.length),
|
43678
44001
|
receiptsRoot: ZeroBytes32,
|
43679
44002
|
script: hexlify(script),
|
43680
44003
|
scriptData: hexlify(scriptData)
|
@@ -43738,7 +44061,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43738
44061
|
}
|
43739
44062
|
calculateMaxGas(chainInfo, minGas) {
|
43740
44063
|
const { consensusParameters } = chainInfo;
|
43741
|
-
const { gasPerByte } = consensusParameters;
|
44064
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43742
44065
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43743
44066
|
(acc, wit) => acc + wit.dataLength,
|
43744
44067
|
0
|
@@ -43748,7 +44071,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43748
44071
|
minGas,
|
43749
44072
|
witnessesLength,
|
43750
44073
|
witnessLimit: this.witnessLimit,
|
43751
|
-
gasLimit: this.gasLimit
|
44074
|
+
gasLimit: this.gasLimit,
|
44075
|
+
maxGasPerTx
|
43752
44076
|
});
|
43753
44077
|
}
|
43754
44078
|
/**
|
@@ -43821,13 +44145,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43821
44145
|
}
|
43822
44146
|
}
|
43823
44147
|
};
|
44148
|
+
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44149
|
+
(acc, input) => {
|
44150
|
+
if (input.type === InputType.Coin && input.owner === owner) {
|
44151
|
+
acc.utxos.push(input.id);
|
44152
|
+
}
|
44153
|
+
if (input.type === InputType.Message && input.recipient === owner) {
|
44154
|
+
acc.messages.push(input.nonce);
|
44155
|
+
}
|
44156
|
+
return acc;
|
44157
|
+
},
|
44158
|
+
{
|
44159
|
+
utxos: [],
|
44160
|
+
messages: []
|
44161
|
+
}
|
44162
|
+
);
|
43824
44163
|
|
43825
44164
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
43826
44165
|
var calculateTransactionFee = (params) => {
|
43827
44166
|
const {
|
43828
|
-
|
44167
|
+
gasPrice,
|
43829
44168
|
rawPayload,
|
43830
|
-
|
44169
|
+
tip,
|
44170
|
+
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43831
44171
|
} = params;
|
43832
44172
|
const gasPerByte = bn(feeParams.gasPerByte);
|
43833
44173
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -43837,8 +44177,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43837
44177
|
return {
|
43838
44178
|
fee: bn(0),
|
43839
44179
|
minFee: bn(0),
|
43840
|
-
maxFee: bn(0)
|
43841
|
-
feeFromGasUsed: bn(0)
|
44180
|
+
maxFee: bn(0)
|
43842
44181
|
};
|
43843
44182
|
}
|
43844
44183
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -43870,7 +44209,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43870
44209
|
metadataGas,
|
43871
44210
|
txBytesSize: transactionBytes.length
|
43872
44211
|
});
|
43873
|
-
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
43874
44212
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
43875
44213
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
43876
44214
|
const maxGas = getMaxGas({
|
@@ -43878,17 +44216,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43878
44216
|
minGas,
|
43879
44217
|
witnessesLength,
|
43880
44218
|
gasLimit,
|
43881
|
-
witnessLimit
|
44219
|
+
witnessLimit,
|
44220
|
+
maxGasPerTx
|
44221
|
+
});
|
44222
|
+
const minFee = calculateGasFee({
|
44223
|
+
gasPrice,
|
44224
|
+
gas: minGas,
|
44225
|
+
priceFactor: gasPriceFactor,
|
44226
|
+
tip
|
44227
|
+
});
|
44228
|
+
const maxFee = calculateGasFee({
|
44229
|
+
gasPrice,
|
44230
|
+
gas: maxGas,
|
44231
|
+
priceFactor: gasPriceFactor,
|
44232
|
+
tip
|
43882
44233
|
});
|
43883
|
-
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43884
|
-
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43885
|
-
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43886
|
-
const fee = minFee.add(feeFromGasUsed);
|
43887
44234
|
return {
|
43888
|
-
fee,
|
43889
44235
|
minFee,
|
43890
44236
|
maxFee,
|
43891
|
-
|
44237
|
+
fee: maxFee
|
43892
44238
|
};
|
43893
44239
|
};
|
43894
44240
|
|
@@ -44442,7 +44788,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44442
44788
|
gqlTransactionStatus,
|
44443
44789
|
abiMap = {},
|
44444
44790
|
maxInputs,
|
44445
|
-
gasCosts
|
44791
|
+
gasCosts,
|
44792
|
+
maxGasPerTx,
|
44793
|
+
gasPrice
|
44446
44794
|
} = params;
|
44447
44795
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44448
44796
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44456,11 +44804,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44456
44804
|
maxInputs
|
44457
44805
|
});
|
44458
44806
|
const typeName = getTransactionTypeName(transaction.type);
|
44807
|
+
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44459
44808
|
const { fee } = calculateTransactionFee({
|
44460
|
-
|
44809
|
+
gasPrice,
|
44461
44810
|
rawPayload,
|
44811
|
+
tip,
|
44462
44812
|
consensusParameters: {
|
44463
44813
|
gasCosts,
|
44814
|
+
maxGasPerTx,
|
44464
44815
|
feeParams: {
|
44465
44816
|
gasPerByte,
|
44466
44817
|
gasPriceFactor
|
@@ -44596,8 +44947,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44596
44947
|
const decodedTransaction = this.decodeTransaction(
|
44597
44948
|
transaction
|
44598
44949
|
);
|
44599
|
-
|
44600
|
-
|
44950
|
+
let txReceipts = [];
|
44951
|
+
if (transaction?.status && "receipts" in transaction.status) {
|
44952
|
+
txReceipts = transaction.status.receipts;
|
44953
|
+
}
|
44954
|
+
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44955
|
+
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44956
|
+
const gasPrice = await this.provider.getLatestGasPrice();
|
44601
44957
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44602
44958
|
const transactionSummary = assembleTransactionSummary({
|
44603
44959
|
id: this.id,
|
@@ -44609,7 +44965,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44609
44965
|
gasPriceFactor,
|
44610
44966
|
abiMap: contractsAbiMap,
|
44611
44967
|
maxInputs,
|
44612
|
-
gasCosts
|
44968
|
+
gasCosts,
|
44969
|
+
maxGasPerTx,
|
44970
|
+
gasPrice
|
44613
44971
|
});
|
44614
44972
|
return transactionSummary;
|
44615
44973
|
}
|
@@ -44753,13 +45111,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44753
45111
|
gasPerByte: bn(feeParams.gasPerByte),
|
44754
45112
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
44755
45113
|
chainId: bn(consensusParameters.chainId),
|
44756
|
-
baseAssetId: consensusParameters.baseAssetId,
|
44757
45114
|
gasCosts
|
44758
45115
|
},
|
44759
45116
|
gasCosts,
|
44760
45117
|
latestBlock: {
|
44761
45118
|
id: latestBlock.id,
|
44762
|
-
height: bn(latestBlock.
|
45119
|
+
height: bn(latestBlock.height),
|
44763
45120
|
time: latestBlock.header.time,
|
44764
45121
|
transactions: latestBlock.transactions.map((i) => ({
|
44765
45122
|
id: i.id
|
@@ -44853,10 +45210,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44853
45210
|
* Returns some helpful parameters related to gas fees.
|
44854
45211
|
*/
|
44855
45212
|
getGasConfig() {
|
44856
|
-
const { minGasPrice } = this.getNode();
|
44857
45213
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
44858
45214
|
return {
|
44859
|
-
minGasPrice,
|
44860
45215
|
maxGasPerTx,
|
44861
45216
|
maxGasPerPredicate,
|
44862
45217
|
gasPriceFactor,
|
@@ -44954,7 +45309,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44954
45309
|
*/
|
44955
45310
|
async getBlockNumber() {
|
44956
45311
|
const { chain } = await this.operations.getChain();
|
44957
|
-
return bn(chain.latestBlock.
|
45312
|
+
return bn(chain.latestBlock.height, 10);
|
44958
45313
|
}
|
44959
45314
|
/**
|
44960
45315
|
* Returns the chain information.
|
@@ -44966,11 +45321,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44966
45321
|
const processedNodeInfo = {
|
44967
45322
|
maxDepth: bn(nodeInfo.maxDepth),
|
44968
45323
|
maxTx: bn(nodeInfo.maxTx),
|
44969
|
-
minGasPrice: bn(nodeInfo.minGasPrice),
|
44970
45324
|
nodeVersion: nodeInfo.nodeVersion,
|
44971
45325
|
utxoValidation: nodeInfo.utxoValidation,
|
44972
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44973
|
-
peers: nodeInfo.peers
|
45326
|
+
vmBacktrace: nodeInfo.vmBacktrace
|
44974
45327
|
};
|
44975
45328
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
44976
45329
|
return processedNodeInfo;
|
@@ -44996,17 +45349,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44996
45349
|
} = this.getChain();
|
44997
45350
|
return chainId.toNumber();
|
44998
45351
|
}
|
44999
|
-
/**
|
45000
|
-
* Returns the base asset ID
|
45001
|
-
*
|
45002
|
-
* @returns A promise that resolves to the base asset ID
|
45003
|
-
*/
|
45004
|
-
getBaseAssetId() {
|
45005
|
-
const {
|
45006
|
-
consensusParameters: { baseAssetId }
|
45007
|
-
} = this.getChain();
|
45008
|
-
return baseAssetId;
|
45009
|
-
}
|
45010
45352
|
/**
|
45011
45353
|
* Submits a transaction to the chain to be executed.
|
45012
45354
|
*
|
@@ -45067,14 +45409,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45067
45409
|
return this.estimateTxDependencies(transactionRequest);
|
45068
45410
|
}
|
45069
45411
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45070
|
-
const { dryRun:
|
45071
|
-
encodedTransaction,
|
45412
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45413
|
+
encodedTransactions: encodedTransaction,
|
45072
45414
|
utxoValidation: utxoValidation || false
|
45073
45415
|
});
|
45074
|
-
const receipts =
|
45075
|
-
|
45076
|
-
|
45077
|
-
};
|
45416
|
+
const [{ receipts: rawReceipts, status }] = dryRunStatuses;
|
45417
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45418
|
+
return { receipts, dryrunStatus: status };
|
45078
45419
|
}
|
45079
45420
|
/**
|
45080
45421
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45113,9 +45454,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45113
45454
|
* If there are missing variable outputs,
|
45114
45455
|
* `addVariableOutputs` is called on the transaction.
|
45115
45456
|
*
|
45116
|
-
* @privateRemarks
|
45117
|
-
* TODO: Investigate support for missing contract IDs
|
45118
|
-
* TODO: Add support for missing output messages
|
45119
45457
|
*
|
45120
45458
|
* @param transactionRequest - The transaction request object.
|
45121
45459
|
* @returns A promise.
|
@@ -45128,16 +45466,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45128
45466
|
missingContractIds: []
|
45129
45467
|
};
|
45130
45468
|
}
|
45131
|
-
await this.estimatePredicates(transactionRequest);
|
45132
45469
|
let receipts = [];
|
45133
45470
|
const missingContractIds = [];
|
45134
45471
|
let outputVariables = 0;
|
45472
|
+
let dryrunStatus;
|
45135
45473
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45136
|
-
const {
|
45137
|
-
|
45474
|
+
const {
|
45475
|
+
dryRun: [{ receipts: rawReceipts, status }]
|
45476
|
+
} = await this.operations.dryRun({
|
45477
|
+
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45138
45478
|
utxoValidation: false
|
45139
45479
|
});
|
45140
|
-
receipts =
|
45480
|
+
receipts = rawReceipts.map(processGqlReceipt);
|
45481
|
+
dryrunStatus = status;
|
45141
45482
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45142
45483
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45143
45484
|
if (hasMissingOutputs) {
|
@@ -45147,6 +45488,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45147
45488
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45148
45489
|
missingContractIds.push(contractId);
|
45149
45490
|
});
|
45491
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45492
|
+
transactionRequest,
|
45493
|
+
optimizeGas: false
|
45494
|
+
});
|
45495
|
+
transactionRequest.maxFee = maxFee;
|
45150
45496
|
} else {
|
45151
45497
|
break;
|
45152
45498
|
}
|
@@ -45154,7 +45500,133 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45154
45500
|
return {
|
45155
45501
|
receipts,
|
45156
45502
|
outputVariables,
|
45157
|
-
missingContractIds
|
45503
|
+
missingContractIds,
|
45504
|
+
dryrunStatus
|
45505
|
+
};
|
45506
|
+
}
|
45507
|
+
/**
|
45508
|
+
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45509
|
+
*
|
45510
|
+
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45511
|
+
* further modifications are identified. The method iteratively updates these transactions
|
45512
|
+
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45513
|
+
*
|
45514
|
+
* @param transactionRequests - Array of transaction request objects.
|
45515
|
+
* @returns A promise that resolves to an array of results for each transaction.
|
45516
|
+
*/
|
45517
|
+
async estimateMultipleTxDependencies(transactionRequests) {
|
45518
|
+
const results = transactionRequests.map(() => ({
|
45519
|
+
receipts: [],
|
45520
|
+
outputVariables: 0,
|
45521
|
+
missingContractIds: [],
|
45522
|
+
dryrunStatus: void 0
|
45523
|
+
}));
|
45524
|
+
const allRequests = clone_default(transactionRequests);
|
45525
|
+
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45526
|
+
allRequests.forEach((req, index) => {
|
45527
|
+
if (req.type === TransactionType.Script) {
|
45528
|
+
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45529
|
+
}
|
45530
|
+
});
|
45531
|
+
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45532
|
+
let attempt = 0;
|
45533
|
+
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45534
|
+
const encodedTransactions = transactionsToProcess.map(
|
45535
|
+
(index) => serializedTransactionsMap.get(index)
|
45536
|
+
);
|
45537
|
+
const dryRunResults = await this.operations.dryRun({
|
45538
|
+
encodedTransactions,
|
45539
|
+
utxoValidation: false
|
45540
|
+
});
|
45541
|
+
const nextRoundTransactions = [];
|
45542
|
+
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45543
|
+
const currentResultIndex = transactionsToProcess[i];
|
45544
|
+
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45545
|
+
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45546
|
+
results[currentResultIndex].dryrunStatus = status;
|
45547
|
+
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45548
|
+
results[currentResultIndex].receipts
|
45549
|
+
);
|
45550
|
+
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45551
|
+
const requestToProcess = allRequests[currentResultIndex];
|
45552
|
+
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45553
|
+
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45554
|
+
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45555
|
+
missingOutputContractIds.forEach(({ contractId }) => {
|
45556
|
+
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45557
|
+
results[currentResultIndex].missingContractIds.push(contractId);
|
45558
|
+
});
|
45559
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45560
|
+
transactionRequest: requestToProcess,
|
45561
|
+
optimizeGas: false
|
45562
|
+
});
|
45563
|
+
requestToProcess.maxFee = maxFee;
|
45564
|
+
serializedTransactionsMap.set(
|
45565
|
+
currentResultIndex,
|
45566
|
+
hexlify(requestToProcess.toTransactionBytes())
|
45567
|
+
);
|
45568
|
+
nextRoundTransactions.push(currentResultIndex);
|
45569
|
+
allRequests[currentResultIndex] = requestToProcess;
|
45570
|
+
}
|
45571
|
+
}
|
45572
|
+
transactionsToProcess = nextRoundTransactions;
|
45573
|
+
attempt += 1;
|
45574
|
+
}
|
45575
|
+
return results;
|
45576
|
+
}
|
45577
|
+
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45578
|
+
if (estimateTxDependencies) {
|
45579
|
+
return this.estimateMultipleTxDependencies(transactionRequests);
|
45580
|
+
}
|
45581
|
+
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45582
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45583
|
+
encodedTransactions,
|
45584
|
+
utxoValidation: utxoValidation || false
|
45585
|
+
});
|
45586
|
+
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45587
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45588
|
+
return { receipts, dryrunStatus: status };
|
45589
|
+
});
|
45590
|
+
return results;
|
45591
|
+
}
|
45592
|
+
async estimateTxGasAndFee(params) {
|
45593
|
+
const { transactionRequest, optimizeGas = true } = params;
|
45594
|
+
let { gasPrice } = params;
|
45595
|
+
const chainInfo = this.getChain();
|
45596
|
+
const { gasPriceFactor } = this.getGasConfig();
|
45597
|
+
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45598
|
+
if (!gasPrice) {
|
45599
|
+
gasPrice = await this.estimateGasPrice(10);
|
45600
|
+
}
|
45601
|
+
const minFee = calculateGasFee({
|
45602
|
+
gasPrice: bn(gasPrice),
|
45603
|
+
gas: minGas,
|
45604
|
+
priceFactor: gasPriceFactor,
|
45605
|
+
tip: transactionRequest.tip
|
45606
|
+
}).add(1);
|
45607
|
+
let gasLimit = bn(0);
|
45608
|
+
if (transactionRequest.type === TransactionType.Script) {
|
45609
|
+
gasLimit = transactionRequest.gasLimit;
|
45610
|
+
if (!optimizeGas) {
|
45611
|
+
transactionRequest.gasLimit = minGas;
|
45612
|
+
gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45613
|
+
transactionRequest.gasLimit = gasLimit;
|
45614
|
+
}
|
45615
|
+
}
|
45616
|
+
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45617
|
+
const maxFee = calculateGasFee({
|
45618
|
+
gasPrice: bn(gasPrice),
|
45619
|
+
gas: maxGas,
|
45620
|
+
priceFactor: gasPriceFactor,
|
45621
|
+
tip: transactionRequest.tip
|
45622
|
+
}).add(1);
|
45623
|
+
return {
|
45624
|
+
minGas,
|
45625
|
+
minFee,
|
45626
|
+
maxGas,
|
45627
|
+
maxFee,
|
45628
|
+
gasPrice,
|
45629
|
+
gasLimit
|
45158
45630
|
};
|
45159
45631
|
}
|
45160
45632
|
/**
|
@@ -45172,15 +45644,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45172
45644
|
if (estimateTxDependencies) {
|
45173
45645
|
return this.estimateTxDependencies(transactionRequest);
|
45174
45646
|
}
|
45175
|
-
const
|
45176
|
-
const { dryRun:
|
45177
|
-
|
45647
|
+
const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
|
45648
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45649
|
+
encodedTransactions,
|
45178
45650
|
utxoValidation: true
|
45179
45651
|
});
|
45180
|
-
const
|
45181
|
-
|
45182
|
-
receipts
|
45183
|
-
|
45652
|
+
const callResult = dryRunStatuses.map((dryRunStatus) => {
|
45653
|
+
const { id, receipts, status } = dryRunStatus;
|
45654
|
+
const processedReceipts = receipts.map(processGqlReceipt);
|
45655
|
+
return { id, receipts: processedReceipts, status };
|
45656
|
+
});
|
45657
|
+
return { receipts: callResult[0].receipts };
|
45184
45658
|
}
|
45185
45659
|
/**
|
45186
45660
|
* Returns a transaction cost to enable user
|
@@ -45197,80 +45671,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45197
45671
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45198
45672
|
* @returns A promise that resolves to the transaction cost object.
|
45199
45673
|
*/
|
45200
|
-
async getTransactionCost(transactionRequestLike,
|
45201
|
-
estimateTxDependencies = true,
|
45202
|
-
estimatePredicates = true,
|
45203
|
-
resourcesOwner,
|
45204
|
-
signatureCallback
|
45205
|
-
} = {}) {
|
45674
|
+
async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
|
45206
45675
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45207
|
-
const chainInfo = this.getChain();
|
45208
|
-
const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
|
45209
|
-
const gasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45210
45676
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45211
45677
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45212
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45678
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
|
45213
45679
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45214
|
-
|
45215
|
-
|
45216
|
-
|
45217
|
-
}
|
45218
|
-
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45219
|
-
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45220
|
-
}
|
45221
|
-
await this.estimatePredicates(txRequestClone);
|
45680
|
+
txRequestClone.maxFee = bn(0);
|
45681
|
+
if (isScriptTransaction) {
|
45682
|
+
txRequestClone.gasLimit = bn(0);
|
45222
45683
|
}
|
45223
|
-
if (
|
45224
|
-
|
45684
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45685
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45225
45686
|
}
|
45226
|
-
const
|
45227
|
-
|
45687
|
+
const signedRequest = clone_default(txRequestClone);
|
45688
|
+
let addedSignatures = 0;
|
45689
|
+
if (signatureCallback && isScriptTransaction) {
|
45690
|
+
const lengthBefore = signedRequest.witnesses.length;
|
45691
|
+
await signatureCallback(signedRequest);
|
45692
|
+
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
45693
|
+
}
|
45694
|
+
await this.estimatePredicates(signedRequest);
|
45695
|
+
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45696
|
+
transactionRequest: signedRequest,
|
45697
|
+
optimizeGas: false
|
45698
|
+
});
|
45699
|
+
txRequestClone.maxFee = maxFee;
|
45228
45700
|
let receipts = [];
|
45229
45701
|
let missingContractIds = [];
|
45230
45702
|
let outputVariables = 0;
|
45231
|
-
|
45232
|
-
|
45233
|
-
|
45703
|
+
let gasUsed = bn(0);
|
45704
|
+
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
45705
|
+
if (isScriptTransaction) {
|
45706
|
+
if (signatureCallback) {
|
45707
|
+
await signatureCallback(txRequestClone);
|
45708
|
+
}
|
45709
|
+
txRequestClone.gasLimit = gasLimit;
|
45234
45710
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45235
45711
|
receipts = result.receipts;
|
45236
45712
|
outputVariables = result.outputVariables;
|
45237
45713
|
missingContractIds = result.missingContractIds;
|
45714
|
+
gasUsed = getGasUsedFromReceipts(receipts);
|
45715
|
+
txRequestClone.gasLimit = gasUsed;
|
45716
|
+
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
45717
|
+
transactionRequest: txRequestClone,
|
45718
|
+
gasPrice
|
45719
|
+
}));
|
45238
45720
|
}
|
45239
|
-
const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
|
45240
|
-
const usedFee = calculatePriceWithFactor(
|
45241
|
-
gasUsed,
|
45242
|
-
gasPrice,
|
45243
|
-
gasPriceFactor
|
45244
|
-
).normalizeZeroToOne();
|
45245
|
-
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45246
|
-
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45247
45721
|
return {
|
45248
45722
|
requiredQuantities: allQuantities,
|
45249
45723
|
receipts,
|
45250
45724
|
gasUsed,
|
45251
|
-
minGasPrice,
|
45252
45725
|
gasPrice,
|
45253
45726
|
minGas,
|
45254
45727
|
maxGas,
|
45255
|
-
usedFee,
|
45256
45728
|
minFee,
|
45257
45729
|
maxFee,
|
45258
|
-
estimatedInputs: txRequestClone.inputs,
|
45259
45730
|
outputVariables,
|
45260
|
-
missingContractIds
|
45731
|
+
missingContractIds,
|
45732
|
+
addedSignatures,
|
45733
|
+
estimatedPredicates: txRequestClone.inputs
|
45261
45734
|
};
|
45262
45735
|
}
|
45263
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45736
|
+
async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
|
45264
45737
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45265
45738
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45266
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45739
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, {
|
45740
|
+
quantitiesToContract
|
45741
|
+
});
|
45267
45742
|
transactionRequest.addResources(
|
45268
45743
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45269
45744
|
);
|
45270
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45271
|
-
|
45272
|
-
|
45273
|
-
);
|
45745
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
|
45746
|
+
quantitiesToContract
|
45747
|
+
});
|
45274
45748
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45275
45749
|
return {
|
45276
45750
|
resources,
|
@@ -45294,7 +45768,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45294
45768
|
assetId: coin.assetId,
|
45295
45769
|
amount: bn(coin.amount),
|
45296
45770
|
owner: Address.fromAddressOrString(coin.owner),
|
45297
|
-
maturity: bn(coin.maturity).toNumber(),
|
45298
45771
|
blockCreated: bn(coin.blockCreated),
|
45299
45772
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45300
45773
|
}));
|
@@ -45346,7 +45819,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45346
45819
|
amount: bn(coin.amount),
|
45347
45820
|
assetId: coin.assetId,
|
45348
45821
|
owner: Address.fromAddressOrString(coin.owner),
|
45349
|
-
maturity: bn(coin.maturity).toNumber(),
|
45350
45822
|
blockCreated: bn(coin.blockCreated),
|
45351
45823
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45352
45824
|
};
|
@@ -45379,7 +45851,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45379
45851
|
}
|
45380
45852
|
return {
|
45381
45853
|
id: block2.id,
|
45382
|
-
height: bn(block2.
|
45854
|
+
height: bn(block2.height),
|
45383
45855
|
time: block2.header.time,
|
45384
45856
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45385
45857
|
};
|
@@ -45394,7 +45866,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45394
45866
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45395
45867
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45396
45868
|
id: block2.id,
|
45397
|
-
height: bn(block2.
|
45869
|
+
height: bn(block2.height),
|
45398
45870
|
time: block2.header.time,
|
45399
45871
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45400
45872
|
}));
|
@@ -45421,7 +45893,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45421
45893
|
}
|
45422
45894
|
return {
|
45423
45895
|
id: block2.id,
|
45424
|
-
height: bn(block2.
|
45896
|
+
height: bn(block2.height, 10),
|
45425
45897
|
time: block2.header.time,
|
45426
45898
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45427
45899
|
transactions: block2.transactions.map(
|
@@ -45601,8 +46073,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45601
46073
|
prevRoot: messageBlockHeader.prevRoot,
|
45602
46074
|
time: messageBlockHeader.time,
|
45603
46075
|
applicationHash: messageBlockHeader.applicationHash,
|
45604
|
-
|
45605
|
-
|
46076
|
+
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount),
|
46077
|
+
messageOutboxRoot: messageBlockHeader.messageOutboxRoot,
|
46078
|
+
consensusParametersVersion: messageBlockHeader.consensusParametersVersion,
|
46079
|
+
eventInboxRoot: messageBlockHeader.eventInboxRoot,
|
46080
|
+
stateTransitionBytecodeVersion: messageBlockHeader.stateTransitionBytecodeVersion
|
45606
46081
|
},
|
45607
46082
|
commitBlockHeader: {
|
45608
46083
|
id: commitBlockHeader.id,
|
@@ -45613,8 +46088,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45613
46088
|
prevRoot: commitBlockHeader.prevRoot,
|
45614
46089
|
time: commitBlockHeader.time,
|
45615
46090
|
applicationHash: commitBlockHeader.applicationHash,
|
45616
|
-
|
45617
|
-
|
46091
|
+
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount),
|
46092
|
+
messageOutboxRoot: commitBlockHeader.messageOutboxRoot,
|
46093
|
+
consensusParametersVersion: commitBlockHeader.consensusParametersVersion,
|
46094
|
+
eventInboxRoot: commitBlockHeader.eventInboxRoot,
|
46095
|
+
stateTransitionBytecodeVersion: commitBlockHeader.stateTransitionBytecodeVersion
|
45618
46096
|
},
|
45619
46097
|
sender: Address.fromAddressOrString(sender),
|
45620
46098
|
recipient: Address.fromAddressOrString(recipient),
|
@@ -45623,6 +46101,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45623
46101
|
data
|
45624
46102
|
};
|
45625
46103
|
}
|
46104
|
+
async getLatestGasPrice() {
|
46105
|
+
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46106
|
+
return bn(latestGasPrice.gasPrice);
|
46107
|
+
}
|
46108
|
+
async estimateGasPrice(blockHorizon) {
|
46109
|
+
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46110
|
+
blockHorizon: String(blockHorizon)
|
46111
|
+
});
|
46112
|
+
return bn(estimateGasPrice.gasPrice);
|
46113
|
+
}
|
45626
46114
|
/**
|
45627
46115
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
45628
46116
|
*
|
@@ -45868,9 +46356,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45868
46356
|
* @param assetId - The asset ID to check the balance for.
|
45869
46357
|
* @returns A promise that resolves to the balance amount.
|
45870
46358
|
*/
|
45871
|
-
async getBalance(assetId) {
|
45872
|
-
const
|
45873
|
-
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
46359
|
+
async getBalance(assetId = BaseAssetId) {
|
46360
|
+
const amount = await this.provider.getBalance(this.address, assetId);
|
45874
46361
|
return amount;
|
45875
46362
|
}
|
45876
46363
|
/**
|
@@ -45907,37 +46394,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45907
46394
|
* @param fee - The estimated transaction fee.
|
45908
46395
|
* @returns A promise that resolves when the resources are added to the transaction.
|
45909
46396
|
*/
|
45910
|
-
async fund(request,
|
45911
|
-
const
|
45912
|
-
const
|
46397
|
+
async fund(request, params) {
|
46398
|
+
const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
|
46399
|
+
const txRequest = request;
|
46400
|
+
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45913
46401
|
amount: bn(fee),
|
45914
|
-
assetId:
|
45915
|
-
coinQuantities
|
46402
|
+
assetId: BaseAssetId,
|
46403
|
+
coinQuantities: requiredQuantities
|
45916
46404
|
});
|
45917
46405
|
const quantitiesDict = {};
|
45918
|
-
|
46406
|
+
requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
|
45919
46407
|
quantitiesDict[assetId] = {
|
45920
46408
|
required: amount,
|
45921
46409
|
owned: bn(0)
|
45922
46410
|
};
|
45923
46411
|
});
|
45924
|
-
|
45925
|
-
const cachedMessages = [];
|
45926
|
-
const owner = this.address.toB256();
|
45927
|
-
request.inputs.forEach((input) => {
|
46412
|
+
txRequest.inputs.forEach((input) => {
|
45928
46413
|
const isResource = "amount" in input;
|
45929
46414
|
if (isResource) {
|
45930
46415
|
const isCoin2 = "owner" in input;
|
45931
46416
|
if (isCoin2) {
|
45932
46417
|
const assetId = String(input.assetId);
|
45933
|
-
if (
|
46418
|
+
if (quantitiesDict[assetId]) {
|
45934
46419
|
const amount = bn(input.amount);
|
45935
46420
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45936
|
-
cachedUtxos.push(input.id);
|
45937
46421
|
}
|
45938
|
-
} else if (input.
|
45939
|
-
quantitiesDict[
|
45940
|
-
cachedMessages.push(input.nonce);
|
46422
|
+
} else if (input.amount && quantitiesDict[BaseAssetId]) {
|
46423
|
+
quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
|
45941
46424
|
}
|
45942
46425
|
}
|
45943
46426
|
});
|
@@ -45952,12 +46435,23 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45952
46435
|
});
|
45953
46436
|
const needsToBeFunded = missingQuantities.length;
|
45954
46437
|
if (needsToBeFunded) {
|
45955
|
-
const
|
45956
|
-
|
45957
|
-
|
45958
|
-
|
45959
|
-
|
46438
|
+
const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
|
46439
|
+
const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
|
46440
|
+
txRequest.addResources(resources);
|
46441
|
+
}
|
46442
|
+
txRequest.shiftPredicateData();
|
46443
|
+
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46444
|
+
const requestToBeReEstimate = clone_default(txRequest);
|
46445
|
+
if (addedSignatures) {
|
46446
|
+
Array.from({ length: addedSignatures }).forEach(
|
46447
|
+
() => requestToBeReEstimate.addEmptyWitness()
|
46448
|
+
);
|
45960
46449
|
}
|
46450
|
+
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46451
|
+
transactionRequest: requestToBeReEstimate
|
46452
|
+
});
|
46453
|
+
txRequest.maxFee = maxFee;
|
46454
|
+
return txRequest;
|
45961
46455
|
}
|
45962
46456
|
/**
|
45963
46457
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -45965,30 +46459,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45965
46459
|
* @param destination - The address of the destination.
|
45966
46460
|
* @param amount - The amount of coins to transfer.
|
45967
46461
|
* @param assetId - The asset ID of the coins to transfer.
|
45968
|
-
* @param txParams - The transaction parameters (gasLimit,
|
46462
|
+
* @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
|
45969
46463
|
* @returns A promise that resolves to the prepared transaction request.
|
45970
46464
|
*/
|
45971
|
-
async createTransfer(destination, amount, assetId, txParams = {}) {
|
45972
|
-
const
|
45973
|
-
|
45974
|
-
const
|
45975
|
-
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
45976
|
-
const request = new ScriptTransactionRequest(params);
|
45977
|
-
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
45978
|
-
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46465
|
+
async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
|
46466
|
+
const request = new ScriptTransactionRequest(txParams);
|
46467
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
|
46468
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
45979
46469
|
estimateTxDependencies: true,
|
45980
46470
|
resourcesOwner: this
|
45981
46471
|
});
|
45982
|
-
|
45983
|
-
|
45984
|
-
|
45985
|
-
|
45986
|
-
|
45987
|
-
|
45988
|
-
|
45989
|
-
|
45990
|
-
await this.fund(request,
|
45991
|
-
request.updatePredicateInputs(estimatedInputs);
|
46472
|
+
if ("gasLimit" in txParams) {
|
46473
|
+
this.validateGas({
|
46474
|
+
gasUsed: txCost.gasUsed,
|
46475
|
+
gasLimit: request.gasLimit
|
46476
|
+
});
|
46477
|
+
}
|
46478
|
+
request.gasLimit = txCost.gasUsed;
|
46479
|
+
request.maxFee = txCost.maxFee;
|
46480
|
+
await this.fund(request, txCost);
|
45992
46481
|
return request;
|
45993
46482
|
}
|
45994
46483
|
/**
|
@@ -46000,15 +46489,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46000
46489
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46001
46490
|
* @returns A promise that resolves to the transaction response.
|
46002
46491
|
*/
|
46003
|
-
async transfer(destination, amount, assetId, txParams = {}) {
|
46492
|
+
async transfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
|
46004
46493
|
if (bn(amount).lte(0)) {
|
46005
46494
|
throw new FuelError(
|
46006
46495
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
46007
46496
|
"Transfer amount must be a positive number."
|
46008
46497
|
);
|
46009
46498
|
}
|
46010
|
-
const
|
46011
|
-
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
46499
|
+
const request = await this.createTransfer(destination, amount, assetId, txParams);
|
46012
46500
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
46013
46501
|
}
|
46014
46502
|
/**
|
@@ -46020,7 +46508,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46020
46508
|
* @param txParams - The optional transaction parameters.
|
46021
46509
|
* @returns A promise that resolves to the transaction response.
|
46022
46510
|
*/
|
46023
|
-
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46511
|
+
async transferToContract(contractId, amount, assetId = BaseAssetId, txParams = {}) {
|
46024
46512
|
if (bn(amount).lte(0)) {
|
46025
46513
|
throw new FuelError(
|
46026
46514
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46028,33 +46516,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46028
46516
|
);
|
46029
46517
|
}
|
46030
46518
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46031
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46032
|
-
const baseAssetId = this.provider.getBaseAssetId();
|
46033
|
-
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46034
|
-
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
46035
46519
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46036
46520
|
hexlifiedContractId: contractAddress.toB256(),
|
46037
46521
|
amountToTransfer: bn(amount),
|
46038
|
-
assetId
|
46522
|
+
assetId
|
46039
46523
|
});
|
46040
46524
|
const request = new ScriptTransactionRequest({
|
46041
|
-
...
|
46525
|
+
...txParams,
|
46042
46526
|
script,
|
46043
46527
|
scriptData
|
46044
46528
|
});
|
46045
46529
|
request.addContractInputAndOutput(contractAddress);
|
46046
|
-
const
|
46047
|
-
|
46048
|
-
[{ amount: bn(amount), assetId: String(
|
46049
|
-
);
|
46050
|
-
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46051
|
-
this.validateGas({
|
46052
|
-
gasUsed,
|
46053
|
-
gasPrice: request.gasPrice,
|
46054
|
-
gasLimit: request.gasLimit,
|
46055
|
-
minGasPrice
|
46530
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
46531
|
+
resourcesOwner: this,
|
46532
|
+
quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
|
46056
46533
|
});
|
46057
|
-
|
46534
|
+
if (txParams.gasLimit) {
|
46535
|
+
this.validateGas({
|
46536
|
+
gasUsed: txCost.gasUsed,
|
46537
|
+
gasLimit: request.gasLimit
|
46538
|
+
});
|
46539
|
+
}
|
46540
|
+
request.gasLimit = txCost.gasUsed;
|
46541
|
+
request.maxFee = txCost.maxFee;
|
46542
|
+
await this.fund(request, txCost);
|
46058
46543
|
return this.sendTransaction(request);
|
46059
46544
|
}
|
46060
46545
|
/**
|
@@ -46066,8 +46551,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46066
46551
|
* @returns A promise that resolves to the transaction response.
|
46067
46552
|
*/
|
46068
46553
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46069
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46070
|
-
const baseAssetId = this.provider.getBaseAssetId();
|
46071
46554
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46072
46555
|
const recipientDataArray = arrayify(
|
46073
46556
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46080,26 +46563,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46080
46563
|
...recipientDataArray,
|
46081
46564
|
...amountDataArray
|
46082
46565
|
]);
|
46083
|
-
const params = {
|
46084
|
-
script,
|
46085
|
-
gasPrice: minGasPrice,
|
46086
|
-
baseAssetId,
|
46087
|
-
...txParams
|
46088
|
-
};
|
46566
|
+
const params = { script, ...txParams };
|
46089
46567
|
const request = new ScriptTransactionRequest(params);
|
46090
|
-
const
|
46091
|
-
const
|
46092
|
-
|
46093
|
-
|
46094
|
-
|
46095
|
-
|
46096
|
-
|
46097
|
-
|
46098
|
-
|
46099
|
-
|
46100
|
-
|
46101
|
-
});
|
46102
|
-
await this.fund(request, requiredQuantities, maxFee);
|
46568
|
+
const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
|
46569
|
+
const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
|
46570
|
+
if (txParams.gasLimit) {
|
46571
|
+
this.validateGas({
|
46572
|
+
gasUsed: txCost.gasUsed,
|
46573
|
+
gasLimit: request.gasLimit
|
46574
|
+
});
|
46575
|
+
}
|
46576
|
+
request.maxFee = txCost.maxFee;
|
46577
|
+
request.gasLimit = txCost.gasUsed;
|
46578
|
+
await this.fund(request, txCost);
|
46103
46579
|
return this.sendTransaction(request);
|
46104
46580
|
}
|
46105
46581
|
async signMessage(message) {
|
@@ -46157,18 +46633,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46157
46633
|
}
|
46158
46634
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46159
46635
|
}
|
46160
|
-
validateGas({
|
46161
|
-
gasUsed,
|
46162
|
-
gasPrice,
|
46163
|
-
gasLimit,
|
46164
|
-
minGasPrice
|
46165
|
-
}) {
|
46166
|
-
if (minGasPrice.gt(gasPrice)) {
|
46167
|
-
throw new FuelError(
|
46168
|
-
ErrorCode.GAS_PRICE_TOO_LOW,
|
46169
|
-
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46170
|
-
);
|
46171
|
-
}
|
46636
|
+
validateGas({ gasUsed, gasLimit }) {
|
46172
46637
|
if (gasUsed.gt(gasLimit)) {
|
46173
46638
|
throw new FuelError(
|
46174
46639
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -47551,12 +48016,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47551
48016
|
};
|
47552
48017
|
|
47553
48018
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
|
47554
|
-
var
|
48019
|
+
var import_crypto16 = __toESM(__require("crypto"));
|
47555
48020
|
var rnds8Pool = new Uint8Array(256);
|
47556
48021
|
var poolPtr = rnds8Pool.length;
|
47557
48022
|
function rng() {
|
47558
48023
|
if (poolPtr > rnds8Pool.length - 16) {
|
47559
|
-
|
48024
|
+
import_crypto16.default.randomFillSync(rnds8Pool);
|
47560
48025
|
poolPtr = 0;
|
47561
48026
|
}
|
47562
48027
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
@@ -47572,9 +48037,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47572
48037
|
}
|
47573
48038
|
|
47574
48039
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
|
47575
|
-
var
|
48040
|
+
var import_crypto17 = __toESM(__require("crypto"));
|
47576
48041
|
var native_default = {
|
47577
|
-
randomUUID:
|
48042
|
+
randomUUID: import_crypto17.default.randomUUID
|
47578
48043
|
};
|
47579
48044
|
|
47580
48045
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
|
@@ -47757,7 +48222,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47757
48222
|
* @param transactionRequestLike - The transaction request to send.
|
47758
48223
|
* @returns A promise that resolves to the TransactionResponse object.
|
47759
48224
|
*/
|
47760
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
48225
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
|
47761
48226
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
47762
48227
|
if (estimateTxDependencies) {
|
47763
48228
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50517,16 +50982,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50517
50982
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50518
50983
|
wallet.provider
|
50519
50984
|
);
|
50520
|
-
const
|
50521
|
-
|
50522
|
-
|
50523
|
-
|
50524
|
-
baseAssetId,
|
50525
|
-
gasLimit: 1e4,
|
50526
|
-
gasPrice: minGasPrice
|
50985
|
+
const request = new ScriptTransactionRequest();
|
50986
|
+
quantities.forEach((quantity) => {
|
50987
|
+
const { amount, assetId } = coinQuantityfy(quantity);
|
50988
|
+
request.addCoinOutput(wallet.address, amount, assetId);
|
50527
50989
|
});
|
50528
|
-
|
50529
|
-
|
50990
|
+
const txCost = await genesisWallet.provider.getTransactionCost(request);
|
50991
|
+
request.gasLimit = txCost.gasUsed;
|
50992
|
+
request.maxFee = txCost.maxFee;
|
50993
|
+
await genesisWallet.fund(request, txCost);
|
50530
50994
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50531
50995
|
};
|
50532
50996
|
|
@@ -50556,7 +51020,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50556
51020
|
|
50557
51021
|
// src/test-utils/launchNode.ts
|
50558
51022
|
var import_child_process = __require("child_process");
|
50559
|
-
var
|
51023
|
+
var import_crypto21 = __require("crypto");
|
50560
51024
|
var import_fs2 = __require("fs");
|
50561
51025
|
var import_os = __toESM(__require("os"));
|
50562
51026
|
var import_path8 = __toESM(__require("path"));
|
@@ -50605,12 +51069,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50605
51069
|
// eslint-disable-next-line no-async-promise-executor
|
50606
51070
|
new Promise(async (resolve, reject) => {
|
50607
51071
|
const remainingArgs = extractRemainingArgs(args, [
|
50608
|
-
"--
|
51072
|
+
"--snapshot",
|
50609
51073
|
"--consensus-key",
|
50610
51074
|
"--db-type",
|
50611
51075
|
"--poa-instant"
|
50612
51076
|
]);
|
50613
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
51077
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--snapshot");
|
50614
51078
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
50615
51079
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
50616
51080
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -50628,37 +51092,55 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50628
51092
|
})).toString();
|
50629
51093
|
let chainConfigPathToUse;
|
50630
51094
|
const prefix = basePath || import_os.default.tmpdir();
|
50631
|
-
const suffix = basePath ? "" : (0,
|
50632
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51095
|
+
const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
|
51096
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "chainConfigs");
|
50633
51097
|
if (chainConfigPath) {
|
50634
51098
|
chainConfigPathToUse = chainConfigPath;
|
50635
51099
|
} else {
|
50636
51100
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
50637
51101
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
50638
51102
|
}
|
50639
|
-
|
50640
|
-
|
51103
|
+
let { stateConfigJson } = defaultChainConfigs;
|
51104
|
+
const { chainConfigJson, metadataJson } = defaultChainConfigs;
|
51105
|
+
stateConfigJson = {
|
51106
|
+
...stateConfigJson,
|
51107
|
+
coins: [
|
51108
|
+
...stateConfigJson.coins.map((coin) => ({
|
51109
|
+
...coin,
|
51110
|
+
amount: "18446744073709551615"
|
51111
|
+
}))
|
51112
|
+
],
|
51113
|
+
messages: stateConfigJson.messages.map((message) => ({
|
51114
|
+
...message,
|
51115
|
+
amount: "18446744073709551615"
|
51116
|
+
}))
|
51117
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51118
|
+
};
|
50641
51119
|
if (!process.env.GENESIS_SECRET) {
|
50642
51120
|
const pk = Signer.generatePrivateKey();
|
50643
51121
|
const signer = new Signer(pk);
|
50644
51122
|
process.env.GENESIS_SECRET = hexlify(pk);
|
50645
|
-
|
50646
|
-
|
50647
|
-
|
50648
|
-
|
50649
|
-
|
50650
|
-
|
50651
|
-
|
50652
|
-
|
50653
|
-
|
50654
|
-
|
50655
|
-
}
|
50656
|
-
]
|
50657
|
-
}
|
50658
|
-
};
|
51123
|
+
stateConfigJson.coins.push({
|
51124
|
+
tx_id: hexlify(randomBytes3(34)),
|
51125
|
+
owner: signer.address.toHexString(),
|
51126
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51127
|
+
amount: "18446744073709551615",
|
51128
|
+
asset_id: BaseAssetId,
|
51129
|
+
output_index: 0,
|
51130
|
+
tx_pointer_block_height: 0,
|
51131
|
+
tx_pointer_tx_idx: 0
|
51132
|
+
});
|
50659
51133
|
}
|
50660
|
-
|
50661
|
-
|
51134
|
+
let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
|
51135
|
+
const regexMakeNumber = /("amount":)"(\d+)"/gm;
|
51136
|
+
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51137
|
+
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51138
|
+
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51139
|
+
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51140
|
+
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51141
|
+
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51142
|
+
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51143
|
+
chainConfigPathToUse = tempDirPath;
|
50662
51144
|
}
|
50663
51145
|
const child = (0, import_child_process.spawn)(
|
50664
51146
|
command,
|
@@ -50667,10 +51149,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50667
51149
|
["--ip", ipToUse],
|
50668
51150
|
["--port", portToUse],
|
50669
51151
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
50670
|
-
["--min-gas-price", "
|
51152
|
+
["--min-gas-price", "1"],
|
50671
51153
|
poaInstant ? ["--poa-instant", "true"] : [],
|
50672
51154
|
["--consensus-key", consensusKey],
|
50673
|
-
["--
|
51155
|
+
["--snapshot", chainConfigPathToUse],
|
50674
51156
|
"--vm-backtrace",
|
50675
51157
|
"--utxo-validation",
|
50676
51158
|
"--debug",
|
@@ -50717,10 +51199,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50717
51199
|
})
|
50718
51200
|
);
|
50719
51201
|
var generateWallets = async (count, provider) => {
|
50720
|
-
const baseAssetId = provider.getBaseAssetId();
|
50721
51202
|
const wallets = [];
|
50722
51203
|
for (let i = 0; i < count; i += 1) {
|
50723
|
-
const wallet = await generateTestWallet(provider, [[1e3,
|
51204
|
+
const wallet = await generateTestWallet(provider, [[1e3, BaseAssetId]]);
|
50724
51205
|
wallets.push(wallet);
|
50725
51206
|
}
|
50726
51207
|
return wallets;
|
@@ -50730,7 +51211,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50730
51211
|
walletCount = 10
|
50731
51212
|
} = {}) => {
|
50732
51213
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
50733
|
-
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51214
|
+
const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
|
50734
51215
|
const wallets = await generateWallets(walletCount, provider);
|
50735
51216
|
const cleanup = () => {
|
50736
51217
|
closeNode();
|