@fuel-ts/account 0.81.0 → 0.83.0
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 +3 -3
- package/dist/account.d.ts +7 -6
- 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 +890 -619
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +853 -604
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +696 -448
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +12 -24
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +810 -359
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/coin-quantity.d.ts +3 -3
- package/dist/providers/coin-quantity.d.ts.map +1 -1
- package/dist/providers/coin.d.ts +4 -2
- package/dist/providers/coin.d.ts.map +1 -1
- package/dist/providers/message.d.ts +7 -1
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +44 -27
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/input.d.ts +2 -2
- package/dist/providers/transaction-request/input.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +13 -33
- 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/providers/utils/merge-quantities.d.ts +1 -1
- package/dist/providers/utils/merge-quantities.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils.global.js +1615 -1114
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +841 -596
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +696 -451
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +16 -16
@@ -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,9 +31914,9 @@ spurious results.`);
|
|
31914
31914
|
// ../versions/dist/index.mjs
|
31915
31915
|
function getBuiltinVersions() {
|
31916
31916
|
return {
|
31917
|
-
FORC: "0.
|
31918
|
-
FUEL_CORE: "0.
|
31919
|
-
FUELS: "0.
|
31917
|
+
FORC: "0.56.0",
|
31918
|
+
FUEL_CORE: "0.24.3",
|
31919
|
+
FUELS: "0.83.0"
|
31920
31920
|
};
|
31921
31921
|
}
|
31922
31922
|
function parseVersion(version2) {
|
@@ -32015,6 +32015,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32015
32015
|
ErrorCode2["INVALID_TRANSFER_AMOUNT"] = "invalid-transfer-amount";
|
32016
32016
|
ErrorCode2["GAS_PRICE_TOO_LOW"] = "gas-price-too-low";
|
32017
32017
|
ErrorCode2["GAS_LIMIT_TOO_LOW"] = "gas-limit-too-low";
|
32018
|
+
ErrorCode2["MAX_FEE_TOO_LOW"] = "max-fee-too-low";
|
32018
32019
|
ErrorCode2["TRANSACTION_NOT_FOUND"] = "transaction-not-found";
|
32019
32020
|
ErrorCode2["TRANSACTION_FAILED"] = "transaction-failed";
|
32020
32021
|
ErrorCode2["INVALID_CONFIGURABLE_CONSTANTS"] = "invalid-configurable-constants";
|
@@ -32193,521 +32194,757 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32193
32194
|
__publicField3(DateTime, "TAI64_NULL", "");
|
32194
32195
|
var chainConfig_default = {
|
32195
32196
|
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"
|
32197
|
+
consensus_parameters: {
|
32198
|
+
V1: {
|
32199
|
+
tx_params: {
|
32200
|
+
V1: {
|
32201
|
+
max_inputs: 255,
|
32202
|
+
max_outputs: 255,
|
32203
|
+
max_witnesses: 255,
|
32204
|
+
max_gas_per_tx: 3e7,
|
32205
|
+
max_size: 112640
|
32206
|
+
}
|
32207
|
+
},
|
32208
|
+
predicate_params: {
|
32209
|
+
V1: {
|
32210
|
+
max_predicate_length: 102400,
|
32211
|
+
max_predicate_data_length: 102400,
|
32212
|
+
max_message_data_length: 102400,
|
32213
|
+
max_gas_per_predicate: 3e7
|
32214
|
+
}
|
32215
|
+
},
|
32216
|
+
script_params: {
|
32217
|
+
V1: {
|
32218
|
+
max_script_length: 102400,
|
32219
|
+
max_script_data_length: 102400
|
32220
|
+
}
|
32221
|
+
},
|
32222
|
+
contract_params: {
|
32223
|
+
V1: {
|
32224
|
+
contract_max_size: 102400,
|
32225
|
+
max_storage_slots: 1760
|
32226
|
+
}
|
32227
|
+
},
|
32228
|
+
fee_params: {
|
32229
|
+
V1: {
|
32230
|
+
gas_price_factor: 92,
|
32231
|
+
gas_per_byte: 63
|
32232
|
+
}
|
32233
|
+
},
|
32234
|
+
chain_id: 0,
|
32235
|
+
gas_costs: {
|
32236
|
+
V1: {
|
32237
|
+
add: 2,
|
32238
|
+
addi: 2,
|
32239
|
+
aloc: 1,
|
32240
|
+
and: 2,
|
32241
|
+
andi: 2,
|
32242
|
+
bal: 366,
|
32243
|
+
bhei: 2,
|
32244
|
+
bhsh: 2,
|
32245
|
+
burn: 33949,
|
32246
|
+
cb: 2,
|
32247
|
+
cfei: 2,
|
32248
|
+
cfsi: 2,
|
32249
|
+
div: 2,
|
32250
|
+
divi: 2,
|
32251
|
+
eck1: 3347,
|
32252
|
+
ecr1: 46165,
|
32253
|
+
ed19: 4210,
|
32254
|
+
eq: 2,
|
32255
|
+
exp: 2,
|
32256
|
+
expi: 2,
|
32257
|
+
flag: 1,
|
32258
|
+
gm: 2,
|
32259
|
+
gt: 2,
|
32260
|
+
gtf: 16,
|
32261
|
+
ji: 2,
|
32262
|
+
jmp: 2,
|
32263
|
+
jne: 2,
|
32264
|
+
jnei: 2,
|
32265
|
+
jnzi: 2,
|
32266
|
+
jmpf: 2,
|
32267
|
+
jmpb: 2,
|
32268
|
+
jnzf: 2,
|
32269
|
+
jnzb: 2,
|
32270
|
+
jnef: 2,
|
32271
|
+
jneb: 2,
|
32272
|
+
lb: 2,
|
32273
|
+
log: 754,
|
32274
|
+
lt: 2,
|
32275
|
+
lw: 2,
|
32276
|
+
mint: 35718,
|
32277
|
+
mlog: 2,
|
32278
|
+
mod: 2,
|
32279
|
+
modi: 2,
|
32280
|
+
move: 2,
|
32281
|
+
movi: 2,
|
32282
|
+
mroo: 5,
|
32283
|
+
mul: 2,
|
32284
|
+
muli: 2,
|
32285
|
+
mldv: 4,
|
32286
|
+
noop: 1,
|
32287
|
+
not: 2,
|
32288
|
+
or: 2,
|
32289
|
+
ori: 2,
|
32290
|
+
poph: 3,
|
32291
|
+
popl: 3,
|
32292
|
+
pshh: 4,
|
32293
|
+
pshl: 4,
|
32294
|
+
ret_contract: 733,
|
32295
|
+
rvrt_contract: 722,
|
32296
|
+
sb: 2,
|
32297
|
+
sll: 2,
|
32298
|
+
slli: 2,
|
32299
|
+
srl: 2,
|
32300
|
+
srli: 2,
|
32301
|
+
srw: 253,
|
32302
|
+
sub: 2,
|
32303
|
+
subi: 2,
|
32304
|
+
sw: 2,
|
32305
|
+
sww: 29053,
|
32306
|
+
time: 79,
|
32307
|
+
tr: 46242,
|
32308
|
+
tro: 33251,
|
32309
|
+
wdcm: 3,
|
32310
|
+
wqcm: 3,
|
32311
|
+
wdop: 3,
|
32312
|
+
wqop: 3,
|
32313
|
+
wdml: 3,
|
32314
|
+
wqml: 4,
|
32315
|
+
wddv: 5,
|
32316
|
+
wqdv: 7,
|
32317
|
+
wdmd: 11,
|
32318
|
+
wqmd: 18,
|
32319
|
+
wdam: 9,
|
32320
|
+
wqam: 12,
|
32321
|
+
wdmm: 11,
|
32322
|
+
wqmm: 11,
|
32323
|
+
xor: 2,
|
32324
|
+
xori: 2,
|
32325
|
+
call: {
|
32326
|
+
LightOperation: {
|
32327
|
+
base: 21687,
|
32328
|
+
units_per_gas: 4
|
32329
|
+
}
|
32330
|
+
},
|
32331
|
+
ccp: {
|
32332
|
+
LightOperation: {
|
32333
|
+
base: 59,
|
32334
|
+
units_per_gas: 20
|
32335
|
+
}
|
32336
|
+
},
|
32337
|
+
croo: {
|
32338
|
+
LightOperation: {
|
32339
|
+
base: 1,
|
32340
|
+
units_per_gas: 1
|
32341
|
+
}
|
32342
|
+
},
|
32343
|
+
csiz: {
|
32344
|
+
LightOperation: {
|
32345
|
+
base: 59,
|
32346
|
+
units_per_gas: 195
|
32347
|
+
}
|
32348
|
+
},
|
32349
|
+
k256: {
|
32350
|
+
LightOperation: {
|
32351
|
+
base: 282,
|
32352
|
+
units_per_gas: 3
|
32353
|
+
}
|
32354
|
+
},
|
32355
|
+
ldc: {
|
32356
|
+
LightOperation: {
|
32357
|
+
base: 45,
|
32358
|
+
units_per_gas: 65
|
32359
|
+
}
|
32360
|
+
},
|
32361
|
+
logd: {
|
32362
|
+
LightOperation: {
|
32363
|
+
base: 1134,
|
32364
|
+
units_per_gas: 2
|
32365
|
+
}
|
32366
|
+
},
|
32367
|
+
mcl: {
|
32368
|
+
LightOperation: {
|
32369
|
+
base: 3,
|
32370
|
+
units_per_gas: 523
|
32371
|
+
}
|
32372
|
+
},
|
32373
|
+
mcli: {
|
32374
|
+
LightOperation: {
|
32375
|
+
base: 3,
|
32376
|
+
units_per_gas: 526
|
32377
|
+
}
|
32378
|
+
},
|
32379
|
+
mcp: {
|
32380
|
+
LightOperation: {
|
32381
|
+
base: 3,
|
32382
|
+
units_per_gas: 448
|
32383
|
+
}
|
32384
|
+
},
|
32385
|
+
mcpi: {
|
32386
|
+
LightOperation: {
|
32387
|
+
base: 7,
|
32388
|
+
units_per_gas: 585
|
32389
|
+
}
|
32390
|
+
},
|
32391
|
+
meq: {
|
32392
|
+
LightOperation: {
|
32393
|
+
base: 11,
|
32394
|
+
units_per_gas: 1097
|
32395
|
+
}
|
32396
|
+
},
|
32397
|
+
retd_contract: {
|
32398
|
+
LightOperation: {
|
32399
|
+
base: 1086,
|
32400
|
+
units_per_gas: 2
|
32401
|
+
}
|
32402
|
+
},
|
32403
|
+
s256: {
|
32404
|
+
LightOperation: {
|
32405
|
+
base: 45,
|
32406
|
+
units_per_gas: 3
|
32407
|
+
}
|
32408
|
+
},
|
32409
|
+
scwq: {
|
32410
|
+
HeavyOperation: {
|
32411
|
+
base: 30375,
|
32412
|
+
gas_per_unit: 28628
|
32413
|
+
}
|
32414
|
+
},
|
32415
|
+
smo: {
|
32416
|
+
LightOperation: {
|
32417
|
+
base: 64196,
|
32418
|
+
units_per_gas: 1
|
32419
|
+
}
|
32420
|
+
},
|
32421
|
+
srwq: {
|
32422
|
+
HeavyOperation: {
|
32423
|
+
base: 262,
|
32424
|
+
gas_per_unit: 249
|
32425
|
+
}
|
32426
|
+
},
|
32427
|
+
swwq: {
|
32428
|
+
HeavyOperation: {
|
32429
|
+
base: 28484,
|
32430
|
+
gas_per_unit: 26613
|
32431
|
+
}
|
32432
|
+
},
|
32433
|
+
contract_root: {
|
32434
|
+
LightOperation: {
|
32435
|
+
base: 45,
|
32436
|
+
units_per_gas: 1
|
32437
|
+
}
|
32438
|
+
},
|
32439
|
+
state_root: {
|
32440
|
+
HeavyOperation: {
|
32441
|
+
base: 350,
|
32442
|
+
gas_per_unit: 176
|
32443
|
+
}
|
32444
|
+
},
|
32445
|
+
new_storage_per_byte: 63,
|
32446
|
+
vm_initialization: {
|
32447
|
+
LightOperation: {
|
32448
|
+
base: 1645,
|
32449
|
+
units_per_gas: 14
|
32450
|
+
}
|
32451
|
+
}
|
32452
|
+
}
|
32453
32453
|
},
|
32454
|
-
|
32455
|
-
|
32456
|
-
|
32457
|
-
|
32458
|
-
amount: "0xb04f3c08f59b309e",
|
32459
|
-
data: "",
|
32460
|
-
da_height: "0x00"
|
32461
|
-
}
|
32462
|
-
]
|
32454
|
+
base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
|
32455
|
+
block_gas_limit: 3e7,
|
32456
|
+
privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
|
32457
|
+
}
|
32463
32458
|
},
|
32464
|
-
|
32465
|
-
|
32466
|
-
|
32467
|
-
|
32468
|
-
|
32469
|
-
|
32470
|
-
|
32459
|
+
consensus: {
|
32460
|
+
PoA: {
|
32461
|
+
signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
|
32462
|
+
}
|
32463
|
+
}
|
32464
|
+
};
|
32465
|
+
var metadata_default = {
|
32466
|
+
chain_config: "chainConfig.json",
|
32467
|
+
table_encoding: {
|
32468
|
+
Json: {
|
32469
|
+
filepath: "stateConfig.json"
|
32470
|
+
}
|
32471
|
+
}
|
32472
|
+
};
|
32473
|
+
var stateConfig_default = {
|
32474
|
+
coins: [
|
32475
|
+
{
|
32476
|
+
tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
|
32477
|
+
output_index: 0,
|
32478
|
+
tx_pointer_block_height: 0,
|
32479
|
+
tx_pointer_tx_idx: 0,
|
32480
|
+
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32481
|
+
amount: 18446744073709552e3,
|
32482
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32471
32483
|
},
|
32472
|
-
|
32473
|
-
|
32474
|
-
|
32475
|
-
|
32476
|
-
|
32484
|
+
{
|
32485
|
+
tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
|
32486
|
+
output_index: 0,
|
32487
|
+
tx_pointer_block_height: 0,
|
32488
|
+
tx_pointer_tx_idx: 0,
|
32489
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32490
|
+
amount: 18446744073709552e3,
|
32491
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32477
32492
|
},
|
32478
|
-
|
32479
|
-
|
32480
|
-
|
32493
|
+
{
|
32494
|
+
tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
|
32495
|
+
output_index: 0,
|
32496
|
+
tx_pointer_block_height: 0,
|
32497
|
+
tx_pointer_tx_idx: 0,
|
32498
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32499
|
+
amount: 18446744073709552e3,
|
32500
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32481
32501
|
},
|
32482
|
-
|
32483
|
-
|
32484
|
-
|
32502
|
+
{
|
32503
|
+
tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
|
32504
|
+
output_index: 0,
|
32505
|
+
tx_pointer_block_height: 0,
|
32506
|
+
tx_pointer_tx_idx: 0,
|
32507
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32508
|
+
amount: 18446744073709552e3,
|
32509
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32485
32510
|
},
|
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
|
-
}
|
32511
|
+
{
|
32512
|
+
tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
|
32513
|
+
output_index: 0,
|
32514
|
+
tx_pointer_block_height: 0,
|
32515
|
+
tx_pointer_tx_idx: 0,
|
32516
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32517
|
+
amount: 18446744073709552e3,
|
32518
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32586
32519
|
},
|
32587
|
-
|
32588
|
-
|
32589
|
-
|
32590
|
-
|
32591
|
-
|
32520
|
+
{
|
32521
|
+
tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
|
32522
|
+
output_index: 0,
|
32523
|
+
tx_pointer_block_height: 0,
|
32524
|
+
tx_pointer_tx_idx: 0,
|
32525
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32526
|
+
amount: 18446744073709552e3,
|
32527
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32592
32528
|
},
|
32593
|
-
|
32594
|
-
|
32595
|
-
|
32596
|
-
|
32597
|
-
|
32529
|
+
{
|
32530
|
+
tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
|
32531
|
+
output_index: 0,
|
32532
|
+
tx_pointer_block_height: 0,
|
32533
|
+
tx_pointer_tx_idx: 0,
|
32534
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32535
|
+
amount: 18446744073709552e3,
|
32536
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32598
32537
|
},
|
32599
|
-
|
32600
|
-
|
32601
|
-
|
32602
|
-
|
32603
|
-
|
32538
|
+
{
|
32539
|
+
tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
|
32540
|
+
output_index: 0,
|
32541
|
+
tx_pointer_block_height: 0,
|
32542
|
+
tx_pointer_tx_idx: 0,
|
32543
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32544
|
+
amount: 18446744073709552e3,
|
32545
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32604
32546
|
},
|
32605
|
-
|
32606
|
-
|
32607
|
-
|
32608
|
-
|
32609
|
-
|
32547
|
+
{
|
32548
|
+
tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
|
32549
|
+
output_index: 0,
|
32550
|
+
tx_pointer_block_height: 0,
|
32551
|
+
tx_pointer_tx_idx: 0,
|
32552
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32553
|
+
amount: 18446744073709552e3,
|
32554
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32610
32555
|
},
|
32611
|
-
|
32612
|
-
|
32613
|
-
|
32614
|
-
|
32615
|
-
|
32556
|
+
{
|
32557
|
+
tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
|
32558
|
+
output_index: 0,
|
32559
|
+
tx_pointer_block_height: 0,
|
32560
|
+
tx_pointer_tx_idx: 0,
|
32561
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32562
|
+
amount: 18446744073709552e3,
|
32563
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32616
32564
|
},
|
32617
|
-
|
32618
|
-
|
32619
|
-
|
32620
|
-
|
32621
|
-
|
32565
|
+
{
|
32566
|
+
tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
|
32567
|
+
output_index: 0,
|
32568
|
+
tx_pointer_block_height: 0,
|
32569
|
+
tx_pointer_tx_idx: 0,
|
32570
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32571
|
+
amount: 18446744073709552e3,
|
32572
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32622
32573
|
},
|
32623
|
-
|
32624
|
-
|
32625
|
-
|
32626
|
-
|
32627
|
-
|
32574
|
+
{
|
32575
|
+
tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
|
32576
|
+
output_index: 0,
|
32577
|
+
tx_pointer_block_height: 0,
|
32578
|
+
tx_pointer_tx_idx: 0,
|
32579
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32580
|
+
amount: 18446744073709552e3,
|
32581
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32628
32582
|
},
|
32629
|
-
|
32630
|
-
|
32631
|
-
|
32632
|
-
|
32633
|
-
|
32583
|
+
{
|
32584
|
+
tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
|
32585
|
+
output_index: 0,
|
32586
|
+
tx_pointer_block_height: 0,
|
32587
|
+
tx_pointer_tx_idx: 0,
|
32588
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32589
|
+
amount: 18446744073709552e3,
|
32590
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32634
32591
|
},
|
32635
|
-
|
32636
|
-
|
32637
|
-
|
32638
|
-
|
32639
|
-
|
32592
|
+
{
|
32593
|
+
tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
|
32594
|
+
output_index: 0,
|
32595
|
+
tx_pointer_block_height: 0,
|
32596
|
+
tx_pointer_tx_idx: 0,
|
32597
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32598
|
+
amount: 18446744073709552e3,
|
32599
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32640
32600
|
},
|
32641
|
-
|
32642
|
-
|
32643
|
-
|
32644
|
-
|
32645
|
-
|
32601
|
+
{
|
32602
|
+
tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
|
32603
|
+
output_index: 0,
|
32604
|
+
tx_pointer_block_height: 0,
|
32605
|
+
tx_pointer_tx_idx: 0,
|
32606
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32607
|
+
amount: 18446744073709552e3,
|
32608
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32646
32609
|
},
|
32647
|
-
|
32648
|
-
|
32649
|
-
|
32650
|
-
|
32651
|
-
|
32610
|
+
{
|
32611
|
+
tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
|
32612
|
+
output_index: 0,
|
32613
|
+
tx_pointer_block_height: 0,
|
32614
|
+
tx_pointer_tx_idx: 0,
|
32615
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32616
|
+
amount: 18446744073709552e3,
|
32617
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32652
32618
|
},
|
32653
|
-
|
32654
|
-
|
32655
|
-
|
32656
|
-
|
32657
|
-
|
32619
|
+
{
|
32620
|
+
tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
|
32621
|
+
output_index: 0,
|
32622
|
+
tx_pointer_block_height: 0,
|
32623
|
+
tx_pointer_tx_idx: 0,
|
32624
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32625
|
+
amount: 18446744073709552e3,
|
32626
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32658
32627
|
},
|
32659
|
-
|
32660
|
-
|
32661
|
-
|
32662
|
-
|
32663
|
-
|
32628
|
+
{
|
32629
|
+
tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
|
32630
|
+
output_index: 0,
|
32631
|
+
tx_pointer_block_height: 0,
|
32632
|
+
tx_pointer_tx_idx: 0,
|
32633
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32634
|
+
amount: 18446744073709552e3,
|
32635
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32664
32636
|
},
|
32665
|
-
|
32666
|
-
|
32667
|
-
|
32668
|
-
|
32669
|
-
|
32637
|
+
{
|
32638
|
+
tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
|
32639
|
+
output_index: 0,
|
32640
|
+
tx_pointer_block_height: 0,
|
32641
|
+
tx_pointer_tx_idx: 0,
|
32642
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32643
|
+
amount: 18446744073709552e3,
|
32644
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32670
32645
|
},
|
32671
|
-
|
32672
|
-
|
32673
|
-
|
32674
|
-
|
32675
|
-
|
32646
|
+
{
|
32647
|
+
tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
|
32648
|
+
output_index: 0,
|
32649
|
+
tx_pointer_block_height: 0,
|
32650
|
+
tx_pointer_tx_idx: 0,
|
32651
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32652
|
+
amount: 18446744073709552e3,
|
32653
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32676
32654
|
},
|
32677
|
-
|
32678
|
-
|
32679
|
-
|
32680
|
-
|
32681
|
-
|
32655
|
+
{
|
32656
|
+
tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
|
32657
|
+
output_index: 0,
|
32658
|
+
tx_pointer_block_height: 0,
|
32659
|
+
tx_pointer_tx_idx: 0,
|
32660
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32661
|
+
amount: 18446744073709552e3,
|
32662
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32682
32663
|
},
|
32683
|
-
|
32684
|
-
|
32685
|
-
|
32686
|
-
|
32687
|
-
|
32664
|
+
{
|
32665
|
+
tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
|
32666
|
+
output_index: 0,
|
32667
|
+
tx_pointer_block_height: 0,
|
32668
|
+
tx_pointer_tx_idx: 0,
|
32669
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32670
|
+
amount: 18446744073709552e3,
|
32671
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32688
32672
|
},
|
32689
|
-
|
32690
|
-
|
32691
|
-
|
32692
|
-
|
32693
|
-
|
32673
|
+
{
|
32674
|
+
tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
|
32675
|
+
output_index: 0,
|
32676
|
+
tx_pointer_block_height: 0,
|
32677
|
+
tx_pointer_tx_idx: 0,
|
32678
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32679
|
+
amount: 18446744073709552e3,
|
32680
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32694
32681
|
},
|
32695
|
-
|
32696
|
-
|
32697
|
-
|
32698
|
-
|
32699
|
-
|
32682
|
+
{
|
32683
|
+
tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
|
32684
|
+
output_index: 0,
|
32685
|
+
tx_pointer_block_height: 0,
|
32686
|
+
tx_pointer_tx_idx: 0,
|
32687
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32688
|
+
amount: 18446744073709552e3,
|
32689
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32700
32690
|
},
|
32701
|
-
|
32702
|
-
|
32703
|
-
|
32704
|
-
|
32705
|
-
|
32691
|
+
{
|
32692
|
+
tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
|
32693
|
+
output_index: 0,
|
32694
|
+
tx_pointer_block_height: 0,
|
32695
|
+
tx_pointer_tx_idx: 0,
|
32696
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32697
|
+
amount: 18446744073709552e3,
|
32698
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32699
|
+
},
|
32700
|
+
{
|
32701
|
+
tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
|
32702
|
+
output_index: 0,
|
32703
|
+
tx_pointer_block_height: 0,
|
32704
|
+
tx_pointer_tx_idx: 0,
|
32705
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32706
|
+
amount: 18446744073709552e3,
|
32707
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32708
|
+
},
|
32709
|
+
{
|
32710
|
+
tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
|
32711
|
+
output_index: 0,
|
32712
|
+
tx_pointer_block_height: 0,
|
32713
|
+
tx_pointer_tx_idx: 0,
|
32714
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32715
|
+
amount: 18446744073709552e3,
|
32716
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32717
|
+
},
|
32718
|
+
{
|
32719
|
+
tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
|
32720
|
+
output_index: 0,
|
32721
|
+
tx_pointer_block_height: 0,
|
32722
|
+
tx_pointer_tx_idx: 0,
|
32723
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32724
|
+
amount: 18446744073709552e3,
|
32725
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32726
|
+
},
|
32727
|
+
{
|
32728
|
+
tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
|
32729
|
+
output_index: 0,
|
32730
|
+
tx_pointer_block_height: 0,
|
32731
|
+
tx_pointer_tx_idx: 0,
|
32732
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32733
|
+
amount: 18446744073709552e3,
|
32734
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32735
|
+
},
|
32736
|
+
{
|
32737
|
+
tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
|
32738
|
+
output_index: 0,
|
32739
|
+
tx_pointer_block_height: 0,
|
32740
|
+
tx_pointer_tx_idx: 0,
|
32741
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32742
|
+
amount: 18446744073709552e3,
|
32743
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32744
|
+
},
|
32745
|
+
{
|
32746
|
+
tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
|
32747
|
+
output_index: 0,
|
32748
|
+
tx_pointer_block_height: 0,
|
32749
|
+
tx_pointer_tx_idx: 0,
|
32750
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32751
|
+
amount: 18446744073709552e3,
|
32752
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32753
|
+
},
|
32754
|
+
{
|
32755
|
+
tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
|
32756
|
+
output_index: 0,
|
32757
|
+
tx_pointer_block_height: 0,
|
32758
|
+
tx_pointer_tx_idx: 0,
|
32759
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32760
|
+
amount: 18446744073709552e3,
|
32761
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32762
|
+
},
|
32763
|
+
{
|
32764
|
+
tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
|
32765
|
+
output_index: 0,
|
32766
|
+
tx_pointer_block_height: 0,
|
32767
|
+
tx_pointer_tx_idx: 0,
|
32768
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32769
|
+
amount: 18446744073709552e3,
|
32770
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32771
|
+
},
|
32772
|
+
{
|
32773
|
+
tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
|
32774
|
+
output_index: 0,
|
32775
|
+
tx_pointer_block_height: 0,
|
32776
|
+
tx_pointer_tx_idx: 0,
|
32777
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32778
|
+
amount: 18446744073709552e3,
|
32779
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32780
|
+
},
|
32781
|
+
{
|
32782
|
+
tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
|
32783
|
+
output_index: 0,
|
32784
|
+
tx_pointer_block_height: 0,
|
32785
|
+
tx_pointer_tx_idx: 0,
|
32786
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32787
|
+
amount: 18446744073709552e3,
|
32788
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32789
|
+
},
|
32790
|
+
{
|
32791
|
+
tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
|
32792
|
+
output_index: 0,
|
32793
|
+
tx_pointer_block_height: 0,
|
32794
|
+
tx_pointer_tx_idx: 0,
|
32795
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32796
|
+
amount: 18446744073709552e3,
|
32797
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32798
|
+
},
|
32799
|
+
{
|
32800
|
+
tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
|
32801
|
+
output_index: 0,
|
32802
|
+
tx_pointer_block_height: 0,
|
32803
|
+
tx_pointer_tx_idx: 0,
|
32804
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32805
|
+
amount: 18446744073709552e3,
|
32806
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32807
|
+
},
|
32808
|
+
{
|
32809
|
+
tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
|
32810
|
+
output_index: 0,
|
32811
|
+
tx_pointer_block_height: 0,
|
32812
|
+
tx_pointer_tx_idx: 0,
|
32813
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32814
|
+
amount: 18446744073709552e3,
|
32815
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32816
|
+
},
|
32817
|
+
{
|
32818
|
+
tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
|
32819
|
+
output_index: 0,
|
32820
|
+
tx_pointer_block_height: 0,
|
32821
|
+
tx_pointer_tx_idx: 0,
|
32822
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32823
|
+
amount: 18446744073709552e3,
|
32824
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32825
|
+
},
|
32826
|
+
{
|
32827
|
+
tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
|
32828
|
+
output_index: 0,
|
32829
|
+
tx_pointer_block_height: 0,
|
32830
|
+
tx_pointer_tx_idx: 0,
|
32831
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32832
|
+
amount: 18446744073709552e3,
|
32833
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32834
|
+
},
|
32835
|
+
{
|
32836
|
+
tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
|
32837
|
+
output_index: 0,
|
32838
|
+
tx_pointer_block_height: 0,
|
32839
|
+
tx_pointer_tx_idx: 0,
|
32840
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32841
|
+
amount: 18446744073709552e3,
|
32842
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32843
|
+
},
|
32844
|
+
{
|
32845
|
+
tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
|
32846
|
+
output_index: 0,
|
32847
|
+
tx_pointer_block_height: 0,
|
32848
|
+
tx_pointer_tx_idx: 0,
|
32849
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32850
|
+
amount: 18446744073709552e3,
|
32851
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32852
|
+
},
|
32853
|
+
{
|
32854
|
+
tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
|
32855
|
+
output_index: 0,
|
32856
|
+
tx_pointer_block_height: 0,
|
32857
|
+
tx_pointer_tx_idx: 0,
|
32858
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32859
|
+
amount: 18446744073709552e3,
|
32860
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32861
|
+
},
|
32862
|
+
{
|
32863
|
+
tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
|
32864
|
+
output_index: 0,
|
32865
|
+
tx_pointer_block_height: 0,
|
32866
|
+
tx_pointer_tx_idx: 0,
|
32867
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32868
|
+
amount: 18446744073709552e3,
|
32869
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32870
|
+
},
|
32871
|
+
{
|
32872
|
+
tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
|
32873
|
+
output_index: 0,
|
32874
|
+
tx_pointer_block_height: 0,
|
32875
|
+
tx_pointer_tx_idx: 0,
|
32876
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32877
|
+
amount: 18446744073709552e3,
|
32878
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32879
|
+
},
|
32880
|
+
{
|
32881
|
+
tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
|
32882
|
+
output_index: 0,
|
32883
|
+
tx_pointer_block_height: 0,
|
32884
|
+
tx_pointer_tx_idx: 0,
|
32885
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32886
|
+
amount: 18446744073709552e3,
|
32887
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32888
|
+
},
|
32889
|
+
{
|
32890
|
+
tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
|
32891
|
+
output_index: 0,
|
32892
|
+
tx_pointer_block_height: 0,
|
32893
|
+
tx_pointer_tx_idx: 0,
|
32894
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32895
|
+
amount: 18446744073709552e3,
|
32896
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32897
|
+
},
|
32898
|
+
{
|
32899
|
+
tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
|
32900
|
+
output_index: 0,
|
32901
|
+
tx_pointer_block_height: 0,
|
32902
|
+
tx_pointer_tx_idx: 0,
|
32903
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32904
|
+
amount: 18446744073709552e3,
|
32905
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32906
|
+
},
|
32907
|
+
{
|
32908
|
+
tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
|
32909
|
+
output_index: 0,
|
32910
|
+
tx_pointer_block_height: 0,
|
32911
|
+
tx_pointer_tx_idx: 0,
|
32912
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32913
|
+
amount: 18446744073709552e3,
|
32914
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32706
32915
|
}
|
32707
|
-
|
32916
|
+
],
|
32917
|
+
messages: [
|
32918
|
+
{
|
32919
|
+
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32920
|
+
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32921
|
+
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32922
|
+
amount: 18446744073709552e3,
|
32923
|
+
data: "",
|
32924
|
+
da_height: 0
|
32925
|
+
},
|
32926
|
+
{
|
32927
|
+
sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32928
|
+
recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32929
|
+
nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
|
32930
|
+
amount: 12704439083013452e3,
|
32931
|
+
data: "",
|
32932
|
+
da_height: 0
|
32933
|
+
}
|
32934
|
+
],
|
32935
|
+
contracts: [],
|
32936
|
+
block_height: 0,
|
32937
|
+
da_block_height: 0
|
32938
|
+
};
|
32939
|
+
var defaultSnapshotConfigs = {
|
32940
|
+
chainConfigJson: chainConfig_default,
|
32941
|
+
metadataJson: metadata_default,
|
32942
|
+
stateConfigJson: stateConfig_default
|
32708
32943
|
};
|
32709
|
-
var defaultChainConfig = chainConfig_default;
|
32710
32944
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32945
|
+
function isDefined(value) {
|
32946
|
+
return value !== void 0;
|
32947
|
+
}
|
32711
32948
|
|
32712
32949
|
// ../crypto/dist/index.mjs
|
32713
32950
|
var import_crypto8 = __toESM(__require("crypto"), 1);
|
@@ -34627,7 +34864,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34627
34864
|
toEvmAddress() {
|
34628
34865
|
const b256Address = toB256(this.bech32Address);
|
34629
34866
|
return {
|
34630
|
-
|
34867
|
+
bits: clearFirst12BytesFromB256(b256Address)
|
34631
34868
|
};
|
34632
34869
|
}
|
34633
34870
|
/**
|
@@ -34637,7 +34874,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34637
34874
|
*/
|
34638
34875
|
toAssetId() {
|
34639
34876
|
return {
|
34640
|
-
|
34877
|
+
bits: this.toB256()
|
34641
34878
|
};
|
34642
34879
|
}
|
34643
34880
|
/**
|
@@ -34755,10 +34992,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34755
34992
|
}
|
34756
34993
|
};
|
34757
34994
|
|
34758
|
-
// ../address/dist/configs.mjs
|
34759
|
-
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
34760
|
-
var BaseAssetId = ZeroBytes32;
|
34761
|
-
|
34762
34995
|
// ../math/dist/index.mjs
|
34763
34996
|
var import_bn = __toESM(require_bn(), 1);
|
34764
34997
|
var DEFAULT_PRECISION = 9;
|
@@ -34978,32 +35211,182 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34978
35211
|
function toBytes3(value, bytesPadding) {
|
34979
35212
|
return bn(value).toBytes(bytesPadding);
|
34980
35213
|
}
|
34981
|
-
|
34982
|
-
|
35214
|
+
|
35215
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
35216
|
+
function _isPlaceholder(a) {
|
35217
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
35218
|
+
}
|
35219
|
+
|
35220
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
35221
|
+
function _curry1(fn) {
|
35222
|
+
return function f1(a) {
|
35223
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
35224
|
+
return f1;
|
35225
|
+
} else {
|
35226
|
+
return fn.apply(this, arguments);
|
35227
|
+
}
|
35228
|
+
};
|
35229
|
+
}
|
35230
|
+
|
35231
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
35232
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
35233
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
35234
|
+
};
|
35235
|
+
|
35236
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
35237
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
35238
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
35239
|
+
});
|
35240
|
+
var type_default = type;
|
35241
|
+
|
35242
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
35243
|
+
var pad = function pad2(n) {
|
35244
|
+
return (n < 10 ? "0" : "") + n;
|
35245
|
+
};
|
35246
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
35247
|
+
return d.toISOString();
|
35248
|
+
} : function _toISOString3(d) {
|
35249
|
+
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";
|
35250
|
+
};
|
35251
|
+
|
35252
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
35253
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
35254
|
+
return n << 0 === n;
|
35255
|
+
};
|
35256
|
+
|
35257
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
35258
|
+
function _cloneRegExp(pattern) {
|
35259
|
+
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" : ""));
|
34983
35260
|
}
|
34984
35261
|
|
35262
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
35263
|
+
function _clone(value, deep, map) {
|
35264
|
+
map || (map = new _ObjectMap());
|
35265
|
+
if (_isPrimitive(value)) {
|
35266
|
+
return value;
|
35267
|
+
}
|
35268
|
+
var copy = function copy2(copiedValue) {
|
35269
|
+
var cachedCopy = map.get(value);
|
35270
|
+
if (cachedCopy) {
|
35271
|
+
return cachedCopy;
|
35272
|
+
}
|
35273
|
+
map.set(value, copiedValue);
|
35274
|
+
for (var key in value) {
|
35275
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
35276
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
35277
|
+
}
|
35278
|
+
}
|
35279
|
+
return copiedValue;
|
35280
|
+
};
|
35281
|
+
switch (type_default(value)) {
|
35282
|
+
case "Object":
|
35283
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
35284
|
+
case "Array":
|
35285
|
+
return copy([]);
|
35286
|
+
case "Date":
|
35287
|
+
return new Date(value.valueOf());
|
35288
|
+
case "RegExp":
|
35289
|
+
return _cloneRegExp(value);
|
35290
|
+
case "Int8Array":
|
35291
|
+
case "Uint8Array":
|
35292
|
+
case "Uint8ClampedArray":
|
35293
|
+
case "Int16Array":
|
35294
|
+
case "Uint16Array":
|
35295
|
+
case "Int32Array":
|
35296
|
+
case "Uint32Array":
|
35297
|
+
case "Float32Array":
|
35298
|
+
case "Float64Array":
|
35299
|
+
case "BigInt64Array":
|
35300
|
+
case "BigUint64Array":
|
35301
|
+
return value.slice();
|
35302
|
+
default:
|
35303
|
+
return value;
|
35304
|
+
}
|
35305
|
+
}
|
35306
|
+
function _isPrimitive(param) {
|
35307
|
+
var type3 = typeof param;
|
35308
|
+
return param == null || type3 != "object" && type3 != "function";
|
35309
|
+
}
|
35310
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
35311
|
+
function _ObjectMap2() {
|
35312
|
+
this.map = {};
|
35313
|
+
this.length = 0;
|
35314
|
+
}
|
35315
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
35316
|
+
const hashedKey = this.hash(key);
|
35317
|
+
let bucket = this.map[hashedKey];
|
35318
|
+
if (!bucket) {
|
35319
|
+
this.map[hashedKey] = bucket = [];
|
35320
|
+
}
|
35321
|
+
bucket.push([key, value]);
|
35322
|
+
this.length += 1;
|
35323
|
+
};
|
35324
|
+
_ObjectMap2.prototype.hash = function(key) {
|
35325
|
+
let hashedKey = [];
|
35326
|
+
for (var value in key) {
|
35327
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
35328
|
+
}
|
35329
|
+
return hashedKey.join();
|
35330
|
+
};
|
35331
|
+
_ObjectMap2.prototype.get = function(key) {
|
35332
|
+
if (this.length <= 180) {
|
35333
|
+
for (const p in this.map) {
|
35334
|
+
const bucket2 = this.map[p];
|
35335
|
+
for (let i = 0; i < bucket2.length; i += 1) {
|
35336
|
+
const element = bucket2[i];
|
35337
|
+
if (element[0] === key) {
|
35338
|
+
return element[1];
|
35339
|
+
}
|
35340
|
+
}
|
35341
|
+
}
|
35342
|
+
return;
|
35343
|
+
}
|
35344
|
+
const hashedKey = this.hash(key);
|
35345
|
+
const bucket = this.map[hashedKey];
|
35346
|
+
if (!bucket) {
|
35347
|
+
return;
|
35348
|
+
}
|
35349
|
+
for (let i = 0; i < bucket.length; i += 1) {
|
35350
|
+
const element = bucket[i];
|
35351
|
+
if (element[0] === key) {
|
35352
|
+
return element[1];
|
35353
|
+
}
|
35354
|
+
}
|
35355
|
+
};
|
35356
|
+
return _ObjectMap2;
|
35357
|
+
}();
|
35358
|
+
|
35359
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
35360
|
+
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
35361
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
35362
|
+
});
|
35363
|
+
var clone_default = clone;
|
35364
|
+
|
35365
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
35366
|
+
var hasProtoTrim = typeof String.prototype.trim === "function";
|
35367
|
+
|
34985
35368
|
// src/providers/coin-quantity.ts
|
34986
35369
|
var coinQuantityfy = (coinQuantityLike) => {
|
34987
35370
|
let assetId;
|
34988
35371
|
let amount;
|
34989
|
-
let
|
35372
|
+
let max;
|
34990
35373
|
if (Array.isArray(coinQuantityLike)) {
|
34991
35374
|
amount = coinQuantityLike[0];
|
34992
|
-
assetId = coinQuantityLike[1]
|
34993
|
-
|
35375
|
+
assetId = coinQuantityLike[1];
|
35376
|
+
max = coinQuantityLike[2] ?? void 0;
|
34994
35377
|
} else {
|
34995
35378
|
amount = coinQuantityLike.amount;
|
34996
|
-
assetId = coinQuantityLike.assetId
|
34997
|
-
|
35379
|
+
assetId = coinQuantityLike.assetId;
|
35380
|
+
max = coinQuantityLike.max ?? void 0;
|
34998
35381
|
}
|
34999
35382
|
const bnAmount = bn(amount);
|
35000
35383
|
return {
|
35001
35384
|
assetId: hexlify(assetId),
|
35002
35385
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35003
|
-
max:
|
35386
|
+
max: max ? bn(max) : void 0
|
35004
35387
|
};
|
35005
35388
|
};
|
35006
|
-
var
|
35389
|
+
var addAmountToCoinQuantities = (params) => {
|
35007
35390
|
const { amount, assetId } = params;
|
35008
35391
|
const coinQuantities = [...params.coinQuantities];
|
35009
35392
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35070,7 +35453,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35070
35453
|
var ENCODING_V1 = "1";
|
35071
35454
|
var WORD_SIZE = 8;
|
35072
35455
|
var BYTES_32 = 32;
|
35073
|
-
var UTXO_ID_LEN = BYTES_32 +
|
35456
|
+
var UTXO_ID_LEN = BYTES_32 + 2;
|
35074
35457
|
var ASSET_ID_LEN = BYTES_32;
|
35075
35458
|
var ADDRESS_LEN = BYTES_32;
|
35076
35459
|
var NONCE_LEN = BYTES_32;
|
@@ -35078,9 +35461,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35078
35461
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35079
35462
|
var MAX_BYTES = 2 ** 32 - 1;
|
35080
35463
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35081
|
-
|
35464
|
+
ASSET_ID_LEN + // Base asset ID
|
35082
35465
|
// Asset ID/Balance coin input pairs
|
35083
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35466
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
|
35084
35467
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35085
35468
|
WORD_SIZE + // Gas limit
|
35086
35469
|
WORD_SIZE + // Script size
|
@@ -35098,7 +35481,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35098
35481
|
ASSET_ID_LEN + // Asset id
|
35099
35482
|
TX_POINTER_LEN + // TxPointer
|
35100
35483
|
WORD_SIZE + // Witnesses index
|
35101
|
-
WORD_SIZE + // Maturity
|
35102
35484
|
WORD_SIZE + // Predicate size
|
35103
35485
|
WORD_SIZE + // Predicate data size
|
35104
35486
|
WORD_SIZE;
|
@@ -35420,7 +35802,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35420
35802
|
constructor(name, coders) {
|
35421
35803
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35422
35804
|
const encodedValueSize = Object.values(coders).reduce(
|
35423
|
-
(
|
35805
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
35424
35806
|
0
|
35425
35807
|
);
|
35426
35808
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -35807,6 +36189,20 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35807
36189
|
];
|
35808
36190
|
}
|
35809
36191
|
};
|
36192
|
+
var getEncodingVersion = (encoding) => {
|
36193
|
+
switch (encoding) {
|
36194
|
+
case void 0:
|
36195
|
+
case ENCODING_V0:
|
36196
|
+
return ENCODING_V0;
|
36197
|
+
case ENCODING_V1:
|
36198
|
+
return ENCODING_V1;
|
36199
|
+
default:
|
36200
|
+
throw new FuelError(
|
36201
|
+
ErrorCode.UNSUPPORTED_ENCODING_VERSION,
|
36202
|
+
`Encoding version '${encoding}' is unsupported.`
|
36203
|
+
);
|
36204
|
+
}
|
36205
|
+
};
|
35810
36206
|
var findFunctionByName = (abi, name) => {
|
35811
36207
|
const fn = abi.functions.find((f2) => f2.name === name);
|
35812
36208
|
if (!fn) {
|
@@ -36124,7 +36520,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36124
36520
|
constructor(name, coders) {
|
36125
36521
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36126
36522
|
const encodedValueSize = Object.values(coders).reduce(
|
36127
|
-
(
|
36523
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
36128
36524
|
0
|
36129
36525
|
);
|
36130
36526
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36415,9 +36811,11 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36415
36811
|
};
|
36416
36812
|
var VecCoder2 = class extends Coder {
|
36417
36813
|
coder;
|
36814
|
+
#isOptionVec;
|
36418
36815
|
constructor(coder) {
|
36419
36816
|
super("struct", `struct Vec`, coder.encodedLength + WORD_SIZE);
|
36420
36817
|
this.coder = coder;
|
36818
|
+
this.#isOptionVec = this.coder instanceof OptionCoder2;
|
36421
36819
|
}
|
36422
36820
|
encode(value) {
|
36423
36821
|
if (!Array.isArray(value)) {
|
@@ -36428,7 +36826,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36428
36826
|
return new Uint8Array([...lengthBytes, ...concatBytes2(bytes3)]);
|
36429
36827
|
}
|
36430
36828
|
decode(data, offset) {
|
36431
|
-
if (data.length < this.encodedLength || data.length > MAX_BYTES) {
|
36829
|
+
if (!this.#isOptionVec && (data.length < this.encodedLength || data.length > MAX_BYTES)) {
|
36432
36830
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid vec data size.`);
|
36433
36831
|
}
|
36434
36832
|
const offsetAndLength = offset + WORD_SIZE;
|
@@ -36436,15 +36834,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36436
36834
|
const length = bn(new BigNumberCoder("u64").decode(lengthBytes, 0)[0]).toNumber();
|
36437
36835
|
const dataLength2 = length * this.coder.encodedLength;
|
36438
36836
|
const dataBytes = data.slice(offsetAndLength, offsetAndLength + dataLength2);
|
36439
|
-
if (dataBytes.length !== dataLength2) {
|
36837
|
+
if (!this.#isOptionVec && dataBytes.length !== dataLength2) {
|
36440
36838
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid vec byte data size.`);
|
36441
36839
|
}
|
36442
|
-
|
36443
|
-
|
36444
|
-
|
36445
|
-
)
|
36446
|
-
|
36447
|
-
|
36840
|
+
let newOffset = offsetAndLength;
|
36841
|
+
const chunks = [];
|
36842
|
+
for (let i = 0; i < length; i++) {
|
36843
|
+
const [decoded, optionOffset] = this.coder.decode(data, newOffset);
|
36844
|
+
chunks.push(decoded);
|
36845
|
+
newOffset = optionOffset;
|
36846
|
+
}
|
36847
|
+
return [chunks, newOffset];
|
36448
36848
|
}
|
36449
36849
|
};
|
36450
36850
|
var getCoder2 = (resolvedAbiType, _options) => {
|
@@ -36571,7 +36971,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36571
36971
|
this.signature = FunctionFragment.getSignature(this.jsonAbi, this.jsonFn);
|
36572
36972
|
this.selector = FunctionFragment.getFunctionSelector(this.signature);
|
36573
36973
|
this.selectorBytes = new StdStringCoder2().encode(name);
|
36574
|
-
this.encoding =
|
36974
|
+
this.encoding = getEncodingVersion(jsonAbi.encoding);
|
36575
36975
|
this.isInputDataPointer = this.#isInputDataPointer();
|
36576
36976
|
this.outputMetadata = {
|
36577
36977
|
isHeapType: this.#isOutputDataHeap(),
|
@@ -36709,8 +37109,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36709
37109
|
functions;
|
36710
37110
|
configurables;
|
36711
37111
|
jsonAbi;
|
37112
|
+
encoding;
|
36712
37113
|
constructor(jsonAbi) {
|
36713
37114
|
this.jsonAbi = jsonAbi;
|
37115
|
+
this.encoding = getEncodingVersion(jsonAbi.encoding);
|
36714
37116
|
this.functions = Object.fromEntries(
|
36715
37117
|
this.jsonAbi.functions.map((x) => [x.name, new FunctionFragment(this.jsonAbi, x.name)])
|
36716
37118
|
);
|
@@ -36754,7 +37156,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36754
37156
|
);
|
36755
37157
|
}
|
36756
37158
|
return AbiCoder.decode(this.jsonAbi, loggedType.loggedType, arrayify(data), 0, {
|
36757
|
-
encoding: this.
|
37159
|
+
encoding: this.encoding
|
36758
37160
|
});
|
36759
37161
|
}
|
36760
37162
|
encodeConfigurable(name, value) {
|
@@ -36836,18 +37238,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36836
37238
|
encode(value) {
|
36837
37239
|
const parts = [];
|
36838
37240
|
parts.push(new B256Coder().encode(value.txID));
|
36839
|
-
parts.push(new NumberCoder("
|
37241
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36840
37242
|
parts.push(new B256Coder().encode(value.owner));
|
36841
37243
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36842
37244
|
parts.push(new B256Coder().encode(value.assetId));
|
36843
37245
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
36844
|
-
parts.push(new NumberCoder("
|
36845
|
-
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37246
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36846
37247
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36847
|
-
parts.push(new
|
36848
|
-
parts.push(new
|
36849
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36850
|
-
parts.push(
|
37248
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37249
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
37250
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37251
|
+
parts.push(
|
37252
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37253
|
+
);
|
36851
37254
|
return concat(parts);
|
36852
37255
|
}
|
36853
37256
|
decode(data, offset) {
|
@@ -36855,7 +37258,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36855
37258
|
let o = offset;
|
36856
37259
|
[decoded, o] = new B256Coder().decode(data, o);
|
36857
37260
|
const txID = decoded;
|
36858
|
-
[decoded, o] = new NumberCoder("
|
37261
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36859
37262
|
const outputIndex = decoded;
|
36860
37263
|
[decoded, o] = new B256Coder().decode(data, o);
|
36861
37264
|
const owner = decoded;
|
@@ -36865,19 +37268,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36865
37268
|
const assetId = decoded;
|
36866
37269
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
36867
37270
|
const txPointer = decoded;
|
36868
|
-
[decoded, o] = new NumberCoder("
|
37271
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36869
37272
|
const witnessIndex = Number(decoded);
|
36870
|
-
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36871
|
-
const maturity = decoded;
|
36872
37273
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36873
37274
|
const predicateGasUsed = decoded;
|
36874
|
-
[decoded, o] = new
|
37275
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36875
37276
|
const predicateLength = decoded;
|
36876
|
-
[decoded, o] = new
|
37277
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36877
37278
|
const predicateDataLength = decoded;
|
36878
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37279
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
36879
37280
|
const predicate = decoded;
|
36880
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37281
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
36881
37282
|
const predicateData = decoded;
|
36882
37283
|
return [
|
36883
37284
|
{
|
@@ -36889,7 +37290,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36889
37290
|
assetId,
|
36890
37291
|
txPointer,
|
36891
37292
|
witnessIndex,
|
36892
|
-
maturity,
|
36893
37293
|
predicateGasUsed,
|
36894
37294
|
predicateLength,
|
36895
37295
|
predicateDataLength,
|
@@ -36907,7 +37307,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36907
37307
|
encode(value) {
|
36908
37308
|
const parts = [];
|
36909
37309
|
parts.push(new B256Coder().encode(value.txID));
|
36910
|
-
parts.push(new NumberCoder("
|
37310
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36911
37311
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
36912
37312
|
parts.push(new B256Coder().encode(value.stateRoot));
|
36913
37313
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -36919,7 +37319,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36919
37319
|
let o = offset;
|
36920
37320
|
[decoded, o] = new B256Coder().decode(data, o);
|
36921
37321
|
const txID = decoded;
|
36922
|
-
[decoded, o] = new NumberCoder("
|
37322
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36923
37323
|
const outputIndex = decoded;
|
36924
37324
|
[decoded, o] = new B256Coder().decode(data, o);
|
36925
37325
|
const balanceRoot = decoded;
|
@@ -36968,14 +37368,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36968
37368
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
36969
37369
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36970
37370
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
36971
|
-
parts.push(new NumberCoder("
|
37371
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36972
37372
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36973
|
-
parts.push(new
|
36974
|
-
parts.push(new
|
36975
|
-
parts.push(new
|
37373
|
+
parts.push(new BigNumberCoder("u64").encode(data.length));
|
37374
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37375
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
36976
37376
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
36977
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36978
|
-
parts.push(
|
37377
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37378
|
+
parts.push(
|
37379
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37380
|
+
);
|
36979
37381
|
return concat(parts);
|
36980
37382
|
}
|
36981
37383
|
static decodeData(messageData) {
|
@@ -36995,21 +37397,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36995
37397
|
const amount = decoded;
|
36996
37398
|
[decoded, o] = new B256Coder().decode(data, o);
|
36997
37399
|
const nonce = decoded;
|
36998
|
-
[decoded, o] = new NumberCoder("
|
37400
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36999
37401
|
const witnessIndex = Number(decoded);
|
37000
37402
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37001
37403
|
const predicateGasUsed = decoded;
|
37002
37404
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37003
37405
|
const dataLength2 = decoded;
|
37004
|
-
[decoded, o] = new
|
37406
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37005
37407
|
const predicateLength = decoded;
|
37006
|
-
[decoded, o] = new
|
37408
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37007
37409
|
const predicateDataLength = decoded;
|
37008
37410
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37009
37411
|
const messageData = decoded;
|
37010
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37412
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
37011
37413
|
const predicate = decoded;
|
37012
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37414
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
37013
37415
|
const predicateData = decoded;
|
37014
37416
|
return [
|
37015
37417
|
{
|
@@ -37321,7 +37723,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37321
37723
|
}
|
37322
37724
|
};
|
37323
37725
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37324
|
-
PolicyType2[PolicyType2["
|
37726
|
+
PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
|
37325
37727
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37326
37728
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37327
37729
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37369,9 +37771,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37369
37771
|
let o = offset;
|
37370
37772
|
const policies = [];
|
37371
37773
|
if (policyTypes & 1) {
|
37372
|
-
const [
|
37774
|
+
const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37373
37775
|
o = nextOffset;
|
37374
|
-
policies.push({ type: 1, data:
|
37776
|
+
policies.push({ type: 1, data: tip });
|
37375
37777
|
}
|
37376
37778
|
if (policyTypes & 2) {
|
37377
37779
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -37603,15 +38005,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37603
38005
|
encode(value) {
|
37604
38006
|
const parts = [];
|
37605
38007
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
37606
|
-
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37607
|
-
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
37608
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37609
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37610
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37611
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37612
38008
|
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37613
|
-
parts.push(new
|
37614
|
-
parts.push(new
|
38009
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
|
38010
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
38011
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38012
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38013
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38014
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
38015
|
+
parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
|
38016
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
|
37615
38017
|
parts.push(new PoliciesCoder().encode(value.policies));
|
37616
38018
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37617
38019
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -37623,23 +38025,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37623
38025
|
let o = offset;
|
37624
38026
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37625
38027
|
const scriptGasLimit = decoded;
|
37626
|
-
[decoded, o] = new
|
38028
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38029
|
+
const receiptsRoot = decoded;
|
38030
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37627
38031
|
const scriptLength = decoded;
|
37628
|
-
[decoded, o] = new
|
38032
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37629
38033
|
const scriptDataLength = decoded;
|
37630
38034
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37631
38035
|
const policyTypes = decoded;
|
37632
|
-
[decoded, o] = new NumberCoder("
|
38036
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37633
38037
|
const inputsCount = decoded;
|
37634
|
-
[decoded, o] = new NumberCoder("
|
38038
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37635
38039
|
const outputsCount = decoded;
|
37636
|
-
[decoded, o] = new NumberCoder("
|
38040
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37637
38041
|
const witnessesCount = decoded;
|
37638
|
-
[decoded, o] = new
|
37639
|
-
const receiptsRoot = decoded;
|
37640
|
-
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38042
|
+
[decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
|
37641
38043
|
const script = decoded;
|
37642
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38044
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
|
37643
38045
|
const scriptData = decoded;
|
37644
38046
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37645
38047
|
const policies = decoded;
|
@@ -37677,18 +38079,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37677
38079
|
}
|
37678
38080
|
encode(value) {
|
37679
38081
|
const parts = [];
|
37680
|
-
parts.push(new NumberCoder("
|
37681
|
-
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
37682
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37683
|
-
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37684
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37685
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37686
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
38082
|
+
parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
|
37687
38083
|
parts.push(new B256Coder().encode(value.salt));
|
37688
|
-
parts.push(new
|
38084
|
+
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
38085
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38086
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38087
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38088
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
37689
38089
|
parts.push(
|
37690
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(
|
38090
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
|
38091
|
+
value.storageSlots
|
38092
|
+
)
|
37691
38093
|
);
|
38094
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
37692
38095
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37693
38096
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
37694
38097
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -37697,26 +38100,27 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37697
38100
|
decode(data, offset) {
|
37698
38101
|
let decoded;
|
37699
38102
|
let o = offset;
|
37700
|
-
[decoded, o] = new NumberCoder("
|
37701
|
-
const bytecodeLength = decoded;
|
37702
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38103
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37703
38104
|
const bytecodeWitnessIndex = decoded;
|
38105
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38106
|
+
const salt = decoded;
|
38107
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38108
|
+
const storageSlotsCount = decoded;
|
37704
38109
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37705
38110
|
const policyTypes = decoded;
|
37706
38111
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37707
|
-
const storageSlotsCount = decoded;
|
37708
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37709
38112
|
const inputsCount = decoded;
|
37710
|
-
[decoded, o] = new NumberCoder("
|
38113
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37711
38114
|
const outputsCount = decoded;
|
37712
|
-
[decoded, o] = new NumberCoder("
|
38115
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37713
38116
|
const witnessesCount = decoded;
|
37714
|
-
[decoded, o] = new
|
37715
|
-
|
38117
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
|
38118
|
+
data,
|
38119
|
+
o
|
38120
|
+
);
|
38121
|
+
const storageSlots = decoded;
|
37716
38122
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37717
38123
|
const policies = decoded;
|
37718
|
-
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37719
|
-
const storageSlots = decoded;
|
37720
38124
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
37721
38125
|
const inputs = decoded;
|
37722
38126
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -37726,7 +38130,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37726
38130
|
return [
|
37727
38131
|
{
|
37728
38132
|
type: 1,
|
37729
|
-
bytecodeLength,
|
37730
38133
|
bytecodeWitnessIndex,
|
37731
38134
|
policyTypes,
|
37732
38135
|
storageSlotsCount,
|
@@ -37755,6 +38158,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37755
38158
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
37756
38159
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
37757
38160
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38161
|
+
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
37758
38162
|
return concat(parts);
|
37759
38163
|
}
|
37760
38164
|
decode(data, offset) {
|
@@ -37770,6 +38174,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37770
38174
|
const mintAmount = decoded;
|
37771
38175
|
[decoded, o] = new B256Coder().decode(data, o);
|
37772
38176
|
const mintAssetId = decoded;
|
38177
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38178
|
+
const gasPrice = decoded;
|
37773
38179
|
return [
|
37774
38180
|
{
|
37775
38181
|
type: 2,
|
@@ -37777,7 +38183,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37777
38183
|
inputContract,
|
37778
38184
|
outputContract,
|
37779
38185
|
mintAmount,
|
37780
|
-
mintAssetId
|
38186
|
+
mintAssetId,
|
38187
|
+
gasPrice
|
37781
38188
|
},
|
37782
38189
|
o
|
37783
38190
|
];
|
@@ -38084,159 +38491,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38084
38491
|
// src/providers/provider.ts
|
38085
38492
|
var import_graphql_request = __toESM(require_dist2());
|
38086
38493
|
|
38087
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38088
|
-
function _isPlaceholder(a) {
|
38089
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38090
|
-
}
|
38091
|
-
|
38092
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38093
|
-
function _curry1(fn) {
|
38094
|
-
return function f1(a) {
|
38095
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38096
|
-
return f1;
|
38097
|
-
} else {
|
38098
|
-
return fn.apply(this, arguments);
|
38099
|
-
}
|
38100
|
-
};
|
38101
|
-
}
|
38102
|
-
|
38103
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38104
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
38105
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38106
|
-
};
|
38107
|
-
|
38108
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38109
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38110
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38111
|
-
});
|
38112
|
-
var type_default = type;
|
38113
|
-
|
38114
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38115
|
-
var pad = function pad2(n) {
|
38116
|
-
return (n < 10 ? "0" : "") + n;
|
38117
|
-
};
|
38118
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38119
|
-
return d.toISOString();
|
38120
|
-
} : function _toISOString3(d) {
|
38121
|
-
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";
|
38122
|
-
};
|
38123
|
-
|
38124
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38125
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38126
|
-
return n << 0 === n;
|
38127
|
-
};
|
38128
|
-
|
38129
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38130
|
-
function _cloneRegExp(pattern) {
|
38131
|
-
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" : ""));
|
38132
|
-
}
|
38133
|
-
|
38134
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38135
|
-
function _clone(value, deep, map) {
|
38136
|
-
map || (map = new _ObjectMap());
|
38137
|
-
if (_isPrimitive(value)) {
|
38138
|
-
return value;
|
38139
|
-
}
|
38140
|
-
var copy = function copy2(copiedValue) {
|
38141
|
-
var cachedCopy = map.get(value);
|
38142
|
-
if (cachedCopy) {
|
38143
|
-
return cachedCopy;
|
38144
|
-
}
|
38145
|
-
map.set(value, copiedValue);
|
38146
|
-
for (var key in value) {
|
38147
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38148
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38149
|
-
}
|
38150
|
-
}
|
38151
|
-
return copiedValue;
|
38152
|
-
};
|
38153
|
-
switch (type_default(value)) {
|
38154
|
-
case "Object":
|
38155
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
38156
|
-
case "Array":
|
38157
|
-
return copy([]);
|
38158
|
-
case "Date":
|
38159
|
-
return new Date(value.valueOf());
|
38160
|
-
case "RegExp":
|
38161
|
-
return _cloneRegExp(value);
|
38162
|
-
case "Int8Array":
|
38163
|
-
case "Uint8Array":
|
38164
|
-
case "Uint8ClampedArray":
|
38165
|
-
case "Int16Array":
|
38166
|
-
case "Uint16Array":
|
38167
|
-
case "Int32Array":
|
38168
|
-
case "Uint32Array":
|
38169
|
-
case "Float32Array":
|
38170
|
-
case "Float64Array":
|
38171
|
-
case "BigInt64Array":
|
38172
|
-
case "BigUint64Array":
|
38173
|
-
return value.slice();
|
38174
|
-
default:
|
38175
|
-
return value;
|
38176
|
-
}
|
38177
|
-
}
|
38178
|
-
function _isPrimitive(param) {
|
38179
|
-
var type3 = typeof param;
|
38180
|
-
return param == null || type3 != "object" && type3 != "function";
|
38181
|
-
}
|
38182
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
38183
|
-
function _ObjectMap2() {
|
38184
|
-
this.map = {};
|
38185
|
-
this.length = 0;
|
38186
|
-
}
|
38187
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
38188
|
-
const hashedKey = this.hash(key);
|
38189
|
-
let bucket = this.map[hashedKey];
|
38190
|
-
if (!bucket) {
|
38191
|
-
this.map[hashedKey] = bucket = [];
|
38192
|
-
}
|
38193
|
-
bucket.push([key, value]);
|
38194
|
-
this.length += 1;
|
38195
|
-
};
|
38196
|
-
_ObjectMap2.prototype.hash = function(key) {
|
38197
|
-
let hashedKey = [];
|
38198
|
-
for (var value in key) {
|
38199
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38200
|
-
}
|
38201
|
-
return hashedKey.join();
|
38202
|
-
};
|
38203
|
-
_ObjectMap2.prototype.get = function(key) {
|
38204
|
-
if (this.length <= 180) {
|
38205
|
-
for (const p in this.map) {
|
38206
|
-
const bucket2 = this.map[p];
|
38207
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
38208
|
-
const element = bucket2[i];
|
38209
|
-
if (element[0] === key) {
|
38210
|
-
return element[1];
|
38211
|
-
}
|
38212
|
-
}
|
38213
|
-
}
|
38214
|
-
return;
|
38215
|
-
}
|
38216
|
-
const hashedKey = this.hash(key);
|
38217
|
-
const bucket = this.map[hashedKey];
|
38218
|
-
if (!bucket) {
|
38219
|
-
return;
|
38220
|
-
}
|
38221
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
38222
|
-
const element = bucket[i];
|
38223
|
-
if (element[0] === key) {
|
38224
|
-
return element[1];
|
38225
|
-
}
|
38226
|
-
}
|
38227
|
-
};
|
38228
|
-
return _ObjectMap2;
|
38229
|
-
}();
|
38230
|
-
|
38231
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38232
|
-
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38233
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38234
|
-
});
|
38235
|
-
var clone_default = clone2;
|
38236
|
-
|
38237
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38238
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38239
|
-
|
38240
38494
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38241
38495
|
var __assign = function() {
|
38242
38496
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41402,16 +41656,20 @@ spurious results.`);
|
|
41402
41656
|
var lib_default2 = gql;
|
41403
41657
|
|
41404
41658
|
// src/providers/__generated__/operations.ts
|
41659
|
+
var TransactionStatusSubscriptionFragmentFragmentDoc = lib_default2`
|
41660
|
+
fragment transactionStatusSubscriptionFragment on TransactionStatus {
|
41661
|
+
type: __typename
|
41662
|
+
... on SqueezedOutStatus {
|
41663
|
+
reason
|
41664
|
+
}
|
41665
|
+
}
|
41666
|
+
`;
|
41405
41667
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41406
41668
|
fragment receiptFragment on Receipt {
|
41407
|
-
|
41408
|
-
id
|
41409
|
-
}
|
41669
|
+
id
|
41410
41670
|
pc
|
41411
41671
|
is
|
41412
|
-
to
|
41413
|
-
id
|
41414
|
-
}
|
41672
|
+
to
|
41415
41673
|
toAddress
|
41416
41674
|
amount
|
41417
41675
|
assetId
|
@@ -41449,10 +41707,16 @@ spurious results.`);
|
|
41449
41707
|
id
|
41450
41708
|
}
|
41451
41709
|
time
|
41710
|
+
receipts {
|
41711
|
+
...receiptFragment
|
41712
|
+
}
|
41452
41713
|
programState {
|
41453
41714
|
returnType
|
41454
41715
|
data
|
41455
41716
|
}
|
41717
|
+
receipts {
|
41718
|
+
...receiptFragment
|
41719
|
+
}
|
41456
41720
|
}
|
41457
41721
|
... on FailureStatus {
|
41458
41722
|
block {
|
@@ -41460,26 +41724,24 @@ spurious results.`);
|
|
41460
41724
|
}
|
41461
41725
|
time
|
41462
41726
|
reason
|
41727
|
+
receipts {
|
41728
|
+
...receiptFragment
|
41729
|
+
}
|
41463
41730
|
}
|
41464
41731
|
... on SqueezedOutStatus {
|
41465
41732
|
reason
|
41466
41733
|
}
|
41467
41734
|
}
|
41468
|
-
`;
|
41735
|
+
${ReceiptFragmentFragmentDoc}`;
|
41469
41736
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41470
41737
|
fragment transactionFragment on Transaction {
|
41471
41738
|
id
|
41472
41739
|
rawPayload
|
41473
|
-
gasPrice
|
41474
|
-
receipts {
|
41475
|
-
...receiptFragment
|
41476
|
-
}
|
41477
41740
|
status {
|
41478
41741
|
...transactionStatusFragment
|
41479
41742
|
}
|
41480
41743
|
}
|
41481
|
-
${
|
41482
|
-
${TransactionStatusFragmentFragmentDoc}`;
|
41744
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41483
41745
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41484
41746
|
fragment inputEstimatePredicatesFragment on Input {
|
41485
41747
|
... on InputCoin {
|
@@ -41497,6 +41759,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41497
41759
|
}
|
41498
41760
|
}
|
41499
41761
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41762
|
+
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41763
|
+
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41764
|
+
reason
|
41765
|
+
programState {
|
41766
|
+
returnType
|
41767
|
+
data
|
41768
|
+
}
|
41769
|
+
}
|
41770
|
+
`;
|
41771
|
+
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41772
|
+
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41773
|
+
programState {
|
41774
|
+
returnType
|
41775
|
+
data
|
41776
|
+
}
|
41777
|
+
}
|
41778
|
+
`;
|
41779
|
+
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41780
|
+
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41781
|
+
... on DryRunFailureStatus {
|
41782
|
+
...dryRunFailureStatusFragment
|
41783
|
+
}
|
41784
|
+
... on DryRunSuccessStatus {
|
41785
|
+
...dryRunSuccessStatusFragment
|
41786
|
+
}
|
41787
|
+
}
|
41788
|
+
${DryRunFailureStatusFragmentFragmentDoc}
|
41789
|
+
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41790
|
+
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41791
|
+
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41792
|
+
id
|
41793
|
+
status {
|
41794
|
+
...dryRunTransactionStatusFragment
|
41795
|
+
}
|
41796
|
+
receipts {
|
41797
|
+
...receiptFragment
|
41798
|
+
}
|
41799
|
+
}
|
41800
|
+
${DryRunTransactionStatusFragmentFragmentDoc}
|
41801
|
+
${ReceiptFragmentFragmentDoc}`;
|
41500
41802
|
var CoinFragmentFragmentDoc = lib_default2`
|
41501
41803
|
fragment coinFragment on Coin {
|
41502
41804
|
__typename
|
@@ -41504,7 +41806,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41504
41806
|
owner
|
41505
41807
|
amount
|
41506
41808
|
assetId
|
41507
|
-
maturity
|
41508
41809
|
blockCreated
|
41509
41810
|
txCreatedIdx
|
41510
41811
|
}
|
@@ -41543,26 +41844,32 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41543
41844
|
messageBlockHeader {
|
41544
41845
|
id
|
41545
41846
|
daHeight
|
41847
|
+
consensusParametersVersion
|
41848
|
+
stateTransitionBytecodeVersion
|
41546
41849
|
transactionsCount
|
41850
|
+
messageReceiptCount
|
41547
41851
|
transactionsRoot
|
41852
|
+
messageOutboxRoot
|
41853
|
+
eventInboxRoot
|
41548
41854
|
height
|
41549
41855
|
prevRoot
|
41550
41856
|
time
|
41551
41857
|
applicationHash
|
41552
|
-
messageReceiptRoot
|
41553
|
-
messageReceiptCount
|
41554
41858
|
}
|
41555
41859
|
commitBlockHeader {
|
41556
41860
|
id
|
41557
41861
|
daHeight
|
41862
|
+
consensusParametersVersion
|
41863
|
+
stateTransitionBytecodeVersion
|
41558
41864
|
transactionsCount
|
41865
|
+
messageReceiptCount
|
41559
41866
|
transactionsRoot
|
41867
|
+
messageOutboxRoot
|
41868
|
+
eventInboxRoot
|
41560
41869
|
height
|
41561
41870
|
prevRoot
|
41562
41871
|
time
|
41563
41872
|
applicationHash
|
41564
|
-
messageReceiptRoot
|
41565
|
-
messageReceiptCount
|
41566
41873
|
}
|
41567
41874
|
sender
|
41568
41875
|
recipient
|
@@ -41581,8 +41888,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41581
41888
|
var BlockFragmentFragmentDoc = lib_default2`
|
41582
41889
|
fragment blockFragment on Block {
|
41583
41890
|
id
|
41891
|
+
height
|
41584
41892
|
header {
|
41585
|
-
height
|
41586
41893
|
time
|
41587
41894
|
}
|
41588
41895
|
transactions {
|
@@ -41592,6 +41899,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41592
41899
|
`;
|
41593
41900
|
var TxParametersFragmentFragmentDoc = lib_default2`
|
41594
41901
|
fragment TxParametersFragment on TxParameters {
|
41902
|
+
version
|
41595
41903
|
maxInputs
|
41596
41904
|
maxOutputs
|
41597
41905
|
maxWitnesses
|
@@ -41601,6 +41909,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41601
41909
|
`;
|
41602
41910
|
var PredicateParametersFragmentFragmentDoc = lib_default2`
|
41603
41911
|
fragment PredicateParametersFragment on PredicateParameters {
|
41912
|
+
version
|
41604
41913
|
maxPredicateLength
|
41605
41914
|
maxPredicateDataLength
|
41606
41915
|
maxGasPerPredicate
|
@@ -41609,18 +41918,21 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41609
41918
|
`;
|
41610
41919
|
var ScriptParametersFragmentFragmentDoc = lib_default2`
|
41611
41920
|
fragment ScriptParametersFragment on ScriptParameters {
|
41921
|
+
version
|
41612
41922
|
maxScriptLength
|
41613
41923
|
maxScriptDataLength
|
41614
41924
|
}
|
41615
41925
|
`;
|
41616
41926
|
var ContractParametersFragmentFragmentDoc = lib_default2`
|
41617
41927
|
fragment ContractParametersFragment on ContractParameters {
|
41928
|
+
version
|
41618
41929
|
contractMaxSize
|
41619
41930
|
maxStorageSlots
|
41620
41931
|
}
|
41621
41932
|
`;
|
41622
41933
|
var FeeParametersFragmentFragmentDoc = lib_default2`
|
41623
41934
|
fragment FeeParametersFragment on FeeParameters {
|
41935
|
+
version
|
41624
41936
|
gasPriceFactor
|
41625
41937
|
gasPerByte
|
41626
41938
|
}
|
@@ -41640,6 +41952,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41640
41952
|
`;
|
41641
41953
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41642
41954
|
fragment GasCostsFragment on GasCosts {
|
41955
|
+
version
|
41643
41956
|
add
|
41644
41957
|
addi
|
41645
41958
|
aloc
|
@@ -41652,7 +41965,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41652
41965
|
cb
|
41653
41966
|
cfei
|
41654
41967
|
cfsi
|
41655
|
-
croo
|
41656
41968
|
div
|
41657
41969
|
divi
|
41658
41970
|
ecr1
|
@@ -41735,6 +42047,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41735
42047
|
ccp {
|
41736
42048
|
...DependentCostFragment
|
41737
42049
|
}
|
42050
|
+
croo {
|
42051
|
+
...DependentCostFragment
|
42052
|
+
}
|
41738
42053
|
csiz {
|
41739
42054
|
...DependentCostFragment
|
41740
42055
|
}
|
@@ -41794,6 +42109,7 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41794
42109
|
${DependentCostFragmentFragmentDoc}`;
|
41795
42110
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
41796
42111
|
fragment consensusParametersFragment on ConsensusParameters {
|
42112
|
+
version
|
41797
42113
|
txParams {
|
41798
42114
|
...TxParametersFragment
|
41799
42115
|
}
|
@@ -41853,18 +42169,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41853
42169
|
fragment nodeInfoFragment on NodeInfo {
|
41854
42170
|
utxoValidation
|
41855
42171
|
vmBacktrace
|
41856
|
-
minGasPrice
|
41857
42172
|
maxTx
|
41858
42173
|
maxDepth
|
41859
42174
|
nodeVersion
|
41860
|
-
peers {
|
41861
|
-
id
|
41862
|
-
addresses
|
41863
|
-
clientVersion
|
41864
|
-
blockHeight
|
41865
|
-
lastHeartbeatMs
|
41866
|
-
appScore
|
41867
|
-
}
|
41868
42175
|
}
|
41869
42176
|
`;
|
41870
42177
|
var GetVersionDocument = lib_default2`
|
@@ -41899,13 +42206,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41899
42206
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
41900
42207
|
transaction(id: $transactionId) {
|
41901
42208
|
...transactionFragment
|
41902
|
-
receipts {
|
41903
|
-
...receiptFragment
|
41904
|
-
}
|
41905
42209
|
}
|
41906
42210
|
}
|
41907
|
-
${TransactionFragmentFragmentDoc}
|
41908
|
-
${ReceiptFragmentFragmentDoc}`;
|
42211
|
+
${TransactionFragmentFragmentDoc}`;
|
41909
42212
|
var GetTransactionsDocument = lib_default2`
|
41910
42213
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
41911
42214
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42033,6 +42336,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42033
42336
|
}
|
42034
42337
|
}
|
42035
42338
|
${BalanceFragmentFragmentDoc}`;
|
42339
|
+
var GetLatestGasPriceDocument = lib_default2`
|
42340
|
+
query getLatestGasPrice {
|
42341
|
+
latestGasPrice {
|
42342
|
+
gasPrice
|
42343
|
+
}
|
42344
|
+
}
|
42345
|
+
`;
|
42346
|
+
var EstimateGasPriceDocument = lib_default2`
|
42347
|
+
query estimateGasPrice($blockHorizon: U32!) {
|
42348
|
+
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42349
|
+
gasPrice
|
42350
|
+
}
|
42351
|
+
}
|
42352
|
+
`;
|
42036
42353
|
var GetBalancesDocument = lib_default2`
|
42037
42354
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42038
42355
|
balances(
|
@@ -42087,12 +42404,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42087
42404
|
}
|
42088
42405
|
`;
|
42089
42406
|
var DryRunDocument = lib_default2`
|
42090
|
-
mutation dryRun($
|
42091
|
-
dryRun(
|
42092
|
-
...
|
42407
|
+
mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
|
42408
|
+
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
|
42409
|
+
...dryRunTransactionExecutionStatusFragment
|
42093
42410
|
}
|
42094
42411
|
}
|
42095
|
-
${
|
42412
|
+
${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
|
42096
42413
|
var SubmitDocument = lib_default2`
|
42097
42414
|
mutation submit($encodedTransaction: HexString!) {
|
42098
42415
|
submit(tx: $encodedTransaction) {
|
@@ -42111,17 +42428,17 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42111
42428
|
var SubmitAndAwaitDocument = lib_default2`
|
42112
42429
|
subscription submitAndAwait($encodedTransaction: HexString!) {
|
42113
42430
|
submitAndAwait(tx: $encodedTransaction) {
|
42114
|
-
...
|
42431
|
+
...transactionStatusSubscriptionFragment
|
42115
42432
|
}
|
42116
42433
|
}
|
42117
|
-
${
|
42434
|
+
${TransactionStatusSubscriptionFragmentFragmentDoc}`;
|
42118
42435
|
var StatusChangeDocument = lib_default2`
|
42119
42436
|
subscription statusChange($transactionId: TransactionId!) {
|
42120
42437
|
statusChange(id: $transactionId) {
|
42121
|
-
...
|
42438
|
+
...transactionStatusSubscriptionFragment
|
42122
42439
|
}
|
42123
42440
|
}
|
42124
|
-
${
|
42441
|
+
${TransactionStatusSubscriptionFragmentFragmentDoc}`;
|
42125
42442
|
function getSdk(requester) {
|
42126
42443
|
return {
|
42127
42444
|
getVersion(variables, options) {
|
@@ -42175,6 +42492,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42175
42492
|
getBalance(variables, options) {
|
42176
42493
|
return requester(GetBalanceDocument, variables, options);
|
42177
42494
|
},
|
42495
|
+
getLatestGasPrice(variables, options) {
|
42496
|
+
return requester(GetLatestGasPriceDocument, variables, options);
|
42497
|
+
},
|
42498
|
+
estimateGasPrice(variables, options) {
|
42499
|
+
return requester(EstimateGasPriceDocument, variables, options);
|
42500
|
+
},
|
42178
42501
|
getBalances(variables, options) {
|
42179
42502
|
return requester(GetBalancesDocument, variables, options);
|
42180
42503
|
},
|
@@ -42339,6 +42662,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42339
42662
|
}
|
42340
42663
|
};
|
42341
42664
|
|
42665
|
+
// ../address/dist/configs.mjs
|
42666
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42667
|
+
|
42342
42668
|
// src/providers/transaction-request/input.ts
|
42343
42669
|
var inputify = (value) => {
|
42344
42670
|
const { type: type3 } = value;
|
@@ -42358,10 +42684,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42358
42684
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42359
42685
|
},
|
42360
42686
|
witnessIndex: value.witnessIndex,
|
42361
|
-
maturity: value.maturity ?? 0,
|
42362
42687
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42363
|
-
predicateLength: predicate.length,
|
42364
|
-
predicateDataLength: predicateData.length,
|
42688
|
+
predicateLength: bn(predicate.length),
|
42689
|
+
predicateDataLength: bn(predicateData.length),
|
42365
42690
|
predicate: hexlify(predicate),
|
42366
42691
|
predicateData: hexlify(predicateData)
|
42367
42692
|
};
|
@@ -42392,8 +42717,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42392
42717
|
nonce: hexlify(value.nonce),
|
42393
42718
|
witnessIndex: value.witnessIndex,
|
42394
42719
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42395
|
-
predicateLength: predicate.length,
|
42396
|
-
predicateDataLength: predicateData.length,
|
42720
|
+
predicateLength: bn(predicate.length),
|
42721
|
+
predicateDataLength: bn(predicateData.length),
|
42397
42722
|
predicate: hexlify(predicate),
|
42398
42723
|
predicateData: hexlify(predicateData),
|
42399
42724
|
data: hexlify(data),
|
@@ -42550,8 +42875,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42550
42875
|
case "CALL" /* Call */: {
|
42551
42876
|
const callReceipt = {
|
42552
42877
|
type: ReceiptType.Call,
|
42553
|
-
from: hexOrZero(receipt.
|
42554
|
-
to: hexOrZero(receipt?.to
|
42878
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42879
|
+
to: hexOrZero(receipt?.to),
|
42555
42880
|
amount: bn(receipt.amount),
|
42556
42881
|
assetId: hexOrZero(receipt.assetId),
|
42557
42882
|
gas: bn(receipt.gas),
|
@@ -42565,7 +42890,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42565
42890
|
case "RETURN" /* Return */: {
|
42566
42891
|
const returnReceipt = {
|
42567
42892
|
type: ReceiptType.Return,
|
42568
|
-
id: hexOrZero(receipt.
|
42893
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42569
42894
|
val: bn(receipt.val),
|
42570
42895
|
pc: bn(receipt.pc),
|
42571
42896
|
is: bn(receipt.is)
|
@@ -42575,7 +42900,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42575
42900
|
case "RETURN_DATA" /* ReturnData */: {
|
42576
42901
|
const returnDataReceipt = {
|
42577
42902
|
type: ReceiptType.ReturnData,
|
42578
|
-
id: hexOrZero(receipt.
|
42903
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42579
42904
|
ptr: bn(receipt.ptr),
|
42580
42905
|
len: bn(receipt.len),
|
42581
42906
|
digest: hexOrZero(receipt.digest),
|
@@ -42587,7 +42912,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42587
42912
|
case "PANIC" /* Panic */: {
|
42588
42913
|
const panicReceipt = {
|
42589
42914
|
type: ReceiptType.Panic,
|
42590
|
-
id: hexOrZero(receipt.
|
42915
|
+
id: hexOrZero(receipt.id),
|
42591
42916
|
reason: bn(receipt.reason),
|
42592
42917
|
pc: bn(receipt.pc),
|
42593
42918
|
is: bn(receipt.is),
|
@@ -42598,7 +42923,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42598
42923
|
case "REVERT" /* Revert */: {
|
42599
42924
|
const revertReceipt = {
|
42600
42925
|
type: ReceiptType.Revert,
|
42601
|
-
id: hexOrZero(receipt.
|
42926
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42602
42927
|
val: bn(receipt.ra),
|
42603
42928
|
pc: bn(receipt.pc),
|
42604
42929
|
is: bn(receipt.is)
|
@@ -42608,7 +42933,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42608
42933
|
case "LOG" /* Log */: {
|
42609
42934
|
const logReceipt = {
|
42610
42935
|
type: ReceiptType.Log,
|
42611
|
-
id: hexOrZero(receipt.
|
42936
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42612
42937
|
val0: bn(receipt.ra),
|
42613
42938
|
val1: bn(receipt.rb),
|
42614
42939
|
val2: bn(receipt.rc),
|
@@ -42621,7 +42946,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42621
42946
|
case "LOG_DATA" /* LogData */: {
|
42622
42947
|
const logDataReceipt = {
|
42623
42948
|
type: ReceiptType.LogData,
|
42624
|
-
id: hexOrZero(receipt.
|
42949
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42625
42950
|
val0: bn(receipt.ra),
|
42626
42951
|
val1: bn(receipt.rb),
|
42627
42952
|
ptr: bn(receipt.ptr),
|
@@ -42635,8 +42960,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42635
42960
|
case "TRANSFER" /* Transfer */: {
|
42636
42961
|
const transferReceipt = {
|
42637
42962
|
type: ReceiptType.Transfer,
|
42638
|
-
from: hexOrZero(receipt.
|
42639
|
-
to: hexOrZero(receipt.toAddress || receipt?.to
|
42963
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42964
|
+
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42640
42965
|
amount: bn(receipt.amount),
|
42641
42966
|
assetId: hexOrZero(receipt.assetId),
|
42642
42967
|
pc: bn(receipt.pc),
|
@@ -42647,8 +42972,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42647
42972
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42648
42973
|
const transferOutReceipt = {
|
42649
42974
|
type: ReceiptType.TransferOut,
|
42650
|
-
from: hexOrZero(receipt.
|
42651
|
-
to: hexOrZero(receipt.toAddress || receipt.to
|
42975
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42976
|
+
to: hexOrZero(receipt.toAddress || receipt.to),
|
42652
42977
|
amount: bn(receipt.amount),
|
42653
42978
|
assetId: hexOrZero(receipt.assetId),
|
42654
42979
|
pc: bn(receipt.pc),
|
@@ -42691,7 +43016,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42691
43016
|
return receiptMessageOut;
|
42692
43017
|
}
|
42693
43018
|
case "MINT" /* Mint */: {
|
42694
|
-
const contractId = hexOrZero(receipt.
|
43019
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42695
43020
|
const subId = hexOrZero(receipt.subId);
|
42696
43021
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
42697
43022
|
const mintReceipt = {
|
@@ -42706,7 +43031,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42706
43031
|
return mintReceipt;
|
42707
43032
|
}
|
42708
43033
|
case "BURN" /* Burn */: {
|
42709
|
-
const contractId = hexOrZero(receipt.
|
43034
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42710
43035
|
const subId = hexOrZero(receipt.subId);
|
42711
43036
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
42712
43037
|
const burnReceipt = {
|
@@ -42726,7 +43051,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42726
43051
|
}
|
42727
43052
|
|
42728
43053
|
// src/providers/utils/gas.ts
|
42729
|
-
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
42730
43054
|
var getGasUsedFromReceipts = (receipts) => {
|
42731
43055
|
const scriptResult = receipts.filter(
|
42732
43056
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -42747,18 +43071,28 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42747
43071
|
}
|
42748
43072
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
42749
43073
|
const witnessCache = [];
|
42750
|
-
const
|
43074
|
+
const chargeableInputs = inputs.filter((input) => {
|
43075
|
+
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43076
|
+
if (isCoinOrMessage) {
|
43077
|
+
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43078
|
+
return true;
|
43079
|
+
}
|
43080
|
+
if (!witnessCache.includes(input.witnessIndex)) {
|
43081
|
+
witnessCache.push(input.witnessIndex);
|
43082
|
+
return true;
|
43083
|
+
}
|
43084
|
+
}
|
43085
|
+
return false;
|
43086
|
+
});
|
43087
|
+
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43088
|
+
const totalGas = chargeableInputs.reduce((total, input) => {
|
42751
43089
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
42752
43090
|
return total.add(
|
42753
|
-
|
43091
|
+
vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
42754
43092
|
);
|
42755
43093
|
}
|
42756
|
-
|
42757
|
-
|
42758
|
-
return total.add(gasCosts.ecr1);
|
42759
|
-
}
|
42760
|
-
return total;
|
42761
|
-
}, bn());
|
43094
|
+
return total.add(gasCosts.ecr1);
|
43095
|
+
}, bn(0));
|
42762
43096
|
return totalGas;
|
42763
43097
|
}
|
42764
43098
|
function getMinGas(params) {
|
@@ -42770,12 +43104,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42770
43104
|
return minGas;
|
42771
43105
|
}
|
42772
43106
|
function getMaxGas(params) {
|
42773
|
-
const {
|
43107
|
+
const {
|
43108
|
+
gasPerByte,
|
43109
|
+
witnessesLength,
|
43110
|
+
witnessLimit,
|
43111
|
+
minGas,
|
43112
|
+
gasLimit = bn(0),
|
43113
|
+
maxGasPerTx
|
43114
|
+
} = params;
|
42774
43115
|
let remainingAllowedWitnessGas = bn(0);
|
42775
43116
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
42776
43117
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
42777
43118
|
}
|
42778
|
-
|
43119
|
+
const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43120
|
+
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42779
43121
|
}
|
42780
43122
|
function calculateMetadataGasForTxCreate({
|
42781
43123
|
gasCosts,
|
@@ -42797,6 +43139,10 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42797
43139
|
}) {
|
42798
43140
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
42799
43141
|
}
|
43142
|
+
var calculateGasFee = (params) => {
|
43143
|
+
const { gas, gasPrice, priceFactor, tip } = params;
|
43144
|
+
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43145
|
+
};
|
42800
43146
|
|
42801
43147
|
// src/providers/utils/json.ts
|
42802
43148
|
function normalize2(object) {
|
@@ -42926,7 +43272,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42926
43272
|
// src/providers/transaction-request/transaction-request.ts
|
42927
43273
|
var BaseTransactionRequest = class {
|
42928
43274
|
/** Gas price for transaction */
|
42929
|
-
|
43275
|
+
tip;
|
42930
43276
|
/** Block until which tx cannot be included */
|
42931
43277
|
maturity;
|
42932
43278
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -42945,7 +43291,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42945
43291
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
42946
43292
|
*/
|
42947
43293
|
constructor({
|
42948
|
-
|
43294
|
+
tip,
|
42949
43295
|
maturity,
|
42950
43296
|
maxFee,
|
42951
43297
|
witnessLimit,
|
@@ -42953,7 +43299,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42953
43299
|
outputs,
|
42954
43300
|
witnesses
|
42955
43301
|
} = {}) {
|
42956
|
-
this.
|
43302
|
+
this.tip = bn(tip);
|
42957
43303
|
this.maturity = maturity ?? 0;
|
42958
43304
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
42959
43305
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
@@ -42964,9 +43310,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42964
43310
|
static getPolicyMeta(req) {
|
42965
43311
|
let policyTypes = 0;
|
42966
43312
|
const policies = [];
|
42967
|
-
if (req.
|
42968
|
-
policyTypes += PolicyType.
|
42969
|
-
policies.push({ data: req.
|
43313
|
+
if (req.tip) {
|
43314
|
+
policyTypes += PolicyType.Tip;
|
43315
|
+
policies.push({ data: req.tip, type: PolicyType.Tip });
|
42970
43316
|
}
|
42971
43317
|
if (req.witnessLimit) {
|
42972
43318
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43150,13 +43496,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43150
43496
|
* assetId, if one it was not added yet.
|
43151
43497
|
*
|
43152
43498
|
* @param coin - Coin resource.
|
43153
|
-
* @param predicate - Predicate bytes.
|
43154
|
-
* @param predicateData - Predicate data bytes.
|
43155
43499
|
*/
|
43156
|
-
addCoinInput(coin
|
43500
|
+
addCoinInput(coin) {
|
43157
43501
|
const { assetId, owner, amount } = coin;
|
43158
43502
|
let witnessIndex;
|
43159
|
-
if (predicate) {
|
43503
|
+
if (coin.predicate) {
|
43160
43504
|
witnessIndex = 0;
|
43161
43505
|
} else {
|
43162
43506
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43171,25 +43515,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43171
43515
|
amount,
|
43172
43516
|
assetId,
|
43173
43517
|
txPointer: "0x00000000000000000000000000000000",
|
43174
|
-
witnessIndex
|
43175
|
-
predicate: predicate?.bytes
|
43518
|
+
witnessIndex
|
43176
43519
|
};
|
43177
43520
|
this.pushInput(input);
|
43178
43521
|
this.addChangeOutput(owner, assetId);
|
43179
43522
|
}
|
43180
43523
|
/**
|
43181
43524
|
* Adds a single message input to the transaction and a change output for the
|
43182
|
-
*
|
43525
|
+
* asset against the message
|
43183
43526
|
*
|
43184
43527
|
* @param message - Message resource.
|
43185
|
-
* @param predicate - Predicate bytes.
|
43186
|
-
* @param predicateData - Predicate data bytes.
|
43187
43528
|
*/
|
43188
|
-
addMessageInput(message
|
43189
|
-
const { recipient, sender, amount } = message;
|
43190
|
-
const assetId = BaseAssetId;
|
43529
|
+
addMessageInput(message) {
|
43530
|
+
const { recipient, sender, amount, assetId } = message;
|
43191
43531
|
let witnessIndex;
|
43192
|
-
if (predicate) {
|
43532
|
+
if (message.predicate) {
|
43193
43533
|
witnessIndex = 0;
|
43194
43534
|
} else {
|
43195
43535
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43203,8 +43543,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43203
43543
|
sender: sender.toB256(),
|
43204
43544
|
recipient: recipient.toB256(),
|
43205
43545
|
amount,
|
43206
|
-
witnessIndex
|
43207
|
-
predicate: predicate?.bytes
|
43546
|
+
witnessIndex
|
43208
43547
|
};
|
43209
43548
|
this.pushInput(input);
|
43210
43549
|
this.addChangeOutput(recipient, assetId);
|
@@ -43235,32 +43574,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43235
43574
|
resources.forEach((resource) => this.addResource(resource));
|
43236
43575
|
return this;
|
43237
43576
|
}
|
43238
|
-
/**
|
43239
|
-
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43240
|
-
* outputs from the related assetIds.
|
43241
|
-
*
|
43242
|
-
* @param resources - The resources to add.
|
43243
|
-
* @returns This transaction.
|
43244
|
-
*/
|
43245
|
-
addPredicateResource(resource, predicate) {
|
43246
|
-
if (isCoin(resource)) {
|
43247
|
-
this.addCoinInput(resource, predicate);
|
43248
|
-
} else {
|
43249
|
-
this.addMessageInput(resource, predicate);
|
43250
|
-
}
|
43251
|
-
return this;
|
43252
|
-
}
|
43253
|
-
/**
|
43254
|
-
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43255
|
-
* from the related assetIds.
|
43256
|
-
*
|
43257
|
-
* @param resources - The resources to add.
|
43258
|
-
* @returns This transaction.
|
43259
|
-
*/
|
43260
|
-
addPredicateResources(resources, predicate) {
|
43261
|
-
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43262
|
-
return this;
|
43263
|
-
}
|
43264
43577
|
/**
|
43265
43578
|
* Adds a coin output to the transaction.
|
43266
43579
|
*
|
@@ -43268,7 +43581,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43268
43581
|
* @param amount - Amount of coin.
|
43269
43582
|
* @param assetId - Asset ID of coin.
|
43270
43583
|
*/
|
43271
|
-
addCoinOutput(to, amount, assetId
|
43584
|
+
addCoinOutput(to, amount, assetId) {
|
43272
43585
|
this.pushOutput({
|
43273
43586
|
type: OutputType.Coin,
|
43274
43587
|
to: addressify(to).toB256(),
|
@@ -43300,7 +43613,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43300
43613
|
* @param to - Address of the owner.
|
43301
43614
|
* @param assetId - Asset ID of coin.
|
43302
43615
|
*/
|
43303
|
-
addChangeOutput(to, assetId
|
43616
|
+
addChangeOutput(to, assetId) {
|
43304
43617
|
const changeOutput = this.getChangeOutputs().find(
|
43305
43618
|
(output3) => hexlify(output3.assetId) === assetId
|
43306
43619
|
);
|
@@ -43340,7 +43653,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43340
43653
|
}
|
43341
43654
|
calculateMaxGas(chainInfo, minGas) {
|
43342
43655
|
const { consensusParameters } = chainInfo;
|
43343
|
-
const { gasPerByte } = consensusParameters;
|
43656
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43344
43657
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43345
43658
|
(acc, wit) => acc + wit.dataLength,
|
43346
43659
|
0
|
@@ -43349,7 +43662,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43349
43662
|
gasPerByte,
|
43350
43663
|
minGas,
|
43351
43664
|
witnessesLength,
|
43352
|
-
witnessLimit: this.witnessLimit
|
43665
|
+
witnessLimit: this.witnessLimit,
|
43666
|
+
maxGasPerTx
|
43353
43667
|
});
|
43354
43668
|
}
|
43355
43669
|
/**
|
@@ -43357,8 +43671,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43357
43671
|
* quantities array.
|
43358
43672
|
*
|
43359
43673
|
* @param quantities - CoinQuantity Array.
|
43674
|
+
* @param baseAssetId - The base asset to fund the transaction.
|
43360
43675
|
*/
|
43361
|
-
fundWithFakeUtxos(quantities, resourcesOwner) {
|
43676
|
+
fundWithFakeUtxos(quantities, baseAssetId, resourcesOwner) {
|
43362
43677
|
const findAssetInput = (assetId) => this.inputs.find((input) => {
|
43363
43678
|
if ("assetId" in input) {
|
43364
43679
|
return input.assetId === assetId;
|
@@ -43367,24 +43682,27 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43367
43682
|
});
|
43368
43683
|
const updateAssetInput = (assetId, quantity) => {
|
43369
43684
|
const assetInput = findAssetInput(assetId);
|
43685
|
+
let usedQuantity = quantity;
|
43686
|
+
if (assetId === baseAssetId) {
|
43687
|
+
usedQuantity = bn("1000000000000000000");
|
43688
|
+
}
|
43370
43689
|
if (assetInput && "assetId" in assetInput) {
|
43371
43690
|
assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
|
43372
|
-
assetInput.amount =
|
43691
|
+
assetInput.amount = usedQuantity;
|
43373
43692
|
} else {
|
43374
43693
|
this.addResources([
|
43375
43694
|
{
|
43376
43695
|
id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
43377
|
-
amount:
|
43696
|
+
amount: usedQuantity,
|
43378
43697
|
assetId,
|
43379
43698
|
owner: resourcesOwner || Address.fromRandom(),
|
43380
|
-
maturity: 0,
|
43381
43699
|
blockCreated: bn(1),
|
43382
43700
|
txCreatedIdx: bn(1)
|
43383
43701
|
}
|
43384
43702
|
]);
|
43385
43703
|
}
|
43386
43704
|
};
|
43387
|
-
updateAssetInput(
|
43705
|
+
updateAssetInput(baseAssetId, bn(1e11));
|
43388
43706
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43389
43707
|
}
|
43390
43708
|
/**
|
@@ -43409,7 +43727,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43409
43727
|
toJSON() {
|
43410
43728
|
return normalizeJSON(this);
|
43411
43729
|
}
|
43412
|
-
|
43730
|
+
updatePredicateGasUsed(inputs) {
|
43413
43731
|
this.inputs.forEach((i) => {
|
43414
43732
|
let correspondingInput;
|
43415
43733
|
switch (i.type) {
|
@@ -43431,6 +43749,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43431
43749
|
}
|
43432
43750
|
});
|
43433
43751
|
}
|
43752
|
+
shiftPredicateData() {
|
43753
|
+
this.inputs.forEach((input) => {
|
43754
|
+
if ("predicateData" in input && "padPredicateData" in input && typeof input.padPredicateData === "function") {
|
43755
|
+
input.predicateData = input.padPredicateData(
|
43756
|
+
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43757
|
+
);
|
43758
|
+
}
|
43759
|
+
});
|
43760
|
+
}
|
43434
43761
|
};
|
43435
43762
|
|
43436
43763
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43541,12 +43868,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43541
43868
|
*
|
43542
43869
|
* @param createTransactionRequestLike - The initial values for the instance
|
43543
43870
|
*/
|
43544
|
-
constructor({
|
43545
|
-
bytecodeWitnessIndex,
|
43546
|
-
salt,
|
43547
|
-
storageSlots,
|
43548
|
-
...rest
|
43549
|
-
} = {}) {
|
43871
|
+
constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
|
43550
43872
|
super(rest);
|
43551
43873
|
this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
|
43552
43874
|
this.salt = hexlify(salt ?? ZeroBytes32);
|
@@ -43564,9 +43886,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43564
43886
|
return {
|
43565
43887
|
type: TransactionType.Create,
|
43566
43888
|
...baseTransaction,
|
43567
|
-
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43568
43889
|
bytecodeWitnessIndex,
|
43569
|
-
storageSlotsCount: storageSlots.length,
|
43890
|
+
storageSlotsCount: bn(storageSlots.length),
|
43570
43891
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43571
43892
|
storageSlots
|
43572
43893
|
};
|
@@ -43680,8 +44001,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43680
44001
|
type: TransactionType.Script,
|
43681
44002
|
scriptGasLimit: this.gasLimit,
|
43682
44003
|
...super.getBaseTransaction(),
|
43683
|
-
scriptLength: script.length,
|
43684
|
-
scriptDataLength: scriptData.length,
|
44004
|
+
scriptLength: bn(script.length),
|
44005
|
+
scriptDataLength: bn(scriptData.length),
|
43685
44006
|
receiptsRoot: ZeroBytes32,
|
43686
44007
|
script: hexlify(script),
|
43687
44008
|
scriptData: hexlify(scriptData)
|
@@ -43745,7 +44066,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43745
44066
|
}
|
43746
44067
|
calculateMaxGas(chainInfo, minGas) {
|
43747
44068
|
const { consensusParameters } = chainInfo;
|
43748
|
-
const { gasPerByte } = consensusParameters;
|
44069
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43749
44070
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43750
44071
|
(acc, wit) => acc + wit.dataLength,
|
43751
44072
|
0
|
@@ -43755,7 +44076,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43755
44076
|
minGas,
|
43756
44077
|
witnessesLength,
|
43757
44078
|
witnessLimit: this.witnessLimit,
|
43758
|
-
gasLimit: this.gasLimit
|
44079
|
+
gasLimit: this.gasLimit,
|
44080
|
+
maxGasPerTx
|
43759
44081
|
});
|
43760
44082
|
}
|
43761
44083
|
/**
|
@@ -43828,13 +44150,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43828
44150
|
}
|
43829
44151
|
}
|
43830
44152
|
};
|
44153
|
+
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44154
|
+
(acc, input) => {
|
44155
|
+
if (input.type === InputType.Coin && input.owner === owner) {
|
44156
|
+
acc.utxos.push(input.id);
|
44157
|
+
}
|
44158
|
+
if (input.type === InputType.Message && input.recipient === owner) {
|
44159
|
+
acc.messages.push(input.nonce);
|
44160
|
+
}
|
44161
|
+
return acc;
|
44162
|
+
},
|
44163
|
+
{
|
44164
|
+
utxos: [],
|
44165
|
+
messages: []
|
44166
|
+
}
|
44167
|
+
);
|
43831
44168
|
|
43832
44169
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
43833
44170
|
var calculateTransactionFee = (params) => {
|
43834
44171
|
const {
|
43835
|
-
|
44172
|
+
gasPrice,
|
43836
44173
|
rawPayload,
|
43837
|
-
|
44174
|
+
tip,
|
44175
|
+
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43838
44176
|
} = params;
|
43839
44177
|
const gasPerByte = bn(feeParams.gasPerByte);
|
43840
44178
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -43844,8 +44182,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43844
44182
|
return {
|
43845
44183
|
fee: bn(0),
|
43846
44184
|
minFee: bn(0),
|
43847
|
-
maxFee: bn(0)
|
43848
|
-
feeFromGasUsed: bn(0)
|
44185
|
+
maxFee: bn(0)
|
43849
44186
|
};
|
43850
44187
|
}
|
43851
44188
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -43877,7 +44214,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43877
44214
|
metadataGas,
|
43878
44215
|
txBytesSize: transactionBytes.length
|
43879
44216
|
});
|
43880
|
-
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
43881
44217
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
43882
44218
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
43883
44219
|
const maxGas = getMaxGas({
|
@@ -43885,17 +44221,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43885
44221
|
minGas,
|
43886
44222
|
witnessesLength,
|
43887
44223
|
gasLimit,
|
43888
|
-
witnessLimit
|
44224
|
+
witnessLimit,
|
44225
|
+
maxGasPerTx
|
44226
|
+
});
|
44227
|
+
const minFee = calculateGasFee({
|
44228
|
+
gasPrice,
|
44229
|
+
gas: minGas,
|
44230
|
+
priceFactor: gasPriceFactor,
|
44231
|
+
tip
|
44232
|
+
});
|
44233
|
+
const maxFee = calculateGasFee({
|
44234
|
+
gasPrice,
|
44235
|
+
gas: maxGas,
|
44236
|
+
priceFactor: gasPriceFactor,
|
44237
|
+
tip
|
43889
44238
|
});
|
43890
|
-
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43891
|
-
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43892
|
-
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43893
|
-
const fee = minFee.add(feeFromGasUsed);
|
43894
44239
|
return {
|
43895
|
-
fee,
|
43896
44240
|
minFee,
|
43897
44241
|
maxFee,
|
43898
|
-
|
44242
|
+
fee: maxFee
|
43899
44243
|
};
|
43900
44244
|
};
|
43901
44245
|
|
@@ -44449,7 +44793,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44449
44793
|
gqlTransactionStatus,
|
44450
44794
|
abiMap = {},
|
44451
44795
|
maxInputs,
|
44452
|
-
gasCosts
|
44796
|
+
gasCosts,
|
44797
|
+
maxGasPerTx,
|
44798
|
+
gasPrice
|
44453
44799
|
} = params;
|
44454
44800
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44455
44801
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44463,11 +44809,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44463
44809
|
maxInputs
|
44464
44810
|
});
|
44465
44811
|
const typeName = getTransactionTypeName(transaction.type);
|
44812
|
+
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44466
44813
|
const { fee } = calculateTransactionFee({
|
44467
|
-
|
44814
|
+
gasPrice,
|
44468
44815
|
rawPayload,
|
44816
|
+
tip,
|
44469
44817
|
consensusParameters: {
|
44470
44818
|
gasCosts,
|
44819
|
+
maxGasPerTx,
|
44471
44820
|
feeParams: {
|
44472
44821
|
gasPerByte,
|
44473
44822
|
gasPriceFactor
|
@@ -44603,8 +44952,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44603
44952
|
const decodedTransaction = this.decodeTransaction(
|
44604
44953
|
transaction
|
44605
44954
|
);
|
44606
|
-
|
44607
|
-
|
44955
|
+
let txReceipts = [];
|
44956
|
+
if (transaction?.status && "receipts" in transaction.status) {
|
44957
|
+
txReceipts = transaction.status.receipts;
|
44958
|
+
}
|
44959
|
+
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44960
|
+
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44961
|
+
const gasPrice = await this.provider.getLatestGasPrice();
|
44608
44962
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44609
44963
|
const transactionSummary = assembleTransactionSummary({
|
44610
44964
|
id: this.id,
|
@@ -44616,7 +44970,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44616
44970
|
gasPriceFactor,
|
44617
44971
|
abiMap: contractsAbiMap,
|
44618
44972
|
maxInputs,
|
44619
|
-
gasCosts
|
44973
|
+
gasCosts,
|
44974
|
+
maxGasPerTx,
|
44975
|
+
gasPrice
|
44620
44976
|
});
|
44621
44977
|
return transactionSummary;
|
44622
44978
|
}
|
@@ -44722,7 +45078,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44722
45078
|
}
|
44723
45079
|
|
44724
45080
|
// src/providers/utils/merge-quantities.ts
|
44725
|
-
var mergeQuantities = (
|
45081
|
+
var mergeQuantities = (...coinQuantities) => {
|
44726
45082
|
const resultMap = {};
|
44727
45083
|
function addToMap({ amount, assetId }) {
|
44728
45084
|
if (resultMap[assetId]) {
|
@@ -44731,8 +45087,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44731
45087
|
resultMap[assetId] = amount;
|
44732
45088
|
}
|
44733
45089
|
}
|
44734
|
-
|
44735
|
-
arr2.forEach(addToMap);
|
45090
|
+
coinQuantities.forEach((arr) => arr.forEach(addToMap));
|
44736
45091
|
return Object.entries(resultMap).map(([assetId, amount]) => ({ assetId, amount }));
|
44737
45092
|
};
|
44738
45093
|
|
@@ -44760,12 +45115,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44760
45115
|
gasPerByte: bn(feeParams.gasPerByte),
|
44761
45116
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
44762
45117
|
chainId: bn(consensusParameters.chainId),
|
45118
|
+
baseAssetId: consensusParameters.baseAssetId,
|
44763
45119
|
gasCosts
|
44764
45120
|
},
|
44765
45121
|
gasCosts,
|
44766
45122
|
latestBlock: {
|
44767
45123
|
id: latestBlock.id,
|
44768
|
-
height: bn(latestBlock.
|
45124
|
+
height: bn(latestBlock.height),
|
44769
45125
|
time: latestBlock.header.time,
|
44770
45126
|
transactions: latestBlock.transactions.map((i) => ({
|
44771
45127
|
id: i.id
|
@@ -44859,10 +45215,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44859
45215
|
* Returns some helpful parameters related to gas fees.
|
44860
45216
|
*/
|
44861
45217
|
getGasConfig() {
|
44862
|
-
const { minGasPrice } = this.getNode();
|
44863
45218
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
44864
45219
|
return {
|
44865
|
-
minGasPrice,
|
44866
45220
|
maxGasPerTx,
|
44867
45221
|
maxGasPerPredicate,
|
44868
45222
|
gasPriceFactor,
|
@@ -44960,7 +45314,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44960
45314
|
*/
|
44961
45315
|
async getBlockNumber() {
|
44962
45316
|
const { chain } = await this.operations.getChain();
|
44963
|
-
return bn(chain.latestBlock.
|
45317
|
+
return bn(chain.latestBlock.height, 10);
|
44964
45318
|
}
|
44965
45319
|
/**
|
44966
45320
|
* Returns the chain information.
|
@@ -44972,11 +45326,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44972
45326
|
const processedNodeInfo = {
|
44973
45327
|
maxDepth: bn(nodeInfo.maxDepth),
|
44974
45328
|
maxTx: bn(nodeInfo.maxTx),
|
44975
|
-
minGasPrice: bn(nodeInfo.minGasPrice),
|
44976
45329
|
nodeVersion: nodeInfo.nodeVersion,
|
44977
45330
|
utxoValidation: nodeInfo.utxoValidation,
|
44978
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44979
|
-
peers: nodeInfo.peers
|
45331
|
+
vmBacktrace: nodeInfo.vmBacktrace
|
44980
45332
|
};
|
44981
45333
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
44982
45334
|
return processedNodeInfo;
|
@@ -45002,6 +45354,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45002
45354
|
} = this.getChain();
|
45003
45355
|
return chainId.toNumber();
|
45004
45356
|
}
|
45357
|
+
/**
|
45358
|
+
* Returns the base asset ID for the current provider network
|
45359
|
+
*
|
45360
|
+
* @returns the base asset ID
|
45361
|
+
*/
|
45362
|
+
getBaseAssetId() {
|
45363
|
+
const {
|
45364
|
+
consensusParameters: { baseAssetId }
|
45365
|
+
} = this.getChain();
|
45366
|
+
return baseAssetId;
|
45367
|
+
}
|
45005
45368
|
/**
|
45006
45369
|
* Submits a transaction to the chain to be executed.
|
45007
45370
|
*
|
@@ -45062,14 +45425,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45062
45425
|
return this.estimateTxDependencies(transactionRequest);
|
45063
45426
|
}
|
45064
45427
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45065
|
-
const { dryRun:
|
45066
|
-
encodedTransaction,
|
45428
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45429
|
+
encodedTransactions: encodedTransaction,
|
45067
45430
|
utxoValidation: utxoValidation || false
|
45068
45431
|
});
|
45069
|
-
const receipts =
|
45070
|
-
|
45071
|
-
|
45072
|
-
};
|
45432
|
+
const [{ receipts: rawReceipts, status }] = dryRunStatuses;
|
45433
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45434
|
+
return { receipts, dryrunStatus: status };
|
45073
45435
|
}
|
45074
45436
|
/**
|
45075
45437
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45108,9 +45470,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45108
45470
|
* If there are missing variable outputs,
|
45109
45471
|
* `addVariableOutputs` is called on the transaction.
|
45110
45472
|
*
|
45111
|
-
* @privateRemarks
|
45112
|
-
* TODO: Investigate support for missing contract IDs
|
45113
|
-
* TODO: Add support for missing output messages
|
45114
45473
|
*
|
45115
45474
|
* @param transactionRequest - The transaction request object.
|
45116
45475
|
* @returns A promise.
|
@@ -45123,16 +45482,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45123
45482
|
missingContractIds: []
|
45124
45483
|
};
|
45125
45484
|
}
|
45126
|
-
await this.estimatePredicates(transactionRequest);
|
45127
45485
|
let receipts = [];
|
45128
45486
|
const missingContractIds = [];
|
45129
45487
|
let outputVariables = 0;
|
45488
|
+
let dryrunStatus;
|
45130
45489
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45131
|
-
const {
|
45132
|
-
|
45490
|
+
const {
|
45491
|
+
dryRun: [{ receipts: rawReceipts, status }]
|
45492
|
+
} = await this.operations.dryRun({
|
45493
|
+
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45133
45494
|
utxoValidation: false
|
45134
45495
|
});
|
45135
|
-
receipts =
|
45496
|
+
receipts = rawReceipts.map(processGqlReceipt);
|
45497
|
+
dryrunStatus = status;
|
45136
45498
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45137
45499
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45138
45500
|
if (hasMissingOutputs) {
|
@@ -45142,6 +45504,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45142
45504
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45143
45505
|
missingContractIds.push(contractId);
|
45144
45506
|
});
|
45507
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45508
|
+
transactionRequest
|
45509
|
+
});
|
45510
|
+
transactionRequest.maxFee = maxFee;
|
45145
45511
|
} else {
|
45146
45512
|
break;
|
45147
45513
|
}
|
@@ -45149,37 +45515,136 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45149
45515
|
return {
|
45150
45516
|
receipts,
|
45151
45517
|
outputVariables,
|
45152
|
-
missingContractIds
|
45518
|
+
missingContractIds,
|
45519
|
+
dryrunStatus
|
45153
45520
|
};
|
45154
45521
|
}
|
45522
|
+
/**
|
45523
|
+
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45524
|
+
*
|
45525
|
+
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45526
|
+
* further modifications are identified. The method iteratively updates these transactions
|
45527
|
+
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45528
|
+
*
|
45529
|
+
* @param transactionRequests - Array of transaction request objects.
|
45530
|
+
* @returns A promise that resolves to an array of results for each transaction.
|
45531
|
+
*/
|
45532
|
+
async estimateMultipleTxDependencies(transactionRequests) {
|
45533
|
+
const results = transactionRequests.map(() => ({
|
45534
|
+
receipts: [],
|
45535
|
+
outputVariables: 0,
|
45536
|
+
missingContractIds: [],
|
45537
|
+
dryrunStatus: void 0
|
45538
|
+
}));
|
45539
|
+
const allRequests = clone_default(transactionRequests);
|
45540
|
+
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45541
|
+
allRequests.forEach((req, index) => {
|
45542
|
+
if (req.type === TransactionType.Script) {
|
45543
|
+
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45544
|
+
}
|
45545
|
+
});
|
45546
|
+
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45547
|
+
let attempt = 0;
|
45548
|
+
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45549
|
+
const encodedTransactions = transactionsToProcess.map(
|
45550
|
+
(index) => serializedTransactionsMap.get(index)
|
45551
|
+
);
|
45552
|
+
const dryRunResults = await this.operations.dryRun({
|
45553
|
+
encodedTransactions,
|
45554
|
+
utxoValidation: false
|
45555
|
+
});
|
45556
|
+
const nextRoundTransactions = [];
|
45557
|
+
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45558
|
+
const requestIdx = transactionsToProcess[i];
|
45559
|
+
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45560
|
+
const result = results[requestIdx];
|
45561
|
+
result.receipts = rawReceipts.map(processGqlReceipt);
|
45562
|
+
result.dryrunStatus = status;
|
45563
|
+
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45564
|
+
result.receipts
|
45565
|
+
);
|
45566
|
+
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45567
|
+
const request = allRequests[requestIdx];
|
45568
|
+
if (hasMissingOutputs && request?.type === TransactionType.Script) {
|
45569
|
+
result.outputVariables += missingOutputVariables.length;
|
45570
|
+
request.addVariableOutputs(missingOutputVariables.length);
|
45571
|
+
missingOutputContractIds.forEach(({ contractId }) => {
|
45572
|
+
request.addContractInputAndOutput(Address.fromString(contractId));
|
45573
|
+
result.missingContractIds.push(contractId);
|
45574
|
+
});
|
45575
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45576
|
+
transactionRequest: request
|
45577
|
+
});
|
45578
|
+
request.maxFee = maxFee;
|
45579
|
+
serializedTransactionsMap.set(requestIdx, hexlify(request.toTransactionBytes()));
|
45580
|
+
nextRoundTransactions.push(requestIdx);
|
45581
|
+
}
|
45582
|
+
}
|
45583
|
+
transactionsToProcess = nextRoundTransactions;
|
45584
|
+
attempt += 1;
|
45585
|
+
}
|
45586
|
+
return results;
|
45587
|
+
}
|
45588
|
+
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45589
|
+
if (estimateTxDependencies) {
|
45590
|
+
return this.estimateMultipleTxDependencies(transactionRequests);
|
45591
|
+
}
|
45592
|
+
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45593
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45594
|
+
encodedTransactions,
|
45595
|
+
utxoValidation: utxoValidation || false
|
45596
|
+
});
|
45597
|
+
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45598
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45599
|
+
return { receipts, dryrunStatus: status };
|
45600
|
+
});
|
45601
|
+
return results;
|
45602
|
+
}
|
45155
45603
|
/**
|
45156
45604
|
* Estimates the transaction gas and fee based on the provided transaction request.
|
45157
45605
|
* @param transactionRequest - The transaction request object.
|
45158
45606
|
* @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
|
45159
45607
|
*/
|
45160
|
-
estimateTxGasAndFee(params) {
|
45608
|
+
async estimateTxGasAndFee(params) {
|
45161
45609
|
const { transactionRequest } = params;
|
45162
|
-
|
45610
|
+
let { gasPrice } = params;
|
45163
45611
|
const chainInfo = this.getChain();
|
45164
|
-
const
|
45165
|
-
transactionRequest.gasPrice = gasPrice;
|
45612
|
+
const { gasPriceFactor, maxGasPerTx } = this.getGasConfig();
|
45166
45613
|
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45167
|
-
|
45614
|
+
if (!gasPrice) {
|
45615
|
+
gasPrice = await this.estimateGasPrice(10);
|
45616
|
+
}
|
45617
|
+
const minFee = calculateGasFee({
|
45618
|
+
gasPrice: bn(gasPrice),
|
45619
|
+
gas: minGas,
|
45620
|
+
priceFactor: gasPriceFactor,
|
45621
|
+
tip: transactionRequest.tip
|
45622
|
+
}).add(1);
|
45623
|
+
let gasLimit = bn(0);
|
45168
45624
|
if (transactionRequest.type === TransactionType.Script) {
|
45625
|
+
gasLimit = transactionRequest.gasLimit;
|
45169
45626
|
if (transactionRequest.gasLimit.eq(0)) {
|
45170
45627
|
transactionRequest.gasLimit = minGas;
|
45171
45628
|
transactionRequest.gasLimit = maxGasPerTx.sub(
|
45172
45629
|
transactionRequest.calculateMaxGas(chainInfo, minGas)
|
45173
45630
|
);
|
45631
|
+
gasLimit = transactionRequest.gasLimit;
|
45174
45632
|
}
|
45175
45633
|
}
|
45176
45634
|
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45177
|
-
const maxFee =
|
45635
|
+
const maxFee = calculateGasFee({
|
45636
|
+
gasPrice: bn(gasPrice),
|
45637
|
+
gas: maxGas,
|
45638
|
+
priceFactor: gasPriceFactor,
|
45639
|
+
tip: transactionRequest.tip
|
45640
|
+
}).add(1);
|
45178
45641
|
return {
|
45179
45642
|
minGas,
|
45180
45643
|
minFee,
|
45181
45644
|
maxGas,
|
45182
|
-
maxFee
|
45645
|
+
maxFee,
|
45646
|
+
gasPrice,
|
45647
|
+
gasLimit
|
45183
45648
|
};
|
45184
45649
|
}
|
45185
45650
|
/**
|
@@ -45197,15 +45662,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45197
45662
|
if (estimateTxDependencies) {
|
45198
45663
|
return this.estimateTxDependencies(transactionRequest);
|
45199
45664
|
}
|
45200
|
-
const
|
45201
|
-
const { dryRun:
|
45202
|
-
|
45665
|
+
const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
|
45666
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45667
|
+
encodedTransactions,
|
45203
45668
|
utxoValidation: true
|
45204
45669
|
});
|
45205
|
-
const
|
45206
|
-
|
45207
|
-
receipts
|
45208
|
-
|
45670
|
+
const callResult = dryRunStatuses.map((dryRunStatus) => {
|
45671
|
+
const { id, receipts, status } = dryRunStatus;
|
45672
|
+
const processedReceipts = receipts.map(processGqlReceipt);
|
45673
|
+
return { id, receipts: processedReceipts, status };
|
45674
|
+
});
|
45675
|
+
return { receipts: callResult[0].receipts };
|
45209
45676
|
}
|
45210
45677
|
/**
|
45211
45678
|
* Returns a transaction cost to enable user
|
@@ -45222,77 +45689,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45222
45689
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45223
45690
|
* @returns A promise that resolves to the transaction cost object.
|
45224
45691
|
*/
|
45225
|
-
async getTransactionCost(transactionRequestLike,
|
45226
|
-
estimateTxDependencies = true,
|
45227
|
-
estimatePredicates = true,
|
45228
|
-
resourcesOwner,
|
45229
|
-
signatureCallback
|
45230
|
-
} = {}) {
|
45692
|
+
async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
|
45231
45693
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45232
|
-
const { minGasPrice } = this.getGasConfig();
|
45233
|
-
const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45234
45694
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45695
|
+
const baseAssetId = this.getBaseAssetId();
|
45235
45696
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45236
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45237
|
-
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45697
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
|
45698
|
+
txRequestClone.fundWithFakeUtxos(allQuantities, baseAssetId, resourcesOwner?.address);
|
45699
|
+
txRequestClone.maxFee = bn(0);
|
45238
45700
|
if (isScriptTransaction) {
|
45239
45701
|
txRequestClone.gasLimit = bn(0);
|
45240
45702
|
}
|
45241
|
-
if (
|
45242
|
-
|
45243
|
-
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45244
|
-
}
|
45245
|
-
await this.estimatePredicates(txRequestClone);
|
45703
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45704
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45246
45705
|
}
|
45706
|
+
const signedRequest = clone_default(txRequestClone);
|
45707
|
+
let addedSignatures = 0;
|
45247
45708
|
if (signatureCallback && isScriptTransaction) {
|
45248
|
-
|
45709
|
+
const lengthBefore = signedRequest.witnesses.length;
|
45710
|
+
await signatureCallback(signedRequest);
|
45711
|
+
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
45249
45712
|
}
|
45250
|
-
|
45251
|
-
|
45713
|
+
await this.estimatePredicates(signedRequest);
|
45714
|
+
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45715
|
+
transactionRequest: signedRequest
|
45252
45716
|
});
|
45253
45717
|
let receipts = [];
|
45254
45718
|
let missingContractIds = [];
|
45255
45719
|
let outputVariables = 0;
|
45256
45720
|
let gasUsed = bn(0);
|
45257
|
-
|
45258
|
-
|
45721
|
+
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
45722
|
+
txRequestClone.maxFee = maxFee;
|
45723
|
+
if (isScriptTransaction) {
|
45724
|
+
txRequestClone.gasLimit = gasLimit;
|
45725
|
+
if (signatureCallback) {
|
45726
|
+
await signatureCallback(txRequestClone);
|
45727
|
+
}
|
45259
45728
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45260
45729
|
receipts = result.receipts;
|
45261
45730
|
outputVariables = result.outputVariables;
|
45262
45731
|
missingContractIds = result.missingContractIds;
|
45263
45732
|
gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
|
45264
45733
|
txRequestClone.gasLimit = gasUsed;
|
45265
|
-
|
45266
|
-
|
45267
|
-
|
45734
|
+
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
45735
|
+
transactionRequest: txRequestClone,
|
45736
|
+
gasPrice
|
45268
45737
|
}));
|
45269
45738
|
}
|
45270
45739
|
return {
|
45271
45740
|
requiredQuantities: allQuantities,
|
45272
45741
|
receipts,
|
45273
45742
|
gasUsed,
|
45274
|
-
|
45275
|
-
gasPrice: setGasPrice,
|
45743
|
+
gasPrice,
|
45276
45744
|
minGas,
|
45277
45745
|
maxGas,
|
45278
45746
|
minFee,
|
45279
45747
|
maxFee,
|
45280
|
-
estimatedInputs: txRequestClone.inputs,
|
45281
45748
|
outputVariables,
|
45282
|
-
missingContractIds
|
45749
|
+
missingContractIds,
|
45750
|
+
addedSignatures,
|
45751
|
+
estimatedPredicates: txRequestClone.inputs
|
45283
45752
|
};
|
45284
45753
|
}
|
45285
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45754
|
+
async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
|
45286
45755
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45287
45756
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45288
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45757
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, {
|
45758
|
+
quantitiesToContract
|
45759
|
+
});
|
45289
45760
|
transactionRequest.addResources(
|
45290
45761
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45291
45762
|
);
|
45292
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45293
|
-
|
45294
|
-
|
45295
|
-
);
|
45763
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
|
45764
|
+
quantitiesToContract
|
45765
|
+
});
|
45296
45766
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45297
45767
|
return {
|
45298
45768
|
resources,
|
@@ -45316,7 +45786,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45316
45786
|
assetId: coin.assetId,
|
45317
45787
|
amount: bn(coin.amount),
|
45318
45788
|
owner: Address.fromAddressOrString(coin.owner),
|
45319
|
-
maturity: bn(coin.maturity).toNumber(),
|
45320
45789
|
blockCreated: bn(coin.blockCreated),
|
45321
45790
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45322
45791
|
}));
|
@@ -45368,7 +45837,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45368
45837
|
amount: bn(coin.amount),
|
45369
45838
|
assetId: coin.assetId,
|
45370
45839
|
owner: Address.fromAddressOrString(coin.owner),
|
45371
|
-
maturity: bn(coin.maturity).toNumber(),
|
45372
45840
|
blockCreated: bn(coin.blockCreated),
|
45373
45841
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45374
45842
|
};
|
@@ -45401,7 +45869,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45401
45869
|
}
|
45402
45870
|
return {
|
45403
45871
|
id: block2.id,
|
45404
|
-
height: bn(block2.
|
45872
|
+
height: bn(block2.height),
|
45405
45873
|
time: block2.header.time,
|
45406
45874
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45407
45875
|
};
|
@@ -45416,7 +45884,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45416
45884
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45417
45885
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45418
45886
|
id: block2.id,
|
45419
|
-
height: bn(block2.
|
45887
|
+
height: bn(block2.height),
|
45420
45888
|
time: block2.header.time,
|
45421
45889
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45422
45890
|
}));
|
@@ -45443,7 +45911,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45443
45911
|
}
|
45444
45912
|
return {
|
45445
45913
|
id: block2.id,
|
45446
|
-
height: bn(block2.
|
45914
|
+
height: bn(block2.height, 10),
|
45447
45915
|
time: block2.header.time,
|
45448
45916
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45449
45917
|
transactions: block2.transactions.map(
|
@@ -45623,8 +46091,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45623
46091
|
prevRoot: messageBlockHeader.prevRoot,
|
45624
46092
|
time: messageBlockHeader.time,
|
45625
46093
|
applicationHash: messageBlockHeader.applicationHash,
|
45626
|
-
|
45627
|
-
|
46094
|
+
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount),
|
46095
|
+
messageOutboxRoot: messageBlockHeader.messageOutboxRoot,
|
46096
|
+
consensusParametersVersion: messageBlockHeader.consensusParametersVersion,
|
46097
|
+
eventInboxRoot: messageBlockHeader.eventInboxRoot,
|
46098
|
+
stateTransitionBytecodeVersion: messageBlockHeader.stateTransitionBytecodeVersion
|
45628
46099
|
},
|
45629
46100
|
commitBlockHeader: {
|
45630
46101
|
id: commitBlockHeader.id,
|
@@ -45635,8 +46106,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45635
46106
|
prevRoot: commitBlockHeader.prevRoot,
|
45636
46107
|
time: commitBlockHeader.time,
|
45637
46108
|
applicationHash: commitBlockHeader.applicationHash,
|
45638
|
-
|
45639
|
-
|
46109
|
+
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount),
|
46110
|
+
messageOutboxRoot: commitBlockHeader.messageOutboxRoot,
|
46111
|
+
consensusParametersVersion: commitBlockHeader.consensusParametersVersion,
|
46112
|
+
eventInboxRoot: commitBlockHeader.eventInboxRoot,
|
46113
|
+
stateTransitionBytecodeVersion: commitBlockHeader.stateTransitionBytecodeVersion
|
45640
46114
|
},
|
45641
46115
|
sender: Address.fromAddressOrString(sender),
|
45642
46116
|
recipient: Address.fromAddressOrString(recipient),
|
@@ -45645,6 +46119,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45645
46119
|
data
|
45646
46120
|
};
|
45647
46121
|
}
|
46122
|
+
async getLatestGasPrice() {
|
46123
|
+
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46124
|
+
return bn(latestGasPrice.gasPrice);
|
46125
|
+
}
|
46126
|
+
async estimateGasPrice(blockHorizon) {
|
46127
|
+
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46128
|
+
blockHorizon: String(blockHorizon)
|
46129
|
+
});
|
46130
|
+
return bn(estimateGasPrice.gasPrice);
|
46131
|
+
}
|
45648
46132
|
/**
|
45649
46133
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
45650
46134
|
*
|
@@ -45890,8 +46374,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45890
46374
|
* @param assetId - The asset ID to check the balance for.
|
45891
46375
|
* @returns A promise that resolves to the balance amount.
|
45892
46376
|
*/
|
45893
|
-
async getBalance(assetId
|
45894
|
-
const
|
46377
|
+
async getBalance(assetId) {
|
46378
|
+
const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
|
46379
|
+
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
45895
46380
|
return amount;
|
45896
46381
|
}
|
45897
46382
|
/**
|
@@ -45928,37 +46413,31 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45928
46413
|
* @param fee - The estimated transaction fee.
|
45929
46414
|
* @returns A promise that resolves when the resources are added to the transaction.
|
45930
46415
|
*/
|
45931
|
-
async fund(request,
|
45932
|
-
const
|
46416
|
+
async fund(request, params) {
|
46417
|
+
const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
|
46418
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46419
|
+
const txRequest = request;
|
46420
|
+
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45933
46421
|
amount: bn(fee),
|
45934
|
-
assetId:
|
45935
|
-
coinQuantities
|
46422
|
+
assetId: baseAssetId,
|
46423
|
+
coinQuantities: requiredQuantities
|
45936
46424
|
});
|
45937
46425
|
const quantitiesDict = {};
|
45938
|
-
|
46426
|
+
requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
|
45939
46427
|
quantitiesDict[assetId] = {
|
45940
46428
|
required: amount,
|
45941
46429
|
owned: bn(0)
|
45942
46430
|
};
|
45943
46431
|
});
|
45944
|
-
|
45945
|
-
const cachedMessages = [];
|
45946
|
-
const owner = this.address.toB256();
|
45947
|
-
request.inputs.forEach((input) => {
|
46432
|
+
txRequest.inputs.forEach((input) => {
|
45948
46433
|
const isResource = "amount" in input;
|
45949
|
-
if (isResource) {
|
45950
|
-
|
45951
|
-
|
45952
|
-
|
45953
|
-
|
45954
|
-
|
45955
|
-
|
45956
|
-
cachedUtxos.push(input.id);
|
45957
|
-
}
|
45958
|
-
} else if (input.recipient === owner && input.amount && quantitiesDict[BaseAssetId]) {
|
45959
|
-
quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
|
45960
|
-
cachedMessages.push(input.nonce);
|
45961
|
-
}
|
46434
|
+
if (!isResource) {
|
46435
|
+
return;
|
46436
|
+
}
|
46437
|
+
const isCoin2 = "owner" in input;
|
46438
|
+
const assetId = isCoin2 ? String(input.assetId) : baseAssetId;
|
46439
|
+
if (quantitiesDict[assetId]) {
|
46440
|
+
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(input.amount);
|
45962
46441
|
}
|
45963
46442
|
});
|
45964
46443
|
const missingQuantities = [];
|
@@ -45972,12 +46451,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45972
46451
|
});
|
45973
46452
|
const needsToBeFunded = missingQuantities.length;
|
45974
46453
|
if (needsToBeFunded) {
|
45975
|
-
const
|
45976
|
-
|
45977
|
-
|
45978
|
-
|
45979
|
-
|
45980
|
-
|
46454
|
+
const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
|
46455
|
+
const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
|
46456
|
+
txRequest.addResources(resources);
|
46457
|
+
}
|
46458
|
+
txRequest.shiftPredicateData();
|
46459
|
+
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46460
|
+
const requestToReestimate = clone_default(txRequest);
|
46461
|
+
if (addedSignatures) {
|
46462
|
+
Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());
|
46463
|
+
}
|
46464
|
+
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46465
|
+
transactionRequest: requestToReestimate
|
46466
|
+
});
|
46467
|
+
txRequest.maxFee = maxFee;
|
46468
|
+
return txRequest;
|
45981
46469
|
}
|
45982
46470
|
/**
|
45983
46471
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -45985,28 +46473,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45985
46473
|
* @param destination - The address of the destination.
|
45986
46474
|
* @param amount - The amount of coins to transfer.
|
45987
46475
|
* @param assetId - The asset ID of the coins to transfer.
|
45988
|
-
* @param txParams - The transaction parameters (gasLimit,
|
46476
|
+
* @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
|
45989
46477
|
* @returns A promise that resolves to the prepared transaction request.
|
45990
46478
|
*/
|
45991
|
-
async createTransfer(destination, amount, assetId
|
45992
|
-
const
|
45993
|
-
const
|
45994
|
-
|
45995
|
-
|
45996
|
-
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46479
|
+
async createTransfer(destination, amount, assetId, txParams = {}) {
|
46480
|
+
const request = new ScriptTransactionRequest(txParams);
|
46481
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46482
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
46483
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
45997
46484
|
estimateTxDependencies: true,
|
45998
46485
|
resourcesOwner: this
|
45999
46486
|
});
|
46000
|
-
|
46001
|
-
|
46002
|
-
|
46003
|
-
|
46004
|
-
gasPrice: request.gasPrice,
|
46005
|
-
gasLimit: request.gasLimit,
|
46006
|
-
minGasPrice
|
46487
|
+
this.validateGasLimitAndMaxFee({
|
46488
|
+
gasUsed: txCost.gasUsed,
|
46489
|
+
maxFee: txCost.maxFee,
|
46490
|
+
txParams
|
46007
46491
|
});
|
46008
|
-
|
46009
|
-
request.
|
46492
|
+
request.gasLimit = txCost.gasUsed;
|
46493
|
+
request.maxFee = txCost.maxFee;
|
46494
|
+
await this.fund(request, txCost);
|
46010
46495
|
return request;
|
46011
46496
|
}
|
46012
46497
|
/**
|
@@ -46015,17 +46500,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46015
46500
|
* @param destination - The address of the destination.
|
46016
46501
|
* @param amount - The amount of coins to transfer.
|
46017
46502
|
* @param assetId - The asset ID of the coins to transfer.
|
46018
|
-
* @param txParams - The transaction parameters (gasLimit,
|
46503
|
+
* @param txParams - The transaction parameters (gasLimit, maturity).
|
46019
46504
|
* @returns A promise that resolves to the transaction response.
|
46020
46505
|
*/
|
46021
|
-
async transfer(destination, amount, assetId
|
46506
|
+
async transfer(destination, amount, assetId, txParams = {}) {
|
46022
46507
|
if (bn(amount).lte(0)) {
|
46023
46508
|
throw new FuelError(
|
46024
46509
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
46025
46510
|
"Transfer amount must be a positive number."
|
46026
46511
|
);
|
46027
46512
|
}
|
46028
|
-
const
|
46513
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46514
|
+
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
46029
46515
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
46030
46516
|
}
|
46031
46517
|
/**
|
@@ -46037,7 +46523,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46037
46523
|
* @param txParams - The optional transaction parameters.
|
46038
46524
|
* @returns A promise that resolves to the transaction response.
|
46039
46525
|
*/
|
46040
|
-
async transferToContract(contractId, amount, assetId
|
46526
|
+
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46041
46527
|
if (bn(amount).lte(0)) {
|
46042
46528
|
throw new FuelError(
|
46043
46529
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46045,31 +46531,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46045
46531
|
);
|
46046
46532
|
}
|
46047
46533
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46048
|
-
const
|
46049
|
-
const params = { gasPrice: minGasPrice, ...txParams };
|
46534
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46050
46535
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46051
46536
|
hexlifiedContractId: contractAddress.toB256(),
|
46052
46537
|
amountToTransfer: bn(amount),
|
46053
|
-
assetId
|
46538
|
+
assetId: assetIdToTransfer
|
46054
46539
|
});
|
46055
46540
|
const request = new ScriptTransactionRequest({
|
46056
|
-
...
|
46541
|
+
...txParams,
|
46057
46542
|
script,
|
46058
46543
|
scriptData
|
46059
46544
|
});
|
46060
46545
|
request.addContractInputAndOutput(contractAddress);
|
46061
|
-
const
|
46062
|
-
|
46063
|
-
[{ amount: bn(amount), assetId: String(
|
46064
|
-
);
|
46065
|
-
|
46066
|
-
|
46067
|
-
|
46068
|
-
|
46069
|
-
gasLimit: request.gasLimit,
|
46070
|
-
minGasPrice
|
46546
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
46547
|
+
resourcesOwner: this,
|
46548
|
+
quantitiesToContract: [{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
|
46549
|
+
});
|
46550
|
+
this.validateGasLimitAndMaxFee({
|
46551
|
+
gasUsed: txCost.gasUsed,
|
46552
|
+
maxFee: txCost.maxFee,
|
46553
|
+
txParams
|
46071
46554
|
});
|
46072
|
-
|
46555
|
+
request.gasLimit = txCost.gasUsed;
|
46556
|
+
request.maxFee = txCost.maxFee;
|
46557
|
+
await this.fund(request, txCost);
|
46073
46558
|
return this.sendTransaction(request);
|
46074
46559
|
}
|
46075
46560
|
/**
|
@@ -46081,7 +46566,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46081
46566
|
* @returns A promise that resolves to the transaction response.
|
46082
46567
|
*/
|
46083
46568
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46084
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46085
46569
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46086
46570
|
const recipientDataArray = arrayify(
|
46087
46571
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46094,21 +46578,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46094
46578
|
...recipientDataArray,
|
46095
46579
|
...amountDataArray
|
46096
46580
|
]);
|
46097
|
-
const params = { script,
|
46581
|
+
const params = { script, ...txParams };
|
46582
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46098
46583
|
const request = new ScriptTransactionRequest(params);
|
46099
|
-
const
|
46100
|
-
const
|
46101
|
-
|
46102
|
-
|
46103
|
-
|
46104
|
-
|
46105
|
-
this.validateGas({
|
46106
|
-
gasUsed,
|
46107
|
-
gasPrice: request.gasPrice,
|
46108
|
-
gasLimit: request.gasLimit,
|
46109
|
-
minGasPrice
|
46584
|
+
const quantitiesToContract = [{ amount: bn(amount), assetId: baseAssetId }];
|
46585
|
+
const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
|
46586
|
+
this.validateGasLimitAndMaxFee({
|
46587
|
+
gasUsed: txCost.gasUsed,
|
46588
|
+
maxFee: txCost.maxFee,
|
46589
|
+
txParams
|
46110
46590
|
});
|
46111
|
-
|
46591
|
+
request.maxFee = txCost.maxFee;
|
46592
|
+
request.gasLimit = txCost.gasUsed;
|
46593
|
+
await this.fund(request, txCost);
|
46112
46594
|
return this.sendTransaction(request);
|
46113
46595
|
}
|
46114
46596
|
async signMessage(message) {
|
@@ -46166,22 +46648,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46166
46648
|
}
|
46167
46649
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46168
46650
|
}
|
46169
|
-
|
46651
|
+
validateGasLimitAndMaxFee({
|
46652
|
+
txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },
|
46170
46653
|
gasUsed,
|
46171
|
-
|
46172
|
-
gasLimit,
|
46173
|
-
minGasPrice
|
46654
|
+
maxFee
|
46174
46655
|
}) {
|
46175
|
-
if (
|
46656
|
+
if (isDefined(setGasLimit) && gasUsed.gt(setGasLimit)) {
|
46176
46657
|
throw new FuelError(
|
46177
|
-
ErrorCode.
|
46178
|
-
`Gas
|
46658
|
+
ErrorCode.GAS_LIMIT_TOO_LOW,
|
46659
|
+
`Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`
|
46179
46660
|
);
|
46180
46661
|
}
|
46181
|
-
if (
|
46662
|
+
if (isDefined(setMaxFee) && maxFee.gt(setMaxFee)) {
|
46182
46663
|
throw new FuelError(
|
46183
|
-
ErrorCode.
|
46184
|
-
`
|
46664
|
+
ErrorCode.MAX_FEE_TOO_LOW,
|
46665
|
+
`Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`
|
46185
46666
|
);
|
46186
46667
|
}
|
46187
46668
|
}
|
@@ -47766,7 +48247,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47766
48247
|
* @param transactionRequestLike - The transaction request to send.
|
47767
48248
|
* @returns A promise that resolves to the TransactionResponse object.
|
47768
48249
|
*/
|
47769
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
48250
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
|
47770
48251
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
47771
48252
|
if (estimateTxDependencies) {
|
47772
48253
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50526,14 +51007,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50526
51007
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50527
51008
|
wallet.provider
|
50528
51009
|
);
|
50529
|
-
const
|
50530
|
-
|
50531
|
-
|
50532
|
-
|
50533
|
-
gasPrice: minGasPrice
|
51010
|
+
const request = new ScriptTransactionRequest();
|
51011
|
+
quantities.forEach((quantity) => {
|
51012
|
+
const { amount, assetId } = coinQuantityfy(quantity);
|
51013
|
+
request.addCoinOutput(wallet.address, amount, assetId);
|
50534
51014
|
});
|
50535
|
-
|
50536
|
-
|
51015
|
+
const txCost = await genesisWallet.provider.getTransactionCost(request);
|
51016
|
+
request.gasLimit = txCost.gasUsed;
|
51017
|
+
request.maxFee = txCost.maxFee;
|
51018
|
+
await genesisWallet.fund(request, txCost);
|
50537
51019
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50538
51020
|
};
|
50539
51021
|
|
@@ -50563,7 +51045,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50563
51045
|
|
50564
51046
|
// src/test-utils/launchNode.ts
|
50565
51047
|
var import_child_process = __require("child_process");
|
50566
|
-
var
|
51048
|
+
var import_crypto22 = __require("crypto");
|
50567
51049
|
var import_fs2 = __require("fs");
|
50568
51050
|
var import_os = __toESM(__require("os"));
|
50569
51051
|
var import_path8 = __toESM(__require("path"));
|
@@ -50612,12 +51094,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50612
51094
|
// eslint-disable-next-line no-async-promise-executor
|
50613
51095
|
new Promise(async (resolve, reject) => {
|
50614
51096
|
const remainingArgs = extractRemainingArgs(args, [
|
50615
|
-
"--
|
51097
|
+
"--snapshot",
|
50616
51098
|
"--consensus-key",
|
50617
51099
|
"--db-type",
|
50618
51100
|
"--poa-instant"
|
50619
51101
|
]);
|
50620
|
-
const
|
51102
|
+
const snapshotDir = getFlagValueFromArgs(args, "--snapshot");
|
50621
51103
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
50622
51104
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
50623
51105
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -50633,39 +51115,57 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50633
51115
|
stopPort: 5e3
|
50634
51116
|
// don't try ports above 5000
|
50635
51117
|
})).toString();
|
50636
|
-
let
|
51118
|
+
let snapshotDirToUse;
|
50637
51119
|
const prefix = basePath || import_os.default.tmpdir();
|
50638
|
-
const suffix = basePath ? "" : (0,
|
50639
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
50640
|
-
if (
|
50641
|
-
|
51120
|
+
const suffix = basePath ? "" : (0, import_crypto22.randomUUID)();
|
51121
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "snapshotDir");
|
51122
|
+
if (snapshotDir) {
|
51123
|
+
snapshotDirToUse = snapshotDir;
|
50642
51124
|
} else {
|
50643
51125
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
50644
51126
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
50645
51127
|
}
|
50646
|
-
|
50647
|
-
|
51128
|
+
let { stateConfigJson } = defaultSnapshotConfigs;
|
51129
|
+
const { chainConfigJson, metadataJson } = defaultSnapshotConfigs;
|
51130
|
+
stateConfigJson = {
|
51131
|
+
...stateConfigJson,
|
51132
|
+
coins: [
|
51133
|
+
...stateConfigJson.coins.map((coin) => ({
|
51134
|
+
...coin,
|
51135
|
+
amount: "18446744073709551615"
|
51136
|
+
}))
|
51137
|
+
],
|
51138
|
+
messages: stateConfigJson.messages.map((message) => ({
|
51139
|
+
...message,
|
51140
|
+
amount: "18446744073709551615"
|
51141
|
+
}))
|
51142
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51143
|
+
};
|
50648
51144
|
if (!process.env.GENESIS_SECRET) {
|
50649
51145
|
const pk = Signer.generatePrivateKey();
|
50650
51146
|
const signer = new Signer(pk);
|
50651
51147
|
process.env.GENESIS_SECRET = hexlify(pk);
|
50652
|
-
|
50653
|
-
|
50654
|
-
|
50655
|
-
|
50656
|
-
|
50657
|
-
|
50658
|
-
|
50659
|
-
|
50660
|
-
|
50661
|
-
|
50662
|
-
}
|
50663
|
-
]
|
50664
|
-
}
|
50665
|
-
};
|
51148
|
+
stateConfigJson.coins.push({
|
51149
|
+
tx_id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
51150
|
+
owner: signer.address.toHexString(),
|
51151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51152
|
+
amount: "18446744073709551615",
|
51153
|
+
asset_id: chainConfigJson.consensus_parameters.V1.base_asset_id,
|
51154
|
+
output_index: 0,
|
51155
|
+
tx_pointer_block_height: 0,
|
51156
|
+
tx_pointer_tx_idx: 0
|
51157
|
+
});
|
50666
51158
|
}
|
50667
|
-
|
50668
|
-
|
51159
|
+
let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
|
51160
|
+
const regexMakeNumber = /("amount":)"(\d+)"/gm;
|
51161
|
+
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51162
|
+
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51163
|
+
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51164
|
+
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51165
|
+
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51166
|
+
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51167
|
+
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51168
|
+
snapshotDirToUse = tempDirPath;
|
50669
51169
|
}
|
50670
51170
|
const child = (0, import_child_process.spawn)(
|
50671
51171
|
command,
|
@@ -50674,10 +51174,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50674
51174
|
["--ip", ipToUse],
|
50675
51175
|
["--port", portToUse],
|
50676
51176
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
50677
|
-
["--min-gas-price", "
|
51177
|
+
["--min-gas-price", "1"],
|
50678
51178
|
poaInstant ? ["--poa-instant", "true"] : [],
|
50679
51179
|
["--consensus-key", consensusKey],
|
50680
|
-
["--
|
51180
|
+
["--snapshot", snapshotDirToUse],
|
50681
51181
|
"--vm-backtrace",
|
50682
51182
|
"--utxo-validation",
|
50683
51183
|
"--debug",
|
@@ -50707,7 +51207,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50707
51207
|
cleanup: () => killNode(cleanupConfig),
|
50708
51208
|
ip: ipToUse,
|
50709
51209
|
port: portToUse,
|
50710
|
-
|
51210
|
+
snapshotDir: snapshotDirToUse
|
50711
51211
|
});
|
50712
51212
|
}
|
50713
51213
|
if (/error/i.test(chunk)) {
|
@@ -50724,9 +51224,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50724
51224
|
})
|
50725
51225
|
);
|
50726
51226
|
var generateWallets = async (count, provider) => {
|
51227
|
+
const baseAssetId = provider.getBaseAssetId();
|
50727
51228
|
const wallets = [];
|
50728
51229
|
for (let i = 0; i < count; i += 1) {
|
50729
|
-
const wallet = await generateTestWallet(provider, [[
|
51230
|
+
const wallet = await generateTestWallet(provider, [[1e5, baseAssetId]]);
|
50730
51231
|
wallets.push(wallet);
|
50731
51232
|
}
|
50732
51233
|
return wallets;
|
@@ -50736,7 +51237,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50736
51237
|
walletCount = 10
|
50737
51238
|
} = {}) => {
|
50738
51239
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
50739
|
-
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51240
|
+
const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
|
50740
51241
|
const wallets = await generateWallets(walletCount, provider);
|
50741
51242
|
const cleanup = () => {
|
50742
51243
|
closeNode();
|