@fuel-ts/account 0.0.0-rc-2034-20240410113328 → 0.0.0-rc-2021-20240410132122
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 +798 -564
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +759 -525
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +639 -406
- 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 +888 -322
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/coin-quantity.d.ts +1 -1
- 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 +3 -1
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +36 -31
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/input.d.ts +2 -2
- package/dist/providers/transaction-request/input.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +8 -25
- 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.global.js +1512 -1063
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +735 -521
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +629 -415
- 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,520 +32193,753 @@ 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
|
-
|
32489
|
-
|
32490
|
-
|
32491
|
-
|
32492
|
-
|
32493
|
-
|
32494
|
-
aloc: 1,
|
32495
|
-
and: 1,
|
32496
|
-
andi: 1,
|
32497
|
-
bal: 13,
|
32498
|
-
bhei: 1,
|
32499
|
-
bhsh: 1,
|
32500
|
-
burn: 132,
|
32501
|
-
cb: 1,
|
32502
|
-
cfei: 1,
|
32503
|
-
cfsi: 1,
|
32504
|
-
croo: 16,
|
32505
|
-
div: 1,
|
32506
|
-
divi: 1,
|
32507
|
-
ecr1: 3e3,
|
32508
|
-
eck1: 951,
|
32509
|
-
ed19: 3e3,
|
32510
|
-
eq: 1,
|
32511
|
-
exp: 1,
|
32512
|
-
expi: 1,
|
32513
|
-
flag: 1,
|
32514
|
-
gm: 1,
|
32515
|
-
gt: 1,
|
32516
|
-
gtf: 1,
|
32517
|
-
ji: 1,
|
32518
|
-
jmp: 1,
|
32519
|
-
jne: 1,
|
32520
|
-
jnei: 1,
|
32521
|
-
jnzi: 1,
|
32522
|
-
jmpf: 1,
|
32523
|
-
jmpb: 1,
|
32524
|
-
jnzf: 1,
|
32525
|
-
jnzb: 1,
|
32526
|
-
jnef: 1,
|
32527
|
-
jneb: 1,
|
32528
|
-
lb: 1,
|
32529
|
-
log: 9,
|
32530
|
-
lt: 1,
|
32531
|
-
lw: 1,
|
32532
|
-
mint: 135,
|
32533
|
-
mlog: 1,
|
32534
|
-
modOp: 1,
|
32535
|
-
modi: 1,
|
32536
|
-
moveOp: 1,
|
32537
|
-
movi: 1,
|
32538
|
-
mroo: 2,
|
32539
|
-
mul: 1,
|
32540
|
-
muli: 1,
|
32541
|
-
mldv: 1,
|
32542
|
-
noop: 1,
|
32543
|
-
not: 1,
|
32544
|
-
or: 1,
|
32545
|
-
ori: 1,
|
32546
|
-
poph: 2,
|
32547
|
-
popl: 2,
|
32548
|
-
pshh: 2,
|
32549
|
-
pshl: 2,
|
32550
|
-
ret: 13,
|
32551
|
-
rvrt: 13,
|
32552
|
-
sb: 1,
|
32553
|
-
sll: 1,
|
32554
|
-
slli: 1,
|
32555
|
-
srl: 1,
|
32556
|
-
srli: 1,
|
32557
|
-
srw: 12,
|
32558
|
-
sub: 1,
|
32559
|
-
subi: 1,
|
32560
|
-
sw: 1,
|
32561
|
-
sww: 67,
|
32562
|
-
time: 1,
|
32563
|
-
tr: 105,
|
32564
|
-
tro: 60,
|
32565
|
-
wdcm: 1,
|
32566
|
-
wqcm: 1,
|
32567
|
-
wdop: 1,
|
32568
|
-
wqop: 1,
|
32569
|
-
wdml: 1,
|
32570
|
-
wqml: 1,
|
32571
|
-
wddv: 1,
|
32572
|
-
wqdv: 2,
|
32573
|
-
wdmd: 3,
|
32574
|
-
wqmd: 4,
|
32575
|
-
wdam: 2,
|
32576
|
-
wqam: 3,
|
32577
|
-
wdmm: 3,
|
32578
|
-
wqmm: 3,
|
32579
|
-
xor: 1,
|
32580
|
-
xori: 1,
|
32581
|
-
call: {
|
32582
|
-
LightOperation: {
|
32583
|
-
base: 144,
|
32584
|
-
units_per_gas: 214
|
32585
|
-
}
|
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"
|
32586
32518
|
},
|
32587
|
-
|
32588
|
-
|
32589
|
-
|
32590
|
-
|
32591
|
-
|
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"
|
32592
32527
|
},
|
32593
|
-
|
32594
|
-
|
32595
|
-
|
32596
|
-
|
32597
|
-
|
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"
|
32598
32536
|
},
|
32599
|
-
|
32600
|
-
|
32601
|
-
|
32602
|
-
|
32603
|
-
|
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"
|
32604
32545
|
},
|
32605
|
-
|
32606
|
-
|
32607
|
-
|
32608
|
-
|
32609
|
-
|
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"
|
32610
32554
|
},
|
32611
|
-
|
32612
|
-
|
32613
|
-
|
32614
|
-
|
32615
|
-
|
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"
|
32616
32563
|
},
|
32617
|
-
|
32618
|
-
|
32619
|
-
|
32620
|
-
|
32621
|
-
|
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"
|
32622
32572
|
},
|
32623
|
-
|
32624
|
-
|
32625
|
-
|
32626
|
-
|
32627
|
-
|
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"
|
32628
32581
|
},
|
32629
|
-
|
32630
|
-
|
32631
|
-
|
32632
|
-
|
32633
|
-
|
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"
|
32634
32590
|
},
|
32635
|
-
|
32636
|
-
|
32637
|
-
|
32638
|
-
|
32639
|
-
|
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"
|
32640
32599
|
},
|
32641
|
-
|
32642
|
-
|
32643
|
-
|
32644
|
-
|
32645
|
-
|
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"
|
32646
32608
|
},
|
32647
|
-
|
32648
|
-
|
32649
|
-
|
32650
|
-
|
32651
|
-
|
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"
|
32652
32617
|
},
|
32653
|
-
|
32654
|
-
|
32655
|
-
|
32656
|
-
|
32657
|
-
|
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"
|
32658
32626
|
},
|
32659
|
-
|
32660
|
-
|
32661
|
-
|
32662
|
-
|
32663
|
-
|
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"
|
32664
32635
|
},
|
32665
|
-
|
32666
|
-
|
32667
|
-
|
32668
|
-
|
32669
|
-
|
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"
|
32670
32644
|
},
|
32671
|
-
|
32672
|
-
|
32673
|
-
|
32674
|
-
|
32675
|
-
|
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"
|
32676
32653
|
},
|
32677
|
-
|
32678
|
-
|
32679
|
-
|
32680
|
-
|
32681
|
-
|
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"
|
32682
32662
|
},
|
32683
|
-
|
32684
|
-
|
32685
|
-
|
32686
|
-
|
32687
|
-
|
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"
|
32688
32671
|
},
|
32689
|
-
|
32690
|
-
|
32691
|
-
|
32692
|
-
|
32693
|
-
|
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"
|
32694
32680
|
},
|
32695
|
-
|
32696
|
-
|
32697
|
-
|
32698
|
-
|
32699
|
-
|
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"
|
32700
32689
|
},
|
32701
|
-
|
32702
|
-
|
32703
|
-
|
32704
|
-
|
32705
|
-
|
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"
|
32698
|
+
},
|
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"
|
32706
32914
|
}
|
32707
|
-
|
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
|
32708
32942
|
};
|
32709
|
-
var defaultChainConfig = chainConfig_default;
|
32710
32943
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32711
32944
|
|
32712
32945
|
// ../crypto/dist/index.mjs
|
@@ -34999,32 +35232,182 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34999
35232
|
function toBytes3(value, bytesPadding) {
|
35000
35233
|
return bn(value).toBytes(bytesPadding);
|
35001
35234
|
}
|
35002
|
-
|
35003
|
-
|
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" : ""));
|
35004
35281
|
}
|
35005
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";
|
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";
|
35388
|
+
|
35006
35389
|
// src/providers/coin-quantity.ts
|
35007
35390
|
var coinQuantityfy = (coinQuantityLike) => {
|
35008
35391
|
let assetId;
|
35009
35392
|
let amount;
|
35010
|
-
let
|
35393
|
+
let max;
|
35011
35394
|
if (Array.isArray(coinQuantityLike)) {
|
35012
35395
|
amount = coinQuantityLike[0];
|
35013
35396
|
assetId = coinQuantityLike[1] ?? BaseAssetId;
|
35014
|
-
|
35397
|
+
max = coinQuantityLike[2] ?? void 0;
|
35015
35398
|
} else {
|
35016
35399
|
amount = coinQuantityLike.amount;
|
35017
35400
|
assetId = coinQuantityLike.assetId ?? BaseAssetId;
|
35018
|
-
|
35401
|
+
max = coinQuantityLike.max ?? void 0;
|
35019
35402
|
}
|
35020
35403
|
const bnAmount = bn(amount);
|
35021
35404
|
return {
|
35022
35405
|
assetId: hexlify(assetId),
|
35023
35406
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35024
|
-
max:
|
35407
|
+
max: max ? bn(max) : void 0
|
35025
35408
|
};
|
35026
35409
|
};
|
35027
|
-
var
|
35410
|
+
var addAmountToCoinQuantities = (params) => {
|
35028
35411
|
const { amount, assetId } = params;
|
35029
35412
|
const coinQuantities = [...params.coinQuantities];
|
35030
35413
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35098,9 +35481,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35098
35481
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35099
35482
|
var MAX_BYTES = 2 ** 32 - 1;
|
35100
35483
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35101
|
-
|
35484
|
+
ASSET_ID_LEN + // Base asset ID
|
35102
35485
|
// Asset ID/Balance coin input pairs
|
35103
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35486
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
|
35104
35487
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35105
35488
|
WORD_SIZE + // Gas limit
|
35106
35489
|
WORD_SIZE + // Script size
|
@@ -35118,7 +35501,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35118
35501
|
ASSET_ID_LEN + // Asset id
|
35119
35502
|
TX_POINTER_LEN + // TxPointer
|
35120
35503
|
WORD_SIZE + // Witnesses index
|
35121
|
-
WORD_SIZE + // Maturity
|
35122
35504
|
WORD_SIZE + // Predicate size
|
35123
35505
|
WORD_SIZE + // Predicate data size
|
35124
35506
|
WORD_SIZE;
|
@@ -35250,6 +35632,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35250
35632
|
const padding = new Uint8Array(WORD_SIZE - encoded.length % WORD_SIZE);
|
35251
35633
|
return concatBytes2([encoded, padding]);
|
35252
35634
|
};
|
35635
|
+
var isUint8Array = (value) => value instanceof Uint8Array;
|
35253
35636
|
var ArrayCoder = class extends Coder {
|
35254
35637
|
coder;
|
35255
35638
|
length;
|
@@ -35439,7 +35822,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35439
35822
|
constructor(name, coders) {
|
35440
35823
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35441
35824
|
const encodedValueSize = Object.values(coders).reduce(
|
35442
|
-
(
|
35825
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
35443
35826
|
0
|
35444
35827
|
);
|
35445
35828
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -35791,8 +36174,11 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35791
36174
|
this.coder = coder;
|
35792
36175
|
}
|
35793
36176
|
encode(value) {
|
35794
|
-
if (!Array.isArray(value)) {
|
35795
|
-
throw new FuelError(
|
36177
|
+
if (!Array.isArray(value) && !isUint8Array(value)) {
|
36178
|
+
throw new FuelError(
|
36179
|
+
ErrorCode.ENCODE_ERROR,
|
36180
|
+
`Expected array value, or a Uint8Array. You can use arrayify to convert a value to a Uint8Array.`
|
36181
|
+
);
|
35796
36182
|
}
|
35797
36183
|
const parts = [];
|
35798
36184
|
const pointer = new BigNumberCoder("u64").encode(BASE_VECTOR_OFFSET);
|
@@ -36140,7 +36526,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36140
36526
|
constructor(name, coders) {
|
36141
36527
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36142
36528
|
const encodedValueSize = Object.values(coders).reduce(
|
36143
|
-
(
|
36529
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
36144
36530
|
0
|
36145
36531
|
);
|
36146
36532
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36842,18 +37228,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36842
37228
|
encode(value) {
|
36843
37229
|
const parts = [];
|
36844
37230
|
parts.push(new B256Coder().encode(value.txID));
|
36845
|
-
parts.push(new NumberCoder("
|
37231
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36846
37232
|
parts.push(new B256Coder().encode(value.owner));
|
36847
37233
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36848
37234
|
parts.push(new B256Coder().encode(value.assetId));
|
36849
37235
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
36850
|
-
parts.push(new NumberCoder("
|
36851
|
-
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37236
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36852
37237
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36853
|
-
parts.push(new
|
36854
|
-
parts.push(new
|
36855
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36856
|
-
parts.push(
|
37238
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37239
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
37240
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37241
|
+
parts.push(
|
37242
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37243
|
+
);
|
36857
37244
|
return concat(parts);
|
36858
37245
|
}
|
36859
37246
|
decode(data, offset) {
|
@@ -36861,7 +37248,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36861
37248
|
let o = offset;
|
36862
37249
|
[decoded, o] = new B256Coder().decode(data, o);
|
36863
37250
|
const txID = decoded;
|
36864
|
-
[decoded, o] = new NumberCoder("
|
37251
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36865
37252
|
const outputIndex = decoded;
|
36866
37253
|
[decoded, o] = new B256Coder().decode(data, o);
|
36867
37254
|
const owner = decoded;
|
@@ -36871,19 +37258,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36871
37258
|
const assetId = decoded;
|
36872
37259
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
36873
37260
|
const txPointer = decoded;
|
36874
|
-
[decoded, o] = new NumberCoder("
|
37261
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36875
37262
|
const witnessIndex = Number(decoded);
|
36876
|
-
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36877
|
-
const maturity = decoded;
|
36878
37263
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36879
37264
|
const predicateGasUsed = decoded;
|
36880
|
-
[decoded, o] = new
|
37265
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36881
37266
|
const predicateLength = decoded;
|
36882
|
-
[decoded, o] = new
|
37267
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36883
37268
|
const predicateDataLength = decoded;
|
36884
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37269
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
36885
37270
|
const predicate = decoded;
|
36886
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37271
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
36887
37272
|
const predicateData = decoded;
|
36888
37273
|
return [
|
36889
37274
|
{
|
@@ -36895,7 +37280,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36895
37280
|
assetId,
|
36896
37281
|
txPointer,
|
36897
37282
|
witnessIndex,
|
36898
|
-
maturity,
|
36899
37283
|
predicateGasUsed,
|
36900
37284
|
predicateLength,
|
36901
37285
|
predicateDataLength,
|
@@ -36913,7 +37297,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36913
37297
|
encode(value) {
|
36914
37298
|
const parts = [];
|
36915
37299
|
parts.push(new B256Coder().encode(value.txID));
|
36916
|
-
parts.push(new NumberCoder("
|
37300
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36917
37301
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
36918
37302
|
parts.push(new B256Coder().encode(value.stateRoot));
|
36919
37303
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -36925,7 +37309,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36925
37309
|
let o = offset;
|
36926
37310
|
[decoded, o] = new B256Coder().decode(data, o);
|
36927
37311
|
const txID = decoded;
|
36928
|
-
[decoded, o] = new NumberCoder("
|
37312
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36929
37313
|
const outputIndex = decoded;
|
36930
37314
|
[decoded, o] = new B256Coder().decode(data, o);
|
36931
37315
|
const balanceRoot = decoded;
|
@@ -36974,14 +37358,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36974
37358
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
36975
37359
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36976
37360
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
36977
|
-
parts.push(new NumberCoder("
|
37361
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36978
37362
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36979
|
-
parts.push(new
|
36980
|
-
parts.push(new
|
36981
|
-
parts.push(new
|
37363
|
+
parts.push(new BigNumberCoder("u64").encode(data.length));
|
37364
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37365
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
36982
37366
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
36983
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36984
|
-
parts.push(
|
37367
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37368
|
+
parts.push(
|
37369
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37370
|
+
);
|
36985
37371
|
return concat(parts);
|
36986
37372
|
}
|
36987
37373
|
static decodeData(messageData) {
|
@@ -37001,21 +37387,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37001
37387
|
const amount = decoded;
|
37002
37388
|
[decoded, o] = new B256Coder().decode(data, o);
|
37003
37389
|
const nonce = decoded;
|
37004
|
-
[decoded, o] = new NumberCoder("
|
37390
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37005
37391
|
const witnessIndex = Number(decoded);
|
37006
37392
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37007
37393
|
const predicateGasUsed = decoded;
|
37008
37394
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37009
37395
|
const dataLength2 = decoded;
|
37010
|
-
[decoded, o] = new
|
37396
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37011
37397
|
const predicateLength = decoded;
|
37012
|
-
[decoded, o] = new
|
37398
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37013
37399
|
const predicateDataLength = decoded;
|
37014
37400
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37015
37401
|
const messageData = decoded;
|
37016
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37402
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
37017
37403
|
const predicate = decoded;
|
37018
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37404
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
37019
37405
|
const predicateData = decoded;
|
37020
37406
|
return [
|
37021
37407
|
{
|
@@ -37327,7 +37713,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37327
37713
|
}
|
37328
37714
|
};
|
37329
37715
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37330
|
-
PolicyType2[PolicyType2["
|
37716
|
+
PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
|
37331
37717
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37332
37718
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37333
37719
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37375,9 +37761,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37375
37761
|
let o = offset;
|
37376
37762
|
const policies = [];
|
37377
37763
|
if (policyTypes & 1) {
|
37378
|
-
const [
|
37764
|
+
const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37379
37765
|
o = nextOffset;
|
37380
|
-
policies.push({ type: 1, data:
|
37766
|
+
policies.push({ type: 1, data: tip });
|
37381
37767
|
}
|
37382
37768
|
if (policyTypes & 2) {
|
37383
37769
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -37609,15 +37995,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37609
37995
|
encode(value) {
|
37610
37996
|
const parts = [];
|
37611
37997
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
37612
|
-
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37613
|
-
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
37614
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37615
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37616
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37617
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37618
37998
|
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37619
|
-
parts.push(new
|
37620
|
-
parts.push(new
|
37999
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
|
38000
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
38001
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38002
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38003
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38004
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
38005
|
+
parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
|
38006
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
|
37621
38007
|
parts.push(new PoliciesCoder().encode(value.policies));
|
37622
38008
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37623
38009
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -37629,23 +38015,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37629
38015
|
let o = offset;
|
37630
38016
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37631
38017
|
const scriptGasLimit = decoded;
|
37632
|
-
[decoded, o] = new
|
38018
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38019
|
+
const receiptsRoot = decoded;
|
38020
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37633
38021
|
const scriptLength = decoded;
|
37634
|
-
[decoded, o] = new
|
38022
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37635
38023
|
const scriptDataLength = decoded;
|
37636
38024
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37637
38025
|
const policyTypes = decoded;
|
37638
|
-
[decoded, o] = new NumberCoder("
|
38026
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37639
38027
|
const inputsCount = decoded;
|
37640
|
-
[decoded, o] = new NumberCoder("
|
38028
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37641
38029
|
const outputsCount = decoded;
|
37642
|
-
[decoded, o] = new NumberCoder("
|
38030
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37643
38031
|
const witnessesCount = decoded;
|
37644
|
-
[decoded, o] = new
|
37645
|
-
const receiptsRoot = decoded;
|
37646
|
-
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38032
|
+
[decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
|
37647
38033
|
const script = decoded;
|
37648
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38034
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
|
37649
38035
|
const scriptData = decoded;
|
37650
38036
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37651
38037
|
const policies = decoded;
|
@@ -37683,18 +38069,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37683
38069
|
}
|
37684
38070
|
encode(value) {
|
37685
38071
|
const parts = [];
|
37686
|
-
parts.push(new NumberCoder("
|
37687
|
-
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
37688
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37689
|
-
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37690
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37691
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37692
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
38072
|
+
parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
|
37693
38073
|
parts.push(new B256Coder().encode(value.salt));
|
37694
|
-
parts.push(new
|
38074
|
+
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
38075
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38076
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38077
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38078
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
37695
38079
|
parts.push(
|
37696
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(
|
38080
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
|
38081
|
+
value.storageSlots
|
38082
|
+
)
|
37697
38083
|
);
|
38084
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
37698
38085
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37699
38086
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
37700
38087
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -37703,26 +38090,27 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37703
38090
|
decode(data, offset) {
|
37704
38091
|
let decoded;
|
37705
38092
|
let o = offset;
|
37706
|
-
[decoded, o] = new NumberCoder("
|
37707
|
-
const bytecodeLength = decoded;
|
37708
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38093
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37709
38094
|
const bytecodeWitnessIndex = decoded;
|
38095
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38096
|
+
const salt = decoded;
|
38097
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38098
|
+
const storageSlotsCount = decoded;
|
37710
38099
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37711
38100
|
const policyTypes = decoded;
|
37712
38101
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37713
|
-
const storageSlotsCount = decoded;
|
37714
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37715
38102
|
const inputsCount = decoded;
|
37716
|
-
[decoded, o] = new NumberCoder("
|
38103
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37717
38104
|
const outputsCount = decoded;
|
37718
|
-
[decoded, o] = new NumberCoder("
|
38105
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37719
38106
|
const witnessesCount = decoded;
|
37720
|
-
[decoded, o] = new
|
37721
|
-
|
38107
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
|
38108
|
+
data,
|
38109
|
+
o
|
38110
|
+
);
|
38111
|
+
const storageSlots = decoded;
|
37722
38112
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37723
38113
|
const policies = decoded;
|
37724
|
-
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37725
|
-
const storageSlots = decoded;
|
37726
38114
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
37727
38115
|
const inputs = decoded;
|
37728
38116
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -37732,7 +38120,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37732
38120
|
return [
|
37733
38121
|
{
|
37734
38122
|
type: 1,
|
37735
|
-
bytecodeLength,
|
37736
38123
|
bytecodeWitnessIndex,
|
37737
38124
|
policyTypes,
|
37738
38125
|
storageSlotsCount,
|
@@ -37761,6 +38148,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37761
38148
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
37762
38149
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
37763
38150
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38151
|
+
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
37764
38152
|
return concat(parts);
|
37765
38153
|
}
|
37766
38154
|
decode(data, offset) {
|
@@ -37776,6 +38164,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37776
38164
|
const mintAmount = decoded;
|
37777
38165
|
[decoded, o] = new B256Coder().decode(data, o);
|
37778
38166
|
const mintAssetId = decoded;
|
38167
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38168
|
+
const gasPrice = decoded;
|
37779
38169
|
return [
|
37780
38170
|
{
|
37781
38171
|
type: 2,
|
@@ -37783,7 +38173,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37783
38173
|
inputContract,
|
37784
38174
|
outputContract,
|
37785
38175
|
mintAmount,
|
37786
|
-
mintAssetId
|
38176
|
+
mintAssetId,
|
38177
|
+
gasPrice
|
37787
38178
|
},
|
37788
38179
|
o
|
37789
38180
|
];
|
@@ -38090,159 +38481,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38090
38481
|
// src/providers/provider.ts
|
38091
38482
|
var import_graphql_request = __toESM(require_dist2());
|
38092
38483
|
|
38093
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38094
|
-
function _isPlaceholder(a) {
|
38095
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38096
|
-
}
|
38097
|
-
|
38098
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38099
|
-
function _curry1(fn) {
|
38100
|
-
return function f1(a) {
|
38101
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38102
|
-
return f1;
|
38103
|
-
} else {
|
38104
|
-
return fn.apply(this, arguments);
|
38105
|
-
}
|
38106
|
-
};
|
38107
|
-
}
|
38108
|
-
|
38109
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38110
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
38111
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38112
|
-
};
|
38113
|
-
|
38114
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38115
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38116
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38117
|
-
});
|
38118
|
-
var type_default = type;
|
38119
|
-
|
38120
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38121
|
-
var pad = function pad2(n) {
|
38122
|
-
return (n < 10 ? "0" : "") + n;
|
38123
|
-
};
|
38124
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38125
|
-
return d.toISOString();
|
38126
|
-
} : function _toISOString3(d) {
|
38127
|
-
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";
|
38128
|
-
};
|
38129
|
-
|
38130
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38131
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38132
|
-
return n << 0 === n;
|
38133
|
-
};
|
38134
|
-
|
38135
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38136
|
-
function _cloneRegExp(pattern) {
|
38137
|
-
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" : ""));
|
38138
|
-
}
|
38139
|
-
|
38140
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38141
|
-
function _clone(value, deep, map) {
|
38142
|
-
map || (map = new _ObjectMap());
|
38143
|
-
if (_isPrimitive(value)) {
|
38144
|
-
return value;
|
38145
|
-
}
|
38146
|
-
var copy = function copy2(copiedValue) {
|
38147
|
-
var cachedCopy = map.get(value);
|
38148
|
-
if (cachedCopy) {
|
38149
|
-
return cachedCopy;
|
38150
|
-
}
|
38151
|
-
map.set(value, copiedValue);
|
38152
|
-
for (var key in value) {
|
38153
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38154
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38155
|
-
}
|
38156
|
-
}
|
38157
|
-
return copiedValue;
|
38158
|
-
};
|
38159
|
-
switch (type_default(value)) {
|
38160
|
-
case "Object":
|
38161
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
38162
|
-
case "Array":
|
38163
|
-
return copy([]);
|
38164
|
-
case "Date":
|
38165
|
-
return new Date(value.valueOf());
|
38166
|
-
case "RegExp":
|
38167
|
-
return _cloneRegExp(value);
|
38168
|
-
case "Int8Array":
|
38169
|
-
case "Uint8Array":
|
38170
|
-
case "Uint8ClampedArray":
|
38171
|
-
case "Int16Array":
|
38172
|
-
case "Uint16Array":
|
38173
|
-
case "Int32Array":
|
38174
|
-
case "Uint32Array":
|
38175
|
-
case "Float32Array":
|
38176
|
-
case "Float64Array":
|
38177
|
-
case "BigInt64Array":
|
38178
|
-
case "BigUint64Array":
|
38179
|
-
return value.slice();
|
38180
|
-
default:
|
38181
|
-
return value;
|
38182
|
-
}
|
38183
|
-
}
|
38184
|
-
function _isPrimitive(param) {
|
38185
|
-
var type3 = typeof param;
|
38186
|
-
return param == null || type3 != "object" && type3 != "function";
|
38187
|
-
}
|
38188
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
38189
|
-
function _ObjectMap2() {
|
38190
|
-
this.map = {};
|
38191
|
-
this.length = 0;
|
38192
|
-
}
|
38193
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
38194
|
-
const hashedKey = this.hash(key);
|
38195
|
-
let bucket = this.map[hashedKey];
|
38196
|
-
if (!bucket) {
|
38197
|
-
this.map[hashedKey] = bucket = [];
|
38198
|
-
}
|
38199
|
-
bucket.push([key, value]);
|
38200
|
-
this.length += 1;
|
38201
|
-
};
|
38202
|
-
_ObjectMap2.prototype.hash = function(key) {
|
38203
|
-
let hashedKey = [];
|
38204
|
-
for (var value in key) {
|
38205
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38206
|
-
}
|
38207
|
-
return hashedKey.join();
|
38208
|
-
};
|
38209
|
-
_ObjectMap2.prototype.get = function(key) {
|
38210
|
-
if (this.length <= 180) {
|
38211
|
-
for (const p in this.map) {
|
38212
|
-
const bucket2 = this.map[p];
|
38213
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
38214
|
-
const element = bucket2[i];
|
38215
|
-
if (element[0] === key) {
|
38216
|
-
return element[1];
|
38217
|
-
}
|
38218
|
-
}
|
38219
|
-
}
|
38220
|
-
return;
|
38221
|
-
}
|
38222
|
-
const hashedKey = this.hash(key);
|
38223
|
-
const bucket = this.map[hashedKey];
|
38224
|
-
if (!bucket) {
|
38225
|
-
return;
|
38226
|
-
}
|
38227
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
38228
|
-
const element = bucket[i];
|
38229
|
-
if (element[0] === key) {
|
38230
|
-
return element[1];
|
38231
|
-
}
|
38232
|
-
}
|
38233
|
-
};
|
38234
|
-
return _ObjectMap2;
|
38235
|
-
}();
|
38236
|
-
|
38237
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38238
|
-
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38239
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38240
|
-
});
|
38241
|
-
var clone_default = clone2;
|
38242
|
-
|
38243
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38244
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38245
|
-
|
38246
38484
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38247
38485
|
var __assign = function() {
|
38248
38486
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41410,14 +41648,10 @@ spurious results.`);
|
|
41410
41648
|
// src/providers/__generated__/operations.ts
|
41411
41649
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41412
41650
|
fragment receiptFragment on Receipt {
|
41413
|
-
|
41414
|
-
id
|
41415
|
-
}
|
41651
|
+
id
|
41416
41652
|
pc
|
41417
41653
|
is
|
41418
|
-
to
|
41419
|
-
id
|
41420
|
-
}
|
41654
|
+
to
|
41421
41655
|
toAddress
|
41422
41656
|
amount
|
41423
41657
|
assetId
|
@@ -41455,10 +41689,16 @@ spurious results.`);
|
|
41455
41689
|
id
|
41456
41690
|
}
|
41457
41691
|
time
|
41692
|
+
receipts {
|
41693
|
+
...receiptFragment
|
41694
|
+
}
|
41458
41695
|
programState {
|
41459
41696
|
returnType
|
41460
41697
|
data
|
41461
41698
|
}
|
41699
|
+
receipts {
|
41700
|
+
...receiptFragment
|
41701
|
+
}
|
41462
41702
|
}
|
41463
41703
|
... on FailureStatus {
|
41464
41704
|
block {
|
@@ -41466,26 +41706,24 @@ spurious results.`);
|
|
41466
41706
|
}
|
41467
41707
|
time
|
41468
41708
|
reason
|
41709
|
+
receipts {
|
41710
|
+
...receiptFragment
|
41711
|
+
}
|
41469
41712
|
}
|
41470
41713
|
... on SqueezedOutStatus {
|
41471
41714
|
reason
|
41472
41715
|
}
|
41473
41716
|
}
|
41474
|
-
`;
|
41717
|
+
${ReceiptFragmentFragmentDoc}`;
|
41475
41718
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41476
41719
|
fragment transactionFragment on Transaction {
|
41477
41720
|
id
|
41478
41721
|
rawPayload
|
41479
|
-
gasPrice
|
41480
|
-
receipts {
|
41481
|
-
...receiptFragment
|
41482
|
-
}
|
41483
41722
|
status {
|
41484
41723
|
...transactionStatusFragment
|
41485
41724
|
}
|
41486
41725
|
}
|
41487
|
-
${
|
41488
|
-
${TransactionStatusFragmentFragmentDoc}`;
|
41726
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41489
41727
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41490
41728
|
fragment inputEstimatePredicatesFragment on Input {
|
41491
41729
|
... on InputCoin {
|
@@ -41503,6 +41741,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41503
41741
|
}
|
41504
41742
|
}
|
41505
41743
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41744
|
+
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41745
|
+
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41746
|
+
reason
|
41747
|
+
programState {
|
41748
|
+
returnType
|
41749
|
+
data
|
41750
|
+
}
|
41751
|
+
}
|
41752
|
+
`;
|
41753
|
+
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41754
|
+
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41755
|
+
programState {
|
41756
|
+
returnType
|
41757
|
+
data
|
41758
|
+
}
|
41759
|
+
}
|
41760
|
+
`;
|
41761
|
+
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41762
|
+
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41763
|
+
... on DryRunFailureStatus {
|
41764
|
+
...dryRunFailureStatusFragment
|
41765
|
+
}
|
41766
|
+
... on DryRunSuccessStatus {
|
41767
|
+
...dryRunSuccessStatusFragment
|
41768
|
+
}
|
41769
|
+
}
|
41770
|
+
${DryRunFailureStatusFragmentFragmentDoc}
|
41771
|
+
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41772
|
+
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41773
|
+
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41774
|
+
id
|
41775
|
+
status {
|
41776
|
+
...dryRunTransactionStatusFragment
|
41777
|
+
}
|
41778
|
+
receipts {
|
41779
|
+
...receiptFragment
|
41780
|
+
}
|
41781
|
+
}
|
41782
|
+
${DryRunTransactionStatusFragmentFragmentDoc}
|
41783
|
+
${ReceiptFragmentFragmentDoc}`;
|
41506
41784
|
var CoinFragmentFragmentDoc = lib_default2`
|
41507
41785
|
fragment coinFragment on Coin {
|
41508
41786
|
__typename
|
@@ -41510,7 +41788,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41510
41788
|
owner
|
41511
41789
|
amount
|
41512
41790
|
assetId
|
41513
|
-
maturity
|
41514
41791
|
blockCreated
|
41515
41792
|
txCreatedIdx
|
41516
41793
|
}
|
@@ -41555,7 +41832,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41555
41832
|
prevRoot
|
41556
41833
|
time
|
41557
41834
|
applicationHash
|
41558
|
-
messageReceiptRoot
|
41559
41835
|
messageReceiptCount
|
41560
41836
|
}
|
41561
41837
|
commitBlockHeader {
|
@@ -41567,7 +41843,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41567
41843
|
prevRoot
|
41568
41844
|
time
|
41569
41845
|
applicationHash
|
41570
|
-
messageReceiptRoot
|
41571
41846
|
messageReceiptCount
|
41572
41847
|
}
|
41573
41848
|
sender
|
@@ -41587,8 +41862,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41587
41862
|
var BlockFragmentFragmentDoc = lib_default2`
|
41588
41863
|
fragment blockFragment on Block {
|
41589
41864
|
id
|
41865
|
+
height
|
41590
41866
|
header {
|
41591
|
-
height
|
41592
41867
|
time
|
41593
41868
|
}
|
41594
41869
|
transactions {
|
@@ -41646,6 +41921,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41646
41921
|
`;
|
41647
41922
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41648
41923
|
fragment GasCostsFragment on GasCosts {
|
41924
|
+
version {
|
41925
|
+
... on Version {
|
41926
|
+
value
|
41927
|
+
}
|
41928
|
+
}
|
41649
41929
|
add
|
41650
41930
|
addi
|
41651
41931
|
aloc
|
@@ -41658,7 +41938,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41658
41938
|
cb
|
41659
41939
|
cfei
|
41660
41940
|
cfsi
|
41661
|
-
croo
|
41662
41941
|
div
|
41663
41942
|
divi
|
41664
41943
|
ecr1
|
@@ -41741,6 +42020,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41741
42020
|
ccp {
|
41742
42021
|
...DependentCostFragment
|
41743
42022
|
}
|
42023
|
+
croo {
|
42024
|
+
...DependentCostFragment
|
42025
|
+
}
|
41744
42026
|
csiz {
|
41745
42027
|
...DependentCostFragment
|
41746
42028
|
}
|
@@ -41800,6 +42082,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41800
42082
|
${DependentCostFragmentFragmentDoc}`;
|
41801
42083
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
41802
42084
|
fragment consensusParametersFragment on ConsensusParameters {
|
42085
|
+
version {
|
42086
|
+
... on Version {
|
42087
|
+
value
|
42088
|
+
}
|
42089
|
+
}
|
41803
42090
|
txParams {
|
41804
42091
|
...TxParametersFragment
|
41805
42092
|
}
|
@@ -41859,18 +42146,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41859
42146
|
fragment nodeInfoFragment on NodeInfo {
|
41860
42147
|
utxoValidation
|
41861
42148
|
vmBacktrace
|
41862
|
-
minGasPrice
|
41863
42149
|
maxTx
|
41864
42150
|
maxDepth
|
41865
42151
|
nodeVersion
|
41866
|
-
peers {
|
41867
|
-
id
|
41868
|
-
addresses
|
41869
|
-
clientVersion
|
41870
|
-
blockHeight
|
41871
|
-
lastHeartbeatMs
|
41872
|
-
appScore
|
41873
|
-
}
|
41874
42152
|
}
|
41875
42153
|
`;
|
41876
42154
|
var GetVersionDocument = lib_default2`
|
@@ -41905,13 +42183,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41905
42183
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
41906
42184
|
transaction(id: $transactionId) {
|
41907
42185
|
...transactionFragment
|
41908
|
-
receipts {
|
41909
|
-
...receiptFragment
|
41910
|
-
}
|
41911
42186
|
}
|
41912
42187
|
}
|
41913
|
-
${TransactionFragmentFragmentDoc}
|
41914
|
-
${ReceiptFragmentFragmentDoc}`;
|
42188
|
+
${TransactionFragmentFragmentDoc}`;
|
41915
42189
|
var GetTransactionsDocument = lib_default2`
|
41916
42190
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
41917
42191
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42039,6 +42313,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42039
42313
|
}
|
42040
42314
|
}
|
42041
42315
|
${BalanceFragmentFragmentDoc}`;
|
42316
|
+
var GetLatestGasPriceDocument = lib_default2`
|
42317
|
+
query getLatestGasPrice {
|
42318
|
+
latestGasPrice {
|
42319
|
+
gasPrice
|
42320
|
+
}
|
42321
|
+
}
|
42322
|
+
`;
|
42323
|
+
var EstimateGasPriceDocument = lib_default2`
|
42324
|
+
query estimateGasPrice($blockHorizon: U32!) {
|
42325
|
+
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42326
|
+
gasPrice
|
42327
|
+
}
|
42328
|
+
}
|
42329
|
+
`;
|
42042
42330
|
var GetBalancesDocument = lib_default2`
|
42043
42331
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42044
42332
|
balances(
|
@@ -42093,12 +42381,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42093
42381
|
}
|
42094
42382
|
`;
|
42095
42383
|
var DryRunDocument = lib_default2`
|
42096
|
-
mutation dryRun($
|
42097
|
-
dryRun(
|
42098
|
-
...
|
42384
|
+
mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
|
42385
|
+
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
|
42386
|
+
...dryRunTransactionExecutionStatusFragment
|
42099
42387
|
}
|
42100
42388
|
}
|
42101
|
-
${
|
42389
|
+
${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
|
42102
42390
|
var SubmitDocument = lib_default2`
|
42103
42391
|
mutation submit($encodedTransaction: HexString!) {
|
42104
42392
|
submit(tx: $encodedTransaction) {
|
@@ -42181,6 +42469,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42181
42469
|
getBalance(variables, options) {
|
42182
42470
|
return requester(GetBalanceDocument, variables, options);
|
42183
42471
|
},
|
42472
|
+
getLatestGasPrice(variables, options) {
|
42473
|
+
return requester(GetLatestGasPriceDocument, variables, options);
|
42474
|
+
},
|
42475
|
+
estimateGasPrice(variables, options) {
|
42476
|
+
return requester(EstimateGasPriceDocument, variables, options);
|
42477
|
+
},
|
42184
42478
|
getBalances(variables, options) {
|
42185
42479
|
return requester(GetBalancesDocument, variables, options);
|
42186
42480
|
},
|
@@ -42248,11 +42542,14 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42248
42542
|
let data;
|
42249
42543
|
let errors;
|
42250
42544
|
try {
|
42251
|
-
|
42545
|
+
const sanitizedText = text.replace(/\s/g, "");
|
42546
|
+
({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
|
42252
42547
|
} catch (e) {
|
42253
42548
|
throw new FuelError(
|
42254
42549
|
ErrorCode.STREAM_PARSING_ERROR,
|
42255
|
-
`Error while parsing stream data response: ${text}
|
42550
|
+
`Error while parsing stream data response: ${text}
|
42551
|
+
|
42552
|
+
Thrown error: ${e}`
|
42256
42553
|
);
|
42257
42554
|
}
|
42258
42555
|
if (Array.isArray(errors)) {
|
@@ -42346,7 +42643,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42346
42643
|
return {
|
42347
42644
|
type: InputType.Coin,
|
42348
42645
|
txID: hexlify(arrayify(value.id).slice(0, 32)),
|
42349
|
-
outputIndex: toNumber2(arrayify(value.id).slice(32,
|
42646
|
+
outputIndex: toNumber2(arrayify(value.id).slice(32, 34)),
|
42350
42647
|
owner: hexlify(value.owner),
|
42351
42648
|
amount: bn(value.amount),
|
42352
42649
|
assetId: hexlify(value.assetId),
|
@@ -42355,10 +42652,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42355
42652
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42356
42653
|
},
|
42357
42654
|
witnessIndex: value.witnessIndex,
|
42358
|
-
maturity: value.maturity ?? 0,
|
42359
42655
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42360
|
-
predicateLength: predicate.length,
|
42361
|
-
predicateDataLength: predicateData.length,
|
42656
|
+
predicateLength: bn(predicate.length),
|
42657
|
+
predicateDataLength: bn(predicateData.length),
|
42362
42658
|
predicate: hexlify(predicate),
|
42363
42659
|
predicateData: hexlify(predicateData)
|
42364
42660
|
};
|
@@ -42389,8 +42685,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42389
42685
|
nonce: hexlify(value.nonce),
|
42390
42686
|
witnessIndex: value.witnessIndex,
|
42391
42687
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42392
|
-
predicateLength: predicate.length,
|
42393
|
-
predicateDataLength: predicateData.length,
|
42688
|
+
predicateLength: bn(predicate.length),
|
42689
|
+
predicateDataLength: bn(predicateData.length),
|
42394
42690
|
predicate: hexlify(predicate),
|
42395
42691
|
predicateData: hexlify(predicateData),
|
42396
42692
|
data: hexlify(data),
|
@@ -42547,8 +42843,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42547
42843
|
case "CALL" /* Call */: {
|
42548
42844
|
const callReceipt = {
|
42549
42845
|
type: ReceiptType.Call,
|
42550
|
-
from: hexOrZero(receipt.
|
42551
|
-
to: hexOrZero(receipt?.to
|
42846
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42847
|
+
to: hexOrZero(receipt?.to),
|
42552
42848
|
amount: bn(receipt.amount),
|
42553
42849
|
assetId: hexOrZero(receipt.assetId),
|
42554
42850
|
gas: bn(receipt.gas),
|
@@ -42562,7 +42858,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42562
42858
|
case "RETURN" /* Return */: {
|
42563
42859
|
const returnReceipt = {
|
42564
42860
|
type: ReceiptType.Return,
|
42565
|
-
id: hexOrZero(receipt.
|
42861
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42566
42862
|
val: bn(receipt.val),
|
42567
42863
|
pc: bn(receipt.pc),
|
42568
42864
|
is: bn(receipt.is)
|
@@ -42572,7 +42868,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42572
42868
|
case "RETURN_DATA" /* ReturnData */: {
|
42573
42869
|
const returnDataReceipt = {
|
42574
42870
|
type: ReceiptType.ReturnData,
|
42575
|
-
id: hexOrZero(receipt.
|
42871
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42576
42872
|
ptr: bn(receipt.ptr),
|
42577
42873
|
len: bn(receipt.len),
|
42578
42874
|
digest: hexOrZero(receipt.digest),
|
@@ -42584,7 +42880,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42584
42880
|
case "PANIC" /* Panic */: {
|
42585
42881
|
const panicReceipt = {
|
42586
42882
|
type: ReceiptType.Panic,
|
42587
|
-
id: hexOrZero(receipt.
|
42883
|
+
id: hexOrZero(receipt.id),
|
42588
42884
|
reason: bn(receipt.reason),
|
42589
42885
|
pc: bn(receipt.pc),
|
42590
42886
|
is: bn(receipt.is),
|
@@ -42595,7 +42891,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42595
42891
|
case "REVERT" /* Revert */: {
|
42596
42892
|
const revertReceipt = {
|
42597
42893
|
type: ReceiptType.Revert,
|
42598
|
-
id: hexOrZero(receipt.
|
42894
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42599
42895
|
val: bn(receipt.ra),
|
42600
42896
|
pc: bn(receipt.pc),
|
42601
42897
|
is: bn(receipt.is)
|
@@ -42605,7 +42901,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42605
42901
|
case "LOG" /* Log */: {
|
42606
42902
|
const logReceipt = {
|
42607
42903
|
type: ReceiptType.Log,
|
42608
|
-
id: hexOrZero(receipt.
|
42904
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42609
42905
|
val0: bn(receipt.ra),
|
42610
42906
|
val1: bn(receipt.rb),
|
42611
42907
|
val2: bn(receipt.rc),
|
@@ -42618,7 +42914,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42618
42914
|
case "LOG_DATA" /* LogData */: {
|
42619
42915
|
const logDataReceipt = {
|
42620
42916
|
type: ReceiptType.LogData,
|
42621
|
-
id: hexOrZero(receipt.
|
42917
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42622
42918
|
val0: bn(receipt.ra),
|
42623
42919
|
val1: bn(receipt.rb),
|
42624
42920
|
ptr: bn(receipt.ptr),
|
@@ -42632,8 +42928,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42632
42928
|
case "TRANSFER" /* Transfer */: {
|
42633
42929
|
const transferReceipt = {
|
42634
42930
|
type: ReceiptType.Transfer,
|
42635
|
-
from: hexOrZero(receipt.
|
42636
|
-
to: hexOrZero(receipt.toAddress || receipt?.to
|
42931
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42932
|
+
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42637
42933
|
amount: bn(receipt.amount),
|
42638
42934
|
assetId: hexOrZero(receipt.assetId),
|
42639
42935
|
pc: bn(receipt.pc),
|
@@ -42644,8 +42940,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42644
42940
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42645
42941
|
const transferOutReceipt = {
|
42646
42942
|
type: ReceiptType.TransferOut,
|
42647
|
-
from: hexOrZero(receipt.
|
42648
|
-
to: hexOrZero(receipt.toAddress || receipt.to
|
42943
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42944
|
+
to: hexOrZero(receipt.toAddress || receipt.to),
|
42649
42945
|
amount: bn(receipt.amount),
|
42650
42946
|
assetId: hexOrZero(receipt.assetId),
|
42651
42947
|
pc: bn(receipt.pc),
|
@@ -42688,7 +42984,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42688
42984
|
return receiptMessageOut;
|
42689
42985
|
}
|
42690
42986
|
case "MINT" /* Mint */: {
|
42691
|
-
const contractId = hexOrZero(receipt.
|
42987
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42692
42988
|
const subId = hexOrZero(receipt.subId);
|
42693
42989
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
42694
42990
|
const mintReceipt = {
|
@@ -42703,7 +42999,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42703
42999
|
return mintReceipt;
|
42704
43000
|
}
|
42705
43001
|
case "BURN" /* Burn */: {
|
42706
|
-
const contractId = hexOrZero(receipt.
|
43002
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42707
43003
|
const subId = hexOrZero(receipt.subId);
|
42708
43004
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
42709
43005
|
const burnReceipt = {
|
@@ -42723,7 +43019,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42723
43019
|
}
|
42724
43020
|
|
42725
43021
|
// src/providers/utils/gas.ts
|
42726
|
-
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
42727
43022
|
var getGasUsedFromReceipts = (receipts) => {
|
42728
43023
|
const scriptResult = receipts.filter(
|
42729
43024
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -42744,18 +43039,28 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42744
43039
|
}
|
42745
43040
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
42746
43041
|
const witnessCache = [];
|
42747
|
-
const
|
43042
|
+
const chargeableInputs = inputs.filter((input) => {
|
43043
|
+
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43044
|
+
if (isCoinOrMessage) {
|
43045
|
+
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43046
|
+
return true;
|
43047
|
+
}
|
43048
|
+
if (!witnessCache.includes(input.witnessIndex)) {
|
43049
|
+
witnessCache.push(input.witnessIndex);
|
43050
|
+
return true;
|
43051
|
+
}
|
43052
|
+
}
|
43053
|
+
return false;
|
43054
|
+
});
|
43055
|
+
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43056
|
+
const totalGas = chargeableInputs.reduce((total, input) => {
|
42748
43057
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
42749
43058
|
return total.add(
|
42750
|
-
|
43059
|
+
vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
42751
43060
|
);
|
42752
43061
|
}
|
42753
|
-
|
42754
|
-
|
42755
|
-
return total.add(gasCosts.ecr1);
|
42756
|
-
}
|
42757
|
-
return total;
|
42758
|
-
}, bn());
|
43062
|
+
return total.add(gasCosts.ecr1);
|
43063
|
+
}, bn(0));
|
42759
43064
|
return totalGas;
|
42760
43065
|
}
|
42761
43066
|
function getMinGas(params) {
|
@@ -42767,12 +43072,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42767
43072
|
return minGas;
|
42768
43073
|
}
|
42769
43074
|
function getMaxGas(params) {
|
42770
|
-
const {
|
43075
|
+
const {
|
43076
|
+
gasPerByte,
|
43077
|
+
witnessesLength,
|
43078
|
+
witnessLimit,
|
43079
|
+
minGas,
|
43080
|
+
gasLimit = bn(0),
|
43081
|
+
maxGasPerTx
|
43082
|
+
} = params;
|
42771
43083
|
let remainingAllowedWitnessGas = bn(0);
|
42772
43084
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
42773
43085
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
42774
43086
|
}
|
42775
|
-
|
43087
|
+
const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43088
|
+
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42776
43089
|
}
|
42777
43090
|
function calculateMetadataGasForTxCreate({
|
42778
43091
|
gasCosts,
|
@@ -42794,6 +43107,10 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42794
43107
|
}) {
|
42795
43108
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
42796
43109
|
}
|
43110
|
+
var calculateGasFee = (params) => {
|
43111
|
+
const { gas, gasPrice, priceFactor, tip } = params;
|
43112
|
+
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43113
|
+
};
|
42797
43114
|
|
42798
43115
|
// src/providers/utils/json.ts
|
42799
43116
|
function normalize2(object) {
|
@@ -42923,7 +43240,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42923
43240
|
// src/providers/transaction-request/transaction-request.ts
|
42924
43241
|
var BaseTransactionRequest = class {
|
42925
43242
|
/** Gas price for transaction */
|
42926
|
-
|
43243
|
+
tip;
|
42927
43244
|
/** Block until which tx cannot be included */
|
42928
43245
|
maturity;
|
42929
43246
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -42942,7 +43259,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42942
43259
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
42943
43260
|
*/
|
42944
43261
|
constructor({
|
42945
|
-
|
43262
|
+
tip,
|
42946
43263
|
maturity,
|
42947
43264
|
maxFee,
|
42948
43265
|
witnessLimit,
|
@@ -42950,7 +43267,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42950
43267
|
outputs,
|
42951
43268
|
witnesses
|
42952
43269
|
} = {}) {
|
42953
|
-
this.
|
43270
|
+
this.tip = bn(tip);
|
42954
43271
|
this.maturity = maturity ?? 0;
|
42955
43272
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
42956
43273
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
@@ -42961,9 +43278,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42961
43278
|
static getPolicyMeta(req) {
|
42962
43279
|
let policyTypes = 0;
|
42963
43280
|
const policies = [];
|
42964
|
-
if (req.
|
42965
|
-
policyTypes += PolicyType.
|
42966
|
-
policies.push({ data: req.
|
43281
|
+
if (req.tip) {
|
43282
|
+
policyTypes += PolicyType.Tip;
|
43283
|
+
policies.push({ data: req.tip, type: PolicyType.Tip });
|
42967
43284
|
}
|
42968
43285
|
if (req.witnessLimit) {
|
42969
43286
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43150,10 +43467,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43150
43467
|
* @param predicate - Predicate bytes.
|
43151
43468
|
* @param predicateData - Predicate data bytes.
|
43152
43469
|
*/
|
43153
|
-
addCoinInput(coin
|
43470
|
+
addCoinInput(coin) {
|
43154
43471
|
const { assetId, owner, amount } = coin;
|
43155
43472
|
let witnessIndex;
|
43156
|
-
if (predicate) {
|
43473
|
+
if (coin.predicate) {
|
43157
43474
|
witnessIndex = 0;
|
43158
43475
|
} else {
|
43159
43476
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43168,9 +43485,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43168
43485
|
amount,
|
43169
43486
|
assetId,
|
43170
43487
|
txPointer: "0x00000000000000000000000000000000",
|
43171
|
-
witnessIndex
|
43172
|
-
predicate: predicate?.bytes,
|
43173
|
-
predicateData: predicate?.predicateDataBytes
|
43488
|
+
witnessIndex
|
43174
43489
|
};
|
43175
43490
|
this.pushInput(input);
|
43176
43491
|
this.addChangeOutput(owner, assetId);
|
@@ -43183,11 +43498,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43183
43498
|
* @param predicate - Predicate bytes.
|
43184
43499
|
* @param predicateData - Predicate data bytes.
|
43185
43500
|
*/
|
43186
|
-
addMessageInput(message
|
43501
|
+
addMessageInput(message) {
|
43187
43502
|
const { recipient, sender, amount } = message;
|
43188
43503
|
const assetId = BaseAssetId;
|
43189
43504
|
let witnessIndex;
|
43190
|
-
if (predicate) {
|
43505
|
+
if (message.predicate) {
|
43191
43506
|
witnessIndex = 0;
|
43192
43507
|
} else {
|
43193
43508
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43201,9 +43516,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43201
43516
|
sender: sender.toB256(),
|
43202
43517
|
recipient: recipient.toB256(),
|
43203
43518
|
amount,
|
43204
|
-
witnessIndex
|
43205
|
-
predicate: predicate?.bytes,
|
43206
|
-
predicateData: predicate?.predicateDataBytes
|
43519
|
+
witnessIndex
|
43207
43520
|
};
|
43208
43521
|
this.pushInput(input);
|
43209
43522
|
this.addChangeOutput(recipient, assetId);
|
@@ -43234,32 +43547,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43234
43547
|
resources.forEach((resource) => this.addResource(resource));
|
43235
43548
|
return this;
|
43236
43549
|
}
|
43237
|
-
/**
|
43238
|
-
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43239
|
-
* outputs from the related assetIds.
|
43240
|
-
*
|
43241
|
-
* @param resources - The resources to add.
|
43242
|
-
* @returns This transaction.
|
43243
|
-
*/
|
43244
|
-
addPredicateResource(resource, predicate) {
|
43245
|
-
if (isCoin(resource)) {
|
43246
|
-
this.addCoinInput(resource, predicate);
|
43247
|
-
} else {
|
43248
|
-
this.addMessageInput(resource, predicate);
|
43249
|
-
}
|
43250
|
-
return this;
|
43251
|
-
}
|
43252
|
-
/**
|
43253
|
-
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43254
|
-
* from the related assetIds.
|
43255
|
-
*
|
43256
|
-
* @param resources - The resources to add.
|
43257
|
-
* @returns This transaction.
|
43258
|
-
*/
|
43259
|
-
addPredicateResources(resources, predicate) {
|
43260
|
-
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43261
|
-
return this;
|
43262
|
-
}
|
43263
43550
|
/**
|
43264
43551
|
* Adds a coin output to the transaction.
|
43265
43552
|
*
|
@@ -43339,7 +43626,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43339
43626
|
}
|
43340
43627
|
calculateMaxGas(chainInfo, minGas) {
|
43341
43628
|
const { consensusParameters } = chainInfo;
|
43342
|
-
const { gasPerByte } = consensusParameters;
|
43629
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43343
43630
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43344
43631
|
(acc, wit) => acc + wit.dataLength,
|
43345
43632
|
0
|
@@ -43348,7 +43635,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43348
43635
|
gasPerByte,
|
43349
43636
|
minGas,
|
43350
43637
|
witnessesLength,
|
43351
|
-
witnessLimit: this.witnessLimit
|
43638
|
+
witnessLimit: this.witnessLimit,
|
43639
|
+
maxGasPerTx
|
43352
43640
|
});
|
43353
43641
|
}
|
43354
43642
|
/**
|
@@ -43366,17 +43654,20 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43366
43654
|
});
|
43367
43655
|
const updateAssetInput = (assetId, quantity) => {
|
43368
43656
|
const assetInput = findAssetInput(assetId);
|
43657
|
+
let usedQuantity = quantity;
|
43658
|
+
if (assetId === BaseAssetId) {
|
43659
|
+
usedQuantity = bn("1000000000000000000");
|
43660
|
+
}
|
43369
43661
|
if (assetInput && "assetId" in assetInput) {
|
43370
|
-
assetInput.id = hexlify(randomBytes3(
|
43371
|
-
assetInput.amount =
|
43662
|
+
assetInput.id = hexlify(randomBytes3(34));
|
43663
|
+
assetInput.amount = usedQuantity;
|
43372
43664
|
} else {
|
43373
43665
|
this.addResources([
|
43374
43666
|
{
|
43375
|
-
id: hexlify(randomBytes3(
|
43376
|
-
amount:
|
43667
|
+
id: hexlify(randomBytes3(34)),
|
43668
|
+
amount: usedQuantity,
|
43377
43669
|
assetId,
|
43378
43670
|
owner: resourcesOwner || Address.fromRandom(),
|
43379
|
-
maturity: 0,
|
43380
43671
|
blockCreated: bn(1),
|
43381
43672
|
txCreatedIdx: bn(1)
|
43382
43673
|
}
|
@@ -43408,7 +43699,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43408
43699
|
toJSON() {
|
43409
43700
|
return normalizeJSON(this);
|
43410
43701
|
}
|
43411
|
-
|
43702
|
+
updatePredicateGasUsed(inputs) {
|
43412
43703
|
this.inputs.forEach((i) => {
|
43413
43704
|
let correspondingInput;
|
43414
43705
|
switch (i.type) {
|
@@ -43430,6 +43721,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43430
43721
|
}
|
43431
43722
|
});
|
43432
43723
|
}
|
43724
|
+
shiftPredicateData() {
|
43725
|
+
this.inputs.forEach((input) => {
|
43726
|
+
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43727
|
+
input.predicateData = input.paddPredicateData(
|
43728
|
+
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43729
|
+
);
|
43730
|
+
}
|
43731
|
+
});
|
43732
|
+
}
|
43433
43733
|
};
|
43434
43734
|
|
43435
43735
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43563,9 +43863,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43563
43863
|
return {
|
43564
43864
|
type: TransactionType.Create,
|
43565
43865
|
...baseTransaction,
|
43566
|
-
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43567
43866
|
bytecodeWitnessIndex,
|
43568
|
-
storageSlotsCount: storageSlots.length,
|
43867
|
+
storageSlotsCount: bn(storageSlots.length),
|
43569
43868
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43570
43869
|
storageSlots
|
43571
43870
|
};
|
@@ -43679,8 +43978,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43679
43978
|
type: TransactionType.Script,
|
43680
43979
|
scriptGasLimit: this.gasLimit,
|
43681
43980
|
...super.getBaseTransaction(),
|
43682
|
-
scriptLength: script.length,
|
43683
|
-
scriptDataLength: scriptData.length,
|
43981
|
+
scriptLength: bn(script.length),
|
43982
|
+
scriptDataLength: bn(scriptData.length),
|
43684
43983
|
receiptsRoot: ZeroBytes32,
|
43685
43984
|
script: hexlify(script),
|
43686
43985
|
scriptData: hexlify(scriptData)
|
@@ -43744,7 +44043,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43744
44043
|
}
|
43745
44044
|
calculateMaxGas(chainInfo, minGas) {
|
43746
44045
|
const { consensusParameters } = chainInfo;
|
43747
|
-
const { gasPerByte } = consensusParameters;
|
44046
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43748
44047
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43749
44048
|
(acc, wit) => acc + wit.dataLength,
|
43750
44049
|
0
|
@@ -43754,7 +44053,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43754
44053
|
minGas,
|
43755
44054
|
witnessesLength,
|
43756
44055
|
witnessLimit: this.witnessLimit,
|
43757
|
-
gasLimit: this.gasLimit
|
44056
|
+
gasLimit: this.gasLimit,
|
44057
|
+
maxGasPerTx
|
43758
44058
|
});
|
43759
44059
|
}
|
43760
44060
|
/**
|
@@ -43827,13 +44127,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43827
44127
|
}
|
43828
44128
|
}
|
43829
44129
|
};
|
44130
|
+
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44131
|
+
(acc, input) => {
|
44132
|
+
if (input.type === InputType.Coin && input.owner === owner) {
|
44133
|
+
acc.utxos.push(input.id);
|
44134
|
+
}
|
44135
|
+
if (input.type === InputType.Message && input.recipient === owner) {
|
44136
|
+
acc.messages.push(input.nonce);
|
44137
|
+
}
|
44138
|
+
return acc;
|
44139
|
+
},
|
44140
|
+
{
|
44141
|
+
utxos: [],
|
44142
|
+
messages: []
|
44143
|
+
}
|
44144
|
+
);
|
43830
44145
|
|
43831
44146
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
43832
44147
|
var calculateTransactionFee = (params) => {
|
43833
44148
|
const {
|
43834
|
-
|
44149
|
+
gasPrice,
|
43835
44150
|
rawPayload,
|
43836
|
-
|
44151
|
+
tip,
|
44152
|
+
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43837
44153
|
} = params;
|
43838
44154
|
const gasPerByte = bn(feeParams.gasPerByte);
|
43839
44155
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -43843,8 +44159,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43843
44159
|
return {
|
43844
44160
|
fee: bn(0),
|
43845
44161
|
minFee: bn(0),
|
43846
|
-
maxFee: bn(0)
|
43847
|
-
feeFromGasUsed: bn(0)
|
44162
|
+
maxFee: bn(0)
|
43848
44163
|
};
|
43849
44164
|
}
|
43850
44165
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -43876,7 +44191,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43876
44191
|
metadataGas,
|
43877
44192
|
txBytesSize: transactionBytes.length
|
43878
44193
|
});
|
43879
|
-
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
43880
44194
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
43881
44195
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
43882
44196
|
const maxGas = getMaxGas({
|
@@ -43884,17 +44198,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43884
44198
|
minGas,
|
43885
44199
|
witnessesLength,
|
43886
44200
|
gasLimit,
|
43887
|
-
witnessLimit
|
44201
|
+
witnessLimit,
|
44202
|
+
maxGasPerTx
|
44203
|
+
});
|
44204
|
+
const minFee = calculateGasFee({
|
44205
|
+
gasPrice,
|
44206
|
+
gas: minGas,
|
44207
|
+
priceFactor: gasPriceFactor,
|
44208
|
+
tip
|
44209
|
+
});
|
44210
|
+
const maxFee = calculateGasFee({
|
44211
|
+
gasPrice,
|
44212
|
+
gas: maxGas,
|
44213
|
+
priceFactor: gasPriceFactor,
|
44214
|
+
tip
|
43888
44215
|
});
|
43889
|
-
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43890
|
-
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43891
|
-
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43892
|
-
const fee = minFee.add(feeFromGasUsed);
|
43893
44216
|
return {
|
43894
|
-
fee,
|
43895
44217
|
minFee,
|
43896
44218
|
maxFee,
|
43897
|
-
|
44219
|
+
fee: maxFee
|
43898
44220
|
};
|
43899
44221
|
};
|
43900
44222
|
|
@@ -44448,7 +44770,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44448
44770
|
gqlTransactionStatus,
|
44449
44771
|
abiMap = {},
|
44450
44772
|
maxInputs,
|
44451
|
-
gasCosts
|
44773
|
+
gasCosts,
|
44774
|
+
maxGasPerTx,
|
44775
|
+
gasPrice
|
44452
44776
|
} = params;
|
44453
44777
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44454
44778
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44462,11 +44786,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44462
44786
|
maxInputs
|
44463
44787
|
});
|
44464
44788
|
const typeName = getTransactionTypeName(transaction.type);
|
44789
|
+
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44465
44790
|
const { fee } = calculateTransactionFee({
|
44466
|
-
|
44791
|
+
gasPrice,
|
44467
44792
|
rawPayload,
|
44793
|
+
tip,
|
44468
44794
|
consensusParameters: {
|
44469
44795
|
gasCosts,
|
44796
|
+
maxGasPerTx,
|
44470
44797
|
feeParams: {
|
44471
44798
|
gasPerByte,
|
44472
44799
|
gasPriceFactor
|
@@ -44602,8 +44929,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44602
44929
|
const decodedTransaction = this.decodeTransaction(
|
44603
44930
|
transaction
|
44604
44931
|
);
|
44605
|
-
|
44606
|
-
|
44932
|
+
let txReceipts = [];
|
44933
|
+
if (transaction?.status && "receipts" in transaction.status) {
|
44934
|
+
txReceipts = transaction.status.receipts;
|
44935
|
+
}
|
44936
|
+
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44937
|
+
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44938
|
+
const gasPrice = await this.provider.getLatestGasPrice();
|
44607
44939
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44608
44940
|
const transactionSummary = assembleTransactionSummary({
|
44609
44941
|
id: this.id,
|
@@ -44615,7 +44947,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44615
44947
|
gasPriceFactor,
|
44616
44948
|
abiMap: contractsAbiMap,
|
44617
44949
|
maxInputs,
|
44618
|
-
gasCosts
|
44950
|
+
gasCosts,
|
44951
|
+
maxGasPerTx,
|
44952
|
+
gasPrice
|
44619
44953
|
});
|
44620
44954
|
return transactionSummary;
|
44621
44955
|
}
|
@@ -44764,7 +45098,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44764
45098
|
gasCosts,
|
44765
45099
|
latestBlock: {
|
44766
45100
|
id: latestBlock.id,
|
44767
|
-
height: bn(latestBlock.
|
45101
|
+
height: bn(latestBlock.height),
|
44768
45102
|
time: latestBlock.header.time,
|
44769
45103
|
transactions: latestBlock.transactions.map((i) => ({
|
44770
45104
|
id: i.id
|
@@ -44858,10 +45192,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44858
45192
|
* Returns some helpful parameters related to gas fees.
|
44859
45193
|
*/
|
44860
45194
|
getGasConfig() {
|
44861
|
-
const { minGasPrice } = this.getNode();
|
44862
45195
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
44863
45196
|
return {
|
44864
|
-
minGasPrice,
|
44865
45197
|
maxGasPerTx,
|
44866
45198
|
maxGasPerPredicate,
|
44867
45199
|
gasPriceFactor,
|
@@ -44959,7 +45291,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44959
45291
|
*/
|
44960
45292
|
async getBlockNumber() {
|
44961
45293
|
const { chain } = await this.operations.getChain();
|
44962
|
-
return bn(chain.latestBlock.
|
45294
|
+
return bn(chain.latestBlock.height, 10);
|
44963
45295
|
}
|
44964
45296
|
/**
|
44965
45297
|
* Returns the chain information.
|
@@ -44971,11 +45303,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44971
45303
|
const processedNodeInfo = {
|
44972
45304
|
maxDepth: bn(nodeInfo.maxDepth),
|
44973
45305
|
maxTx: bn(nodeInfo.maxTx),
|
44974
|
-
minGasPrice: bn(nodeInfo.minGasPrice),
|
44975
45306
|
nodeVersion: nodeInfo.nodeVersion,
|
44976
45307
|
utxoValidation: nodeInfo.utxoValidation,
|
44977
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44978
|
-
peers: nodeInfo.peers
|
45308
|
+
vmBacktrace: nodeInfo.vmBacktrace
|
44979
45309
|
};
|
44980
45310
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
44981
45311
|
return processedNodeInfo;
|
@@ -45061,14 +45391,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45061
45391
|
return this.estimateTxDependencies(transactionRequest);
|
45062
45392
|
}
|
45063
45393
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45064
|
-
const { dryRun:
|
45065
|
-
encodedTransaction,
|
45394
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45395
|
+
encodedTransactions: encodedTransaction,
|
45066
45396
|
utxoValidation: utxoValidation || false
|
45067
45397
|
});
|
45068
|
-
const receipts =
|
45069
|
-
|
45070
|
-
|
45071
|
-
};
|
45398
|
+
const [{ receipts: rawReceipts, status }] = dryRunStatuses;
|
45399
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45400
|
+
return { receipts, dryrunStatus: status };
|
45072
45401
|
}
|
45073
45402
|
/**
|
45074
45403
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45107,9 +45436,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45107
45436
|
* If there are missing variable outputs,
|
45108
45437
|
* `addVariableOutputs` is called on the transaction.
|
45109
45438
|
*
|
45110
|
-
* @privateRemarks
|
45111
|
-
* TODO: Investigate support for missing contract IDs
|
45112
|
-
* TODO: Add support for missing output messages
|
45113
45439
|
*
|
45114
45440
|
* @param transactionRequest - The transaction request object.
|
45115
45441
|
* @returns A promise.
|
@@ -45122,16 +45448,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45122
45448
|
missingContractIds: []
|
45123
45449
|
};
|
45124
45450
|
}
|
45125
|
-
await this.estimatePredicates(transactionRequest);
|
45126
45451
|
let receipts = [];
|
45127
45452
|
const missingContractIds = [];
|
45128
45453
|
let outputVariables = 0;
|
45454
|
+
let dryrunStatus;
|
45129
45455
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45130
|
-
const {
|
45131
|
-
|
45456
|
+
const {
|
45457
|
+
dryRun: [{ receipts: rawReceipts, status }]
|
45458
|
+
} = await this.operations.dryRun({
|
45459
|
+
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45132
45460
|
utxoValidation: false
|
45133
45461
|
});
|
45134
|
-
receipts =
|
45462
|
+
receipts = rawReceipts.map(processGqlReceipt);
|
45463
|
+
dryrunStatus = status;
|
45135
45464
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45136
45465
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45137
45466
|
if (hasMissingOutputs) {
|
@@ -45141,6 +45470,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45141
45470
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45142
45471
|
missingContractIds.push(contractId);
|
45143
45472
|
});
|
45473
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45474
|
+
transactionRequest,
|
45475
|
+
optimizeGas: false
|
45476
|
+
});
|
45477
|
+
transactionRequest.maxFee = maxFee;
|
45144
45478
|
} else {
|
45145
45479
|
break;
|
45146
45480
|
}
|
@@ -45148,38 +45482,133 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45148
45482
|
return {
|
45149
45483
|
receipts,
|
45150
45484
|
outputVariables,
|
45151
|
-
missingContractIds
|
45485
|
+
missingContractIds,
|
45486
|
+
dryrunStatus
|
45152
45487
|
};
|
45153
45488
|
}
|
45154
45489
|
/**
|
45155
|
-
*
|
45156
|
-
*
|
45157
|
-
*
|
45158
|
-
*
|
45159
|
-
|
45160
|
-
|
45161
|
-
|
45162
|
-
|
45490
|
+
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45491
|
+
*
|
45492
|
+
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45493
|
+
* further modifications are identified. The method iteratively updates these transactions
|
45494
|
+
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45495
|
+
*
|
45496
|
+
* @param transactionRequests - Array of transaction request objects.
|
45497
|
+
* @returns A promise that resolves to an array of results for each transaction.
|
45498
|
+
*/
|
45499
|
+
async estimateMultipleTxDependencies(transactionRequests) {
|
45500
|
+
const results = transactionRequests.map(() => ({
|
45501
|
+
receipts: [],
|
45502
|
+
outputVariables: 0,
|
45503
|
+
missingContractIds: [],
|
45504
|
+
dryrunStatus: void 0
|
45505
|
+
}));
|
45506
|
+
const allRequests = clone_default(transactionRequests);
|
45507
|
+
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45508
|
+
allRequests.forEach((req, index) => {
|
45509
|
+
if (req.type === TransactionType.Script) {
|
45510
|
+
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45511
|
+
}
|
45512
|
+
});
|
45513
|
+
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45514
|
+
let attempt = 0;
|
45515
|
+
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45516
|
+
const encodedTransactions = transactionsToProcess.map(
|
45517
|
+
(index) => serializedTransactionsMap.get(index)
|
45518
|
+
);
|
45519
|
+
const dryRunResults = await this.operations.dryRun({
|
45520
|
+
encodedTransactions,
|
45521
|
+
utxoValidation: false
|
45522
|
+
});
|
45523
|
+
const nextRoundTransactions = [];
|
45524
|
+
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45525
|
+
const currentResultIndex = transactionsToProcess[i];
|
45526
|
+
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45527
|
+
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45528
|
+
results[currentResultIndex].dryrunStatus = status;
|
45529
|
+
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45530
|
+
results[currentResultIndex].receipts
|
45531
|
+
);
|
45532
|
+
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45533
|
+
const requestToProcess = allRequests[currentResultIndex];
|
45534
|
+
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45535
|
+
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45536
|
+
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45537
|
+
missingOutputContractIds.forEach(({ contractId }) => {
|
45538
|
+
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45539
|
+
results[currentResultIndex].missingContractIds.push(contractId);
|
45540
|
+
});
|
45541
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45542
|
+
transactionRequest: requestToProcess,
|
45543
|
+
optimizeGas: false
|
45544
|
+
});
|
45545
|
+
requestToProcess.maxFee = maxFee;
|
45546
|
+
serializedTransactionsMap.set(
|
45547
|
+
currentResultIndex,
|
45548
|
+
hexlify(requestToProcess.toTransactionBytes())
|
45549
|
+
);
|
45550
|
+
nextRoundTransactions.push(currentResultIndex);
|
45551
|
+
allRequests[currentResultIndex] = requestToProcess;
|
45552
|
+
}
|
45553
|
+
}
|
45554
|
+
transactionsToProcess = nextRoundTransactions;
|
45555
|
+
attempt += 1;
|
45556
|
+
}
|
45557
|
+
return results;
|
45558
|
+
}
|
45559
|
+
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45560
|
+
if (estimateTxDependencies) {
|
45561
|
+
return this.estimateMultipleTxDependencies(transactionRequests);
|
45562
|
+
}
|
45563
|
+
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45564
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45565
|
+
encodedTransactions,
|
45566
|
+
utxoValidation: utxoValidation || false
|
45567
|
+
});
|
45568
|
+
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45569
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45570
|
+
return { receipts, dryrunStatus: status };
|
45571
|
+
});
|
45572
|
+
return results;
|
45573
|
+
}
|
45574
|
+
async estimateTxGasAndFee(params) {
|
45575
|
+
const { transactionRequest, optimizeGas = true } = params;
|
45576
|
+
let { gasPrice } = params;
|
45163
45577
|
const chainInfo = this.getChain();
|
45164
|
-
const
|
45165
|
-
transactionRequest.gasPrice = gasPrice;
|
45578
|
+
const { gasPriceFactor } = this.getGasConfig();
|
45166
45579
|
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45167
|
-
|
45580
|
+
if (!gasPrice) {
|
45581
|
+
gasPrice = await this.estimateGasPrice(10);
|
45582
|
+
}
|
45583
|
+
const minFee = calculateGasFee({
|
45584
|
+
gasPrice: bn(gasPrice),
|
45585
|
+
gas: minGas,
|
45586
|
+
priceFactor: gasPriceFactor,
|
45587
|
+
tip: transactionRequest.tip
|
45588
|
+
}).add(1);
|
45589
|
+
let gasLimit = bn(0);
|
45168
45590
|
if (transactionRequest.type === TransactionType.Script) {
|
45169
|
-
|
45591
|
+
gasLimit = transactionRequest.gasLimit;
|
45592
|
+
if (!optimizeGas) {
|
45170
45593
|
transactionRequest.gasLimit = minGas;
|
45171
|
-
|
45172
|
-
|
45173
|
-
);
|
45594
|
+
gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45595
|
+
transactionRequest.gasLimit = gasLimit;
|
45174
45596
|
}
|
45175
45597
|
}
|
45176
45598
|
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45177
|
-
const maxFee =
|
45599
|
+
const maxFee = calculateGasFee({
|
45600
|
+
gasPrice: bn(gasPrice),
|
45601
|
+
gas: maxGas,
|
45602
|
+
priceFactor: gasPriceFactor,
|
45603
|
+
tip: transactionRequest.tip
|
45604
|
+
}).add(1);
|
45178
45605
|
return {
|
45179
45606
|
minGas,
|
45180
45607
|
minFee,
|
45181
45608
|
maxGas,
|
45182
|
-
maxFee
|
45609
|
+
maxFee,
|
45610
|
+
gasPrice,
|
45611
|
+
gasLimit
|
45183
45612
|
};
|
45184
45613
|
}
|
45185
45614
|
/**
|
@@ -45197,15 +45626,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45197
45626
|
if (estimateTxDependencies) {
|
45198
45627
|
return this.estimateTxDependencies(transactionRequest);
|
45199
45628
|
}
|
45200
|
-
const
|
45201
|
-
const { dryRun:
|
45202
|
-
|
45629
|
+
const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
|
45630
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45631
|
+
encodedTransactions,
|
45203
45632
|
utxoValidation: true
|
45204
45633
|
});
|
45205
|
-
const
|
45206
|
-
|
45207
|
-
receipts
|
45208
|
-
|
45634
|
+
const callResult = dryRunStatuses.map((dryRunStatus) => {
|
45635
|
+
const { id, receipts, status } = dryRunStatus;
|
45636
|
+
const processedReceipts = receipts.map(processGqlReceipt);
|
45637
|
+
return { id, receipts: processedReceipts, status };
|
45638
|
+
});
|
45639
|
+
return { receipts: callResult[0].receipts };
|
45209
45640
|
}
|
45210
45641
|
/**
|
45211
45642
|
* Returns a transaction cost to enable user
|
@@ -45222,77 +45653,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45222
45653
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45223
45654
|
* @returns A promise that resolves to the transaction cost object.
|
45224
45655
|
*/
|
45225
|
-
async getTransactionCost(transactionRequestLike,
|
45226
|
-
estimateTxDependencies = true,
|
45227
|
-
estimatePredicates = true,
|
45228
|
-
resourcesOwner,
|
45229
|
-
signatureCallback
|
45230
|
-
} = {}) {
|
45656
|
+
async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
|
45231
45657
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45232
|
-
const { minGasPrice } = this.getGasConfig();
|
45233
|
-
const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45234
45658
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45235
45659
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45236
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45660
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
|
45237
45661
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45662
|
+
txRequestClone.maxFee = bn(0);
|
45238
45663
|
if (isScriptTransaction) {
|
45239
45664
|
txRequestClone.gasLimit = bn(0);
|
45240
45665
|
}
|
45241
|
-
if (
|
45242
|
-
|
45243
|
-
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45244
|
-
}
|
45245
|
-
await this.estimatePredicates(txRequestClone);
|
45666
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45667
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45246
45668
|
}
|
45669
|
+
const signedRequest = clone_default(txRequestClone);
|
45670
|
+
let addedSignatures = 0;
|
45247
45671
|
if (signatureCallback && isScriptTransaction) {
|
45248
|
-
|
45249
|
-
|
45250
|
-
|
45251
|
-
|
45672
|
+
const lengthBefore = signedRequest.witnesses.length;
|
45673
|
+
await signatureCallback(signedRequest);
|
45674
|
+
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
45675
|
+
}
|
45676
|
+
await this.estimatePredicates(signedRequest);
|
45677
|
+
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45678
|
+
transactionRequest: signedRequest,
|
45679
|
+
optimizeGas: false
|
45252
45680
|
});
|
45681
|
+
txRequestClone.maxFee = maxFee;
|
45253
45682
|
let receipts = [];
|
45254
45683
|
let missingContractIds = [];
|
45255
45684
|
let outputVariables = 0;
|
45256
45685
|
let gasUsed = bn(0);
|
45257
|
-
|
45258
|
-
|
45686
|
+
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
45687
|
+
if (isScriptTransaction) {
|
45688
|
+
if (signatureCallback) {
|
45689
|
+
await signatureCallback(txRequestClone);
|
45690
|
+
}
|
45691
|
+
txRequestClone.gasLimit = gasLimit;
|
45259
45692
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45260
45693
|
receipts = result.receipts;
|
45261
45694
|
outputVariables = result.outputVariables;
|
45262
45695
|
missingContractIds = result.missingContractIds;
|
45263
|
-
gasUsed =
|
45696
|
+
gasUsed = getGasUsedFromReceipts(receipts);
|
45264
45697
|
txRequestClone.gasLimit = gasUsed;
|
45265
|
-
|
45266
|
-
|
45267
|
-
|
45698
|
+
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
45699
|
+
transactionRequest: txRequestClone,
|
45700
|
+
gasPrice
|
45268
45701
|
}));
|
45269
45702
|
}
|
45270
45703
|
return {
|
45271
45704
|
requiredQuantities: allQuantities,
|
45272
45705
|
receipts,
|
45273
45706
|
gasUsed,
|
45274
|
-
|
45275
|
-
gasPrice: setGasPrice,
|
45707
|
+
gasPrice,
|
45276
45708
|
minGas,
|
45277
45709
|
maxGas,
|
45278
45710
|
minFee,
|
45279
45711
|
maxFee,
|
45280
|
-
estimatedInputs: txRequestClone.inputs,
|
45281
45712
|
outputVariables,
|
45282
|
-
missingContractIds
|
45713
|
+
missingContractIds,
|
45714
|
+
addedSignatures,
|
45715
|
+
estimatedPredicates: txRequestClone.inputs
|
45283
45716
|
};
|
45284
45717
|
}
|
45285
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45718
|
+
async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
|
45286
45719
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45287
45720
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45288
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45721
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, {
|
45722
|
+
quantitiesToContract
|
45723
|
+
});
|
45289
45724
|
transactionRequest.addResources(
|
45290
45725
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45291
45726
|
);
|
45292
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45293
|
-
|
45294
|
-
|
45295
|
-
);
|
45727
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
|
45728
|
+
quantitiesToContract
|
45729
|
+
});
|
45296
45730
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45297
45731
|
return {
|
45298
45732
|
resources,
|
@@ -45316,7 +45750,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45316
45750
|
assetId: coin.assetId,
|
45317
45751
|
amount: bn(coin.amount),
|
45318
45752
|
owner: Address.fromAddressOrString(coin.owner),
|
45319
|
-
maturity: bn(coin.maturity).toNumber(),
|
45320
45753
|
blockCreated: bn(coin.blockCreated),
|
45321
45754
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45322
45755
|
}));
|
@@ -45368,7 +45801,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45368
45801
|
amount: bn(coin.amount),
|
45369
45802
|
assetId: coin.assetId,
|
45370
45803
|
owner: Address.fromAddressOrString(coin.owner),
|
45371
|
-
maturity: bn(coin.maturity).toNumber(),
|
45372
45804
|
blockCreated: bn(coin.blockCreated),
|
45373
45805
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45374
45806
|
};
|
@@ -45401,7 +45833,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45401
45833
|
}
|
45402
45834
|
return {
|
45403
45835
|
id: block2.id,
|
45404
|
-
height: bn(block2.
|
45836
|
+
height: bn(block2.height),
|
45405
45837
|
time: block2.header.time,
|
45406
45838
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45407
45839
|
};
|
@@ -45416,7 +45848,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45416
45848
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45417
45849
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45418
45850
|
id: block2.id,
|
45419
|
-
height: bn(block2.
|
45851
|
+
height: bn(block2.height),
|
45420
45852
|
time: block2.header.time,
|
45421
45853
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45422
45854
|
}));
|
@@ -45443,7 +45875,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45443
45875
|
}
|
45444
45876
|
return {
|
45445
45877
|
id: block2.id,
|
45446
|
-
height: bn(block2.
|
45878
|
+
height: bn(block2.height, 10),
|
45447
45879
|
time: block2.header.time,
|
45448
45880
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45449
45881
|
transactions: block2.transactions.map(
|
@@ -45623,7 +46055,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45623
46055
|
prevRoot: messageBlockHeader.prevRoot,
|
45624
46056
|
time: messageBlockHeader.time,
|
45625
46057
|
applicationHash: messageBlockHeader.applicationHash,
|
45626
|
-
messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
|
45627
46058
|
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
|
45628
46059
|
},
|
45629
46060
|
commitBlockHeader: {
|
@@ -45635,7 +46066,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45635
46066
|
prevRoot: commitBlockHeader.prevRoot,
|
45636
46067
|
time: commitBlockHeader.time,
|
45637
46068
|
applicationHash: commitBlockHeader.applicationHash,
|
45638
|
-
messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
|
45639
46069
|
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
|
45640
46070
|
},
|
45641
46071
|
sender: Address.fromAddressOrString(sender),
|
@@ -45645,6 +46075,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45645
46075
|
data
|
45646
46076
|
};
|
45647
46077
|
}
|
46078
|
+
async getLatestGasPrice() {
|
46079
|
+
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46080
|
+
return bn(latestGasPrice.gasPrice);
|
46081
|
+
}
|
46082
|
+
async estimateGasPrice(blockHorizon) {
|
46083
|
+
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46084
|
+
blockHorizon: String(blockHorizon)
|
46085
|
+
});
|
46086
|
+
return bn(estimateGasPrice.gasPrice);
|
46087
|
+
}
|
45648
46088
|
/**
|
45649
46089
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
45650
46090
|
*
|
@@ -45928,36 +46368,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45928
46368
|
* @param fee - The estimated transaction fee.
|
45929
46369
|
* @returns A promise that resolves when the resources are added to the transaction.
|
45930
46370
|
*/
|
45931
|
-
async fund(request,
|
45932
|
-
const
|
46371
|
+
async fund(request, params) {
|
46372
|
+
const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
|
46373
|
+
const txRequest = request;
|
46374
|
+
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45933
46375
|
amount: bn(fee),
|
45934
46376
|
assetId: BaseAssetId,
|
45935
|
-
coinQuantities
|
46377
|
+
coinQuantities: requiredQuantities
|
45936
46378
|
});
|
45937
46379
|
const quantitiesDict = {};
|
45938
|
-
|
46380
|
+
requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
|
45939
46381
|
quantitiesDict[assetId] = {
|
45940
46382
|
required: amount,
|
45941
46383
|
owned: bn(0)
|
45942
46384
|
};
|
45943
46385
|
});
|
45944
|
-
|
45945
|
-
const cachedMessages = [];
|
45946
|
-
const owner = this.address.toB256();
|
45947
|
-
request.inputs.forEach((input) => {
|
46386
|
+
txRequest.inputs.forEach((input) => {
|
45948
46387
|
const isResource = "amount" in input;
|
45949
46388
|
if (isResource) {
|
45950
46389
|
const isCoin2 = "owner" in input;
|
45951
46390
|
if (isCoin2) {
|
45952
46391
|
const assetId = String(input.assetId);
|
45953
|
-
if (
|
46392
|
+
if (quantitiesDict[assetId]) {
|
45954
46393
|
const amount = bn(input.amount);
|
45955
46394
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45956
|
-
cachedUtxos.push(input.id);
|
45957
46395
|
}
|
45958
|
-
} else if (input.
|
46396
|
+
} else if (input.amount && quantitiesDict[BaseAssetId]) {
|
45959
46397
|
quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
|
45960
|
-
cachedMessages.push(input.nonce);
|
45961
46398
|
}
|
45962
46399
|
}
|
45963
46400
|
});
|
@@ -45972,12 +46409,23 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45972
46409
|
});
|
45973
46410
|
const needsToBeFunded = missingQuantities.length;
|
45974
46411
|
if (needsToBeFunded) {
|
45975
|
-
const
|
45976
|
-
|
45977
|
-
|
45978
|
-
|
45979
|
-
|
46412
|
+
const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
|
46413
|
+
const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
|
46414
|
+
txRequest.addResources(resources);
|
46415
|
+
}
|
46416
|
+
txRequest.shiftPredicateData();
|
46417
|
+
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46418
|
+
const requestToBeReEstimate = clone_default(txRequest);
|
46419
|
+
if (addedSignatures) {
|
46420
|
+
Array.from({ length: addedSignatures }).forEach(
|
46421
|
+
() => requestToBeReEstimate.addEmptyWitness()
|
46422
|
+
);
|
45980
46423
|
}
|
46424
|
+
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46425
|
+
transactionRequest: requestToBeReEstimate
|
46426
|
+
});
|
46427
|
+
txRequest.maxFee = maxFee;
|
46428
|
+
return txRequest;
|
45981
46429
|
}
|
45982
46430
|
/**
|
45983
46431
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -45985,28 +46433,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45985
46433
|
* @param destination - The address of the destination.
|
45986
46434
|
* @param amount - The amount of coins to transfer.
|
45987
46435
|
* @param assetId - The asset ID of the coins to transfer.
|
45988
|
-
* @param txParams - The transaction parameters (gasLimit,
|
46436
|
+
* @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
|
45989
46437
|
* @returns A promise that resolves to the prepared transaction request.
|
45990
46438
|
*/
|
45991
46439
|
async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
|
45992
|
-
const
|
45993
|
-
const params = { gasPrice: minGasPrice, ...txParams };
|
45994
|
-
const request = new ScriptTransactionRequest(params);
|
46440
|
+
const request = new ScriptTransactionRequest(txParams);
|
45995
46441
|
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
|
45996
|
-
const
|
46442
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
45997
46443
|
estimateTxDependencies: true,
|
45998
46444
|
resourcesOwner: this
|
45999
46445
|
});
|
46000
|
-
|
46001
|
-
|
46002
|
-
|
46003
|
-
|
46004
|
-
|
46005
|
-
|
46006
|
-
|
46007
|
-
|
46008
|
-
await this.fund(request,
|
46009
|
-
request.updatePredicateInputs(estimatedInputs);
|
46446
|
+
if ("gasLimit" in txParams) {
|
46447
|
+
this.validateGas({
|
46448
|
+
gasUsed: txCost.gasUsed,
|
46449
|
+
gasLimit: request.gasLimit
|
46450
|
+
});
|
46451
|
+
}
|
46452
|
+
request.gasLimit = txCost.gasUsed;
|
46453
|
+
request.maxFee = txCost.maxFee;
|
46454
|
+
await this.fund(request, txCost);
|
46010
46455
|
return request;
|
46011
46456
|
}
|
46012
46457
|
/**
|
@@ -46045,31 +46490,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46045
46490
|
);
|
46046
46491
|
}
|
46047
46492
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46048
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46049
|
-
const params = { gasPrice: minGasPrice, ...txParams };
|
46050
46493
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46051
46494
|
hexlifiedContractId: contractAddress.toB256(),
|
46052
46495
|
amountToTransfer: bn(amount),
|
46053
46496
|
assetId
|
46054
46497
|
});
|
46055
46498
|
const request = new ScriptTransactionRequest({
|
46056
|
-
...
|
46499
|
+
...txParams,
|
46057
46500
|
script,
|
46058
46501
|
scriptData
|
46059
46502
|
});
|
46060
46503
|
request.addContractInputAndOutput(contractAddress);
|
46061
|
-
const
|
46062
|
-
|
46063
|
-
[{ amount: bn(amount), assetId: String(assetId) }]
|
46064
|
-
);
|
46065
|
-
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46066
|
-
this.validateGas({
|
46067
|
-
gasUsed,
|
46068
|
-
gasPrice: request.gasPrice,
|
46069
|
-
gasLimit: request.gasLimit,
|
46070
|
-
minGasPrice
|
46504
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
46505
|
+
resourcesOwner: this,
|
46506
|
+
quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
|
46071
46507
|
});
|
46072
|
-
|
46508
|
+
if (txParams.gasLimit) {
|
46509
|
+
this.validateGas({
|
46510
|
+
gasUsed: txCost.gasUsed,
|
46511
|
+
gasLimit: request.gasLimit
|
46512
|
+
});
|
46513
|
+
}
|
46514
|
+
request.gasLimit = txCost.gasUsed;
|
46515
|
+
request.maxFee = txCost.maxFee;
|
46516
|
+
await this.fund(request, txCost);
|
46073
46517
|
return this.sendTransaction(request);
|
46074
46518
|
}
|
46075
46519
|
/**
|
@@ -46081,7 +46525,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46081
46525
|
* @returns A promise that resolves to the transaction response.
|
46082
46526
|
*/
|
46083
46527
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46084
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46085
46528
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46086
46529
|
const recipientDataArray = arrayify(
|
46087
46530
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46094,21 +46537,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46094
46537
|
...recipientDataArray,
|
46095
46538
|
...amountDataArray
|
46096
46539
|
]);
|
46097
|
-
const params = { script,
|
46540
|
+
const params = { script, ...txParams };
|
46098
46541
|
const request = new ScriptTransactionRequest(params);
|
46099
|
-
const
|
46100
|
-
const
|
46101
|
-
|
46102
|
-
|
46103
|
-
|
46104
|
-
|
46105
|
-
|
46106
|
-
|
46107
|
-
|
46108
|
-
|
46109
|
-
|
46110
|
-
});
|
46111
|
-
await this.fund(request, requiredQuantities, maxFee);
|
46542
|
+
const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
|
46543
|
+
const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
|
46544
|
+
if (txParams.gasLimit) {
|
46545
|
+
this.validateGas({
|
46546
|
+
gasUsed: txCost.gasUsed,
|
46547
|
+
gasLimit: request.gasLimit
|
46548
|
+
});
|
46549
|
+
}
|
46550
|
+
request.maxFee = txCost.maxFee;
|
46551
|
+
request.gasLimit = txCost.gasUsed;
|
46552
|
+
await this.fund(request, txCost);
|
46112
46553
|
return this.sendTransaction(request);
|
46113
46554
|
}
|
46114
46555
|
async signMessage(message) {
|
@@ -46166,18 +46607,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46166
46607
|
}
|
46167
46608
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46168
46609
|
}
|
46169
|
-
validateGas({
|
46170
|
-
gasUsed,
|
46171
|
-
gasPrice,
|
46172
|
-
gasLimit,
|
46173
|
-
minGasPrice
|
46174
|
-
}) {
|
46175
|
-
if (minGasPrice.gt(gasPrice)) {
|
46176
|
-
throw new FuelError(
|
46177
|
-
ErrorCode.GAS_PRICE_TOO_LOW,
|
46178
|
-
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46179
|
-
);
|
46180
|
-
}
|
46610
|
+
validateGas({ gasUsed, gasLimit }) {
|
46181
46611
|
if (gasUsed.gt(gasLimit)) {
|
46182
46612
|
throw new FuelError(
|
46183
46613
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -47766,7 +48196,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47766
48196
|
* @param transactionRequestLike - The transaction request to send.
|
47767
48197
|
* @returns A promise that resolves to the TransactionResponse object.
|
47768
48198
|
*/
|
47769
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
48199
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
|
47770
48200
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
47771
48201
|
if (estimateTxDependencies) {
|
47772
48202
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50526,14 +50956,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50526
50956
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50527
50957
|
wallet.provider
|
50528
50958
|
);
|
50529
|
-
const
|
50530
|
-
|
50531
|
-
|
50532
|
-
|
50533
|
-
gasPrice: minGasPrice
|
50959
|
+
const request = new ScriptTransactionRequest();
|
50960
|
+
quantities.forEach((quantity) => {
|
50961
|
+
const { amount, assetId } = coinQuantityfy(quantity);
|
50962
|
+
request.addCoinOutput(wallet.address, amount, assetId);
|
50534
50963
|
});
|
50535
|
-
|
50536
|
-
|
50964
|
+
const txCost = await genesisWallet.provider.getTransactionCost(request);
|
50965
|
+
request.gasLimit = txCost.gasUsed;
|
50966
|
+
request.maxFee = txCost.maxFee;
|
50967
|
+
await genesisWallet.fund(request, txCost);
|
50537
50968
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50538
50969
|
};
|
50539
50970
|
|
@@ -50612,12 +51043,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50612
51043
|
// eslint-disable-next-line no-async-promise-executor
|
50613
51044
|
new Promise(async (resolve, reject) => {
|
50614
51045
|
const remainingArgs = extractRemainingArgs(args, [
|
50615
|
-
"--
|
51046
|
+
"--snapshot",
|
50616
51047
|
"--consensus-key",
|
50617
51048
|
"--db-type",
|
50618
51049
|
"--poa-instant"
|
50619
51050
|
]);
|
50620
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
51051
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--snapshot");
|
50621
51052
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
50622
51053
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
50623
51054
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -50636,36 +51067,54 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50636
51067
|
let chainConfigPathToUse;
|
50637
51068
|
const prefix = basePath || import_os.default.tmpdir();
|
50638
51069
|
const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
|
50639
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51070
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "chainConfigs");
|
50640
51071
|
if (chainConfigPath) {
|
50641
51072
|
chainConfigPathToUse = chainConfigPath;
|
50642
51073
|
} else {
|
50643
51074
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
50644
51075
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
50645
51076
|
}
|
50646
|
-
|
50647
|
-
|
51077
|
+
let { stateConfigJson } = defaultChainConfigs;
|
51078
|
+
const { chainConfigJson, metadataJson } = defaultChainConfigs;
|
51079
|
+
stateConfigJson = {
|
51080
|
+
...stateConfigJson,
|
51081
|
+
coins: [
|
51082
|
+
...stateConfigJson.coins.map((coin) => ({
|
51083
|
+
...coin,
|
51084
|
+
amount: "18446744073709551615"
|
51085
|
+
}))
|
51086
|
+
],
|
51087
|
+
messages: stateConfigJson.messages.map((message) => ({
|
51088
|
+
...message,
|
51089
|
+
amount: "18446744073709551615"
|
51090
|
+
}))
|
51091
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51092
|
+
};
|
50648
51093
|
if (!process.env.GENESIS_SECRET) {
|
50649
51094
|
const pk = Signer.generatePrivateKey();
|
50650
51095
|
const signer = new Signer(pk);
|
50651
51096
|
process.env.GENESIS_SECRET = hexlify(pk);
|
50652
|
-
|
50653
|
-
|
50654
|
-
|
50655
|
-
|
50656
|
-
|
50657
|
-
|
50658
|
-
|
50659
|
-
|
50660
|
-
|
50661
|
-
|
50662
|
-
}
|
50663
|
-
]
|
50664
|
-
}
|
50665
|
-
};
|
51097
|
+
stateConfigJson.coins.push({
|
51098
|
+
tx_id: hexlify(randomBytes3(34)),
|
51099
|
+
owner: signer.address.toHexString(),
|
51100
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51101
|
+
amount: "18446744073709551615",
|
51102
|
+
asset_id: BaseAssetId,
|
51103
|
+
output_index: 0,
|
51104
|
+
tx_pointer_block_height: 0,
|
51105
|
+
tx_pointer_tx_idx: 0
|
51106
|
+
});
|
50666
51107
|
}
|
50667
|
-
|
50668
|
-
|
51108
|
+
let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
|
51109
|
+
const regexMakeNumber = /("amount":)"(\d+)"/gm;
|
51110
|
+
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51111
|
+
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51112
|
+
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51113
|
+
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51114
|
+
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51115
|
+
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51116
|
+
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51117
|
+
chainConfigPathToUse = tempDirPath;
|
50669
51118
|
}
|
50670
51119
|
const child = (0, import_child_process.spawn)(
|
50671
51120
|
command,
|
@@ -50674,10 +51123,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50674
51123
|
["--ip", ipToUse],
|
50675
51124
|
["--port", portToUse],
|
50676
51125
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
50677
|
-
["--min-gas-price", "
|
51126
|
+
["--min-gas-price", "1"],
|
50678
51127
|
poaInstant ? ["--poa-instant", "true"] : [],
|
50679
51128
|
["--consensus-key", consensusKey],
|
50680
|
-
["--
|
51129
|
+
["--snapshot", chainConfigPathToUse],
|
50681
51130
|
"--vm-backtrace",
|
50682
51131
|
"--utxo-validation",
|
50683
51132
|
"--debug",
|
@@ -50736,7 +51185,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50736
51185
|
walletCount = 10
|
50737
51186
|
} = {}) => {
|
50738
51187
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
50739
|
-
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51188
|
+
const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
|
50740
51189
|
const wallets = await generateWallets(walletCount, provider);
|
50741
51190
|
const cleanup = () => {
|
50742
51191
|
closeNode();
|