@fuel-ts/account 0.0.0-rc-1976-20240424110729 → 0.0.0-rc-2021-20240424121206
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/README.md +1 -1
- package/dist/account.d.ts +5 -4
- package/dist/account.d.ts.map +1 -1
- package/dist/configs.d.ts.map +1 -1
- package/dist/configs.global.js +1 -1
- package/dist/configs.global.js.map +1 -1
- package/dist/configs.js +1 -1
- package/dist/configs.js.map +1 -1
- package/dist/configs.mjs +1 -1
- package/dist/configs.mjs.map +1 -1
- package/dist/index.global.js +861 -611
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +864 -608
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +706 -451
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +10 -2
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +822 -328
- 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 +37 -34
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/input.d.ts +2 -2
- package/dist/providers/transaction-request/input.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +8 -32
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/utils.d.ts +3 -0
- package/dist/providers/transaction-request/utils.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +2 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +3 -2
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -1
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
- package/dist/providers/utils/gas.d.ts +8 -2
- package/dist/providers/utils/gas.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils.global.js +1578 -1114
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +845 -609
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +699 -463
- 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,8 +31914,8 @@ spurious results.`);
|
|
31914
31914
|
// ../versions/dist/index.mjs
|
31915
31915
|
function getBuiltinVersions() {
|
31916
31916
|
return {
|
31917
|
-
FORC: "0.
|
31918
|
-
FUEL_CORE: "0.
|
31917
|
+
FORC: "0.51.1",
|
31918
|
+
FUEL_CORE: "0.24.2",
|
31919
31919
|
FUELS: "0.81.0"
|
31920
31920
|
};
|
31921
31921
|
}
|
@@ -32193,521 +32193,753 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32193
32193
|
__publicField3(DateTime, "TAI64_NULL", "");
|
32194
32194
|
var chainConfig_default = {
|
32195
32195
|
chain_name: "local_testnet",
|
32196
|
-
|
32197
|
-
|
32198
|
-
|
32199
|
-
|
32200
|
-
|
32201
|
-
|
32202
|
-
|
32203
|
-
|
32204
|
-
|
32205
|
-
|
32206
|
-
|
32207
|
-
|
32208
|
-
|
32209
|
-
|
32210
|
-
|
32211
|
-
|
32212
|
-
|
32213
|
-
|
32214
|
-
|
32215
|
-
|
32216
|
-
|
32217
|
-
|
32218
|
-
|
32219
|
-
|
32220
|
-
|
32221
|
-
|
32222
|
-
|
32223
|
-
|
32224
|
-
|
32225
|
-
|
32226
|
-
|
32227
|
-
|
32228
|
-
|
32229
|
-
|
32230
|
-
|
32231
|
-
|
32232
|
-
|
32233
|
-
|
32234
|
-
{
|
32235
|
-
|
32236
|
-
|
32237
|
-
|
32238
|
-
|
32239
|
-
|
32240
|
-
|
32241
|
-
|
32242
|
-
|
32243
|
-
|
32244
|
-
|
32245
|
-
|
32246
|
-
|
32247
|
-
|
32248
|
-
|
32249
|
-
|
32250
|
-
|
32251
|
-
|
32252
|
-
|
32253
|
-
|
32254
|
-
|
32255
|
-
|
32256
|
-
|
32257
|
-
|
32258
|
-
|
32259
|
-
|
32260
|
-
|
32261
|
-
|
32262
|
-
|
32263
|
-
|
32264
|
-
|
32265
|
-
|
32266
|
-
|
32267
|
-
|
32268
|
-
|
32269
|
-
|
32270
|
-
|
32271
|
-
|
32272
|
-
|
32273
|
-
|
32274
|
-
|
32275
|
-
|
32276
|
-
|
32277
|
-
|
32278
|
-
|
32279
|
-
|
32280
|
-
|
32281
|
-
|
32282
|
-
|
32283
|
-
|
32284
|
-
|
32285
|
-
|
32286
|
-
|
32287
|
-
|
32288
|
-
|
32289
|
-
|
32290
|
-
|
32291
|
-
|
32292
|
-
|
32293
|
-
|
32294
|
-
|
32295
|
-
|
32296
|
-
|
32297
|
-
|
32298
|
-
|
32299
|
-
|
32300
|
-
|
32301
|
-
|
32302
|
-
|
32303
|
-
|
32304
|
-
|
32305
|
-
|
32306
|
-
|
32307
|
-
|
32308
|
-
|
32309
|
-
|
32310
|
-
|
32311
|
-
|
32312
|
-
|
32313
|
-
|
32314
|
-
|
32315
|
-
|
32316
|
-
|
32317
|
-
|
32318
|
-
|
32319
|
-
|
32320
|
-
|
32321
|
-
|
32322
|
-
|
32323
|
-
|
32324
|
-
|
32325
|
-
|
32326
|
-
|
32327
|
-
|
32328
|
-
|
32329
|
-
|
32330
|
-
|
32331
|
-
|
32332
|
-
|
32333
|
-
|
32334
|
-
|
32335
|
-
|
32336
|
-
|
32337
|
-
|
32338
|
-
|
32339
|
-
|
32340
|
-
|
32341
|
-
|
32342
|
-
|
32343
|
-
|
32344
|
-
|
32345
|
-
|
32346
|
-
|
32347
|
-
|
32348
|
-
|
32349
|
-
|
32350
|
-
|
32351
|
-
|
32352
|
-
|
32353
|
-
|
32354
|
-
|
32355
|
-
|
32356
|
-
|
32357
|
-
|
32358
|
-
|
32359
|
-
|
32360
|
-
|
32361
|
-
|
32362
|
-
|
32363
|
-
|
32364
|
-
|
32365
|
-
|
32366
|
-
|
32367
|
-
|
32368
|
-
|
32369
|
-
|
32370
|
-
|
32371
|
-
|
32372
|
-
|
32373
|
-
|
32374
|
-
|
32375
|
-
|
32376
|
-
|
32377
|
-
|
32378
|
-
|
32379
|
-
|
32380
|
-
|
32381
|
-
|
32382
|
-
|
32383
|
-
|
32384
|
-
|
32385
|
-
|
32386
|
-
|
32387
|
-
|
32388
|
-
|
32389
|
-
|
32390
|
-
|
32391
|
-
|
32392
|
-
|
32393
|
-
|
32394
|
-
|
32395
|
-
|
32396
|
-
|
32397
|
-
|
32398
|
-
|
32399
|
-
|
32400
|
-
|
32401
|
-
|
32402
|
-
|
32403
|
-
|
32404
|
-
|
32405
|
-
|
32406
|
-
|
32407
|
-
|
32408
|
-
|
32409
|
-
|
32410
|
-
|
32411
|
-
|
32412
|
-
|
32413
|
-
|
32414
|
-
|
32415
|
-
|
32416
|
-
|
32417
|
-
|
32418
|
-
|
32419
|
-
|
32420
|
-
|
32421
|
-
|
32422
|
-
|
32423
|
-
|
32424
|
-
|
32425
|
-
|
32426
|
-
|
32427
|
-
|
32428
|
-
|
32429
|
-
|
32430
|
-
|
32431
|
-
|
32432
|
-
|
32433
|
-
|
32434
|
-
|
32435
|
-
|
32436
|
-
|
32437
|
-
|
32438
|
-
|
32439
|
-
|
32440
|
-
|
32441
|
-
|
32442
|
-
|
32443
|
-
|
32444
|
-
|
32445
|
-
|
32446
|
-
|
32447
|
-
|
32448
|
-
|
32449
|
-
|
32450
|
-
|
32451
|
-
|
32452
|
-
da_height: "0x00"
|
32196
|
+
consensus_parameters: {
|
32197
|
+
V1: {
|
32198
|
+
tx_params: {
|
32199
|
+
V1: {
|
32200
|
+
max_inputs: 255,
|
32201
|
+
max_outputs: 255,
|
32202
|
+
max_witnesses: 255,
|
32203
|
+
max_gas_per_tx: 3e7,
|
32204
|
+
max_size: 112640
|
32205
|
+
}
|
32206
|
+
},
|
32207
|
+
predicate_params: {
|
32208
|
+
V1: {
|
32209
|
+
max_predicate_length: 102400,
|
32210
|
+
max_predicate_data_length: 102400,
|
32211
|
+
max_message_data_length: 102400,
|
32212
|
+
max_gas_per_predicate: 3e7
|
32213
|
+
}
|
32214
|
+
},
|
32215
|
+
script_params: {
|
32216
|
+
V1: {
|
32217
|
+
max_script_length: 102400,
|
32218
|
+
max_script_data_length: 102400
|
32219
|
+
}
|
32220
|
+
},
|
32221
|
+
contract_params: {
|
32222
|
+
V1: {
|
32223
|
+
contract_max_size: 102400,
|
32224
|
+
max_storage_slots: 1760
|
32225
|
+
}
|
32226
|
+
},
|
32227
|
+
fee_params: {
|
32228
|
+
V1: {
|
32229
|
+
gas_price_factor: 92,
|
32230
|
+
gas_per_byte: 63
|
32231
|
+
}
|
32232
|
+
},
|
32233
|
+
chain_id: 0,
|
32234
|
+
gas_costs: {
|
32235
|
+
V1: {
|
32236
|
+
add: 2,
|
32237
|
+
addi: 2,
|
32238
|
+
aloc: 1,
|
32239
|
+
and: 2,
|
32240
|
+
andi: 2,
|
32241
|
+
bal: 366,
|
32242
|
+
bhei: 2,
|
32243
|
+
bhsh: 2,
|
32244
|
+
burn: 33949,
|
32245
|
+
cb: 2,
|
32246
|
+
cfei: 2,
|
32247
|
+
cfsi: 2,
|
32248
|
+
div: 2,
|
32249
|
+
divi: 2,
|
32250
|
+
eck1: 3347,
|
32251
|
+
ecr1: 46165,
|
32252
|
+
ed19: 4210,
|
32253
|
+
eq: 2,
|
32254
|
+
exp: 2,
|
32255
|
+
expi: 2,
|
32256
|
+
flag: 1,
|
32257
|
+
gm: 2,
|
32258
|
+
gt: 2,
|
32259
|
+
gtf: 16,
|
32260
|
+
ji: 2,
|
32261
|
+
jmp: 2,
|
32262
|
+
jne: 2,
|
32263
|
+
jnei: 2,
|
32264
|
+
jnzi: 2,
|
32265
|
+
jmpf: 2,
|
32266
|
+
jmpb: 2,
|
32267
|
+
jnzf: 2,
|
32268
|
+
jnzb: 2,
|
32269
|
+
jnef: 2,
|
32270
|
+
jneb: 2,
|
32271
|
+
lb: 2,
|
32272
|
+
log: 754,
|
32273
|
+
lt: 2,
|
32274
|
+
lw: 2,
|
32275
|
+
mint: 35718,
|
32276
|
+
mlog: 2,
|
32277
|
+
mod: 2,
|
32278
|
+
modi: 2,
|
32279
|
+
move: 2,
|
32280
|
+
movi: 2,
|
32281
|
+
mroo: 5,
|
32282
|
+
mul: 2,
|
32283
|
+
muli: 2,
|
32284
|
+
mldv: 4,
|
32285
|
+
noop: 1,
|
32286
|
+
not: 2,
|
32287
|
+
or: 2,
|
32288
|
+
ori: 2,
|
32289
|
+
poph: 3,
|
32290
|
+
popl: 3,
|
32291
|
+
pshh: 4,
|
32292
|
+
pshl: 4,
|
32293
|
+
ret_contract: 733,
|
32294
|
+
rvrt_contract: 722,
|
32295
|
+
sb: 2,
|
32296
|
+
sll: 2,
|
32297
|
+
slli: 2,
|
32298
|
+
srl: 2,
|
32299
|
+
srli: 2,
|
32300
|
+
srw: 253,
|
32301
|
+
sub: 2,
|
32302
|
+
subi: 2,
|
32303
|
+
sw: 2,
|
32304
|
+
sww: 29053,
|
32305
|
+
time: 79,
|
32306
|
+
tr: 46242,
|
32307
|
+
tro: 33251,
|
32308
|
+
wdcm: 3,
|
32309
|
+
wqcm: 3,
|
32310
|
+
wdop: 3,
|
32311
|
+
wqop: 3,
|
32312
|
+
wdml: 3,
|
32313
|
+
wqml: 4,
|
32314
|
+
wddv: 5,
|
32315
|
+
wqdv: 7,
|
32316
|
+
wdmd: 11,
|
32317
|
+
wqmd: 18,
|
32318
|
+
wdam: 9,
|
32319
|
+
wqam: 12,
|
32320
|
+
wdmm: 11,
|
32321
|
+
wqmm: 11,
|
32322
|
+
xor: 2,
|
32323
|
+
xori: 2,
|
32324
|
+
call: {
|
32325
|
+
LightOperation: {
|
32326
|
+
base: 21687,
|
32327
|
+
units_per_gas: 4
|
32328
|
+
}
|
32329
|
+
},
|
32330
|
+
ccp: {
|
32331
|
+
LightOperation: {
|
32332
|
+
base: 59,
|
32333
|
+
units_per_gas: 20
|
32334
|
+
}
|
32335
|
+
},
|
32336
|
+
croo: {
|
32337
|
+
LightOperation: {
|
32338
|
+
base: 1,
|
32339
|
+
units_per_gas: 1
|
32340
|
+
}
|
32341
|
+
},
|
32342
|
+
csiz: {
|
32343
|
+
LightOperation: {
|
32344
|
+
base: 59,
|
32345
|
+
units_per_gas: 195
|
32346
|
+
}
|
32347
|
+
},
|
32348
|
+
k256: {
|
32349
|
+
LightOperation: {
|
32350
|
+
base: 282,
|
32351
|
+
units_per_gas: 3
|
32352
|
+
}
|
32353
|
+
},
|
32354
|
+
ldc: {
|
32355
|
+
LightOperation: {
|
32356
|
+
base: 45,
|
32357
|
+
units_per_gas: 65
|
32358
|
+
}
|
32359
|
+
},
|
32360
|
+
logd: {
|
32361
|
+
LightOperation: {
|
32362
|
+
base: 1134,
|
32363
|
+
units_per_gas: 2
|
32364
|
+
}
|
32365
|
+
},
|
32366
|
+
mcl: {
|
32367
|
+
LightOperation: {
|
32368
|
+
base: 3,
|
32369
|
+
units_per_gas: 523
|
32370
|
+
}
|
32371
|
+
},
|
32372
|
+
mcli: {
|
32373
|
+
LightOperation: {
|
32374
|
+
base: 3,
|
32375
|
+
units_per_gas: 526
|
32376
|
+
}
|
32377
|
+
},
|
32378
|
+
mcp: {
|
32379
|
+
LightOperation: {
|
32380
|
+
base: 3,
|
32381
|
+
units_per_gas: 448
|
32382
|
+
}
|
32383
|
+
},
|
32384
|
+
mcpi: {
|
32385
|
+
LightOperation: {
|
32386
|
+
base: 7,
|
32387
|
+
units_per_gas: 585
|
32388
|
+
}
|
32389
|
+
},
|
32390
|
+
meq: {
|
32391
|
+
LightOperation: {
|
32392
|
+
base: 11,
|
32393
|
+
units_per_gas: 1097
|
32394
|
+
}
|
32395
|
+
},
|
32396
|
+
retd_contract: {
|
32397
|
+
LightOperation: {
|
32398
|
+
base: 1086,
|
32399
|
+
units_per_gas: 2
|
32400
|
+
}
|
32401
|
+
},
|
32402
|
+
s256: {
|
32403
|
+
LightOperation: {
|
32404
|
+
base: 45,
|
32405
|
+
units_per_gas: 3
|
32406
|
+
}
|
32407
|
+
},
|
32408
|
+
scwq: {
|
32409
|
+
HeavyOperation: {
|
32410
|
+
base: 30375,
|
32411
|
+
gas_per_unit: 28628
|
32412
|
+
}
|
32413
|
+
},
|
32414
|
+
smo: {
|
32415
|
+
LightOperation: {
|
32416
|
+
base: 64196,
|
32417
|
+
units_per_gas: 1
|
32418
|
+
}
|
32419
|
+
},
|
32420
|
+
srwq: {
|
32421
|
+
HeavyOperation: {
|
32422
|
+
base: 262,
|
32423
|
+
gas_per_unit: 249
|
32424
|
+
}
|
32425
|
+
},
|
32426
|
+
swwq: {
|
32427
|
+
HeavyOperation: {
|
32428
|
+
base: 28484,
|
32429
|
+
gas_per_unit: 26613
|
32430
|
+
}
|
32431
|
+
},
|
32432
|
+
contract_root: {
|
32433
|
+
LightOperation: {
|
32434
|
+
base: 45,
|
32435
|
+
units_per_gas: 1
|
32436
|
+
}
|
32437
|
+
},
|
32438
|
+
state_root: {
|
32439
|
+
HeavyOperation: {
|
32440
|
+
base: 350,
|
32441
|
+
gas_per_unit: 176
|
32442
|
+
}
|
32443
|
+
},
|
32444
|
+
new_storage_per_byte: 63,
|
32445
|
+
vm_initialization: {
|
32446
|
+
LightOperation: {
|
32447
|
+
base: 1645,
|
32448
|
+
units_per_gas: 14
|
32449
|
+
}
|
32450
|
+
}
|
32451
|
+
}
|
32453
32452
|
},
|
32454
|
-
|
32455
|
-
|
32456
|
-
|
32457
|
-
|
32458
|
-
amount: "0xb04f3c08f59b309e",
|
32459
|
-
data: "",
|
32460
|
-
da_height: "0x00"
|
32461
|
-
}
|
32462
|
-
]
|
32453
|
+
base_asset_id: "0000000000000000000000000000000000000000000000000000000000000000",
|
32454
|
+
block_gas_limit: 3e7,
|
32455
|
+
privileged_address: "0000000000000000000000000000000000000000000000000000000000000000"
|
32456
|
+
}
|
32463
32457
|
},
|
32464
|
-
|
32465
|
-
|
32466
|
-
|
32467
|
-
|
32468
|
-
|
32469
|
-
|
32470
|
-
|
32458
|
+
consensus: {
|
32459
|
+
PoA: {
|
32460
|
+
signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
|
32461
|
+
}
|
32462
|
+
}
|
32463
|
+
};
|
32464
|
+
var metadata_default = {
|
32465
|
+
chain_config: "chainConfig.json",
|
32466
|
+
table_encoding: {
|
32467
|
+
Json: {
|
32468
|
+
filepath: "stateConfig.json"
|
32469
|
+
}
|
32470
|
+
}
|
32471
|
+
};
|
32472
|
+
var stateConfig_default = {
|
32473
|
+
coins: [
|
32474
|
+
{
|
32475
|
+
tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
|
32476
|
+
output_index: 0,
|
32477
|
+
tx_pointer_block_height: 0,
|
32478
|
+
tx_pointer_tx_idx: 0,
|
32479
|
+
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32480
|
+
amount: 18446744073709552e3,
|
32481
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32471
32482
|
},
|
32472
|
-
|
32473
|
-
|
32474
|
-
|
32475
|
-
|
32476
|
-
|
32483
|
+
{
|
32484
|
+
tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
|
32485
|
+
output_index: 0,
|
32486
|
+
tx_pointer_block_height: 0,
|
32487
|
+
tx_pointer_tx_idx: 0,
|
32488
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32489
|
+
amount: 18446744073709552e3,
|
32490
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32477
32491
|
},
|
32478
|
-
|
32479
|
-
|
32480
|
-
|
32492
|
+
{
|
32493
|
+
tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
|
32494
|
+
output_index: 0,
|
32495
|
+
tx_pointer_block_height: 0,
|
32496
|
+
tx_pointer_tx_idx: 0,
|
32497
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32498
|
+
amount: 18446744073709552e3,
|
32499
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32481
32500
|
},
|
32482
|
-
|
32483
|
-
|
32484
|
-
|
32501
|
+
{
|
32502
|
+
tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
|
32503
|
+
output_index: 0,
|
32504
|
+
tx_pointer_block_height: 0,
|
32505
|
+
tx_pointer_tx_idx: 0,
|
32506
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32507
|
+
amount: 18446744073709552e3,
|
32508
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32485
32509
|
},
|
32486
|
-
|
32487
|
-
|
32488
|
-
|
32510
|
+
{
|
32511
|
+
tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
|
32512
|
+
output_index: 0,
|
32513
|
+
tx_pointer_block_height: 0,
|
32514
|
+
tx_pointer_tx_idx: 0,
|
32515
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32516
|
+
amount: 18446744073709552e3,
|
32517
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32489
32518
|
},
|
32490
|
-
|
32491
|
-
|
32492
|
-
|
32493
|
-
|
32494
|
-
|
32495
|
-
|
32496
|
-
|
32497
|
-
|
32498
|
-
bal: 13,
|
32499
|
-
bhei: 1,
|
32500
|
-
bhsh: 1,
|
32501
|
-
burn: 132,
|
32502
|
-
cb: 1,
|
32503
|
-
cfei: 1,
|
32504
|
-
cfsi: 1,
|
32505
|
-
croo: 16,
|
32506
|
-
div: 1,
|
32507
|
-
divi: 1,
|
32508
|
-
ecr1: 3e3,
|
32509
|
-
eck1: 951,
|
32510
|
-
ed19: 3e3,
|
32511
|
-
eq: 1,
|
32512
|
-
exp: 1,
|
32513
|
-
expi: 1,
|
32514
|
-
flag: 1,
|
32515
|
-
gm: 1,
|
32516
|
-
gt: 1,
|
32517
|
-
gtf: 1,
|
32518
|
-
ji: 1,
|
32519
|
-
jmp: 1,
|
32520
|
-
jne: 1,
|
32521
|
-
jnei: 1,
|
32522
|
-
jnzi: 1,
|
32523
|
-
jmpf: 1,
|
32524
|
-
jmpb: 1,
|
32525
|
-
jnzf: 1,
|
32526
|
-
jnzb: 1,
|
32527
|
-
jnef: 1,
|
32528
|
-
jneb: 1,
|
32529
|
-
lb: 1,
|
32530
|
-
log: 9,
|
32531
|
-
lt: 1,
|
32532
|
-
lw: 1,
|
32533
|
-
mint: 135,
|
32534
|
-
mlog: 1,
|
32535
|
-
modOp: 1,
|
32536
|
-
modi: 1,
|
32537
|
-
moveOp: 1,
|
32538
|
-
movi: 1,
|
32539
|
-
mroo: 2,
|
32540
|
-
mul: 1,
|
32541
|
-
muli: 1,
|
32542
|
-
mldv: 1,
|
32543
|
-
noop: 1,
|
32544
|
-
not: 1,
|
32545
|
-
or: 1,
|
32546
|
-
ori: 1,
|
32547
|
-
poph: 2,
|
32548
|
-
popl: 2,
|
32549
|
-
pshh: 2,
|
32550
|
-
pshl: 2,
|
32551
|
-
ret: 13,
|
32552
|
-
rvrt: 13,
|
32553
|
-
sb: 1,
|
32554
|
-
sll: 1,
|
32555
|
-
slli: 1,
|
32556
|
-
srl: 1,
|
32557
|
-
srli: 1,
|
32558
|
-
srw: 12,
|
32559
|
-
sub: 1,
|
32560
|
-
subi: 1,
|
32561
|
-
sw: 1,
|
32562
|
-
sww: 67,
|
32563
|
-
time: 1,
|
32564
|
-
tr: 105,
|
32565
|
-
tro: 60,
|
32566
|
-
wdcm: 1,
|
32567
|
-
wqcm: 1,
|
32568
|
-
wdop: 1,
|
32569
|
-
wqop: 1,
|
32570
|
-
wdml: 1,
|
32571
|
-
wqml: 1,
|
32572
|
-
wddv: 1,
|
32573
|
-
wqdv: 2,
|
32574
|
-
wdmd: 3,
|
32575
|
-
wqmd: 4,
|
32576
|
-
wdam: 2,
|
32577
|
-
wqam: 3,
|
32578
|
-
wdmm: 3,
|
32579
|
-
wqmm: 3,
|
32580
|
-
xor: 1,
|
32581
|
-
xori: 1,
|
32582
|
-
call: {
|
32583
|
-
LightOperation: {
|
32584
|
-
base: 144,
|
32585
|
-
units_per_gas: 214
|
32586
|
-
}
|
32519
|
+
{
|
32520
|
+
tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
|
32521
|
+
output_index: 0,
|
32522
|
+
tx_pointer_block_height: 0,
|
32523
|
+
tx_pointer_tx_idx: 0,
|
32524
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32525
|
+
amount: 18446744073709552e3,
|
32526
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32587
32527
|
},
|
32588
|
-
|
32589
|
-
|
32590
|
-
|
32591
|
-
|
32592
|
-
|
32528
|
+
{
|
32529
|
+
tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
|
32530
|
+
output_index: 0,
|
32531
|
+
tx_pointer_block_height: 0,
|
32532
|
+
tx_pointer_tx_idx: 0,
|
32533
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32534
|
+
amount: 18446744073709552e3,
|
32535
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32593
32536
|
},
|
32594
|
-
|
32595
|
-
|
32596
|
-
|
32597
|
-
|
32598
|
-
|
32537
|
+
{
|
32538
|
+
tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
|
32539
|
+
output_index: 0,
|
32540
|
+
tx_pointer_block_height: 0,
|
32541
|
+
tx_pointer_tx_idx: 0,
|
32542
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32543
|
+
amount: 18446744073709552e3,
|
32544
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32599
32545
|
},
|
32600
|
-
|
32601
|
-
|
32602
|
-
|
32603
|
-
|
32604
|
-
|
32546
|
+
{
|
32547
|
+
tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
|
32548
|
+
output_index: 0,
|
32549
|
+
tx_pointer_block_height: 0,
|
32550
|
+
tx_pointer_tx_idx: 0,
|
32551
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32552
|
+
amount: 18446744073709552e3,
|
32553
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32605
32554
|
},
|
32606
|
-
|
32607
|
-
|
32608
|
-
|
32609
|
-
|
32610
|
-
|
32555
|
+
{
|
32556
|
+
tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
|
32557
|
+
output_index: 0,
|
32558
|
+
tx_pointer_block_height: 0,
|
32559
|
+
tx_pointer_tx_idx: 0,
|
32560
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32561
|
+
amount: 18446744073709552e3,
|
32562
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32611
32563
|
},
|
32612
|
-
|
32613
|
-
|
32614
|
-
|
32615
|
-
|
32616
|
-
|
32564
|
+
{
|
32565
|
+
tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
|
32566
|
+
output_index: 0,
|
32567
|
+
tx_pointer_block_height: 0,
|
32568
|
+
tx_pointer_tx_idx: 0,
|
32569
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32570
|
+
amount: 18446744073709552e3,
|
32571
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32617
32572
|
},
|
32618
|
-
|
32619
|
-
|
32620
|
-
|
32621
|
-
|
32622
|
-
|
32573
|
+
{
|
32574
|
+
tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
|
32575
|
+
output_index: 0,
|
32576
|
+
tx_pointer_block_height: 0,
|
32577
|
+
tx_pointer_tx_idx: 0,
|
32578
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32579
|
+
amount: 18446744073709552e3,
|
32580
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32623
32581
|
},
|
32624
|
-
|
32625
|
-
|
32626
|
-
|
32627
|
-
|
32628
|
-
|
32582
|
+
{
|
32583
|
+
tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
|
32584
|
+
output_index: 0,
|
32585
|
+
tx_pointer_block_height: 0,
|
32586
|
+
tx_pointer_tx_idx: 0,
|
32587
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32588
|
+
amount: 18446744073709552e3,
|
32589
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32629
32590
|
},
|
32630
|
-
|
32631
|
-
|
32632
|
-
|
32633
|
-
|
32634
|
-
|
32591
|
+
{
|
32592
|
+
tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
|
32593
|
+
output_index: 0,
|
32594
|
+
tx_pointer_block_height: 0,
|
32595
|
+
tx_pointer_tx_idx: 0,
|
32596
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32597
|
+
amount: 18446744073709552e3,
|
32598
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32635
32599
|
},
|
32636
|
-
|
32637
|
-
|
32638
|
-
|
32639
|
-
|
32640
|
-
|
32600
|
+
{
|
32601
|
+
tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
|
32602
|
+
output_index: 0,
|
32603
|
+
tx_pointer_block_height: 0,
|
32604
|
+
tx_pointer_tx_idx: 0,
|
32605
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32606
|
+
amount: 18446744073709552e3,
|
32607
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32641
32608
|
},
|
32642
|
-
|
32643
|
-
|
32644
|
-
|
32645
|
-
|
32646
|
-
|
32609
|
+
{
|
32610
|
+
tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
|
32611
|
+
output_index: 0,
|
32612
|
+
tx_pointer_block_height: 0,
|
32613
|
+
tx_pointer_tx_idx: 0,
|
32614
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32615
|
+
amount: 18446744073709552e3,
|
32616
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32647
32617
|
},
|
32648
|
-
|
32649
|
-
|
32650
|
-
|
32651
|
-
|
32652
|
-
|
32618
|
+
{
|
32619
|
+
tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
|
32620
|
+
output_index: 0,
|
32621
|
+
tx_pointer_block_height: 0,
|
32622
|
+
tx_pointer_tx_idx: 0,
|
32623
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32624
|
+
amount: 18446744073709552e3,
|
32625
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32653
32626
|
},
|
32654
|
-
|
32655
|
-
|
32656
|
-
|
32657
|
-
|
32658
|
-
|
32627
|
+
{
|
32628
|
+
tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
|
32629
|
+
output_index: 0,
|
32630
|
+
tx_pointer_block_height: 0,
|
32631
|
+
tx_pointer_tx_idx: 0,
|
32632
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32633
|
+
amount: 18446744073709552e3,
|
32634
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32659
32635
|
},
|
32660
|
-
|
32661
|
-
|
32662
|
-
|
32663
|
-
|
32664
|
-
|
32636
|
+
{
|
32637
|
+
tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
|
32638
|
+
output_index: 0,
|
32639
|
+
tx_pointer_block_height: 0,
|
32640
|
+
tx_pointer_tx_idx: 0,
|
32641
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32642
|
+
amount: 18446744073709552e3,
|
32643
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32665
32644
|
},
|
32666
|
-
|
32667
|
-
|
32668
|
-
|
32669
|
-
|
32670
|
-
|
32645
|
+
{
|
32646
|
+
tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
|
32647
|
+
output_index: 0,
|
32648
|
+
tx_pointer_block_height: 0,
|
32649
|
+
tx_pointer_tx_idx: 0,
|
32650
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32651
|
+
amount: 18446744073709552e3,
|
32652
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32671
32653
|
},
|
32672
|
-
|
32673
|
-
|
32674
|
-
|
32675
|
-
|
32676
|
-
|
32654
|
+
{
|
32655
|
+
tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
|
32656
|
+
output_index: 0,
|
32657
|
+
tx_pointer_block_height: 0,
|
32658
|
+
tx_pointer_tx_idx: 0,
|
32659
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32660
|
+
amount: 18446744073709552e3,
|
32661
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32677
32662
|
},
|
32678
|
-
|
32679
|
-
|
32680
|
-
|
32681
|
-
|
32682
|
-
|
32663
|
+
{
|
32664
|
+
tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
|
32665
|
+
output_index: 0,
|
32666
|
+
tx_pointer_block_height: 0,
|
32667
|
+
tx_pointer_tx_idx: 0,
|
32668
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32669
|
+
amount: 18446744073709552e3,
|
32670
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32683
32671
|
},
|
32684
|
-
|
32685
|
-
|
32686
|
-
|
32687
|
-
|
32688
|
-
|
32672
|
+
{
|
32673
|
+
tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
|
32674
|
+
output_index: 0,
|
32675
|
+
tx_pointer_block_height: 0,
|
32676
|
+
tx_pointer_tx_idx: 0,
|
32677
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32678
|
+
amount: 18446744073709552e3,
|
32679
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32689
32680
|
},
|
32690
|
-
|
32691
|
-
|
32692
|
-
|
32693
|
-
|
32694
|
-
|
32681
|
+
{
|
32682
|
+
tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
|
32683
|
+
output_index: 0,
|
32684
|
+
tx_pointer_block_height: 0,
|
32685
|
+
tx_pointer_tx_idx: 0,
|
32686
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32687
|
+
amount: 18446744073709552e3,
|
32688
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32695
32689
|
},
|
32696
|
-
|
32697
|
-
|
32698
|
-
|
32699
|
-
|
32700
|
-
|
32690
|
+
{
|
32691
|
+
tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
|
32692
|
+
output_index: 0,
|
32693
|
+
tx_pointer_block_height: 0,
|
32694
|
+
tx_pointer_tx_idx: 0,
|
32695
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32696
|
+
amount: 18446744073709552e3,
|
32697
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32701
32698
|
},
|
32702
|
-
|
32703
|
-
|
32704
|
-
|
32705
|
-
|
32706
|
-
|
32699
|
+
{
|
32700
|
+
tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
|
32701
|
+
output_index: 0,
|
32702
|
+
tx_pointer_block_height: 0,
|
32703
|
+
tx_pointer_tx_idx: 0,
|
32704
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32705
|
+
amount: 18446744073709552e3,
|
32706
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32707
|
+
},
|
32708
|
+
{
|
32709
|
+
tx_id: "0xbf2305d284ea95227040df4cc727156cccc2ca6aa3b92ed86fea4db1c37e5905f926",
|
32710
|
+
output_index: 0,
|
32711
|
+
tx_pointer_block_height: 0,
|
32712
|
+
tx_pointer_tx_idx: 0,
|
32713
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32714
|
+
amount: 18446744073709552e3,
|
32715
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32716
|
+
},
|
32717
|
+
{
|
32718
|
+
tx_id: "0xf4e1c76c72ecae699696f5e7a62ccf1425f7395080d0ca7b25ab63d1f841f425b807",
|
32719
|
+
output_index: 0,
|
32720
|
+
tx_pointer_block_height: 0,
|
32721
|
+
tx_pointer_tx_idx: 0,
|
32722
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32723
|
+
amount: 18446744073709552e3,
|
32724
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32725
|
+
},
|
32726
|
+
{
|
32727
|
+
tx_id: "0x619c80ee9f4c27c2e134cec6c67bdb268ce7fb1d2ac229ca2a44ec7ac88b2da99669",
|
32728
|
+
output_index: 0,
|
32729
|
+
tx_pointer_block_height: 0,
|
32730
|
+
tx_pointer_tx_idx: 0,
|
32731
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32732
|
+
amount: 18446744073709552e3,
|
32733
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32734
|
+
},
|
32735
|
+
{
|
32736
|
+
tx_id: "0x978d5b6be047ffbf1474dc376a6baa33264629b809e4a8210d11aaa805ec6451585d",
|
32737
|
+
output_index: 0,
|
32738
|
+
tx_pointer_block_height: 0,
|
32739
|
+
tx_pointer_tx_idx: 0,
|
32740
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32741
|
+
amount: 18446744073709552e3,
|
32742
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32743
|
+
},
|
32744
|
+
{
|
32745
|
+
tx_id: "0x673ba12fca6e52429896096262b8c59b61751976e552649fb1fe7369488fc10aa83c",
|
32746
|
+
output_index: 0,
|
32747
|
+
tx_pointer_block_height: 0,
|
32748
|
+
tx_pointer_tx_idx: 0,
|
32749
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32750
|
+
amount: 18446744073709552e3,
|
32751
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32752
|
+
},
|
32753
|
+
{
|
32754
|
+
tx_id: "0xc42a165104b9fcfa4a9ebffc707781ace233f1c0609c24c36a5c4bfcd407480ddb6c",
|
32755
|
+
output_index: 0,
|
32756
|
+
tx_pointer_block_height: 0,
|
32757
|
+
tx_pointer_tx_idx: 0,
|
32758
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32759
|
+
amount: 18446744073709552e3,
|
32760
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32761
|
+
},
|
32762
|
+
{
|
32763
|
+
tx_id: "0xb353fbcd94abba347f3ba25e17744e98da26e608ebccbbbd2e9d004997644bdf993c",
|
32764
|
+
output_index: 0,
|
32765
|
+
tx_pointer_block_height: 0,
|
32766
|
+
tx_pointer_tx_idx: 0,
|
32767
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32768
|
+
amount: 18446744073709552e3,
|
32769
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32770
|
+
},
|
32771
|
+
{
|
32772
|
+
tx_id: "0xc34a6fcb241dec82f885019caf5e14bb6708b435afebfef0037ac447fbb6d30378a3",
|
32773
|
+
output_index: 0,
|
32774
|
+
tx_pointer_block_height: 0,
|
32775
|
+
tx_pointer_tx_idx: 0,
|
32776
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32777
|
+
amount: 18446744073709552e3,
|
32778
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32779
|
+
},
|
32780
|
+
{
|
32781
|
+
tx_id: "0x421dfb5811c905724f2f4c6370cd15eaeb590ddeb966f9a4b9f8d65991dfe5142e12",
|
32782
|
+
output_index: 0,
|
32783
|
+
tx_pointer_block_height: 0,
|
32784
|
+
tx_pointer_tx_idx: 0,
|
32785
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32786
|
+
amount: 18446744073709552e3,
|
32787
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32788
|
+
},
|
32789
|
+
{
|
32790
|
+
tx_id: "0xa952c0487eefac5dda612011c4c82554c8660834461b9b815c6ae257b56b68005235",
|
32791
|
+
output_index: 0,
|
32792
|
+
tx_pointer_block_height: 0,
|
32793
|
+
tx_pointer_tx_idx: 0,
|
32794
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32795
|
+
amount: 18446744073709552e3,
|
32796
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32797
|
+
},
|
32798
|
+
{
|
32799
|
+
tx_id: "0xebaccf91b3b213341d047b6e6af214f1f9729b3d6dadf9c1918a9fe412486af871db",
|
32800
|
+
output_index: 0,
|
32801
|
+
tx_pointer_block_height: 0,
|
32802
|
+
tx_pointer_tx_idx: 0,
|
32803
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32804
|
+
amount: 18446744073709552e3,
|
32805
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32806
|
+
},
|
32807
|
+
{
|
32808
|
+
tx_id: "0xda6d61c153e7d735954408274f4ffe8459c2dbab720ce22a1ae9ffedd33077b5b19d",
|
32809
|
+
output_index: 0,
|
32810
|
+
tx_pointer_block_height: 0,
|
32811
|
+
tx_pointer_tx_idx: 0,
|
32812
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32813
|
+
amount: 18446744073709552e3,
|
32814
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32815
|
+
},
|
32816
|
+
{
|
32817
|
+
tx_id: "0x508871600ef68c4f1e021dd0db219c733107151338aa95de530bd10dc61f6a69c144",
|
32818
|
+
output_index: 0,
|
32819
|
+
tx_pointer_block_height: 0,
|
32820
|
+
tx_pointer_tx_idx: 0,
|
32821
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32822
|
+
amount: 18446744073709552e3,
|
32823
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32824
|
+
},
|
32825
|
+
{
|
32826
|
+
tx_id: "0x509994738b4973e2dbbff9596b176a89fb07ee95f0ed575a4fe07a735a2a181f3200",
|
32827
|
+
output_index: 0,
|
32828
|
+
tx_pointer_block_height: 0,
|
32829
|
+
tx_pointer_tx_idx: 0,
|
32830
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32831
|
+
amount: 18446744073709552e3,
|
32832
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32833
|
+
},
|
32834
|
+
{
|
32835
|
+
tx_id: "0x6cc0cb58df0e0606fc85481aaaf5f47e145a67240b298c184bcb7fd7367c3bbf9453",
|
32836
|
+
output_index: 0,
|
32837
|
+
tx_pointer_block_height: 0,
|
32838
|
+
tx_pointer_tx_idx: 0,
|
32839
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32840
|
+
amount: 18446744073709552e3,
|
32841
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32842
|
+
},
|
32843
|
+
{
|
32844
|
+
tx_id: "0x9ddea761afc31516307e1553647ac6cc26d4a82fed9a9e6a03b994cdbf2293b3e3b6",
|
32845
|
+
output_index: 0,
|
32846
|
+
tx_pointer_block_height: 0,
|
32847
|
+
tx_pointer_tx_idx: 0,
|
32848
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32849
|
+
amount: 18446744073709552e3,
|
32850
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32851
|
+
},
|
32852
|
+
{
|
32853
|
+
tx_id: "0x82dbc478ba63abf28b92d9dce0cb8c2e6c02833d436fe812a33cf78417e4a80c1306",
|
32854
|
+
output_index: 0,
|
32855
|
+
tx_pointer_block_height: 0,
|
32856
|
+
tx_pointer_tx_idx: 0,
|
32857
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32858
|
+
amount: 18446744073709552e3,
|
32859
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32860
|
+
},
|
32861
|
+
{
|
32862
|
+
tx_id: "0xc3b0cb232c74009fd226a6246403f78bcc33d116579f41d9387c0d76c76942749c7c",
|
32863
|
+
output_index: 0,
|
32864
|
+
tx_pointer_block_height: 0,
|
32865
|
+
tx_pointer_tx_idx: 0,
|
32866
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32867
|
+
amount: 18446744073709552e3,
|
32868
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32869
|
+
},
|
32870
|
+
{
|
32871
|
+
tx_id: "0x708ee45d18f94ab06458712745c92c7b9b6049ba345219d6697eae5208ec0328aeaf",
|
32872
|
+
output_index: 0,
|
32873
|
+
tx_pointer_block_height: 0,
|
32874
|
+
tx_pointer_tx_idx: 0,
|
32875
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32876
|
+
amount: 18446744073709552e3,
|
32877
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32878
|
+
},
|
32879
|
+
{
|
32880
|
+
tx_id: "0xfe26968c44ac5becc608ce543075ae9e677b7631f3beb7a11ba20703fdca3c0e3569",
|
32881
|
+
output_index: 0,
|
32882
|
+
tx_pointer_block_height: 0,
|
32883
|
+
tx_pointer_tx_idx: 0,
|
32884
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32885
|
+
amount: 18446744073709552e3,
|
32886
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32887
|
+
},
|
32888
|
+
{
|
32889
|
+
tx_id: "0xe0ec1d2c991feac69be4d0e84ad7c964616de08e16dccc4d2000b1900ba31082b993",
|
32890
|
+
output_index: 0,
|
32891
|
+
tx_pointer_block_height: 0,
|
32892
|
+
tx_pointer_tx_idx: 0,
|
32893
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32894
|
+
amount: 18446744073709552e3,
|
32895
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32896
|
+
},
|
32897
|
+
{
|
32898
|
+
tx_id: "0xfa82dbdd72252d1e6c76ee818bbac0441c3a705aff447f041c8b9fc3cb03f9ccd7e2",
|
32899
|
+
output_index: 0,
|
32900
|
+
tx_pointer_block_height: 0,
|
32901
|
+
tx_pointer_tx_idx: 0,
|
32902
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32903
|
+
amount: 18446744073709552e3,
|
32904
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32905
|
+
},
|
32906
|
+
{
|
32907
|
+
tx_id: "0x324f45e47cef892ac3e0759f3b72207c77046f9938267af4bd4af2ae031b97cb36c8",
|
32908
|
+
output_index: 0,
|
32909
|
+
tx_pointer_block_height: 0,
|
32910
|
+
tx_pointer_tx_idx: 0,
|
32911
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32912
|
+
amount: 18446744073709552e3,
|
32913
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32707
32914
|
}
|
32708
|
-
|
32915
|
+
],
|
32916
|
+
messages: [
|
32917
|
+
{
|
32918
|
+
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32919
|
+
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32920
|
+
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32921
|
+
amount: 18446744073709552e3,
|
32922
|
+
data: "",
|
32923
|
+
da_height: 0
|
32924
|
+
},
|
32925
|
+
{
|
32926
|
+
sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32927
|
+
recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32928
|
+
nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
|
32929
|
+
amount: 12704439083013452e3,
|
32930
|
+
data: "",
|
32931
|
+
da_height: 0
|
32932
|
+
}
|
32933
|
+
],
|
32934
|
+
contracts: [],
|
32935
|
+
block_height: 0,
|
32936
|
+
da_block_height: 0
|
32937
|
+
};
|
32938
|
+
var defaultChainConfigs = {
|
32939
|
+
chainConfigJson: chainConfig_default,
|
32940
|
+
metadataJson: metadata_default,
|
32941
|
+
stateConfigJson: stateConfig_default
|
32709
32942
|
};
|
32710
|
-
var defaultChainConfig = chainConfig_default;
|
32711
32943
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32712
32944
|
|
32713
32945
|
// ../crypto/dist/index.mjs
|
@@ -34756,6 +34988,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34756
34988
|
}
|
34757
34989
|
};
|
34758
34990
|
|
34991
|
+
// ../address/dist/configs.mjs
|
34992
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
34993
|
+
var BaseAssetId = ZeroBytes32;
|
34994
|
+
|
34759
34995
|
// ../math/dist/index.mjs
|
34760
34996
|
var import_bn = __toESM(require_bn(), 1);
|
34761
34997
|
var DEFAULT_PRECISION = 9;
|
@@ -34975,32 +35211,182 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34975
35211
|
function toBytes3(value, bytesPadding) {
|
34976
35212
|
return bn(value).toBytes(bytesPadding);
|
34977
35213
|
}
|
34978
|
-
|
34979
|
-
|
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" : ""));
|
34980
35260
|
}
|
34981
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
|
+
|
34982
35368
|
// src/providers/coin-quantity.ts
|
34983
35369
|
var coinQuantityfy = (coinQuantityLike) => {
|
34984
35370
|
let assetId;
|
34985
35371
|
let amount;
|
34986
|
-
let
|
35372
|
+
let max;
|
34987
35373
|
if (Array.isArray(coinQuantityLike)) {
|
34988
35374
|
amount = coinQuantityLike[0];
|
34989
|
-
assetId = coinQuantityLike[1];
|
34990
|
-
|
35375
|
+
assetId = coinQuantityLike[1] ?? BaseAssetId;
|
35376
|
+
max = coinQuantityLike[2] ?? void 0;
|
34991
35377
|
} else {
|
34992
35378
|
amount = coinQuantityLike.amount;
|
34993
|
-
assetId = coinQuantityLike.assetId;
|
34994
|
-
|
35379
|
+
assetId = coinQuantityLike.assetId ?? BaseAssetId;
|
35380
|
+
max = coinQuantityLike.max ?? void 0;
|
34995
35381
|
}
|
34996
35382
|
const bnAmount = bn(amount);
|
34997
35383
|
return {
|
34998
35384
|
assetId: hexlify(assetId),
|
34999
35385
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35000
|
-
max:
|
35386
|
+
max: max ? bn(max) : void 0
|
35001
35387
|
};
|
35002
35388
|
};
|
35003
|
-
var
|
35389
|
+
var addAmountToCoinQuantities = (params) => {
|
35004
35390
|
const { amount, assetId } = params;
|
35005
35391
|
const coinQuantities = [...params.coinQuantities];
|
35006
35392
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35067,7 +35453,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35067
35453
|
var ENCODING_V1 = "1";
|
35068
35454
|
var WORD_SIZE = 8;
|
35069
35455
|
var BYTES_32 = 32;
|
35070
|
-
var UTXO_ID_LEN = BYTES_32 +
|
35456
|
+
var UTXO_ID_LEN = BYTES_32 + 2;
|
35071
35457
|
var ASSET_ID_LEN = BYTES_32;
|
35072
35458
|
var ADDRESS_LEN = BYTES_32;
|
35073
35459
|
var NONCE_LEN = BYTES_32;
|
@@ -35075,9 +35461,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35075
35461
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35076
35462
|
var MAX_BYTES = 2 ** 32 - 1;
|
35077
35463
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35078
|
-
|
35464
|
+
ASSET_ID_LEN + // Base asset ID
|
35079
35465
|
// Asset ID/Balance coin input pairs
|
35080
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35466
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE) + WORD_SIZE;
|
35081
35467
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35082
35468
|
WORD_SIZE + // Gas limit
|
35083
35469
|
WORD_SIZE + // Script size
|
@@ -35095,7 +35481,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35095
35481
|
ASSET_ID_LEN + // Asset id
|
35096
35482
|
TX_POINTER_LEN + // TxPointer
|
35097
35483
|
WORD_SIZE + // Witnesses index
|
35098
|
-
WORD_SIZE + // Maturity
|
35099
35484
|
WORD_SIZE + // Predicate size
|
35100
35485
|
WORD_SIZE + // Predicate data size
|
35101
35486
|
WORD_SIZE;
|
@@ -35417,7 +35802,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35417
35802
|
constructor(name, coders) {
|
35418
35803
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35419
35804
|
const encodedValueSize = Object.values(coders).reduce(
|
35420
|
-
(
|
35805
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
35421
35806
|
0
|
35422
35807
|
);
|
35423
35808
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36135,7 +36520,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36135
36520
|
constructor(name, coders) {
|
36136
36521
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36137
36522
|
const encodedValueSize = Object.values(coders).reduce(
|
36138
|
-
(
|
36523
|
+
(max, coder) => Math.max(max, coder.encodedLength),
|
36139
36524
|
0
|
36140
36525
|
);
|
36141
36526
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36849,18 +37234,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36849
37234
|
encode(value) {
|
36850
37235
|
const parts = [];
|
36851
37236
|
parts.push(new B256Coder().encode(value.txID));
|
36852
|
-
parts.push(new NumberCoder("
|
37237
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36853
37238
|
parts.push(new B256Coder().encode(value.owner));
|
36854
37239
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36855
37240
|
parts.push(new B256Coder().encode(value.assetId));
|
36856
37241
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
36857
|
-
parts.push(new NumberCoder("
|
36858
|
-
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37242
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36859
37243
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36860
|
-
parts.push(new
|
36861
|
-
parts.push(new
|
36862
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36863
|
-
parts.push(
|
37244
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37245
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
37246
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37247
|
+
parts.push(
|
37248
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37249
|
+
);
|
36864
37250
|
return concat(parts);
|
36865
37251
|
}
|
36866
37252
|
decode(data, offset) {
|
@@ -36868,7 +37254,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36868
37254
|
let o = offset;
|
36869
37255
|
[decoded, o] = new B256Coder().decode(data, o);
|
36870
37256
|
const txID = decoded;
|
36871
|
-
[decoded, o] = new NumberCoder("
|
37257
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36872
37258
|
const outputIndex = decoded;
|
36873
37259
|
[decoded, o] = new B256Coder().decode(data, o);
|
36874
37260
|
const owner = decoded;
|
@@ -36878,19 +37264,17 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36878
37264
|
const assetId = decoded;
|
36879
37265
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
36880
37266
|
const txPointer = decoded;
|
36881
|
-
[decoded, o] = new NumberCoder("
|
37267
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36882
37268
|
const witnessIndex = Number(decoded);
|
36883
|
-
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36884
|
-
const maturity = decoded;
|
36885
37269
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36886
37270
|
const predicateGasUsed = decoded;
|
36887
|
-
[decoded, o] = new
|
37271
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36888
37272
|
const predicateLength = decoded;
|
36889
|
-
[decoded, o] = new
|
37273
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
36890
37274
|
const predicateDataLength = decoded;
|
36891
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37275
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
36892
37276
|
const predicate = decoded;
|
36893
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37277
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
36894
37278
|
const predicateData = decoded;
|
36895
37279
|
return [
|
36896
37280
|
{
|
@@ -36902,7 +37286,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36902
37286
|
assetId,
|
36903
37287
|
txPointer,
|
36904
37288
|
witnessIndex,
|
36905
|
-
maturity,
|
36906
37289
|
predicateGasUsed,
|
36907
37290
|
predicateLength,
|
36908
37291
|
predicateDataLength,
|
@@ -36920,7 +37303,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36920
37303
|
encode(value) {
|
36921
37304
|
const parts = [];
|
36922
37305
|
parts.push(new B256Coder().encode(value.txID));
|
36923
|
-
parts.push(new NumberCoder("
|
37306
|
+
parts.push(new NumberCoder("u16").encode(value.outputIndex));
|
36924
37307
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
36925
37308
|
parts.push(new B256Coder().encode(value.stateRoot));
|
36926
37309
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -36932,7 +37315,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36932
37315
|
let o = offset;
|
36933
37316
|
[decoded, o] = new B256Coder().decode(data, o);
|
36934
37317
|
const txID = decoded;
|
36935
|
-
[decoded, o] = new NumberCoder("
|
37318
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
36936
37319
|
const outputIndex = decoded;
|
36937
37320
|
[decoded, o] = new B256Coder().decode(data, o);
|
36938
37321
|
const balanceRoot = decoded;
|
@@ -36981,14 +37364,16 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36981
37364
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
36982
37365
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
36983
37366
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
36984
|
-
parts.push(new NumberCoder("
|
37367
|
+
parts.push(new NumberCoder("u16").encode(value.witnessIndex));
|
36985
37368
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
36986
|
-
parts.push(new
|
36987
|
-
parts.push(new
|
36988
|
-
parts.push(new
|
37369
|
+
parts.push(new BigNumberCoder("u64").encode(data.length));
|
37370
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateLength));
|
37371
|
+
parts.push(new BigNumberCoder("u64").encode(value.predicateDataLength));
|
36989
37372
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
36990
|
-
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36991
|
-
parts.push(
|
37373
|
+
parts.push(new ByteArrayCoder(value.predicateLength.toNumber()).encode(value.predicate));
|
37374
|
+
parts.push(
|
37375
|
+
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37376
|
+
);
|
36992
37377
|
return concat(parts);
|
36993
37378
|
}
|
36994
37379
|
static decodeData(messageData) {
|
@@ -37008,21 +37393,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37008
37393
|
const amount = decoded;
|
37009
37394
|
[decoded, o] = new B256Coder().decode(data, o);
|
37010
37395
|
const nonce = decoded;
|
37011
|
-
[decoded, o] = new NumberCoder("
|
37396
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37012
37397
|
const witnessIndex = Number(decoded);
|
37013
37398
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37014
37399
|
const predicateGasUsed = decoded;
|
37015
37400
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37016
37401
|
const dataLength2 = decoded;
|
37017
|
-
[decoded, o] = new
|
37402
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37018
37403
|
const predicateLength = decoded;
|
37019
|
-
[decoded, o] = new
|
37404
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37020
37405
|
const predicateDataLength = decoded;
|
37021
37406
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37022
37407
|
const messageData = decoded;
|
37023
|
-
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37408
|
+
[decoded, o] = new ByteArrayCoder(predicateLength.toNumber()).decode(data, o);
|
37024
37409
|
const predicate = decoded;
|
37025
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37410
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength.toNumber()).decode(data, o);
|
37026
37411
|
const predicateData = decoded;
|
37027
37412
|
return [
|
37028
37413
|
{
|
@@ -37334,7 +37719,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37334
37719
|
}
|
37335
37720
|
};
|
37336
37721
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37337
|
-
PolicyType2[PolicyType2["
|
37722
|
+
PolicyType2[PolicyType2["Tip"] = 1] = "Tip";
|
37338
37723
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37339
37724
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37340
37725
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37382,9 +37767,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37382
37767
|
let o = offset;
|
37383
37768
|
const policies = [];
|
37384
37769
|
if (policyTypes & 1) {
|
37385
|
-
const [
|
37770
|
+
const [tip, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37386
37771
|
o = nextOffset;
|
37387
|
-
policies.push({ type: 1, data:
|
37772
|
+
policies.push({ type: 1, data: tip });
|
37388
37773
|
}
|
37389
37774
|
if (policyTypes & 2) {
|
37390
37775
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -37616,15 +38001,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37616
38001
|
encode(value) {
|
37617
38002
|
const parts = [];
|
37618
38003
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
37619
|
-
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37620
|
-
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
37621
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37622
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37623
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37624
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37625
38004
|
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37626
|
-
parts.push(new
|
37627
|
-
parts.push(new
|
38005
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptLength));
|
38006
|
+
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
38007
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38008
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38009
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38010
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
38011
|
+
parts.push(new ByteArrayCoder(value.scriptLength.toNumber()).encode(value.script));
|
38012
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength.toNumber()).encode(value.scriptData));
|
37628
38013
|
parts.push(new PoliciesCoder().encode(value.policies));
|
37629
38014
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37630
38015
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -37636,23 +38021,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37636
38021
|
let o = offset;
|
37637
38022
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37638
38023
|
const scriptGasLimit = decoded;
|
37639
|
-
[decoded, o] = new
|
38024
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38025
|
+
const receiptsRoot = decoded;
|
38026
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37640
38027
|
const scriptLength = decoded;
|
37641
|
-
[decoded, o] = new
|
38028
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37642
38029
|
const scriptDataLength = decoded;
|
37643
38030
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37644
38031
|
const policyTypes = decoded;
|
37645
|
-
[decoded, o] = new NumberCoder("
|
38032
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37646
38033
|
const inputsCount = decoded;
|
37647
|
-
[decoded, o] = new NumberCoder("
|
38034
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37648
38035
|
const outputsCount = decoded;
|
37649
|
-
[decoded, o] = new NumberCoder("
|
38036
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37650
38037
|
const witnessesCount = decoded;
|
37651
|
-
[decoded, o] = new
|
37652
|
-
const receiptsRoot = decoded;
|
37653
|
-
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38038
|
+
[decoded, o] = new ByteArrayCoder(scriptLength.toNumber()).decode(data, o);
|
37654
38039
|
const script = decoded;
|
37655
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38040
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength.toNumber()).decode(data, o);
|
37656
38041
|
const scriptData = decoded;
|
37657
38042
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37658
38043
|
const policies = decoded;
|
@@ -37690,18 +38075,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37690
38075
|
}
|
37691
38076
|
encode(value) {
|
37692
38077
|
const parts = [];
|
37693
|
-
parts.push(new NumberCoder("
|
37694
|
-
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
37695
|
-
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
37696
|
-
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37697
|
-
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37698
|
-
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37699
|
-
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
38078
|
+
parts.push(new NumberCoder("u16").encode(value.bytecodeWitnessIndex));
|
37700
38079
|
parts.push(new B256Coder().encode(value.salt));
|
37701
|
-
parts.push(new
|
38080
|
+
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
38081
|
+
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38082
|
+
parts.push(new NumberCoder("u16").encode(value.inputsCount));
|
38083
|
+
parts.push(new NumberCoder("u16").encode(value.outputsCount));
|
38084
|
+
parts.push(new NumberCoder("u16").encode(value.witnessesCount));
|
37702
38085
|
parts.push(
|
37703
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(
|
38086
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount.toNumber()).encode(
|
38087
|
+
value.storageSlots
|
38088
|
+
)
|
37704
38089
|
);
|
38090
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
37705
38091
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
37706
38092
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
37707
38093
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -37710,26 +38096,27 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37710
38096
|
decode(data, offset) {
|
37711
38097
|
let decoded;
|
37712
38098
|
let o = offset;
|
37713
|
-
[decoded, o] = new NumberCoder("
|
37714
|
-
const bytecodeLength = decoded;
|
37715
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38099
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37716
38100
|
const bytecodeWitnessIndex = decoded;
|
38101
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
38102
|
+
const salt = decoded;
|
38103
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38104
|
+
const storageSlotsCount = decoded;
|
37717
38105
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37718
38106
|
const policyTypes = decoded;
|
37719
38107
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37720
|
-
const storageSlotsCount = decoded;
|
37721
|
-
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37722
38108
|
const inputsCount = decoded;
|
37723
|
-
[decoded, o] = new NumberCoder("
|
38109
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37724
38110
|
const outputsCount = decoded;
|
37725
|
-
[decoded, o] = new NumberCoder("
|
38111
|
+
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37726
38112
|
const witnessesCount = decoded;
|
37727
|
-
[decoded, o] = new
|
37728
|
-
|
38113
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount.toNumber()).decode(
|
38114
|
+
data,
|
38115
|
+
o
|
38116
|
+
);
|
38117
|
+
const storageSlots = decoded;
|
37729
38118
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
37730
38119
|
const policies = decoded;
|
37731
|
-
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37732
|
-
const storageSlots = decoded;
|
37733
38120
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
37734
38121
|
const inputs = decoded;
|
37735
38122
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -37739,7 +38126,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37739
38126
|
return [
|
37740
38127
|
{
|
37741
38128
|
type: 1,
|
37742
|
-
bytecodeLength,
|
37743
38129
|
bytecodeWitnessIndex,
|
37744
38130
|
policyTypes,
|
37745
38131
|
storageSlotsCount,
|
@@ -37768,6 +38154,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37768
38154
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
37769
38155
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
37770
38156
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38157
|
+
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
37771
38158
|
return concat(parts);
|
37772
38159
|
}
|
37773
38160
|
decode(data, offset) {
|
@@ -37783,6 +38170,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37783
38170
|
const mintAmount = decoded;
|
37784
38171
|
[decoded, o] = new B256Coder().decode(data, o);
|
37785
38172
|
const mintAssetId = decoded;
|
38173
|
+
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38174
|
+
const gasPrice = decoded;
|
37786
38175
|
return [
|
37787
38176
|
{
|
37788
38177
|
type: 2,
|
@@ -37790,7 +38179,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37790
38179
|
inputContract,
|
37791
38180
|
outputContract,
|
37792
38181
|
mintAmount,
|
37793
|
-
mintAssetId
|
38182
|
+
mintAssetId,
|
38183
|
+
gasPrice
|
37794
38184
|
},
|
37795
38185
|
o
|
37796
38186
|
];
|
@@ -38097,159 +38487,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38097
38487
|
// src/providers/provider.ts
|
38098
38488
|
var import_graphql_request = __toESM(require_dist2());
|
38099
38489
|
|
38100
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38101
|
-
function _isPlaceholder(a) {
|
38102
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38103
|
-
}
|
38104
|
-
|
38105
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38106
|
-
function _curry1(fn) {
|
38107
|
-
return function f1(a) {
|
38108
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38109
|
-
return f1;
|
38110
|
-
} else {
|
38111
|
-
return fn.apply(this, arguments);
|
38112
|
-
}
|
38113
|
-
};
|
38114
|
-
}
|
38115
|
-
|
38116
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38117
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
38118
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38119
|
-
};
|
38120
|
-
|
38121
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38122
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38123
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38124
|
-
});
|
38125
|
-
var type_default = type;
|
38126
|
-
|
38127
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38128
|
-
var pad = function pad2(n) {
|
38129
|
-
return (n < 10 ? "0" : "") + n;
|
38130
|
-
};
|
38131
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38132
|
-
return d.toISOString();
|
38133
|
-
} : function _toISOString3(d) {
|
38134
|
-
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";
|
38135
|
-
};
|
38136
|
-
|
38137
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38138
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38139
|
-
return n << 0 === n;
|
38140
|
-
};
|
38141
|
-
|
38142
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38143
|
-
function _cloneRegExp(pattern) {
|
38144
|
-
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" : ""));
|
38145
|
-
}
|
38146
|
-
|
38147
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38148
|
-
function _clone(value, deep, map) {
|
38149
|
-
map || (map = new _ObjectMap());
|
38150
|
-
if (_isPrimitive(value)) {
|
38151
|
-
return value;
|
38152
|
-
}
|
38153
|
-
var copy = function copy2(copiedValue) {
|
38154
|
-
var cachedCopy = map.get(value);
|
38155
|
-
if (cachedCopy) {
|
38156
|
-
return cachedCopy;
|
38157
|
-
}
|
38158
|
-
map.set(value, copiedValue);
|
38159
|
-
for (var key in value) {
|
38160
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38161
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38162
|
-
}
|
38163
|
-
}
|
38164
|
-
return copiedValue;
|
38165
|
-
};
|
38166
|
-
switch (type_default(value)) {
|
38167
|
-
case "Object":
|
38168
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
38169
|
-
case "Array":
|
38170
|
-
return copy([]);
|
38171
|
-
case "Date":
|
38172
|
-
return new Date(value.valueOf());
|
38173
|
-
case "RegExp":
|
38174
|
-
return _cloneRegExp(value);
|
38175
|
-
case "Int8Array":
|
38176
|
-
case "Uint8Array":
|
38177
|
-
case "Uint8ClampedArray":
|
38178
|
-
case "Int16Array":
|
38179
|
-
case "Uint16Array":
|
38180
|
-
case "Int32Array":
|
38181
|
-
case "Uint32Array":
|
38182
|
-
case "Float32Array":
|
38183
|
-
case "Float64Array":
|
38184
|
-
case "BigInt64Array":
|
38185
|
-
case "BigUint64Array":
|
38186
|
-
return value.slice();
|
38187
|
-
default:
|
38188
|
-
return value;
|
38189
|
-
}
|
38190
|
-
}
|
38191
|
-
function _isPrimitive(param) {
|
38192
|
-
var type3 = typeof param;
|
38193
|
-
return param == null || type3 != "object" && type3 != "function";
|
38194
|
-
}
|
38195
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
38196
|
-
function _ObjectMap2() {
|
38197
|
-
this.map = {};
|
38198
|
-
this.length = 0;
|
38199
|
-
}
|
38200
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
38201
|
-
const hashedKey = this.hash(key);
|
38202
|
-
let bucket = this.map[hashedKey];
|
38203
|
-
if (!bucket) {
|
38204
|
-
this.map[hashedKey] = bucket = [];
|
38205
|
-
}
|
38206
|
-
bucket.push([key, value]);
|
38207
|
-
this.length += 1;
|
38208
|
-
};
|
38209
|
-
_ObjectMap2.prototype.hash = function(key) {
|
38210
|
-
let hashedKey = [];
|
38211
|
-
for (var value in key) {
|
38212
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38213
|
-
}
|
38214
|
-
return hashedKey.join();
|
38215
|
-
};
|
38216
|
-
_ObjectMap2.prototype.get = function(key) {
|
38217
|
-
if (this.length <= 180) {
|
38218
|
-
for (const p in this.map) {
|
38219
|
-
const bucket2 = this.map[p];
|
38220
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
38221
|
-
const element = bucket2[i];
|
38222
|
-
if (element[0] === key) {
|
38223
|
-
return element[1];
|
38224
|
-
}
|
38225
|
-
}
|
38226
|
-
}
|
38227
|
-
return;
|
38228
|
-
}
|
38229
|
-
const hashedKey = this.hash(key);
|
38230
|
-
const bucket = this.map[hashedKey];
|
38231
|
-
if (!bucket) {
|
38232
|
-
return;
|
38233
|
-
}
|
38234
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
38235
|
-
const element = bucket[i];
|
38236
|
-
if (element[0] === key) {
|
38237
|
-
return element[1];
|
38238
|
-
}
|
38239
|
-
}
|
38240
|
-
};
|
38241
|
-
return _ObjectMap2;
|
38242
|
-
}();
|
38243
|
-
|
38244
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38245
|
-
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38246
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38247
|
-
});
|
38248
|
-
var clone_default = clone2;
|
38249
|
-
|
38250
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38251
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38252
|
-
|
38253
38490
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38254
38491
|
var __assign = function() {
|
38255
38492
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41415,16 +41652,40 @@ spurious results.`);
|
|
41415
41652
|
var lib_default2 = gql;
|
41416
41653
|
|
41417
41654
|
// src/providers/__generated__/operations.ts
|
41655
|
+
var TransactionStatusSubscriptionFragmentFragmentDoc = lib_default2`
|
41656
|
+
fragment transactionStatusSubscriptionFragment on TransactionStatus {
|
41657
|
+
type: __typename
|
41658
|
+
... on SubmittedStatus {
|
41659
|
+
time
|
41660
|
+
}
|
41661
|
+
... on SuccessStatus {
|
41662
|
+
block {
|
41663
|
+
id
|
41664
|
+
}
|
41665
|
+
time
|
41666
|
+
programState {
|
41667
|
+
returnType
|
41668
|
+
data
|
41669
|
+
}
|
41670
|
+
}
|
41671
|
+
... on FailureStatus {
|
41672
|
+
block {
|
41673
|
+
id
|
41674
|
+
}
|
41675
|
+
time
|
41676
|
+
reason
|
41677
|
+
}
|
41678
|
+
... on SqueezedOutStatus {
|
41679
|
+
reason
|
41680
|
+
}
|
41681
|
+
}
|
41682
|
+
`;
|
41418
41683
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41419
41684
|
fragment receiptFragment on Receipt {
|
41420
|
-
|
41421
|
-
id
|
41422
|
-
}
|
41685
|
+
id
|
41423
41686
|
pc
|
41424
41687
|
is
|
41425
|
-
to
|
41426
|
-
id
|
41427
|
-
}
|
41688
|
+
to
|
41428
41689
|
toAddress
|
41429
41690
|
amount
|
41430
41691
|
assetId
|
@@ -41462,10 +41723,16 @@ spurious results.`);
|
|
41462
41723
|
id
|
41463
41724
|
}
|
41464
41725
|
time
|
41726
|
+
receipts {
|
41727
|
+
...receiptFragment
|
41728
|
+
}
|
41465
41729
|
programState {
|
41466
41730
|
returnType
|
41467
41731
|
data
|
41468
41732
|
}
|
41733
|
+
receipts {
|
41734
|
+
...receiptFragment
|
41735
|
+
}
|
41469
41736
|
}
|
41470
41737
|
... on FailureStatus {
|
41471
41738
|
block {
|
@@ -41473,26 +41740,24 @@ spurious results.`);
|
|
41473
41740
|
}
|
41474
41741
|
time
|
41475
41742
|
reason
|
41743
|
+
receipts {
|
41744
|
+
...receiptFragment
|
41745
|
+
}
|
41476
41746
|
}
|
41477
41747
|
... on SqueezedOutStatus {
|
41478
41748
|
reason
|
41479
41749
|
}
|
41480
41750
|
}
|
41481
|
-
`;
|
41751
|
+
${ReceiptFragmentFragmentDoc}`;
|
41482
41752
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41483
41753
|
fragment transactionFragment on Transaction {
|
41484
41754
|
id
|
41485
41755
|
rawPayload
|
41486
|
-
gasPrice
|
41487
|
-
receipts {
|
41488
|
-
...receiptFragment
|
41489
|
-
}
|
41490
41756
|
status {
|
41491
41757
|
...transactionStatusFragment
|
41492
41758
|
}
|
41493
41759
|
}
|
41494
|
-
${
|
41495
|
-
${TransactionStatusFragmentFragmentDoc}`;
|
41760
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41496
41761
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41497
41762
|
fragment inputEstimatePredicatesFragment on Input {
|
41498
41763
|
... on InputCoin {
|
@@ -41510,6 +41775,46 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41510
41775
|
}
|
41511
41776
|
}
|
41512
41777
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41778
|
+
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41779
|
+
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41780
|
+
reason
|
41781
|
+
programState {
|
41782
|
+
returnType
|
41783
|
+
data
|
41784
|
+
}
|
41785
|
+
}
|
41786
|
+
`;
|
41787
|
+
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41788
|
+
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41789
|
+
programState {
|
41790
|
+
returnType
|
41791
|
+
data
|
41792
|
+
}
|
41793
|
+
}
|
41794
|
+
`;
|
41795
|
+
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41796
|
+
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41797
|
+
... on DryRunFailureStatus {
|
41798
|
+
...dryRunFailureStatusFragment
|
41799
|
+
}
|
41800
|
+
... on DryRunSuccessStatus {
|
41801
|
+
...dryRunSuccessStatusFragment
|
41802
|
+
}
|
41803
|
+
}
|
41804
|
+
${DryRunFailureStatusFragmentFragmentDoc}
|
41805
|
+
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41806
|
+
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41807
|
+
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41808
|
+
id
|
41809
|
+
status {
|
41810
|
+
...dryRunTransactionStatusFragment
|
41811
|
+
}
|
41812
|
+
receipts {
|
41813
|
+
...receiptFragment
|
41814
|
+
}
|
41815
|
+
}
|
41816
|
+
${DryRunTransactionStatusFragmentFragmentDoc}
|
41817
|
+
${ReceiptFragmentFragmentDoc}`;
|
41513
41818
|
var CoinFragmentFragmentDoc = lib_default2`
|
41514
41819
|
fragment coinFragment on Coin {
|
41515
41820
|
__typename
|
@@ -41517,7 +41822,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41517
41822
|
owner
|
41518
41823
|
amount
|
41519
41824
|
assetId
|
41520
|
-
maturity
|
41521
41825
|
blockCreated
|
41522
41826
|
txCreatedIdx
|
41523
41827
|
}
|
@@ -41556,26 +41860,32 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41556
41860
|
messageBlockHeader {
|
41557
41861
|
id
|
41558
41862
|
daHeight
|
41863
|
+
consensusParametersVersion
|
41864
|
+
stateTransitionBytecodeVersion
|
41559
41865
|
transactionsCount
|
41866
|
+
messageReceiptCount
|
41560
41867
|
transactionsRoot
|
41868
|
+
messageOutboxRoot
|
41869
|
+
eventInboxRoot
|
41561
41870
|
height
|
41562
41871
|
prevRoot
|
41563
41872
|
time
|
41564
41873
|
applicationHash
|
41565
|
-
messageReceiptRoot
|
41566
|
-
messageReceiptCount
|
41567
41874
|
}
|
41568
41875
|
commitBlockHeader {
|
41569
41876
|
id
|
41570
41877
|
daHeight
|
41878
|
+
consensusParametersVersion
|
41879
|
+
stateTransitionBytecodeVersion
|
41571
41880
|
transactionsCount
|
41881
|
+
messageReceiptCount
|
41572
41882
|
transactionsRoot
|
41883
|
+
messageOutboxRoot
|
41884
|
+
eventInboxRoot
|
41573
41885
|
height
|
41574
41886
|
prevRoot
|
41575
41887
|
time
|
41576
41888
|
applicationHash
|
41577
|
-
messageReceiptRoot
|
41578
|
-
messageReceiptCount
|
41579
41889
|
}
|
41580
41890
|
sender
|
41581
41891
|
recipient
|
@@ -41594,8 +41904,8 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41594
41904
|
var BlockFragmentFragmentDoc = lib_default2`
|
41595
41905
|
fragment blockFragment on Block {
|
41596
41906
|
id
|
41907
|
+
height
|
41597
41908
|
header {
|
41598
|
-
height
|
41599
41909
|
time
|
41600
41910
|
}
|
41601
41911
|
transactions {
|
@@ -41653,6 +41963,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41653
41963
|
`;
|
41654
41964
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41655
41965
|
fragment GasCostsFragment on GasCosts {
|
41966
|
+
version {
|
41967
|
+
... on Version {
|
41968
|
+
value
|
41969
|
+
}
|
41970
|
+
}
|
41656
41971
|
add
|
41657
41972
|
addi
|
41658
41973
|
aloc
|
@@ -41665,7 +41980,6 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41665
41980
|
cb
|
41666
41981
|
cfei
|
41667
41982
|
cfsi
|
41668
|
-
croo
|
41669
41983
|
div
|
41670
41984
|
divi
|
41671
41985
|
ecr1
|
@@ -41748,6 +42062,9 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41748
42062
|
ccp {
|
41749
42063
|
...DependentCostFragment
|
41750
42064
|
}
|
42065
|
+
croo {
|
42066
|
+
...DependentCostFragment
|
42067
|
+
}
|
41751
42068
|
csiz {
|
41752
42069
|
...DependentCostFragment
|
41753
42070
|
}
|
@@ -41807,6 +42124,11 @@ ${TransactionStatusFragmentFragmentDoc}`;
|
|
41807
42124
|
${DependentCostFragmentFragmentDoc}`;
|
41808
42125
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
41809
42126
|
fragment consensusParametersFragment on ConsensusParameters {
|
42127
|
+
version {
|
42128
|
+
... on Version {
|
42129
|
+
value
|
42130
|
+
}
|
42131
|
+
}
|
41810
42132
|
txParams {
|
41811
42133
|
...TxParametersFragment
|
41812
42134
|
}
|
@@ -41866,18 +42188,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41866
42188
|
fragment nodeInfoFragment on NodeInfo {
|
41867
42189
|
utxoValidation
|
41868
42190
|
vmBacktrace
|
41869
|
-
minGasPrice
|
41870
42191
|
maxTx
|
41871
42192
|
maxDepth
|
41872
42193
|
nodeVersion
|
41873
|
-
peers {
|
41874
|
-
id
|
41875
|
-
addresses
|
41876
|
-
clientVersion
|
41877
|
-
blockHeight
|
41878
|
-
lastHeartbeatMs
|
41879
|
-
appScore
|
41880
|
-
}
|
41881
42194
|
}
|
41882
42195
|
`;
|
41883
42196
|
var GetVersionDocument = lib_default2`
|
@@ -41912,13 +42225,9 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
41912
42225
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
41913
42226
|
transaction(id: $transactionId) {
|
41914
42227
|
...transactionFragment
|
41915
|
-
receipts {
|
41916
|
-
...receiptFragment
|
41917
|
-
}
|
41918
42228
|
}
|
41919
42229
|
}
|
41920
|
-
${TransactionFragmentFragmentDoc}
|
41921
|
-
${ReceiptFragmentFragmentDoc}`;
|
42230
|
+
${TransactionFragmentFragmentDoc}`;
|
41922
42231
|
var GetTransactionsDocument = lib_default2`
|
41923
42232
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
41924
42233
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42046,6 +42355,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42046
42355
|
}
|
42047
42356
|
}
|
42048
42357
|
${BalanceFragmentFragmentDoc}`;
|
42358
|
+
var GetLatestGasPriceDocument = lib_default2`
|
42359
|
+
query getLatestGasPrice {
|
42360
|
+
latestGasPrice {
|
42361
|
+
gasPrice
|
42362
|
+
}
|
42363
|
+
}
|
42364
|
+
`;
|
42365
|
+
var EstimateGasPriceDocument = lib_default2`
|
42366
|
+
query estimateGasPrice($blockHorizon: U32!) {
|
42367
|
+
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42368
|
+
gasPrice
|
42369
|
+
}
|
42370
|
+
}
|
42371
|
+
`;
|
42049
42372
|
var GetBalancesDocument = lib_default2`
|
42050
42373
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42051
42374
|
balances(
|
@@ -42100,12 +42423,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42100
42423
|
}
|
42101
42424
|
`;
|
42102
42425
|
var DryRunDocument = lib_default2`
|
42103
|
-
mutation dryRun($
|
42104
|
-
dryRun(
|
42105
|
-
...
|
42426
|
+
mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
|
42427
|
+
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
|
42428
|
+
...dryRunTransactionExecutionStatusFragment
|
42106
42429
|
}
|
42107
42430
|
}
|
42108
|
-
${
|
42431
|
+
${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
|
42109
42432
|
var SubmitDocument = lib_default2`
|
42110
42433
|
mutation submit($encodedTransaction: HexString!) {
|
42111
42434
|
submit(tx: $encodedTransaction) {
|
@@ -42124,17 +42447,17 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42124
42447
|
var SubmitAndAwaitDocument = lib_default2`
|
42125
42448
|
subscription submitAndAwait($encodedTransaction: HexString!) {
|
42126
42449
|
submitAndAwait(tx: $encodedTransaction) {
|
42127
|
-
...
|
42450
|
+
...transactionStatusSubscriptionFragment
|
42128
42451
|
}
|
42129
42452
|
}
|
42130
|
-
${
|
42453
|
+
${TransactionStatusSubscriptionFragmentFragmentDoc}`;
|
42131
42454
|
var StatusChangeDocument = lib_default2`
|
42132
42455
|
subscription statusChange($transactionId: TransactionId!) {
|
42133
42456
|
statusChange(id: $transactionId) {
|
42134
|
-
...
|
42457
|
+
...transactionStatusSubscriptionFragment
|
42135
42458
|
}
|
42136
42459
|
}
|
42137
|
-
${
|
42460
|
+
${TransactionStatusSubscriptionFragmentFragmentDoc}`;
|
42138
42461
|
function getSdk(requester) {
|
42139
42462
|
return {
|
42140
42463
|
getVersion(variables, options) {
|
@@ -42188,6 +42511,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42188
42511
|
getBalance(variables, options) {
|
42189
42512
|
return requester(GetBalanceDocument, variables, options);
|
42190
42513
|
},
|
42514
|
+
getLatestGasPrice(variables, options) {
|
42515
|
+
return requester(GetLatestGasPriceDocument, variables, options);
|
42516
|
+
},
|
42517
|
+
estimateGasPrice(variables, options) {
|
42518
|
+
return requester(EstimateGasPriceDocument, variables, options);
|
42519
|
+
},
|
42191
42520
|
getBalances(variables, options) {
|
42192
42521
|
return requester(GetBalancesDocument, variables, options);
|
42193
42522
|
},
|
@@ -42352,9 +42681,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42352
42681
|
}
|
42353
42682
|
};
|
42354
42683
|
|
42355
|
-
// ../address/dist/configs.mjs
|
42356
|
-
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42357
|
-
|
42358
42684
|
// src/providers/transaction-request/input.ts
|
42359
42685
|
var inputify = (value) => {
|
42360
42686
|
const { type: type3 } = value;
|
@@ -42374,10 +42700,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42374
42700
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42375
42701
|
},
|
42376
42702
|
witnessIndex: value.witnessIndex,
|
42377
|
-
maturity: value.maturity ?? 0,
|
42378
42703
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42379
|
-
predicateLength: predicate.length,
|
42380
|
-
predicateDataLength: predicateData.length,
|
42704
|
+
predicateLength: bn(predicate.length),
|
42705
|
+
predicateDataLength: bn(predicateData.length),
|
42381
42706
|
predicate: hexlify(predicate),
|
42382
42707
|
predicateData: hexlify(predicateData)
|
42383
42708
|
};
|
@@ -42408,8 +42733,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42408
42733
|
nonce: hexlify(value.nonce),
|
42409
42734
|
witnessIndex: value.witnessIndex,
|
42410
42735
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42411
|
-
predicateLength: predicate.length,
|
42412
|
-
predicateDataLength: predicateData.length,
|
42736
|
+
predicateLength: bn(predicate.length),
|
42737
|
+
predicateDataLength: bn(predicateData.length),
|
42413
42738
|
predicate: hexlify(predicate),
|
42414
42739
|
predicateData: hexlify(predicateData),
|
42415
42740
|
data: hexlify(data),
|
@@ -42566,8 +42891,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42566
42891
|
case "CALL" /* Call */: {
|
42567
42892
|
const callReceipt = {
|
42568
42893
|
type: ReceiptType.Call,
|
42569
|
-
from: hexOrZero(receipt.
|
42570
|
-
to: hexOrZero(receipt?.to
|
42894
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42895
|
+
to: hexOrZero(receipt?.to),
|
42571
42896
|
amount: bn(receipt.amount),
|
42572
42897
|
assetId: hexOrZero(receipt.assetId),
|
42573
42898
|
gas: bn(receipt.gas),
|
@@ -42581,7 +42906,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42581
42906
|
case "RETURN" /* Return */: {
|
42582
42907
|
const returnReceipt = {
|
42583
42908
|
type: ReceiptType.Return,
|
42584
|
-
id: hexOrZero(receipt.
|
42909
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42585
42910
|
val: bn(receipt.val),
|
42586
42911
|
pc: bn(receipt.pc),
|
42587
42912
|
is: bn(receipt.is)
|
@@ -42591,7 +42916,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42591
42916
|
case "RETURN_DATA" /* ReturnData */: {
|
42592
42917
|
const returnDataReceipt = {
|
42593
42918
|
type: ReceiptType.ReturnData,
|
42594
|
-
id: hexOrZero(receipt.
|
42919
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42595
42920
|
ptr: bn(receipt.ptr),
|
42596
42921
|
len: bn(receipt.len),
|
42597
42922
|
digest: hexOrZero(receipt.digest),
|
@@ -42603,7 +42928,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42603
42928
|
case "PANIC" /* Panic */: {
|
42604
42929
|
const panicReceipt = {
|
42605
42930
|
type: ReceiptType.Panic,
|
42606
|
-
id: hexOrZero(receipt.
|
42931
|
+
id: hexOrZero(receipt.id),
|
42607
42932
|
reason: bn(receipt.reason),
|
42608
42933
|
pc: bn(receipt.pc),
|
42609
42934
|
is: bn(receipt.is),
|
@@ -42614,7 +42939,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42614
42939
|
case "REVERT" /* Revert */: {
|
42615
42940
|
const revertReceipt = {
|
42616
42941
|
type: ReceiptType.Revert,
|
42617
|
-
id: hexOrZero(receipt.
|
42942
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42618
42943
|
val: bn(receipt.ra),
|
42619
42944
|
pc: bn(receipt.pc),
|
42620
42945
|
is: bn(receipt.is)
|
@@ -42624,7 +42949,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42624
42949
|
case "LOG" /* Log */: {
|
42625
42950
|
const logReceipt = {
|
42626
42951
|
type: ReceiptType.Log,
|
42627
|
-
id: hexOrZero(receipt.
|
42952
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42628
42953
|
val0: bn(receipt.ra),
|
42629
42954
|
val1: bn(receipt.rb),
|
42630
42955
|
val2: bn(receipt.rc),
|
@@ -42637,7 +42962,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42637
42962
|
case "LOG_DATA" /* LogData */: {
|
42638
42963
|
const logDataReceipt = {
|
42639
42964
|
type: ReceiptType.LogData,
|
42640
|
-
id: hexOrZero(receipt.
|
42965
|
+
id: hexOrZero(receipt.id || receipt.contractId),
|
42641
42966
|
val0: bn(receipt.ra),
|
42642
42967
|
val1: bn(receipt.rb),
|
42643
42968
|
ptr: bn(receipt.ptr),
|
@@ -42651,8 +42976,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42651
42976
|
case "TRANSFER" /* Transfer */: {
|
42652
42977
|
const transferReceipt = {
|
42653
42978
|
type: ReceiptType.Transfer,
|
42654
|
-
from: hexOrZero(receipt.
|
42655
|
-
to: hexOrZero(receipt.toAddress || receipt?.to
|
42979
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42980
|
+
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42656
42981
|
amount: bn(receipt.amount),
|
42657
42982
|
assetId: hexOrZero(receipt.assetId),
|
42658
42983
|
pc: bn(receipt.pc),
|
@@ -42663,8 +42988,8 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42663
42988
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42664
42989
|
const transferOutReceipt = {
|
42665
42990
|
type: ReceiptType.TransferOut,
|
42666
|
-
from: hexOrZero(receipt.
|
42667
|
-
to: hexOrZero(receipt.toAddress || receipt.to
|
42991
|
+
from: hexOrZero(receipt.id || receipt.contractId),
|
42992
|
+
to: hexOrZero(receipt.toAddress || receipt.to),
|
42668
42993
|
amount: bn(receipt.amount),
|
42669
42994
|
assetId: hexOrZero(receipt.assetId),
|
42670
42995
|
pc: bn(receipt.pc),
|
@@ -42707,7 +43032,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42707
43032
|
return receiptMessageOut;
|
42708
43033
|
}
|
42709
43034
|
case "MINT" /* Mint */: {
|
42710
|
-
const contractId = hexOrZero(receipt.
|
43035
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42711
43036
|
const subId = hexOrZero(receipt.subId);
|
42712
43037
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
42713
43038
|
const mintReceipt = {
|
@@ -42722,7 +43047,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42722
43047
|
return mintReceipt;
|
42723
43048
|
}
|
42724
43049
|
case "BURN" /* Burn */: {
|
42725
|
-
const contractId = hexOrZero(receipt.
|
43050
|
+
const contractId = hexOrZero(receipt.id || receipt.contractId);
|
42726
43051
|
const subId = hexOrZero(receipt.subId);
|
42727
43052
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
42728
43053
|
const burnReceipt = {
|
@@ -42742,7 +43067,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42742
43067
|
}
|
42743
43068
|
|
42744
43069
|
// src/providers/utils/gas.ts
|
42745
|
-
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
42746
43070
|
var getGasUsedFromReceipts = (receipts) => {
|
42747
43071
|
const scriptResult = receipts.filter(
|
42748
43072
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -42763,18 +43087,28 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42763
43087
|
}
|
42764
43088
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
42765
43089
|
const witnessCache = [];
|
42766
|
-
const
|
43090
|
+
const chargeableInputs = inputs.filter((input) => {
|
43091
|
+
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43092
|
+
if (isCoinOrMessage) {
|
43093
|
+
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43094
|
+
return true;
|
43095
|
+
}
|
43096
|
+
if (!witnessCache.includes(input.witnessIndex)) {
|
43097
|
+
witnessCache.push(input.witnessIndex);
|
43098
|
+
return true;
|
43099
|
+
}
|
43100
|
+
}
|
43101
|
+
return false;
|
43102
|
+
});
|
43103
|
+
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43104
|
+
const totalGas = chargeableInputs.reduce((total, input) => {
|
42767
43105
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
42768
43106
|
return total.add(
|
42769
|
-
|
43107
|
+
vmInitializationCost.add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
42770
43108
|
);
|
42771
43109
|
}
|
42772
|
-
|
42773
|
-
|
42774
|
-
return total.add(gasCosts.ecr1);
|
42775
|
-
}
|
42776
|
-
return total;
|
42777
|
-
}, bn());
|
43110
|
+
return total.add(gasCosts.ecr1);
|
43111
|
+
}, bn(0));
|
42778
43112
|
return totalGas;
|
42779
43113
|
}
|
42780
43114
|
function getMinGas(params) {
|
@@ -42786,12 +43120,20 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42786
43120
|
return minGas;
|
42787
43121
|
}
|
42788
43122
|
function getMaxGas(params) {
|
42789
|
-
const {
|
43123
|
+
const {
|
43124
|
+
gasPerByte,
|
43125
|
+
witnessesLength,
|
43126
|
+
witnessLimit,
|
43127
|
+
minGas,
|
43128
|
+
gasLimit = bn(0),
|
43129
|
+
maxGasPerTx
|
43130
|
+
} = params;
|
42790
43131
|
let remainingAllowedWitnessGas = bn(0);
|
42791
43132
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
42792
43133
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
42793
43134
|
}
|
42794
|
-
|
43135
|
+
const maxGas = remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43136
|
+
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42795
43137
|
}
|
42796
43138
|
function calculateMetadataGasForTxCreate({
|
42797
43139
|
gasCosts,
|
@@ -42813,6 +43155,10 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42813
43155
|
}) {
|
42814
43156
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
42815
43157
|
}
|
43158
|
+
var calculateGasFee = (params) => {
|
43159
|
+
const { gas, gasPrice, priceFactor, tip } = params;
|
43160
|
+
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43161
|
+
};
|
42816
43162
|
|
42817
43163
|
// src/providers/utils/json.ts
|
42818
43164
|
function normalize2(object) {
|
@@ -42942,7 +43288,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42942
43288
|
// src/providers/transaction-request/transaction-request.ts
|
42943
43289
|
var BaseTransactionRequest = class {
|
42944
43290
|
/** Gas price for transaction */
|
42945
|
-
|
43291
|
+
tip;
|
42946
43292
|
/** Block until which tx cannot be included */
|
42947
43293
|
maturity;
|
42948
43294
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -42955,38 +43301,34 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42955
43301
|
outputs = [];
|
42956
43302
|
/** List of witnesses */
|
42957
43303
|
witnesses = [];
|
42958
|
-
/** Base asset ID - should be fetched from the chain */
|
42959
|
-
baseAssetId;
|
42960
43304
|
/**
|
42961
43305
|
* Constructor for initializing a base transaction request.
|
42962
43306
|
*
|
42963
43307
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
42964
43308
|
*/
|
42965
43309
|
constructor({
|
42966
|
-
|
43310
|
+
tip,
|
42967
43311
|
maturity,
|
42968
43312
|
maxFee,
|
42969
43313
|
witnessLimit,
|
42970
43314
|
inputs,
|
42971
43315
|
outputs,
|
42972
|
-
witnesses
|
42973
|
-
|
42974
|
-
|
42975
|
-
this.gasPrice = bn(gasPrice);
|
43316
|
+
witnesses
|
43317
|
+
} = {}) {
|
43318
|
+
this.tip = bn(tip);
|
42976
43319
|
this.maturity = maturity ?? 0;
|
42977
43320
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
42978
43321
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
42979
43322
|
this.inputs = inputs ?? [];
|
42980
43323
|
this.outputs = outputs ?? [];
|
42981
43324
|
this.witnesses = witnesses ?? [];
|
42982
|
-
this.baseAssetId = baseAssetId;
|
42983
43325
|
}
|
42984
43326
|
static getPolicyMeta(req) {
|
42985
43327
|
let policyTypes = 0;
|
42986
43328
|
const policies = [];
|
42987
|
-
if (req.
|
42988
|
-
policyTypes += PolicyType.
|
42989
|
-
policies.push({ data: req.
|
43329
|
+
if (req.tip) {
|
43330
|
+
policyTypes += PolicyType.Tip;
|
43331
|
+
policies.push({ data: req.tip, type: PolicyType.Tip });
|
42990
43332
|
}
|
42991
43333
|
if (req.witnessLimit) {
|
42992
43334
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43170,13 +43512,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43170
43512
|
* assetId, if one it was not added yet.
|
43171
43513
|
*
|
43172
43514
|
* @param coin - Coin resource.
|
43173
|
-
* @param predicate - Predicate bytes.
|
43174
|
-
* @param predicateData - Predicate data bytes.
|
43175
43515
|
*/
|
43176
|
-
addCoinInput(coin
|
43516
|
+
addCoinInput(coin) {
|
43177
43517
|
const { assetId, owner, amount } = coin;
|
43178
43518
|
let witnessIndex;
|
43179
|
-
if (predicate) {
|
43519
|
+
if (coin.predicate) {
|
43180
43520
|
witnessIndex = 0;
|
43181
43521
|
} else {
|
43182
43522
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43191,8 +43531,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43191
43531
|
amount,
|
43192
43532
|
assetId,
|
43193
43533
|
txPointer: "0x00000000000000000000000000000000",
|
43194
|
-
witnessIndex
|
43195
|
-
predicate: predicate?.bytes
|
43534
|
+
witnessIndex
|
43196
43535
|
};
|
43197
43536
|
this.pushInput(input);
|
43198
43537
|
this.addChangeOutput(owner, assetId);
|
@@ -43202,12 +43541,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43202
43541
|
* baseAssetId, if one it was not added yet.
|
43203
43542
|
*
|
43204
43543
|
* @param message - Message resource.
|
43205
|
-
* @param predicate - Predicate bytes.
|
43206
43544
|
*/
|
43207
|
-
addMessageInput(message
|
43545
|
+
addMessageInput(message) {
|
43208
43546
|
const { recipient, sender, amount } = message;
|
43547
|
+
const assetId = BaseAssetId;
|
43209
43548
|
let witnessIndex;
|
43210
|
-
if (predicate) {
|
43549
|
+
if (message.predicate) {
|
43211
43550
|
witnessIndex = 0;
|
43212
43551
|
} else {
|
43213
43552
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43221,11 +43560,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43221
43560
|
sender: sender.toB256(),
|
43222
43561
|
recipient: recipient.toB256(),
|
43223
43562
|
amount,
|
43224
|
-
witnessIndex
|
43225
|
-
predicate: predicate?.bytes
|
43563
|
+
witnessIndex
|
43226
43564
|
};
|
43227
43565
|
this.pushInput(input);
|
43228
|
-
this.addChangeOutput(recipient,
|
43566
|
+
this.addChangeOutput(recipient, assetId);
|
43229
43567
|
}
|
43230
43568
|
/**
|
43231
43569
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -43253,32 +43591,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43253
43591
|
resources.forEach((resource) => this.addResource(resource));
|
43254
43592
|
return this;
|
43255
43593
|
}
|
43256
|
-
/**
|
43257
|
-
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43258
|
-
* outputs from the related assetIds.
|
43259
|
-
*
|
43260
|
-
* @param resources - The resources to add.
|
43261
|
-
* @returns This transaction.
|
43262
|
-
*/
|
43263
|
-
addPredicateResource(resource, predicate) {
|
43264
|
-
if (isCoin(resource)) {
|
43265
|
-
this.addCoinInput(resource, predicate);
|
43266
|
-
} else {
|
43267
|
-
this.addMessageInput(resource, predicate);
|
43268
|
-
}
|
43269
|
-
return this;
|
43270
|
-
}
|
43271
|
-
/**
|
43272
|
-
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43273
|
-
* from the related assetIds.
|
43274
|
-
*
|
43275
|
-
* @param resources - The resources to add.
|
43276
|
-
* @returns This transaction.
|
43277
|
-
*/
|
43278
|
-
addPredicateResources(resources, predicate) {
|
43279
|
-
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43280
|
-
return this;
|
43281
|
-
}
|
43282
43594
|
/**
|
43283
43595
|
* Adds a coin output to the transaction.
|
43284
43596
|
*
|
@@ -43286,12 +43598,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43286
43598
|
* @param amount - Amount of coin.
|
43287
43599
|
* @param assetId - Asset ID of coin.
|
43288
43600
|
*/
|
43289
|
-
addCoinOutput(to, amount, assetId) {
|
43601
|
+
addCoinOutput(to, amount, assetId = BaseAssetId) {
|
43290
43602
|
this.pushOutput({
|
43291
43603
|
type: OutputType.Coin,
|
43292
43604
|
to: addressify(to).toB256(),
|
43293
43605
|
amount,
|
43294
|
-
assetId
|
43606
|
+
assetId
|
43295
43607
|
});
|
43296
43608
|
return this;
|
43297
43609
|
}
|
@@ -43318,7 +43630,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43318
43630
|
* @param to - Address of the owner.
|
43319
43631
|
* @param assetId - Asset ID of coin.
|
43320
43632
|
*/
|
43321
|
-
addChangeOutput(to, assetId) {
|
43633
|
+
addChangeOutput(to, assetId = BaseAssetId) {
|
43322
43634
|
const changeOutput = this.getChangeOutputs().find(
|
43323
43635
|
(output3) => hexlify(output3.assetId) === assetId
|
43324
43636
|
);
|
@@ -43326,7 +43638,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43326
43638
|
this.pushOutput({
|
43327
43639
|
type: OutputType.Change,
|
43328
43640
|
to: addressify(to).toB256(),
|
43329
|
-
assetId
|
43641
|
+
assetId
|
43330
43642
|
});
|
43331
43643
|
}
|
43332
43644
|
}
|
@@ -43358,7 +43670,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43358
43670
|
}
|
43359
43671
|
calculateMaxGas(chainInfo, minGas) {
|
43360
43672
|
const { consensusParameters } = chainInfo;
|
43361
|
-
const { gasPerByte } = consensusParameters;
|
43673
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43362
43674
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43363
43675
|
(acc, wit) => acc + wit.dataLength,
|
43364
43676
|
0
|
@@ -43367,7 +43679,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43367
43679
|
gasPerByte,
|
43368
43680
|
minGas,
|
43369
43681
|
witnessesLength,
|
43370
|
-
witnessLimit: this.witnessLimit
|
43682
|
+
witnessLimit: this.witnessLimit,
|
43683
|
+
maxGasPerTx
|
43371
43684
|
});
|
43372
43685
|
}
|
43373
43686
|
/**
|
@@ -43385,24 +43698,27 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43385
43698
|
});
|
43386
43699
|
const updateAssetInput = (assetId, quantity) => {
|
43387
43700
|
const assetInput = findAssetInput(assetId);
|
43701
|
+
let usedQuantity = quantity;
|
43702
|
+
if (assetId === BaseAssetId) {
|
43703
|
+
usedQuantity = bn("1000000000000000000");
|
43704
|
+
}
|
43388
43705
|
if (assetInput && "assetId" in assetInput) {
|
43389
43706
|
assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
|
43390
|
-
assetInput.amount =
|
43707
|
+
assetInput.amount = usedQuantity;
|
43391
43708
|
} else {
|
43392
43709
|
this.addResources([
|
43393
43710
|
{
|
43394
43711
|
id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
43395
|
-
amount:
|
43712
|
+
amount: usedQuantity,
|
43396
43713
|
assetId,
|
43397
43714
|
owner: resourcesOwner || Address.fromRandom(),
|
43398
|
-
maturity: 0,
|
43399
43715
|
blockCreated: bn(1),
|
43400
43716
|
txCreatedIdx: bn(1)
|
43401
43717
|
}
|
43402
43718
|
]);
|
43403
43719
|
}
|
43404
43720
|
};
|
43405
|
-
updateAssetInput(
|
43721
|
+
updateAssetInput(BaseAssetId, bn(1e11));
|
43406
43722
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43407
43723
|
}
|
43408
43724
|
/**
|
@@ -43427,7 +43743,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43427
43743
|
toJSON() {
|
43428
43744
|
return normalizeJSON(this);
|
43429
43745
|
}
|
43430
|
-
|
43746
|
+
updatePredicateGasUsed(inputs) {
|
43431
43747
|
this.inputs.forEach((i) => {
|
43432
43748
|
let correspondingInput;
|
43433
43749
|
switch (i.type) {
|
@@ -43449,6 +43765,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43449
43765
|
}
|
43450
43766
|
});
|
43451
43767
|
}
|
43768
|
+
shiftPredicateData() {
|
43769
|
+
this.inputs.forEach((input) => {
|
43770
|
+
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43771
|
+
input.predicateData = input.paddPredicateData(
|
43772
|
+
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43773
|
+
);
|
43774
|
+
}
|
43775
|
+
});
|
43776
|
+
}
|
43452
43777
|
};
|
43453
43778
|
|
43454
43779
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43559,7 +43884,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43559
43884
|
*
|
43560
43885
|
* @param createTransactionRequestLike - The initial values for the instance
|
43561
43886
|
*/
|
43562
|
-
constructor({
|
43887
|
+
constructor({
|
43888
|
+
bytecodeWitnessIndex,
|
43889
|
+
salt,
|
43890
|
+
storageSlots,
|
43891
|
+
...rest
|
43892
|
+
} = {}) {
|
43563
43893
|
super(rest);
|
43564
43894
|
this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
|
43565
43895
|
this.salt = hexlify(salt ?? ZeroBytes32);
|
@@ -43577,9 +43907,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43577
43907
|
return {
|
43578
43908
|
type: TransactionType.Create,
|
43579
43909
|
...baseTransaction,
|
43580
|
-
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43581
43910
|
bytecodeWitnessIndex,
|
43582
|
-
storageSlotsCount: storageSlots.length,
|
43911
|
+
storageSlotsCount: bn(storageSlots.length),
|
43583
43912
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43584
43913
|
storageSlots
|
43585
43914
|
};
|
@@ -43674,7 +44003,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43674
44003
|
*
|
43675
44004
|
* @param scriptTransactionRequestLike - The initial values for the instance.
|
43676
44005
|
*/
|
43677
|
-
constructor({ script, scriptData, gasLimit, ...rest }) {
|
44006
|
+
constructor({ script, scriptData, gasLimit, ...rest } = {}) {
|
43678
44007
|
super(rest);
|
43679
44008
|
this.gasLimit = bn(gasLimit);
|
43680
44009
|
this.script = arrayify(script ?? returnZeroScript.bytes);
|
@@ -43693,8 +44022,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43693
44022
|
type: TransactionType.Script,
|
43694
44023
|
scriptGasLimit: this.gasLimit,
|
43695
44024
|
...super.getBaseTransaction(),
|
43696
|
-
scriptLength: script.length,
|
43697
|
-
scriptDataLength: scriptData.length,
|
44025
|
+
scriptLength: bn(script.length),
|
44026
|
+
scriptDataLength: bn(scriptData.length),
|
43698
44027
|
receiptsRoot: ZeroBytes32,
|
43699
44028
|
script: hexlify(script),
|
43700
44029
|
scriptData: hexlify(scriptData)
|
@@ -43758,7 +44087,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43758
44087
|
}
|
43759
44088
|
calculateMaxGas(chainInfo, minGas) {
|
43760
44089
|
const { consensusParameters } = chainInfo;
|
43761
|
-
const { gasPerByte } = consensusParameters;
|
44090
|
+
const { gasPerByte, maxGasPerTx } = consensusParameters;
|
43762
44091
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43763
44092
|
(acc, wit) => acc + wit.dataLength,
|
43764
44093
|
0
|
@@ -43768,7 +44097,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43768
44097
|
minGas,
|
43769
44098
|
witnessesLength,
|
43770
44099
|
witnessLimit: this.witnessLimit,
|
43771
|
-
gasLimit: this.gasLimit
|
44100
|
+
gasLimit: this.gasLimit,
|
44101
|
+
maxGasPerTx
|
43772
44102
|
});
|
43773
44103
|
}
|
43774
44104
|
/**
|
@@ -43841,13 +44171,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43841
44171
|
}
|
43842
44172
|
}
|
43843
44173
|
};
|
44174
|
+
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44175
|
+
(acc, input) => {
|
44176
|
+
if (input.type === InputType.Coin && input.owner === owner) {
|
44177
|
+
acc.utxos.push(input.id);
|
44178
|
+
}
|
44179
|
+
if (input.type === InputType.Message && input.recipient === owner) {
|
44180
|
+
acc.messages.push(input.nonce);
|
44181
|
+
}
|
44182
|
+
return acc;
|
44183
|
+
},
|
44184
|
+
{
|
44185
|
+
utxos: [],
|
44186
|
+
messages: []
|
44187
|
+
}
|
44188
|
+
);
|
43844
44189
|
|
43845
44190
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
43846
44191
|
var calculateTransactionFee = (params) => {
|
43847
44192
|
const {
|
43848
|
-
|
44193
|
+
gasPrice,
|
43849
44194
|
rawPayload,
|
43850
|
-
|
44195
|
+
tip,
|
44196
|
+
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43851
44197
|
} = params;
|
43852
44198
|
const gasPerByte = bn(feeParams.gasPerByte);
|
43853
44199
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -43857,8 +44203,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43857
44203
|
return {
|
43858
44204
|
fee: bn(0),
|
43859
44205
|
minFee: bn(0),
|
43860
|
-
maxFee: bn(0)
|
43861
|
-
feeFromGasUsed: bn(0)
|
44206
|
+
maxFee: bn(0)
|
43862
44207
|
};
|
43863
44208
|
}
|
43864
44209
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -43890,7 +44235,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43890
44235
|
metadataGas,
|
43891
44236
|
txBytesSize: transactionBytes.length
|
43892
44237
|
});
|
43893
|
-
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
43894
44238
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
43895
44239
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
43896
44240
|
const maxGas = getMaxGas({
|
@@ -43898,17 +44242,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43898
44242
|
minGas,
|
43899
44243
|
witnessesLength,
|
43900
44244
|
gasLimit,
|
43901
|
-
witnessLimit
|
44245
|
+
witnessLimit,
|
44246
|
+
maxGasPerTx
|
44247
|
+
});
|
44248
|
+
const minFee = calculateGasFee({
|
44249
|
+
gasPrice,
|
44250
|
+
gas: minGas,
|
44251
|
+
priceFactor: gasPriceFactor,
|
44252
|
+
tip
|
44253
|
+
});
|
44254
|
+
const maxFee = calculateGasFee({
|
44255
|
+
gasPrice,
|
44256
|
+
gas: maxGas,
|
44257
|
+
priceFactor: gasPriceFactor,
|
44258
|
+
tip
|
43902
44259
|
});
|
43903
|
-
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43904
|
-
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43905
|
-
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43906
|
-
const fee = minFee.add(feeFromGasUsed);
|
43907
44260
|
return {
|
43908
|
-
fee,
|
43909
44261
|
minFee,
|
43910
44262
|
maxFee,
|
43911
|
-
|
44263
|
+
fee: maxFee
|
43912
44264
|
};
|
43913
44265
|
};
|
43914
44266
|
|
@@ -44462,7 +44814,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44462
44814
|
gqlTransactionStatus,
|
44463
44815
|
abiMap = {},
|
44464
44816
|
maxInputs,
|
44465
|
-
gasCosts
|
44817
|
+
gasCosts,
|
44818
|
+
maxGasPerTx,
|
44819
|
+
gasPrice
|
44466
44820
|
} = params;
|
44467
44821
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44468
44822
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44476,11 +44830,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44476
44830
|
maxInputs
|
44477
44831
|
});
|
44478
44832
|
const typeName = getTransactionTypeName(transaction.type);
|
44833
|
+
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44479
44834
|
const { fee } = calculateTransactionFee({
|
44480
|
-
|
44835
|
+
gasPrice,
|
44481
44836
|
rawPayload,
|
44837
|
+
tip,
|
44482
44838
|
consensusParameters: {
|
44483
44839
|
gasCosts,
|
44840
|
+
maxGasPerTx,
|
44484
44841
|
feeParams: {
|
44485
44842
|
gasPerByte,
|
44486
44843
|
gasPriceFactor
|
@@ -44616,8 +44973,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44616
44973
|
const decodedTransaction = this.decodeTransaction(
|
44617
44974
|
transaction
|
44618
44975
|
);
|
44619
|
-
|
44620
|
-
|
44976
|
+
let txReceipts = [];
|
44977
|
+
if (transaction?.status && "receipts" in transaction.status) {
|
44978
|
+
txReceipts = transaction.status.receipts;
|
44979
|
+
}
|
44980
|
+
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44981
|
+
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44982
|
+
const gasPrice = await this.provider.getLatestGasPrice();
|
44621
44983
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44622
44984
|
const transactionSummary = assembleTransactionSummary({
|
44623
44985
|
id: this.id,
|
@@ -44629,7 +44991,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44629
44991
|
gasPriceFactor,
|
44630
44992
|
abiMap: contractsAbiMap,
|
44631
44993
|
maxInputs,
|
44632
|
-
gasCosts
|
44994
|
+
gasCosts,
|
44995
|
+
maxGasPerTx,
|
44996
|
+
gasPrice
|
44633
44997
|
});
|
44634
44998
|
return transactionSummary;
|
44635
44999
|
}
|
@@ -44773,13 +45137,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44773
45137
|
gasPerByte: bn(feeParams.gasPerByte),
|
44774
45138
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
44775
45139
|
chainId: bn(consensusParameters.chainId),
|
44776
|
-
baseAssetId: consensusParameters.baseAssetId,
|
44777
45140
|
gasCosts
|
44778
45141
|
},
|
44779
45142
|
gasCosts,
|
44780
45143
|
latestBlock: {
|
44781
45144
|
id: latestBlock.id,
|
44782
|
-
height: bn(latestBlock.
|
45145
|
+
height: bn(latestBlock.height),
|
44783
45146
|
time: latestBlock.header.time,
|
44784
45147
|
transactions: latestBlock.transactions.map((i) => ({
|
44785
45148
|
id: i.id
|
@@ -44873,10 +45236,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44873
45236
|
* Returns some helpful parameters related to gas fees.
|
44874
45237
|
*/
|
44875
45238
|
getGasConfig() {
|
44876
|
-
const { minGasPrice } = this.getNode();
|
44877
45239
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
44878
45240
|
return {
|
44879
|
-
minGasPrice,
|
44880
45241
|
maxGasPerTx,
|
44881
45242
|
maxGasPerPredicate,
|
44882
45243
|
gasPriceFactor,
|
@@ -44974,7 +45335,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44974
45335
|
*/
|
44975
45336
|
async getBlockNumber() {
|
44976
45337
|
const { chain } = await this.operations.getChain();
|
44977
|
-
return bn(chain.latestBlock.
|
45338
|
+
return bn(chain.latestBlock.height, 10);
|
44978
45339
|
}
|
44979
45340
|
/**
|
44980
45341
|
* Returns the chain information.
|
@@ -44986,11 +45347,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44986
45347
|
const processedNodeInfo = {
|
44987
45348
|
maxDepth: bn(nodeInfo.maxDepth),
|
44988
45349
|
maxTx: bn(nodeInfo.maxTx),
|
44989
|
-
minGasPrice: bn(nodeInfo.minGasPrice),
|
44990
45350
|
nodeVersion: nodeInfo.nodeVersion,
|
44991
45351
|
utxoValidation: nodeInfo.utxoValidation,
|
44992
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44993
|
-
peers: nodeInfo.peers
|
45352
|
+
vmBacktrace: nodeInfo.vmBacktrace
|
44994
45353
|
};
|
44995
45354
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
44996
45355
|
return processedNodeInfo;
|
@@ -45016,17 +45375,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45016
45375
|
} = this.getChain();
|
45017
45376
|
return chainId.toNumber();
|
45018
45377
|
}
|
45019
|
-
/**
|
45020
|
-
* Returns the base asset ID
|
45021
|
-
*
|
45022
|
-
* @returns A promise that resolves to the base asset ID
|
45023
|
-
*/
|
45024
|
-
getBaseAssetId() {
|
45025
|
-
const {
|
45026
|
-
consensusParameters: { baseAssetId }
|
45027
|
-
} = this.getChain();
|
45028
|
-
return baseAssetId;
|
45029
|
-
}
|
45030
45378
|
/**
|
45031
45379
|
* Submits a transaction to the chain to be executed.
|
45032
45380
|
*
|
@@ -45087,14 +45435,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45087
45435
|
return this.estimateTxDependencies(transactionRequest);
|
45088
45436
|
}
|
45089
45437
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45090
|
-
const { dryRun:
|
45091
|
-
encodedTransaction,
|
45438
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45439
|
+
encodedTransactions: encodedTransaction,
|
45092
45440
|
utxoValidation: utxoValidation || false
|
45093
45441
|
});
|
45094
|
-
const receipts =
|
45095
|
-
|
45096
|
-
|
45097
|
-
};
|
45442
|
+
const [{ receipts: rawReceipts, status }] = dryRunStatuses;
|
45443
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45444
|
+
return { receipts, dryrunStatus: status };
|
45098
45445
|
}
|
45099
45446
|
/**
|
45100
45447
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45133,9 +45480,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45133
45480
|
* If there are missing variable outputs,
|
45134
45481
|
* `addVariableOutputs` is called on the transaction.
|
45135
45482
|
*
|
45136
|
-
* @privateRemarks
|
45137
|
-
* TODO: Investigate support for missing contract IDs
|
45138
|
-
* TODO: Add support for missing output messages
|
45139
45483
|
*
|
45140
45484
|
* @param transactionRequest - The transaction request object.
|
45141
45485
|
* @returns A promise.
|
@@ -45148,16 +45492,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45148
45492
|
missingContractIds: []
|
45149
45493
|
};
|
45150
45494
|
}
|
45151
|
-
await this.estimatePredicates(transactionRequest);
|
45152
45495
|
let receipts = [];
|
45153
45496
|
const missingContractIds = [];
|
45154
45497
|
let outputVariables = 0;
|
45498
|
+
let dryrunStatus;
|
45155
45499
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45156
|
-
const {
|
45157
|
-
|
45500
|
+
const {
|
45501
|
+
dryRun: [{ receipts: rawReceipts, status }]
|
45502
|
+
} = await this.operations.dryRun({
|
45503
|
+
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45158
45504
|
utxoValidation: false
|
45159
45505
|
});
|
45160
|
-
receipts =
|
45506
|
+
receipts = rawReceipts.map(processGqlReceipt);
|
45507
|
+
dryrunStatus = status;
|
45161
45508
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45162
45509
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45163
45510
|
if (hasMissingOutputs) {
|
@@ -45167,6 +45514,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45167
45514
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45168
45515
|
missingContractIds.push(contractId);
|
45169
45516
|
});
|
45517
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45518
|
+
transactionRequest
|
45519
|
+
});
|
45520
|
+
transactionRequest.maxFee = maxFee;
|
45170
45521
|
} else {
|
45171
45522
|
break;
|
45172
45523
|
}
|
@@ -45174,37 +45525,139 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45174
45525
|
return {
|
45175
45526
|
receipts,
|
45176
45527
|
outputVariables,
|
45177
|
-
missingContractIds
|
45528
|
+
missingContractIds,
|
45529
|
+
dryrunStatus
|
45178
45530
|
};
|
45179
45531
|
}
|
45532
|
+
/**
|
45533
|
+
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45534
|
+
*
|
45535
|
+
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45536
|
+
* further modifications are identified. The method iteratively updates these transactions
|
45537
|
+
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45538
|
+
*
|
45539
|
+
* @param transactionRequests - Array of transaction request objects.
|
45540
|
+
* @returns A promise that resolves to an array of results for each transaction.
|
45541
|
+
*/
|
45542
|
+
async estimateMultipleTxDependencies(transactionRequests) {
|
45543
|
+
const results = transactionRequests.map(() => ({
|
45544
|
+
receipts: [],
|
45545
|
+
outputVariables: 0,
|
45546
|
+
missingContractIds: [],
|
45547
|
+
dryrunStatus: void 0
|
45548
|
+
}));
|
45549
|
+
const allRequests = clone_default(transactionRequests);
|
45550
|
+
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45551
|
+
allRequests.forEach((req, index) => {
|
45552
|
+
if (req.type === TransactionType.Script) {
|
45553
|
+
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45554
|
+
}
|
45555
|
+
});
|
45556
|
+
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45557
|
+
let attempt = 0;
|
45558
|
+
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45559
|
+
const encodedTransactions = transactionsToProcess.map(
|
45560
|
+
(index) => serializedTransactionsMap.get(index)
|
45561
|
+
);
|
45562
|
+
const dryRunResults = await this.operations.dryRun({
|
45563
|
+
encodedTransactions,
|
45564
|
+
utxoValidation: false
|
45565
|
+
});
|
45566
|
+
const nextRoundTransactions = [];
|
45567
|
+
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45568
|
+
const currentResultIndex = transactionsToProcess[i];
|
45569
|
+
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45570
|
+
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45571
|
+
results[currentResultIndex].dryrunStatus = status;
|
45572
|
+
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45573
|
+
results[currentResultIndex].receipts
|
45574
|
+
);
|
45575
|
+
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45576
|
+
const requestToProcess = allRequests[currentResultIndex];
|
45577
|
+
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45578
|
+
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45579
|
+
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45580
|
+
missingOutputContractIds.forEach(({ contractId }) => {
|
45581
|
+
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45582
|
+
results[currentResultIndex].missingContractIds.push(contractId);
|
45583
|
+
});
|
45584
|
+
const { maxFee } = await this.estimateTxGasAndFee({
|
45585
|
+
transactionRequest: requestToProcess
|
45586
|
+
});
|
45587
|
+
requestToProcess.maxFee = maxFee;
|
45588
|
+
serializedTransactionsMap.set(
|
45589
|
+
currentResultIndex,
|
45590
|
+
hexlify(requestToProcess.toTransactionBytes())
|
45591
|
+
);
|
45592
|
+
nextRoundTransactions.push(currentResultIndex);
|
45593
|
+
allRequests[currentResultIndex] = requestToProcess;
|
45594
|
+
}
|
45595
|
+
}
|
45596
|
+
transactionsToProcess = nextRoundTransactions;
|
45597
|
+
attempt += 1;
|
45598
|
+
}
|
45599
|
+
return results;
|
45600
|
+
}
|
45601
|
+
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45602
|
+
if (estimateTxDependencies) {
|
45603
|
+
return this.estimateMultipleTxDependencies(transactionRequests);
|
45604
|
+
}
|
45605
|
+
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45606
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45607
|
+
encodedTransactions,
|
45608
|
+
utxoValidation: utxoValidation || false
|
45609
|
+
});
|
45610
|
+
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45611
|
+
const receipts = rawReceipts.map(processGqlReceipt);
|
45612
|
+
return { receipts, dryrunStatus: status };
|
45613
|
+
});
|
45614
|
+
return results;
|
45615
|
+
}
|
45180
45616
|
/**
|
45181
45617
|
* Estimates the transaction gas and fee based on the provided transaction request.
|
45182
45618
|
* @param transactionRequest - The transaction request object.
|
45183
45619
|
* @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
|
45184
45620
|
*/
|
45185
|
-
estimateTxGasAndFee(params) {
|
45621
|
+
async estimateTxGasAndFee(params) {
|
45186
45622
|
const { transactionRequest } = params;
|
45187
|
-
|
45623
|
+
let { gasPrice } = params;
|
45188
45624
|
const chainInfo = this.getChain();
|
45189
|
-
const
|
45190
|
-
transactionRequest.gasPrice = gasPrice;
|
45625
|
+
const { gasPriceFactor, maxGasPerTx } = this.getGasConfig();
|
45191
45626
|
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45192
|
-
|
45627
|
+
if (!gasPrice) {
|
45628
|
+
gasPrice = await this.estimateGasPrice(10);
|
45629
|
+
}
|
45630
|
+
const minFee = calculateGasFee({
|
45631
|
+
gasPrice: bn(gasPrice),
|
45632
|
+
gas: minGas,
|
45633
|
+
priceFactor: gasPriceFactor,
|
45634
|
+
tip: transactionRequest.tip
|
45635
|
+
}).add(1);
|
45636
|
+
let gasLimit = bn(0);
|
45193
45637
|
if (transactionRequest.type === TransactionType.Script) {
|
45638
|
+
gasLimit = transactionRequest.gasLimit;
|
45194
45639
|
if (transactionRequest.gasLimit.eq(0)) {
|
45195
45640
|
transactionRequest.gasLimit = minGas;
|
45196
45641
|
transactionRequest.gasLimit = maxGasPerTx.sub(
|
45197
45642
|
transactionRequest.calculateMaxGas(chainInfo, minGas)
|
45198
45643
|
);
|
45644
|
+
gasLimit = transactionRequest.gasLimit;
|
45199
45645
|
}
|
45200
45646
|
}
|
45201
45647
|
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45202
|
-
const maxFee =
|
45648
|
+
const maxFee = calculateGasFee({
|
45649
|
+
gasPrice: bn(gasPrice),
|
45650
|
+
gas: maxGas,
|
45651
|
+
priceFactor: gasPriceFactor,
|
45652
|
+
tip: transactionRequest.tip
|
45653
|
+
}).add(1);
|
45203
45654
|
return {
|
45204
45655
|
minGas,
|
45205
45656
|
minFee,
|
45206
45657
|
maxGas,
|
45207
|
-
maxFee
|
45658
|
+
maxFee,
|
45659
|
+
gasPrice,
|
45660
|
+
gasLimit
|
45208
45661
|
};
|
45209
45662
|
}
|
45210
45663
|
/**
|
@@ -45222,15 +45675,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45222
45675
|
if (estimateTxDependencies) {
|
45223
45676
|
return this.estimateTxDependencies(transactionRequest);
|
45224
45677
|
}
|
45225
|
-
const
|
45226
|
-
const { dryRun:
|
45227
|
-
|
45678
|
+
const encodedTransactions = [hexlify(transactionRequest.toTransactionBytes())];
|
45679
|
+
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45680
|
+
encodedTransactions,
|
45228
45681
|
utxoValidation: true
|
45229
45682
|
});
|
45230
|
-
const
|
45231
|
-
|
45232
|
-
receipts
|
45233
|
-
|
45683
|
+
const callResult = dryRunStatuses.map((dryRunStatus) => {
|
45684
|
+
const { id, receipts, status } = dryRunStatus;
|
45685
|
+
const processedReceipts = receipts.map(processGqlReceipt);
|
45686
|
+
return { id, receipts: processedReceipts, status };
|
45687
|
+
});
|
45688
|
+
return { receipts: callResult[0].receipts };
|
45234
45689
|
}
|
45235
45690
|
/**
|
45236
45691
|
* Returns a transaction cost to enable user
|
@@ -45247,77 +45702,79 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45247
45702
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45248
45703
|
* @returns A promise that resolves to the transaction cost object.
|
45249
45704
|
*/
|
45250
|
-
async getTransactionCost(transactionRequestLike,
|
45251
|
-
estimateTxDependencies = true,
|
45252
|
-
estimatePredicates = true,
|
45253
|
-
resourcesOwner,
|
45254
|
-
signatureCallback
|
45255
|
-
} = {}) {
|
45705
|
+
async getTransactionCost(transactionRequestLike, { resourcesOwner, signatureCallback, quantitiesToContract = [] } = {}) {
|
45256
45706
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45257
|
-
const { minGasPrice } = this.getGasConfig();
|
45258
|
-
const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45259
45707
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45260
45708
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45261
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45709
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
|
45262
45710
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45711
|
+
txRequestClone.maxFee = bn(0);
|
45263
45712
|
if (isScriptTransaction) {
|
45264
45713
|
txRequestClone.gasLimit = bn(0);
|
45265
45714
|
}
|
45266
|
-
if (
|
45267
|
-
|
45268
|
-
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45269
|
-
}
|
45270
|
-
await this.estimatePredicates(txRequestClone);
|
45715
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45716
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45271
45717
|
}
|
45718
|
+
const signedRequest = clone_default(txRequestClone);
|
45719
|
+
let addedSignatures = 0;
|
45272
45720
|
if (signatureCallback && isScriptTransaction) {
|
45273
|
-
|
45721
|
+
const lengthBefore = signedRequest.witnesses.length;
|
45722
|
+
await signatureCallback(signedRequest);
|
45723
|
+
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
45274
45724
|
}
|
45275
|
-
|
45276
|
-
|
45725
|
+
await this.estimatePredicates(signedRequest);
|
45726
|
+
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45727
|
+
transactionRequest: signedRequest
|
45277
45728
|
});
|
45278
45729
|
let receipts = [];
|
45279
45730
|
let missingContractIds = [];
|
45280
45731
|
let outputVariables = 0;
|
45281
45732
|
let gasUsed = bn(0);
|
45282
|
-
|
45283
|
-
|
45733
|
+
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
45734
|
+
txRequestClone.maxFee = maxFee;
|
45735
|
+
if (isScriptTransaction) {
|
45736
|
+
txRequestClone.gasLimit = gasLimit;
|
45737
|
+
if (signatureCallback) {
|
45738
|
+
await signatureCallback(txRequestClone);
|
45739
|
+
}
|
45284
45740
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45285
45741
|
receipts = result.receipts;
|
45286
45742
|
outputVariables = result.outputVariables;
|
45287
45743
|
missingContractIds = result.missingContractIds;
|
45288
45744
|
gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
|
45289
45745
|
txRequestClone.gasLimit = gasUsed;
|
45290
|
-
|
45291
|
-
|
45292
|
-
|
45746
|
+
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
45747
|
+
transactionRequest: txRequestClone,
|
45748
|
+
gasPrice
|
45293
45749
|
}));
|
45294
45750
|
}
|
45295
45751
|
return {
|
45296
45752
|
requiredQuantities: allQuantities,
|
45297
45753
|
receipts,
|
45298
45754
|
gasUsed,
|
45299
|
-
|
45300
|
-
gasPrice: setGasPrice,
|
45755
|
+
gasPrice,
|
45301
45756
|
minGas,
|
45302
45757
|
maxGas,
|
45303
45758
|
minFee,
|
45304
45759
|
maxFee,
|
45305
|
-
estimatedInputs: txRequestClone.inputs,
|
45306
45760
|
outputVariables,
|
45307
|
-
missingContractIds
|
45761
|
+
missingContractIds,
|
45762
|
+
addedSignatures,
|
45763
|
+
estimatedPredicates: txRequestClone.inputs
|
45308
45764
|
};
|
45309
45765
|
}
|
45310
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45766
|
+
async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
|
45311
45767
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45312
45768
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45313
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45769
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, {
|
45770
|
+
quantitiesToContract
|
45771
|
+
});
|
45314
45772
|
transactionRequest.addResources(
|
45315
45773
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45316
45774
|
);
|
45317
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45318
|
-
|
45319
|
-
|
45320
|
-
);
|
45775
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(transactionRequest, {
|
45776
|
+
quantitiesToContract
|
45777
|
+
});
|
45321
45778
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45322
45779
|
return {
|
45323
45780
|
resources,
|
@@ -45341,7 +45798,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45341
45798
|
assetId: coin.assetId,
|
45342
45799
|
amount: bn(coin.amount),
|
45343
45800
|
owner: Address.fromAddressOrString(coin.owner),
|
45344
|
-
maturity: bn(coin.maturity).toNumber(),
|
45345
45801
|
blockCreated: bn(coin.blockCreated),
|
45346
45802
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45347
45803
|
}));
|
@@ -45393,7 +45849,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45393
45849
|
amount: bn(coin.amount),
|
45394
45850
|
assetId: coin.assetId,
|
45395
45851
|
owner: Address.fromAddressOrString(coin.owner),
|
45396
|
-
maturity: bn(coin.maturity).toNumber(),
|
45397
45852
|
blockCreated: bn(coin.blockCreated),
|
45398
45853
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45399
45854
|
};
|
@@ -45426,7 +45881,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45426
45881
|
}
|
45427
45882
|
return {
|
45428
45883
|
id: block2.id,
|
45429
|
-
height: bn(block2.
|
45884
|
+
height: bn(block2.height),
|
45430
45885
|
time: block2.header.time,
|
45431
45886
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45432
45887
|
};
|
@@ -45441,7 +45896,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45441
45896
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45442
45897
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45443
45898
|
id: block2.id,
|
45444
|
-
height: bn(block2.
|
45899
|
+
height: bn(block2.height),
|
45445
45900
|
time: block2.header.time,
|
45446
45901
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45447
45902
|
}));
|
@@ -45468,7 +45923,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45468
45923
|
}
|
45469
45924
|
return {
|
45470
45925
|
id: block2.id,
|
45471
|
-
height: bn(block2.
|
45926
|
+
height: bn(block2.height, 10),
|
45472
45927
|
time: block2.header.time,
|
45473
45928
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45474
45929
|
transactions: block2.transactions.map(
|
@@ -45648,8 +46103,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45648
46103
|
prevRoot: messageBlockHeader.prevRoot,
|
45649
46104
|
time: messageBlockHeader.time,
|
45650
46105
|
applicationHash: messageBlockHeader.applicationHash,
|
45651
|
-
|
45652
|
-
|
46106
|
+
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount),
|
46107
|
+
messageOutboxRoot: messageBlockHeader.messageOutboxRoot,
|
46108
|
+
consensusParametersVersion: messageBlockHeader.consensusParametersVersion,
|
46109
|
+
eventInboxRoot: messageBlockHeader.eventInboxRoot,
|
46110
|
+
stateTransitionBytecodeVersion: messageBlockHeader.stateTransitionBytecodeVersion
|
45653
46111
|
},
|
45654
46112
|
commitBlockHeader: {
|
45655
46113
|
id: commitBlockHeader.id,
|
@@ -45660,8 +46118,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45660
46118
|
prevRoot: commitBlockHeader.prevRoot,
|
45661
46119
|
time: commitBlockHeader.time,
|
45662
46120
|
applicationHash: commitBlockHeader.applicationHash,
|
45663
|
-
|
45664
|
-
|
46121
|
+
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount),
|
46122
|
+
messageOutboxRoot: commitBlockHeader.messageOutboxRoot,
|
46123
|
+
consensusParametersVersion: commitBlockHeader.consensusParametersVersion,
|
46124
|
+
eventInboxRoot: commitBlockHeader.eventInboxRoot,
|
46125
|
+
stateTransitionBytecodeVersion: commitBlockHeader.stateTransitionBytecodeVersion
|
45665
46126
|
},
|
45666
46127
|
sender: Address.fromAddressOrString(sender),
|
45667
46128
|
recipient: Address.fromAddressOrString(recipient),
|
@@ -45670,6 +46131,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45670
46131
|
data
|
45671
46132
|
};
|
45672
46133
|
}
|
46134
|
+
async getLatestGasPrice() {
|
46135
|
+
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46136
|
+
return bn(latestGasPrice.gasPrice);
|
46137
|
+
}
|
46138
|
+
async estimateGasPrice(blockHorizon) {
|
46139
|
+
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46140
|
+
blockHorizon: String(blockHorizon)
|
46141
|
+
});
|
46142
|
+
return bn(estimateGasPrice.gasPrice);
|
46143
|
+
}
|
45673
46144
|
/**
|
45674
46145
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
45675
46146
|
*
|
@@ -45915,9 +46386,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45915
46386
|
* @param assetId - The asset ID to check the balance for.
|
45916
46387
|
* @returns A promise that resolves to the balance amount.
|
45917
46388
|
*/
|
45918
|
-
async getBalance(assetId) {
|
45919
|
-
const
|
45920
|
-
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
46389
|
+
async getBalance(assetId = BaseAssetId) {
|
46390
|
+
const amount = await this.provider.getBalance(this.address, assetId);
|
45921
46391
|
return amount;
|
45922
46392
|
}
|
45923
46393
|
/**
|
@@ -45954,37 +46424,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45954
46424
|
* @param fee - The estimated transaction fee.
|
45955
46425
|
* @returns A promise that resolves when the resources are added to the transaction.
|
45956
46426
|
*/
|
45957
|
-
async fund(request,
|
45958
|
-
const
|
45959
|
-
const
|
46427
|
+
async fund(request, params) {
|
46428
|
+
const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
|
46429
|
+
const txRequest = request;
|
46430
|
+
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45960
46431
|
amount: bn(fee),
|
45961
|
-
assetId:
|
45962
|
-
coinQuantities
|
46432
|
+
assetId: BaseAssetId,
|
46433
|
+
coinQuantities: requiredQuantities
|
45963
46434
|
});
|
45964
46435
|
const quantitiesDict = {};
|
45965
|
-
|
46436
|
+
requiredQuantitiesWithFee.forEach(({ amount, assetId }) => {
|
45966
46437
|
quantitiesDict[assetId] = {
|
45967
46438
|
required: amount,
|
45968
46439
|
owned: bn(0)
|
45969
46440
|
};
|
45970
46441
|
});
|
45971
|
-
|
45972
|
-
const cachedMessages = [];
|
45973
|
-
const owner = this.address.toB256();
|
45974
|
-
request.inputs.forEach((input) => {
|
46442
|
+
txRequest.inputs.forEach((input) => {
|
45975
46443
|
const isResource = "amount" in input;
|
45976
46444
|
if (isResource) {
|
45977
46445
|
const isCoin2 = "owner" in input;
|
45978
46446
|
if (isCoin2) {
|
45979
46447
|
const assetId = String(input.assetId);
|
45980
|
-
if (
|
46448
|
+
if (quantitiesDict[assetId]) {
|
45981
46449
|
const amount = bn(input.amount);
|
45982
46450
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45983
|
-
cachedUtxos.push(input.id);
|
45984
46451
|
}
|
45985
|
-
} else if (input.
|
45986
|
-
quantitiesDict[
|
45987
|
-
cachedMessages.push(input.nonce);
|
46452
|
+
} else if (input.amount && quantitiesDict[BaseAssetId]) {
|
46453
|
+
quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
|
45988
46454
|
}
|
45989
46455
|
}
|
45990
46456
|
});
|
@@ -45999,12 +46465,23 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45999
46465
|
});
|
46000
46466
|
const needsToBeFunded = missingQuantities.length;
|
46001
46467
|
if (needsToBeFunded) {
|
46002
|
-
const
|
46003
|
-
|
46004
|
-
|
46005
|
-
|
46006
|
-
|
46468
|
+
const excludedIds = cacheTxInputsFromOwner(txRequest.inputs, this.address.toB256());
|
46469
|
+
const resources = await this.getResourcesToSpend(missingQuantities, excludedIds);
|
46470
|
+
txRequest.addResources(resources);
|
46471
|
+
}
|
46472
|
+
txRequest.shiftPredicateData();
|
46473
|
+
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46474
|
+
const requestToBeReEstimate = clone_default(txRequest);
|
46475
|
+
if (addedSignatures) {
|
46476
|
+
Array.from({ length: addedSignatures }).forEach(
|
46477
|
+
() => requestToBeReEstimate.addEmptyWitness()
|
46478
|
+
);
|
46007
46479
|
}
|
46480
|
+
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46481
|
+
transactionRequest: requestToBeReEstimate
|
46482
|
+
});
|
46483
|
+
txRequest.maxFee = maxFee;
|
46484
|
+
return txRequest;
|
46008
46485
|
}
|
46009
46486
|
/**
|
46010
46487
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -46012,30 +46489,25 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46012
46489
|
* @param destination - The address of the destination.
|
46013
46490
|
* @param amount - The amount of coins to transfer.
|
46014
46491
|
* @param assetId - The asset ID of the coins to transfer.
|
46015
|
-
* @param txParams - The transaction parameters (gasLimit,
|
46492
|
+
* @param txParams - The transaction parameters (gasLimit, tip, maturity, maxFee, witnessLimit).
|
46016
46493
|
* @returns A promise that resolves to the prepared transaction request.
|
46017
46494
|
*/
|
46018
|
-
async createTransfer(destination, amount, assetId, txParams = {}) {
|
46019
|
-
const
|
46020
|
-
|
46021
|
-
const
|
46022
|
-
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
46023
|
-
const request = new ScriptTransactionRequest(params);
|
46024
|
-
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
46025
|
-
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46495
|
+
async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
|
46496
|
+
const request = new ScriptTransactionRequest(txParams);
|
46497
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
|
46498
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
46026
46499
|
estimateTxDependencies: true,
|
46027
46500
|
resourcesOwner: this
|
46028
46501
|
});
|
46029
|
-
|
46030
|
-
|
46031
|
-
|
46032
|
-
|
46033
|
-
|
46034
|
-
|
46035
|
-
|
46036
|
-
|
46037
|
-
await this.fund(request,
|
46038
|
-
request.updatePredicateInputs(estimatedInputs);
|
46502
|
+
if ("gasLimit" in txParams) {
|
46503
|
+
this.validateGas({
|
46504
|
+
gasUsed: txCost.gasUsed,
|
46505
|
+
gasLimit: request.gasLimit
|
46506
|
+
});
|
46507
|
+
}
|
46508
|
+
request.gasLimit = txCost.gasUsed;
|
46509
|
+
request.maxFee = txCost.maxFee;
|
46510
|
+
await this.fund(request, txCost);
|
46039
46511
|
return request;
|
46040
46512
|
}
|
46041
46513
|
/**
|
@@ -46047,15 +46519,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46047
46519
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46048
46520
|
* @returns A promise that resolves to the transaction response.
|
46049
46521
|
*/
|
46050
|
-
async transfer(destination, amount, assetId, txParams = {}) {
|
46522
|
+
async transfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
|
46051
46523
|
if (bn(amount).lte(0)) {
|
46052
46524
|
throw new FuelError(
|
46053
46525
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
46054
46526
|
"Transfer amount must be a positive number."
|
46055
46527
|
);
|
46056
46528
|
}
|
46057
|
-
const
|
46058
|
-
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
46529
|
+
const request = await this.createTransfer(destination, amount, assetId, txParams);
|
46059
46530
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
46060
46531
|
}
|
46061
46532
|
/**
|
@@ -46067,7 +46538,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46067
46538
|
* @param txParams - The optional transaction parameters.
|
46068
46539
|
* @returns A promise that resolves to the transaction response.
|
46069
46540
|
*/
|
46070
|
-
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46541
|
+
async transferToContract(contractId, amount, assetId = BaseAssetId, txParams = {}) {
|
46071
46542
|
if (bn(amount).lte(0)) {
|
46072
46543
|
throw new FuelError(
|
46073
46544
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46075,33 +46546,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46075
46546
|
);
|
46076
46547
|
}
|
46077
46548
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46078
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46079
|
-
const baseAssetId = this.provider.getBaseAssetId();
|
46080
|
-
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46081
|
-
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
46082
46549
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46083
46550
|
hexlifiedContractId: contractAddress.toB256(),
|
46084
46551
|
amountToTransfer: bn(amount),
|
46085
|
-
assetId
|
46552
|
+
assetId
|
46086
46553
|
});
|
46087
46554
|
const request = new ScriptTransactionRequest({
|
46088
|
-
...
|
46555
|
+
...txParams,
|
46089
46556
|
script,
|
46090
46557
|
scriptData
|
46091
46558
|
});
|
46092
46559
|
request.addContractInputAndOutput(contractAddress);
|
46093
|
-
const
|
46094
|
-
|
46095
|
-
[{ amount: bn(amount), assetId: String(
|
46096
|
-
);
|
46097
|
-
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46098
|
-
this.validateGas({
|
46099
|
-
gasUsed,
|
46100
|
-
gasPrice: request.gasPrice,
|
46101
|
-
gasLimit: request.gasLimit,
|
46102
|
-
minGasPrice
|
46560
|
+
const txCost = await this.provider.getTransactionCost(request, {
|
46561
|
+
resourcesOwner: this,
|
46562
|
+
quantitiesToContract: [{ amount: bn(amount), assetId: String(assetId) }]
|
46103
46563
|
});
|
46104
|
-
|
46564
|
+
if (txParams.gasLimit) {
|
46565
|
+
this.validateGas({
|
46566
|
+
gasUsed: txCost.gasUsed,
|
46567
|
+
gasLimit: request.gasLimit
|
46568
|
+
});
|
46569
|
+
}
|
46570
|
+
request.gasLimit = txCost.gasUsed;
|
46571
|
+
request.maxFee = txCost.maxFee;
|
46572
|
+
await this.fund(request, txCost);
|
46105
46573
|
return this.sendTransaction(request);
|
46106
46574
|
}
|
46107
46575
|
/**
|
@@ -46113,8 +46581,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46113
46581
|
* @returns A promise that resolves to the transaction response.
|
46114
46582
|
*/
|
46115
46583
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46116
|
-
const { minGasPrice } = this.provider.getGasConfig();
|
46117
|
-
const baseAssetId = this.provider.getBaseAssetId();
|
46118
46584
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46119
46585
|
const recipientDataArray = arrayify(
|
46120
46586
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46127,26 +46593,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46127
46593
|
...recipientDataArray,
|
46128
46594
|
...amountDataArray
|
46129
46595
|
]);
|
46130
|
-
const params = {
|
46131
|
-
script,
|
46132
|
-
gasPrice: minGasPrice,
|
46133
|
-
baseAssetId,
|
46134
|
-
...txParams
|
46135
|
-
};
|
46596
|
+
const params = { script, ...txParams };
|
46136
46597
|
const request = new ScriptTransactionRequest(params);
|
46137
|
-
const
|
46138
|
-
const
|
46139
|
-
|
46140
|
-
|
46141
|
-
|
46142
|
-
|
46143
|
-
|
46144
|
-
|
46145
|
-
|
46146
|
-
|
46147
|
-
|
46148
|
-
});
|
46149
|
-
await this.fund(request, requiredQuantities, maxFee);
|
46598
|
+
const quantitiesToContract = [{ amount: bn(amount), assetId: BaseAssetId }];
|
46599
|
+
const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
|
46600
|
+
if (txParams.gasLimit) {
|
46601
|
+
this.validateGas({
|
46602
|
+
gasUsed: txCost.gasUsed,
|
46603
|
+
gasLimit: request.gasLimit
|
46604
|
+
});
|
46605
|
+
}
|
46606
|
+
request.maxFee = txCost.maxFee;
|
46607
|
+
request.gasLimit = txCost.gasUsed;
|
46608
|
+
await this.fund(request, txCost);
|
46150
46609
|
return this.sendTransaction(request);
|
46151
46610
|
}
|
46152
46611
|
async signMessage(message) {
|
@@ -46204,18 +46663,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46204
46663
|
}
|
46205
46664
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46206
46665
|
}
|
46207
|
-
validateGas({
|
46208
|
-
gasUsed,
|
46209
|
-
gasPrice,
|
46210
|
-
gasLimit,
|
46211
|
-
minGasPrice
|
46212
|
-
}) {
|
46213
|
-
if (minGasPrice.gt(gasPrice)) {
|
46214
|
-
throw new FuelError(
|
46215
|
-
ErrorCode.GAS_PRICE_TOO_LOW,
|
46216
|
-
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46217
|
-
);
|
46218
|
-
}
|
46666
|
+
validateGas({ gasUsed, gasLimit }) {
|
46219
46667
|
if (gasUsed.gt(gasLimit)) {
|
46220
46668
|
throw new FuelError(
|
46221
46669
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -47804,7 +48252,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47804
48252
|
* @param transactionRequestLike - The transaction request to send.
|
47805
48253
|
* @returns A promise that resolves to the TransactionResponse object.
|
47806
48254
|
*/
|
47807
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
48255
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = false, awaitExecution } = {}) {
|
47808
48256
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
47809
48257
|
if (estimateTxDependencies) {
|
47810
48258
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50564,16 +51012,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50564
51012
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50565
51013
|
wallet.provider
|
50566
51014
|
);
|
50567
|
-
const
|
50568
|
-
|
50569
|
-
|
50570
|
-
|
50571
|
-
baseAssetId,
|
50572
|
-
gasLimit: 1e4,
|
50573
|
-
gasPrice: minGasPrice
|
51015
|
+
const request = new ScriptTransactionRequest();
|
51016
|
+
quantities.forEach((quantity) => {
|
51017
|
+
const { amount, assetId } = coinQuantityfy(quantity);
|
51018
|
+
request.addCoinOutput(wallet.address, amount, assetId);
|
50574
51019
|
});
|
50575
|
-
|
50576
|
-
|
51020
|
+
const txCost = await genesisWallet.provider.getTransactionCost(request);
|
51021
|
+
request.gasLimit = txCost.gasUsed;
|
51022
|
+
request.maxFee = txCost.maxFee;
|
51023
|
+
await genesisWallet.fund(request, txCost);
|
50577
51024
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50578
51025
|
};
|
50579
51026
|
|
@@ -50603,7 +51050,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50603
51050
|
|
50604
51051
|
// src/test-utils/launchNode.ts
|
50605
51052
|
var import_child_process = __require("child_process");
|
50606
|
-
var
|
51053
|
+
var import_crypto22 = __require("crypto");
|
50607
51054
|
var import_fs2 = __require("fs");
|
50608
51055
|
var import_os = __toESM(__require("os"));
|
50609
51056
|
var import_path8 = __toESM(__require("path"));
|
@@ -50652,12 +51099,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50652
51099
|
// eslint-disable-next-line no-async-promise-executor
|
50653
51100
|
new Promise(async (resolve, reject) => {
|
50654
51101
|
const remainingArgs = extractRemainingArgs(args, [
|
50655
|
-
"--
|
51102
|
+
"--snapshot",
|
50656
51103
|
"--consensus-key",
|
50657
51104
|
"--db-type",
|
50658
51105
|
"--poa-instant"
|
50659
51106
|
]);
|
50660
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
51107
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--snapshot");
|
50661
51108
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
50662
51109
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
50663
51110
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -50675,37 +51122,55 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50675
51122
|
})).toString();
|
50676
51123
|
let chainConfigPathToUse;
|
50677
51124
|
const prefix = basePath || import_os.default.tmpdir();
|
50678
|
-
const suffix = basePath ? "" : (0,
|
50679
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51125
|
+
const suffix = basePath ? "" : (0, import_crypto22.randomUUID)();
|
51126
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix, "chainConfigs");
|
50680
51127
|
if (chainConfigPath) {
|
50681
51128
|
chainConfigPathToUse = chainConfigPath;
|
50682
51129
|
} else {
|
50683
51130
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
50684
51131
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
50685
51132
|
}
|
50686
|
-
|
50687
|
-
|
51133
|
+
let { stateConfigJson } = defaultChainConfigs;
|
51134
|
+
const { chainConfigJson, metadataJson } = defaultChainConfigs;
|
51135
|
+
stateConfigJson = {
|
51136
|
+
...stateConfigJson,
|
51137
|
+
coins: [
|
51138
|
+
...stateConfigJson.coins.map((coin) => ({
|
51139
|
+
...coin,
|
51140
|
+
amount: "18446744073709551615"
|
51141
|
+
}))
|
51142
|
+
],
|
51143
|
+
messages: stateConfigJson.messages.map((message) => ({
|
51144
|
+
...message,
|
51145
|
+
amount: "18446744073709551615"
|
51146
|
+
}))
|
51147
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51148
|
+
};
|
50688
51149
|
if (!process.env.GENESIS_SECRET) {
|
50689
51150
|
const pk = Signer.generatePrivateKey();
|
50690
51151
|
const signer = new Signer(pk);
|
50691
51152
|
process.env.GENESIS_SECRET = hexlify(pk);
|
50692
|
-
|
50693
|
-
|
50694
|
-
|
50695
|
-
|
50696
|
-
|
50697
|
-
|
50698
|
-
|
50699
|
-
|
50700
|
-
|
50701
|
-
|
50702
|
-
}
|
50703
|
-
]
|
50704
|
-
}
|
50705
|
-
};
|
51153
|
+
stateConfigJson.coins.push({
|
51154
|
+
tx_id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
51155
|
+
owner: signer.address.toHexString(),
|
51156
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51157
|
+
amount: "18446744073709551615",
|
51158
|
+
asset_id: BaseAssetId,
|
51159
|
+
output_index: 0,
|
51160
|
+
tx_pointer_block_height: 0,
|
51161
|
+
tx_pointer_tx_idx: 0
|
51162
|
+
});
|
50706
51163
|
}
|
50707
|
-
|
50708
|
-
|
51164
|
+
let fixedStateConfigJSON = JSON.stringify(stateConfigJson);
|
51165
|
+
const regexMakeNumber = /("amount":)"(\d+)"/gm;
|
51166
|
+
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51167
|
+
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51168
|
+
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51169
|
+
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51170
|
+
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51171
|
+
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51172
|
+
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51173
|
+
chainConfigPathToUse = tempDirPath;
|
50709
51174
|
}
|
50710
51175
|
const child = (0, import_child_process.spawn)(
|
50711
51176
|
command,
|
@@ -50714,10 +51179,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50714
51179
|
["--ip", ipToUse],
|
50715
51180
|
["--port", portToUse],
|
50716
51181
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
50717
|
-
["--min-gas-price", "
|
51182
|
+
["--min-gas-price", "1"],
|
50718
51183
|
poaInstant ? ["--poa-instant", "true"] : [],
|
50719
51184
|
["--consensus-key", consensusKey],
|
50720
|
-
["--
|
51185
|
+
["--snapshot", chainConfigPathToUse],
|
50721
51186
|
"--vm-backtrace",
|
50722
51187
|
"--utxo-validation",
|
50723
51188
|
"--debug",
|
@@ -50764,10 +51229,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50764
51229
|
})
|
50765
51230
|
);
|
50766
51231
|
var generateWallets = async (count, provider) => {
|
50767
|
-
const baseAssetId = provider.getBaseAssetId();
|
50768
51232
|
const wallets = [];
|
50769
51233
|
for (let i = 0; i < count; i += 1) {
|
50770
|
-
const wallet = await generateTestWallet(provider, [[1e3,
|
51234
|
+
const wallet = await generateTestWallet(provider, [[1e3, BaseAssetId]]);
|
50771
51235
|
wallets.push(wallet);
|
50772
51236
|
}
|
50773
51237
|
return wallets;
|
@@ -50777,7 +51241,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50777
51241
|
walletCount = 10
|
50778
51242
|
} = {}) => {
|
50779
51243
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
50780
|
-
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51244
|
+
const provider = await Provider.create(`http://${ip}:${port}/v1/graphql`);
|
50781
51245
|
const wallets = await generateWallets(walletCount, provider);
|
50782
51246
|
const cleanup = () => {
|
50783
51247
|
closeNode();
|