@fuel-ts/account 0.0.0-rc-2021-20240415193305 → 0.0.0-rc-1976-20240416161016
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/README.md +1 -1
- package/dist/account.d.ts +4 -5
- package/dist/account.d.ts.map +1 -1
- package/dist/configs.d.ts.map +1 -1
- package/dist/configs.global.js +1 -1
- package/dist/configs.global.js.map +1 -1
- package/dist/configs.js +1 -1
- package/dist/configs.js.map +1 -1
- package/dist/configs.mjs +1 -1
- package/dist/configs.mjs.map +1 -1
- package/dist/index.global.js +600 -829
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +600 -835
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +443 -677
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +2 -10
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +329 -911
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/coin-quantity.d.ts +3 -3
- package/dist/providers/coin-quantity.d.ts.map +1 -1
- package/dist/providers/coin.d.ts +2 -4
- package/dist/providers/coin.d.ts.map +1 -1
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -1
- package/dist/providers/message.d.ts +1 -7
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +34 -37
- 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 +29 -9
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/utils.d.ts +0 -3
- package/dist/providers/transaction-request/utils.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +0 -2
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +2 -3
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -1
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
- package/dist/providers/utils/gas.d.ts +2 -8
- package/dist/providers/utils/gas.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils.global.js +1114 -1578
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +599 -813
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +455 -669
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +22 -27
@@ -5104,7 +5104,7 @@
|
|
5104
5104
|
function isBlob(obj) {
|
5105
5105
|
return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
|
5106
5106
|
}
|
5107
|
-
function
|
5107
|
+
function clone(instance) {
|
5108
5108
|
let p1, p2;
|
5109
5109
|
let body = instance.body;
|
5110
5110
|
if (instance.bodyUsed) {
|
@@ -6038,7 +6038,7 @@
|
|
6038
6038
|
* @return Response
|
6039
6039
|
*/
|
6040
6040
|
clone() {
|
6041
|
-
return new Response2(
|
6041
|
+
return new Response2(clone(this), {
|
6042
6042
|
url: this.url,
|
6043
6043
|
status: this.status,
|
6044
6044
|
statusText: this.statusText,
|
@@ -6088,7 +6088,7 @@
|
|
6088
6088
|
if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
6089
6089
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
6090
6090
|
}
|
6091
|
-
let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ?
|
6091
|
+
let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
|
6092
6092
|
Body.call(this, inputBody, {
|
6093
6093
|
timeout: init.timeout || input.timeout || 0,
|
6094
6094
|
size: init.size || input.size || 0
|
@@ -31914,8 +31914,8 @@ spurious results.`);
|
|
31914
31914
|
// ../versions/dist/index.mjs
|
31915
31915
|
function getBuiltinVersions() {
|
31916
31916
|
return {
|
31917
|
-
FORC: "0.
|
31918
|
-
FUEL_CORE: "0.
|
31917
|
+
FORC: "0.49.3",
|
31918
|
+
FUEL_CORE: "0.22.1",
|
31919
31919
|
FUELS: "0.80.0"
|
31920
31920
|
};
|
31921
31921
|
}
|
@@ -32193,757 +32193,525 @@ 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
|
-
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
|
-
}
|
32196
|
+
block_gas_limit: 5e9,
|
32197
|
+
initial_state: {
|
32198
|
+
coins: [
|
32199
|
+
{
|
32200
|
+
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32201
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32202
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32452
32203
|
},
|
32453
|
-
|
32454
|
-
|
32455
|
-
|
32456
|
-
|
32204
|
+
{
|
32205
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32206
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32207
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32208
|
+
},
|
32209
|
+
{
|
32210
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32211
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32212
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32213
|
+
},
|
32214
|
+
{
|
32215
|
+
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32216
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32217
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32218
|
+
},
|
32219
|
+
{
|
32220
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32221
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32222
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32223
|
+
},
|
32224
|
+
{
|
32225
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32226
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32227
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32228
|
+
},
|
32229
|
+
{
|
32230
|
+
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32231
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32232
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32233
|
+
},
|
32234
|
+
{
|
32235
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32236
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32237
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32238
|
+
},
|
32239
|
+
{
|
32240
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32241
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32242
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32243
|
+
},
|
32244
|
+
{
|
32245
|
+
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32246
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32247
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32248
|
+
},
|
32249
|
+
{
|
32250
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32251
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32252
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32253
|
+
},
|
32254
|
+
{
|
32255
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32256
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32257
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32258
|
+
},
|
32259
|
+
{
|
32260
|
+
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32261
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32262
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32263
|
+
},
|
32264
|
+
{
|
32265
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32266
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32267
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32268
|
+
},
|
32269
|
+
{
|
32270
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32271
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32272
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32273
|
+
},
|
32274
|
+
{
|
32275
|
+
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32276
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32277
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32278
|
+
},
|
32279
|
+
{
|
32280
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32281
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32282
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32283
|
+
},
|
32284
|
+
{
|
32285
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32286
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32287
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32288
|
+
},
|
32289
|
+
{
|
32290
|
+
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32291
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32292
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32293
|
+
},
|
32294
|
+
{
|
32295
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32296
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32297
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32298
|
+
},
|
32299
|
+
{
|
32300
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32301
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32302
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32303
|
+
},
|
32304
|
+
{
|
32305
|
+
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32306
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32307
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32308
|
+
},
|
32309
|
+
{
|
32310
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32311
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32312
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32313
|
+
},
|
32314
|
+
{
|
32315
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32316
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32317
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32318
|
+
},
|
32319
|
+
{
|
32320
|
+
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32321
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32322
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32323
|
+
},
|
32324
|
+
{
|
32325
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32326
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32327
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32328
|
+
},
|
32329
|
+
{
|
32330
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32331
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32332
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32333
|
+
},
|
32334
|
+
{
|
32335
|
+
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32336
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32337
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32338
|
+
},
|
32339
|
+
{
|
32340
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32341
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32342
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32343
|
+
},
|
32344
|
+
{
|
32345
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32346
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32347
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32348
|
+
},
|
32349
|
+
{
|
32350
|
+
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32351
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32352
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32353
|
+
},
|
32354
|
+
{
|
32355
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32356
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32357
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32358
|
+
},
|
32359
|
+
{
|
32360
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32361
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32362
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32363
|
+
},
|
32364
|
+
{
|
32365
|
+
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32366
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32367
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32368
|
+
},
|
32369
|
+
{
|
32370
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32371
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32372
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32373
|
+
},
|
32374
|
+
{
|
32375
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32376
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32377
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32378
|
+
},
|
32379
|
+
{
|
32380
|
+
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32381
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32382
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32383
|
+
},
|
32384
|
+
{
|
32385
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32386
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32387
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32388
|
+
},
|
32389
|
+
{
|
32390
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32391
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32392
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32393
|
+
},
|
32394
|
+
{
|
32395
|
+
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32396
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32397
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32398
|
+
},
|
32399
|
+
{
|
32400
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32401
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32402
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32403
|
+
},
|
32404
|
+
{
|
32405
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32406
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32407
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32408
|
+
},
|
32409
|
+
{
|
32410
|
+
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32411
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32412
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32413
|
+
},
|
32414
|
+
{
|
32415
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32416
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32417
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32418
|
+
},
|
32419
|
+
{
|
32420
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32421
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32422
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32423
|
+
},
|
32424
|
+
{
|
32425
|
+
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32426
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32427
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32428
|
+
},
|
32429
|
+
{
|
32430
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32431
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32432
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32433
|
+
},
|
32434
|
+
{
|
32435
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32436
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32437
|
+
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32438
|
+
},
|
32439
|
+
{
|
32440
|
+
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32441
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32442
|
+
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32443
|
+
}
|
32444
|
+
],
|
32445
|
+
messages: [
|
32446
|
+
{
|
32447
|
+
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32448
|
+
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32449
|
+
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32450
|
+
amount: "0x000000000000FFFF",
|
32451
|
+
data: "",
|
32452
|
+
da_height: "0x00"
|
32453
|
+
},
|
32454
|
+
{
|
32455
|
+
sender: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32456
|
+
recipient: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32457
|
+
nonce: "0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b0e1ef2963832068b",
|
32458
|
+
amount: "0xb04f3c08f59b309e",
|
32459
|
+
data: "",
|
32460
|
+
da_height: "0x00"
|
32461
|
+
}
|
32462
|
+
]
|
32457
32463
|
},
|
32458
|
-
|
32459
|
-
|
32460
|
-
|
32461
|
-
|
32462
|
-
|
32463
|
-
|
32464
|
-
|
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"
|
32482
|
-
},
|
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"
|
32491
|
-
},
|
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"
|
32500
|
-
},
|
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"
|
32509
|
-
},
|
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"
|
32518
|
-
},
|
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"
|
32527
|
-
},
|
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"
|
32536
|
-
},
|
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"
|
32545
|
-
},
|
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"
|
32554
|
-
},
|
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"
|
32563
|
-
},
|
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"
|
32572
|
-
},
|
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"
|
32581
|
-
},
|
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"
|
32590
|
-
},
|
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"
|
32599
|
-
},
|
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"
|
32608
|
-
},
|
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"
|
32617
|
-
},
|
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"
|
32626
|
-
},
|
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"
|
32635
|
-
},
|
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"
|
32644
|
-
},
|
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"
|
32653
|
-
},
|
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"
|
32662
|
-
},
|
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"
|
32671
|
-
},
|
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"
|
32680
|
-
},
|
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"
|
32689
|
-
},
|
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"
|
32464
|
+
consensus_parameters: {
|
32465
|
+
tx_params: {
|
32466
|
+
max_inputs: 255,
|
32467
|
+
max_outputs: 255,
|
32468
|
+
max_witnesses: 255,
|
32469
|
+
max_gas_per_tx: 1e7,
|
32470
|
+
max_size: 17825792
|
32698
32471
|
},
|
32699
|
-
{
|
32700
|
-
|
32701
|
-
|
32702
|
-
|
32703
|
-
|
32704
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32705
|
-
amount: 18446744073709552e3,
|
32706
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32472
|
+
predicate_params: {
|
32473
|
+
max_predicate_length: 1048576,
|
32474
|
+
max_predicate_data_length: 1048576,
|
32475
|
+
max_gas_per_predicate: 1e7,
|
32476
|
+
max_message_data_length: 1048576
|
32707
32477
|
},
|
32708
|
-
{
|
32709
|
-
|
32710
|
-
|
32711
|
-
tx_pointer_block_height: 0,
|
32712
|
-
tx_pointer_tx_idx: 0,
|
32713
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32714
|
-
amount: 18446744073709552e3,
|
32715
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32478
|
+
script_params: {
|
32479
|
+
max_script_length: 1048576,
|
32480
|
+
max_script_data_length: 1048576
|
32716
32481
|
},
|
32717
|
-
{
|
32718
|
-
|
32719
|
-
|
32720
|
-
tx_pointer_block_height: 0,
|
32721
|
-
tx_pointer_tx_idx: 0,
|
32722
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32723
|
-
amount: 18446744073709552e3,
|
32724
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32482
|
+
contract_params: {
|
32483
|
+
contract_max_size: 16777216,
|
32484
|
+
max_storage_slots: 255
|
32725
32485
|
},
|
32726
|
-
{
|
32727
|
-
|
32728
|
-
|
32729
|
-
tx_pointer_block_height: 0,
|
32730
|
-
tx_pointer_tx_idx: 0,
|
32731
|
-
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32732
|
-
amount: 18446744073709552e3,
|
32733
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32486
|
+
fee_params: {
|
32487
|
+
gas_price_factor: 92,
|
32488
|
+
gas_per_byte: 4
|
32734
32489
|
},
|
32735
|
-
|
32736
|
-
|
32737
|
-
|
32738
|
-
|
32739
|
-
|
32740
|
-
|
32741
|
-
|
32742
|
-
|
32490
|
+
base_asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32491
|
+
},
|
32492
|
+
gas_costs: {
|
32493
|
+
add: 1,
|
32494
|
+
addi: 1,
|
32495
|
+
aloc: 1,
|
32496
|
+
and: 1,
|
32497
|
+
andi: 1,
|
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
|
+
}
|
32743
32587
|
},
|
32744
|
-
{
|
32745
|
-
|
32746
|
-
|
32747
|
-
|
32748
|
-
|
32749
|
-
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32750
|
-
amount: 18446744073709552e3,
|
32751
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32588
|
+
ccp: {
|
32589
|
+
LightOperation: {
|
32590
|
+
base: 15,
|
32591
|
+
units_per_gas: 103
|
32592
|
+
}
|
32752
32593
|
},
|
32753
|
-
{
|
32754
|
-
|
32755
|
-
|
32756
|
-
|
32757
|
-
|
32758
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32759
|
-
amount: 18446744073709552e3,
|
32760
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32594
|
+
csiz: {
|
32595
|
+
LightOperation: {
|
32596
|
+
base: 17,
|
32597
|
+
units_per_gas: 790
|
32598
|
+
}
|
32761
32599
|
},
|
32762
|
-
{
|
32763
|
-
|
32764
|
-
|
32765
|
-
|
32766
|
-
|
32767
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32768
|
-
amount: 18446744073709552e3,
|
32769
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32600
|
+
k256: {
|
32601
|
+
LightOperation: {
|
32602
|
+
base: 11,
|
32603
|
+
units_per_gas: 214
|
32604
|
+
}
|
32770
32605
|
},
|
32771
|
-
{
|
32772
|
-
|
32773
|
-
|
32774
|
-
|
32775
|
-
|
32776
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32777
|
-
amount: 18446744073709552e3,
|
32778
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32606
|
+
ldc: {
|
32607
|
+
LightOperation: {
|
32608
|
+
base: 15,
|
32609
|
+
units_per_gas: 272
|
32610
|
+
}
|
32779
32611
|
},
|
32780
|
-
{
|
32781
|
-
|
32782
|
-
|
32783
|
-
|
32784
|
-
|
32785
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32786
|
-
amount: 18446744073709552e3,
|
32787
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32612
|
+
logd: {
|
32613
|
+
LightOperation: {
|
32614
|
+
base: 26,
|
32615
|
+
units_per_gas: 64
|
32616
|
+
}
|
32788
32617
|
},
|
32789
|
-
{
|
32790
|
-
|
32791
|
-
|
32792
|
-
|
32793
|
-
|
32794
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32795
|
-
amount: 18446744073709552e3,
|
32796
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32618
|
+
mcl: {
|
32619
|
+
LightOperation: {
|
32620
|
+
base: 1,
|
32621
|
+
units_per_gas: 3333
|
32622
|
+
}
|
32797
32623
|
},
|
32798
|
-
{
|
32799
|
-
|
32800
|
-
|
32801
|
-
|
32802
|
-
|
32803
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32804
|
-
amount: 18446744073709552e3,
|
32805
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32624
|
+
mcli: {
|
32625
|
+
LightOperation: {
|
32626
|
+
base: 1,
|
32627
|
+
units_per_gas: 3333
|
32628
|
+
}
|
32806
32629
|
},
|
32807
|
-
{
|
32808
|
-
|
32809
|
-
|
32810
|
-
|
32811
|
-
|
32812
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32813
|
-
amount: 18446744073709552e3,
|
32814
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32630
|
+
mcp: {
|
32631
|
+
LightOperation: {
|
32632
|
+
base: 1,
|
32633
|
+
units_per_gas: 2e3
|
32634
|
+
}
|
32815
32635
|
},
|
32816
|
-
{
|
32817
|
-
|
32818
|
-
|
32819
|
-
|
32820
|
-
|
32821
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32822
|
-
amount: 18446744073709552e3,
|
32823
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32636
|
+
mcpi: {
|
32637
|
+
LightOperation: {
|
32638
|
+
base: 3,
|
32639
|
+
units_per_gas: 2e3
|
32640
|
+
}
|
32824
32641
|
},
|
32825
|
-
{
|
32826
|
-
|
32827
|
-
|
32828
|
-
|
32829
|
-
|
32830
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32831
|
-
amount: 18446744073709552e3,
|
32832
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32642
|
+
meq: {
|
32643
|
+
LightOperation: {
|
32644
|
+
base: 1,
|
32645
|
+
units_per_gas: 2500
|
32646
|
+
}
|
32833
32647
|
},
|
32834
|
-
{
|
32835
|
-
|
32836
|
-
|
32837
|
-
|
32838
|
-
|
32839
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32840
|
-
amount: 18446744073709552e3,
|
32841
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32648
|
+
retd: {
|
32649
|
+
LightOperation: {
|
32650
|
+
base: 29,
|
32651
|
+
units_per_gas: 62
|
32652
|
+
}
|
32842
32653
|
},
|
32843
|
-
{
|
32844
|
-
|
32845
|
-
|
32846
|
-
|
32847
|
-
|
32848
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32849
|
-
amount: 18446744073709552e3,
|
32850
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32654
|
+
s256: {
|
32655
|
+
LightOperation: {
|
32656
|
+
base: 2,
|
32657
|
+
units_per_gas: 214
|
32658
|
+
}
|
32851
32659
|
},
|
32852
|
-
{
|
32853
|
-
|
32854
|
-
|
32855
|
-
|
32856
|
-
|
32857
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32858
|
-
amount: 18446744073709552e3,
|
32859
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32660
|
+
scwq: {
|
32661
|
+
LightOperation: {
|
32662
|
+
base: 13,
|
32663
|
+
units_per_gas: 5
|
32664
|
+
}
|
32860
32665
|
},
|
32861
|
-
{
|
32862
|
-
|
32863
|
-
|
32864
|
-
|
32865
|
-
|
32866
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32867
|
-
amount: 18446744073709552e3,
|
32868
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32666
|
+
smo: {
|
32667
|
+
LightOperation: {
|
32668
|
+
base: 209,
|
32669
|
+
units_per_gas: 55
|
32670
|
+
}
|
32869
32671
|
},
|
32870
|
-
{
|
32871
|
-
|
32872
|
-
|
32873
|
-
|
32874
|
-
|
32875
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32876
|
-
amount: 18446744073709552e3,
|
32877
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32672
|
+
srwq: {
|
32673
|
+
LightOperation: {
|
32674
|
+
base: 47,
|
32675
|
+
units_per_gas: 5
|
32676
|
+
}
|
32878
32677
|
},
|
32879
|
-
{
|
32880
|
-
|
32881
|
-
|
32882
|
-
|
32883
|
-
|
32884
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32885
|
-
amount: 18446744073709552e3,
|
32886
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32678
|
+
swwq: {
|
32679
|
+
LightOperation: {
|
32680
|
+
base: 44,
|
32681
|
+
units_per_gas: 5
|
32682
|
+
}
|
32887
32683
|
},
|
32888
|
-
{
|
32889
|
-
|
32890
|
-
|
32891
|
-
|
32892
|
-
|
32893
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32894
|
-
amount: 18446744073709552e3,
|
32895
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32684
|
+
contract_root: {
|
32685
|
+
LightOperation: {
|
32686
|
+
base: 75,
|
32687
|
+
units_per_gas: 1
|
32688
|
+
}
|
32896
32689
|
},
|
32897
|
-
{
|
32898
|
-
|
32899
|
-
|
32900
|
-
|
32901
|
-
|
32902
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32903
|
-
amount: 18446744073709552e3,
|
32904
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32690
|
+
state_root: {
|
32691
|
+
LightOperation: {
|
32692
|
+
base: 412,
|
32693
|
+
units_per_gas: 1
|
32694
|
+
}
|
32905
32695
|
},
|
32906
|
-
{
|
32907
|
-
|
32908
|
-
|
32909
|
-
|
32910
|
-
|
32911
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32912
|
-
amount: 18446744073709552e3,
|
32913
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32914
|
-
}
|
32915
|
-
],
|
32916
|
-
messages: [
|
32917
|
-
{
|
32918
|
-
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32919
|
-
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32920
|
-
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32921
|
-
amount: 18446744073709552e3,
|
32922
|
-
data: "",
|
32923
|
-
da_height: 0
|
32696
|
+
vm_initialization: {
|
32697
|
+
HeavyOperation: {
|
32698
|
+
base: 2e3,
|
32699
|
+
gas_per_unit: 0
|
32700
|
+
}
|
32924
32701
|
},
|
32925
|
-
|
32926
|
-
|
32927
|
-
|
32928
|
-
|
32929
|
-
|
32930
|
-
data: "",
|
32931
|
-
da_height: 0
|
32702
|
+
new_storage_per_byte: 1
|
32703
|
+
},
|
32704
|
+
consensus: {
|
32705
|
+
PoA: {
|
32706
|
+
signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
|
32932
32707
|
}
|
32933
|
-
|
32934
|
-
contracts: [],
|
32935
|
-
block_height: 0,
|
32936
|
-
da_block_height: 0
|
32937
|
-
};
|
32938
|
-
var defaultChainConfigs = {
|
32939
|
-
chainConfigJson: chainConfig_default,
|
32940
|
-
metadataJson: metadata_default,
|
32941
|
-
stateConfigJson: stateConfig_default
|
32708
|
+
}
|
32942
32709
|
};
|
32710
|
+
var defaultChainConfig = chainConfig_default;
|
32943
32711
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32944
32712
|
|
32945
32713
|
// ../crypto/dist/index.mjs
|
32946
|
-
var
|
32714
|
+
var import_crypto8 = __toESM(__require("crypto"), 1);
|
32947
32715
|
|
32948
32716
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/_version.js
|
32949
32717
|
var version = "6.7.1";
|
@@ -34015,27 +33783,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34015
33783
|
};
|
34016
33784
|
Object.freeze(pbkdf22);
|
34017
33785
|
|
34018
|
-
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/crypto/random.js
|
34019
|
-
var locked5 = false;
|
34020
|
-
var _randomBytes = function(length) {
|
34021
|
-
return new Uint8Array((0, import_crypto2.randomBytes)(length));
|
34022
|
-
};
|
34023
|
-
var __randomBytes = _randomBytes;
|
34024
|
-
function randomBytes3(length) {
|
34025
|
-
return __randomBytes(length);
|
34026
|
-
}
|
34027
|
-
randomBytes3._ = _randomBytes;
|
34028
|
-
randomBytes3.lock = function() {
|
34029
|
-
locked5 = true;
|
34030
|
-
};
|
34031
|
-
randomBytes3.register = function(func) {
|
34032
|
-
if (locked5) {
|
34033
|
-
throw new Error("randomBytes is locked");
|
34034
|
-
}
|
34035
|
-
__randomBytes = func;
|
34036
|
-
};
|
34037
|
-
Object.freeze(randomBytes3);
|
34038
|
-
|
34039
33786
|
// ../../node_modules/.pnpm/ethers@6.7.1/node_modules/ethers/lib.esm/address/address.js
|
34040
33787
|
var BN_03 = BigInt(0);
|
34041
33788
|
var BN_36 = BigInt(36);
|
@@ -34620,8 +34367,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34620
34367
|
}
|
34621
34368
|
|
34622
34369
|
// ../crypto/dist/index.mjs
|
34370
|
+
var import_crypto9 = __toESM(__require("crypto"), 1);
|
34623
34371
|
var import_crypto10 = __toESM(__require("crypto"), 1);
|
34624
|
-
var import_crypto11 = __toESM(__require("crypto"), 1);
|
34625
34372
|
var scrypt3 = (params) => {
|
34626
34373
|
const { password, salt, n, p, r, dklen } = params;
|
34627
34374
|
const derivedKey = scrypt(password, salt, { N: n, r, p, dkLen: dklen });
|
@@ -34630,7 +34377,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34630
34377
|
var keccak2562 = (data) => keccak_256(data);
|
34631
34378
|
var bufferFromString = (string, encoding = "base64") => Uint8Array.from(Buffer.from(string, encoding));
|
34632
34379
|
var randomBytes4 = (length) => {
|
34633
|
-
const randomValues = Uint8Array.from(
|
34380
|
+
const randomValues = Uint8Array.from(import_crypto9.default.randomBytes(length));
|
34634
34381
|
return randomValues;
|
34635
34382
|
};
|
34636
34383
|
var stringFromBuffer = (buffer, encoding = "base64") => Buffer.from(buffer).toString(encoding);
|
@@ -34645,7 +34392,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34645
34392
|
const salt = randomBytes4(32);
|
34646
34393
|
const secret = keyFromPassword(password, salt);
|
34647
34394
|
const dataBuffer = Uint8Array.from(Buffer.from(JSON.stringify(data), "utf-8"));
|
34648
|
-
const cipher = await
|
34395
|
+
const cipher = await import_crypto8.default.createCipheriv(ALGORITHM, secret, iv);
|
34649
34396
|
let cipherData = cipher.update(dataBuffer);
|
34650
34397
|
cipherData = Buffer.concat([cipherData, cipher.final()]);
|
34651
34398
|
return {
|
@@ -34659,7 +34406,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34659
34406
|
const salt = bufferFromString(keystore.salt);
|
34660
34407
|
const secret = keyFromPassword(password, salt);
|
34661
34408
|
const encryptedText = bufferFromString(keystore.data);
|
34662
|
-
const decipher = await
|
34409
|
+
const decipher = await import_crypto8.default.createDecipheriv(ALGORITHM, secret, iv);
|
34663
34410
|
const decrypted = decipher.update(encryptedText);
|
34664
34411
|
const deBuff = Buffer.concat([decrypted, decipher.final()]);
|
34665
34412
|
const decryptedData = Buffer.from(deBuff).toString("utf-8");
|
@@ -34670,12 +34417,12 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34670
34417
|
}
|
34671
34418
|
};
|
34672
34419
|
async function encryptJsonWalletData(data, key, iv) {
|
34673
|
-
const cipher = await
|
34420
|
+
const cipher = await import_crypto10.default.createCipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
34674
34421
|
const encrypted = Buffer.concat([cipher.update(data), cipher.final()]);
|
34675
34422
|
return new Uint8Array(encrypted);
|
34676
34423
|
}
|
34677
34424
|
async function decryptJsonWalletData(data, key, iv) {
|
34678
|
-
const decipher =
|
34425
|
+
const decipher = import_crypto10.default.createDecipheriv("aes-128-ctr", key.subarray(0, 16), iv);
|
34679
34426
|
const decrypted = await Buffer.concat([decipher.update(data), decipher.final()]);
|
34680
34427
|
return new Uint8Array(decrypted);
|
34681
34428
|
}
|
@@ -35009,10 +34756,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35009
34756
|
}
|
35010
34757
|
};
|
35011
34758
|
|
35012
|
-
// ../address/dist/configs.mjs
|
35013
|
-
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
35014
|
-
var BaseAssetId = ZeroBytes32;
|
35015
|
-
|
35016
34759
|
// ../math/dist/index.mjs
|
35017
34760
|
var import_bn = __toESM(require_bn(), 1);
|
35018
34761
|
var DEFAULT_PRECISION = 9;
|
@@ -35232,159 +34975,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35232
34975
|
function toBytes3(value, bytesPadding) {
|
35233
34976
|
return bn(value).toBytes(bytesPadding);
|
35234
34977
|
}
|
35235
|
-
|
35236
|
-
|
35237
|
-
function _isPlaceholder(a) {
|
35238
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
35239
|
-
}
|
35240
|
-
|
35241
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
35242
|
-
function _curry1(fn) {
|
35243
|
-
return function f1(a) {
|
35244
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
35245
|
-
return f1;
|
35246
|
-
} else {
|
35247
|
-
return fn.apply(this, arguments);
|
35248
|
-
}
|
35249
|
-
};
|
35250
|
-
}
|
35251
|
-
|
35252
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
35253
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
35254
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
35255
|
-
};
|
35256
|
-
|
35257
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
35258
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
35259
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
35260
|
-
});
|
35261
|
-
var type_default = type;
|
35262
|
-
|
35263
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
35264
|
-
var pad = function pad2(n) {
|
35265
|
-
return (n < 10 ? "0" : "") + n;
|
35266
|
-
};
|
35267
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
35268
|
-
return d.toISOString();
|
35269
|
-
} : function _toISOString3(d) {
|
35270
|
-
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
|
35271
|
-
};
|
35272
|
-
|
35273
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
35274
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
35275
|
-
return n << 0 === n;
|
35276
|
-
};
|
35277
|
-
|
35278
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
35279
|
-
function _cloneRegExp(pattern) {
|
35280
|
-
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
35281
|
-
}
|
35282
|
-
|
35283
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
35284
|
-
function _clone(value, deep, map) {
|
35285
|
-
map || (map = new _ObjectMap());
|
35286
|
-
if (_isPrimitive(value)) {
|
35287
|
-
return value;
|
35288
|
-
}
|
35289
|
-
var copy = function copy2(copiedValue) {
|
35290
|
-
var cachedCopy = map.get(value);
|
35291
|
-
if (cachedCopy) {
|
35292
|
-
return cachedCopy;
|
35293
|
-
}
|
35294
|
-
map.set(value, copiedValue);
|
35295
|
-
for (var key in value) {
|
35296
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
35297
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
35298
|
-
}
|
35299
|
-
}
|
35300
|
-
return copiedValue;
|
35301
|
-
};
|
35302
|
-
switch (type_default(value)) {
|
35303
|
-
case "Object":
|
35304
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
35305
|
-
case "Array":
|
35306
|
-
return copy([]);
|
35307
|
-
case "Date":
|
35308
|
-
return new Date(value.valueOf());
|
35309
|
-
case "RegExp":
|
35310
|
-
return _cloneRegExp(value);
|
35311
|
-
case "Int8Array":
|
35312
|
-
case "Uint8Array":
|
35313
|
-
case "Uint8ClampedArray":
|
35314
|
-
case "Int16Array":
|
35315
|
-
case "Uint16Array":
|
35316
|
-
case "Int32Array":
|
35317
|
-
case "Uint32Array":
|
35318
|
-
case "Float32Array":
|
35319
|
-
case "Float64Array":
|
35320
|
-
case "BigInt64Array":
|
35321
|
-
case "BigUint64Array":
|
35322
|
-
return value.slice();
|
35323
|
-
default:
|
35324
|
-
return value;
|
35325
|
-
}
|
35326
|
-
}
|
35327
|
-
function _isPrimitive(param) {
|
35328
|
-
var type3 = typeof param;
|
35329
|
-
return param == null || type3 != "object" && type3 != "function";
|
34978
|
+
function max(...numbers) {
|
34979
|
+
return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
|
35330
34980
|
}
|
35331
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
35332
|
-
function _ObjectMap2() {
|
35333
|
-
this.map = {};
|
35334
|
-
this.length = 0;
|
35335
|
-
}
|
35336
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
35337
|
-
const hashedKey = this.hash(key);
|
35338
|
-
let bucket = this.map[hashedKey];
|
35339
|
-
if (!bucket) {
|
35340
|
-
this.map[hashedKey] = bucket = [];
|
35341
|
-
}
|
35342
|
-
bucket.push([key, value]);
|
35343
|
-
this.length += 1;
|
35344
|
-
};
|
35345
|
-
_ObjectMap2.prototype.hash = function(key) {
|
35346
|
-
let hashedKey = [];
|
35347
|
-
for (var value in key) {
|
35348
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
35349
|
-
}
|
35350
|
-
return hashedKey.join();
|
35351
|
-
};
|
35352
|
-
_ObjectMap2.prototype.get = function(key) {
|
35353
|
-
if (this.length <= 180) {
|
35354
|
-
for (const p in this.map) {
|
35355
|
-
const bucket2 = this.map[p];
|
35356
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
35357
|
-
const element = bucket2[i];
|
35358
|
-
if (element[0] === key) {
|
35359
|
-
return element[1];
|
35360
|
-
}
|
35361
|
-
}
|
35362
|
-
}
|
35363
|
-
return;
|
35364
|
-
}
|
35365
|
-
const hashedKey = this.hash(key);
|
35366
|
-
const bucket = this.map[hashedKey];
|
35367
|
-
if (!bucket) {
|
35368
|
-
return;
|
35369
|
-
}
|
35370
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
35371
|
-
const element = bucket[i];
|
35372
|
-
if (element[0] === key) {
|
35373
|
-
return element[1];
|
35374
|
-
}
|
35375
|
-
}
|
35376
|
-
};
|
35377
|
-
return _ObjectMap2;
|
35378
|
-
}();
|
35379
|
-
|
35380
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
35381
|
-
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
35382
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
35383
|
-
});
|
35384
|
-
var clone_default = clone;
|
35385
|
-
|
35386
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
35387
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
35388
34981
|
|
35389
34982
|
// src/providers/coin-quantity.ts
|
35390
34983
|
var coinQuantityfy = (coinQuantityLike) => {
|
@@ -35393,11 +34986,11 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35393
34986
|
let max2;
|
35394
34987
|
if (Array.isArray(coinQuantityLike)) {
|
35395
34988
|
amount = coinQuantityLike[0];
|
35396
|
-
assetId = coinQuantityLike[1]
|
35397
|
-
max2 = coinQuantityLike[2]
|
34989
|
+
assetId = coinQuantityLike[1];
|
34990
|
+
max2 = coinQuantityLike[2];
|
35398
34991
|
} else {
|
35399
34992
|
amount = coinQuantityLike.amount;
|
35400
|
-
assetId = coinQuantityLike.assetId
|
34993
|
+
assetId = coinQuantityLike.assetId;
|
35401
34994
|
max2 = coinQuantityLike.max ?? void 0;
|
35402
34995
|
}
|
35403
34996
|
const bnAmount = bn(amount);
|
@@ -35407,7 +35000,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35407
35000
|
max: max2 ? bn(max2) : void 0
|
35408
35001
|
};
|
35409
35002
|
};
|
35410
|
-
var
|
35003
|
+
var addAmountToAsset = (params) => {
|
35411
35004
|
const { amount, assetId } = params;
|
35412
35005
|
const coinQuantities = [...params.coinQuantities];
|
35413
35006
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35474,7 +35067,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35474
35067
|
var ENCODING_V1 = "1";
|
35475
35068
|
var WORD_SIZE = 8;
|
35476
35069
|
var BYTES_32 = 32;
|
35477
|
-
var UTXO_ID_LEN = BYTES_32 +
|
35070
|
+
var UTXO_ID_LEN = BYTES_32 + 1;
|
35478
35071
|
var ASSET_ID_LEN = BYTES_32;
|
35479
35072
|
var ADDRESS_LEN = BYTES_32;
|
35480
35073
|
var NONCE_LEN = BYTES_32;
|
@@ -35482,9 +35075,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35482
35075
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35483
35076
|
var MAX_BYTES = 2 ** 32 - 1;
|
35484
35077
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35485
|
-
|
35078
|
+
WORD_SIZE + // Tx size
|
35486
35079
|
// Asset ID/Balance coin input pairs
|
35487
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE)
|
35080
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35488
35081
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35489
35082
|
WORD_SIZE + // Gas limit
|
35490
35083
|
WORD_SIZE + // Script size
|
@@ -35502,6 +35095,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35502
35095
|
ASSET_ID_LEN + // Asset id
|
35503
35096
|
TX_POINTER_LEN + // TxPointer
|
35504
35097
|
WORD_SIZE + // Witnesses index
|
35098
|
+
WORD_SIZE + // Maturity
|
35505
35099
|
WORD_SIZE + // Predicate size
|
35506
35100
|
WORD_SIZE + // Predicate data size
|
35507
35101
|
WORD_SIZE;
|
@@ -37239,19 +36833,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37239
36833
|
encode(value) {
|
37240
36834
|
const parts = [];
|
37241
36835
|
parts.push(new B256Coder().encode(value.txID));
|
37242
|
-
parts.push(new NumberCoder("
|
36836
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37243
36837
|
parts.push(new B256Coder().encode(value.owner));
|
37244
36838
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37245
36839
|
parts.push(new B256Coder().encode(value.assetId));
|
37246
36840
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
37247
|
-
parts.push(new NumberCoder("
|
36841
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
36842
|
+
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37248
36843
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37249
|
-
parts.push(new
|
37250
|
-
parts.push(new
|
37251
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37252
|
-
parts.push(
|
37253
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37254
|
-
);
|
36844
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36845
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
36846
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36847
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37255
36848
|
return concat(parts);
|
37256
36849
|
}
|
37257
36850
|
decode(data, offset) {
|
@@ -37259,7 +36852,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37259
36852
|
let o = offset;
|
37260
36853
|
[decoded, o] = new B256Coder().decode(data, o);
|
37261
36854
|
const txID = decoded;
|
37262
|
-
[decoded, o] = new NumberCoder("
|
36855
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37263
36856
|
const outputIndex = decoded;
|
37264
36857
|
[decoded, o] = new B256Coder().decode(data, o);
|
37265
36858
|
const owner = decoded;
|
@@ -37269,17 +36862,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37269
36862
|
const assetId = decoded;
|
37270
36863
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
37271
36864
|
const txPointer = decoded;
|
37272
|
-
[decoded, o] = new NumberCoder("
|
36865
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37273
36866
|
const witnessIndex = Number(decoded);
|
36867
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36868
|
+
const maturity = decoded;
|
37274
36869
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37275
36870
|
const predicateGasUsed = decoded;
|
37276
|
-
[decoded, o] = new
|
36871
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37277
36872
|
const predicateLength = decoded;
|
37278
|
-
[decoded, o] = new
|
36873
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37279
36874
|
const predicateDataLength = decoded;
|
37280
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
36875
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37281
36876
|
const predicate = decoded;
|
37282
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
36877
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37283
36878
|
const predicateData = decoded;
|
37284
36879
|
return [
|
37285
36880
|
{
|
@@ -37291,6 +36886,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37291
36886
|
assetId,
|
37292
36887
|
txPointer,
|
37293
36888
|
witnessIndex,
|
36889
|
+
maturity,
|
37294
36890
|
predicateGasUsed,
|
37295
36891
|
predicateLength,
|
37296
36892
|
predicateDataLength,
|
@@ -37308,7 +36904,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37308
36904
|
encode(value) {
|
37309
36905
|
const parts = [];
|
37310
36906
|
parts.push(new B256Coder().encode(value.txID));
|
37311
|
-
parts.push(new NumberCoder("
|
36907
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37312
36908
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
37313
36909
|
parts.push(new B256Coder().encode(value.stateRoot));
|
37314
36910
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -37320,7 +36916,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37320
36916
|
let o = offset;
|
37321
36917
|
[decoded, o] = new B256Coder().decode(data, o);
|
37322
36918
|
const txID = decoded;
|
37323
|
-
[decoded, o] = new NumberCoder("
|
36919
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37324
36920
|
const outputIndex = decoded;
|
37325
36921
|
[decoded, o] = new B256Coder().decode(data, o);
|
37326
36922
|
const balanceRoot = decoded;
|
@@ -37369,16 +36965,14 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37369
36965
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
37370
36966
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37371
36967
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
37372
|
-
parts.push(new NumberCoder("
|
36968
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
37373
36969
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37374
|
-
parts.push(new
|
37375
|
-
parts.push(new
|
37376
|
-
parts.push(new
|
36970
|
+
parts.push(new NumberCoder("u32").encode(data.length));
|
36971
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36972
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
37377
36973
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
37378
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37379
|
-
parts.push(
|
37380
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37381
|
-
);
|
36974
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36975
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37382
36976
|
return concat(parts);
|
37383
36977
|
}
|
37384
36978
|
static decodeData(messageData) {
|
@@ -37398,21 +36992,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37398
36992
|
const amount = decoded;
|
37399
36993
|
[decoded, o] = new B256Coder().decode(data, o);
|
37400
36994
|
const nonce = decoded;
|
37401
|
-
[decoded, o] = new NumberCoder("
|
36995
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37402
36996
|
const witnessIndex = Number(decoded);
|
37403
36997
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37404
36998
|
const predicateGasUsed = decoded;
|
37405
36999
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37406
37000
|
const dataLength2 = decoded;
|
37407
|
-
[decoded, o] = new
|
37001
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37408
37002
|
const predicateLength = decoded;
|
37409
|
-
[decoded, o] = new
|
37003
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37410
37004
|
const predicateDataLength = decoded;
|
37411
37005
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37412
37006
|
const messageData = decoded;
|
37413
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
37007
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37414
37008
|
const predicate = decoded;
|
37415
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
37009
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37416
37010
|
const predicateData = decoded;
|
37417
37011
|
return [
|
37418
37012
|
{
|
@@ -37724,7 +37318,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37724
37318
|
}
|
37725
37319
|
};
|
37726
37320
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37727
|
-
PolicyType2[PolicyType2["
|
37321
|
+
PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
|
37728
37322
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37729
37323
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37730
37324
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37772,9 +37366,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37772
37366
|
let o = offset;
|
37773
37367
|
const policies = [];
|
37774
37368
|
if (policyTypes & 1) {
|
37775
|
-
const [
|
37369
|
+
const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37776
37370
|
o = nextOffset;
|
37777
|
-
policies.push({ type: 1, data:
|
37371
|
+
policies.push({ type: 1, data: gasPrice });
|
37778
37372
|
}
|
37779
37373
|
if (policyTypes & 2) {
|
37780
37374
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -38006,15 +37600,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38006
37600
|
encode(value) {
|
38007
37601
|
const parts = [];
|
38008
37602
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
38009
|
-
parts.push(new
|
38010
|
-
parts.push(new
|
38011
|
-
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
37603
|
+
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37604
|
+
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
38012
37605
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38013
|
-
parts.push(new NumberCoder("
|
38014
|
-
parts.push(new NumberCoder("
|
38015
|
-
parts.push(new NumberCoder("
|
38016
|
-
parts.push(new
|
38017
|
-
parts.push(new ByteArrayCoder(value.
|
37606
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37607
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37608
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37609
|
+
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37610
|
+
parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
|
37611
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
|
38018
37612
|
parts.push(new PoliciesCoder().encode(value.policies));
|
38019
37613
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38020
37614
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -38026,23 +37620,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38026
37620
|
let o = offset;
|
38027
37621
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38028
37622
|
const scriptGasLimit = decoded;
|
38029
|
-
[decoded, o] = new
|
38030
|
-
const receiptsRoot = decoded;
|
38031
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37623
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38032
37624
|
const scriptLength = decoded;
|
38033
|
-
[decoded, o] = new
|
37625
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38034
37626
|
const scriptDataLength = decoded;
|
38035
37627
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38036
37628
|
const policyTypes = decoded;
|
38037
|
-
[decoded, o] = new NumberCoder("
|
37629
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38038
37630
|
const inputsCount = decoded;
|
38039
|
-
[decoded, o] = new NumberCoder("
|
37631
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38040
37632
|
const outputsCount = decoded;
|
38041
|
-
[decoded, o] = new NumberCoder("
|
37633
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38042
37634
|
const witnessesCount = decoded;
|
38043
|
-
[decoded, o] = new
|
37635
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37636
|
+
const receiptsRoot = decoded;
|
37637
|
+
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38044
37638
|
const script = decoded;
|
38045
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength
|
37639
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38046
37640
|
const scriptData = decoded;
|
38047
37641
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38048
37642
|
const policies = decoded;
|
@@ -38080,19 +37674,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38080
37674
|
}
|
38081
37675
|
encode(value) {
|
38082
37676
|
const parts = [];
|
38083
|
-
parts.push(new NumberCoder("
|
38084
|
-
parts.push(new
|
38085
|
-
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
37677
|
+
parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
|
37678
|
+
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
38086
37679
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38087
|
-
parts.push(new NumberCoder("u16").encode(value.
|
38088
|
-
parts.push(new NumberCoder("
|
38089
|
-
parts.push(new NumberCoder("
|
37680
|
+
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37681
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37682
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37683
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37684
|
+
parts.push(new B256Coder().encode(value.salt));
|
37685
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
38090
37686
|
parts.push(
|
38091
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount
|
38092
|
-
value.storageSlots
|
38093
|
-
)
|
37687
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
|
38094
37688
|
);
|
38095
|
-
parts.push(new PoliciesCoder().encode(value.policies));
|
38096
37689
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38097
37690
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
38098
37691
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -38101,27 +37694,26 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38101
37694
|
decode(data, offset) {
|
38102
37695
|
let decoded;
|
38103
37696
|
let o = offset;
|
38104
|
-
[decoded, o] = new NumberCoder("
|
37697
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37698
|
+
const bytecodeLength = decoded;
|
37699
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38105
37700
|
const bytecodeWitnessIndex = decoded;
|
38106
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38107
|
-
const salt = decoded;
|
38108
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38109
|
-
const storageSlotsCount = decoded;
|
38110
37701
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38111
37702
|
const policyTypes = decoded;
|
38112
37703
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37704
|
+
const storageSlotsCount = decoded;
|
37705
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38113
37706
|
const inputsCount = decoded;
|
38114
|
-
[decoded, o] = new NumberCoder("
|
37707
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38115
37708
|
const outputsCount = decoded;
|
38116
|
-
[decoded, o] = new NumberCoder("
|
37709
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38117
37710
|
const witnessesCount = decoded;
|
38118
|
-
[decoded, o] = new
|
38119
|
-
|
38120
|
-
o
|
38121
|
-
);
|
38122
|
-
const storageSlots = decoded;
|
37711
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37712
|
+
const salt = decoded;
|
38123
37713
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38124
37714
|
const policies = decoded;
|
37715
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37716
|
+
const storageSlots = decoded;
|
38125
37717
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
38126
37718
|
const inputs = decoded;
|
38127
37719
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -38131,6 +37723,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38131
37723
|
return [
|
38132
37724
|
{
|
38133
37725
|
type: 1,
|
37726
|
+
bytecodeLength,
|
38134
37727
|
bytecodeWitnessIndex,
|
38135
37728
|
policyTypes,
|
38136
37729
|
storageSlotsCount,
|
@@ -38159,7 +37752,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38159
37752
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
38160
37753
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
38161
37754
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38162
|
-
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
38163
37755
|
return concat(parts);
|
38164
37756
|
}
|
38165
37757
|
decode(data, offset) {
|
@@ -38175,8 +37767,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38175
37767
|
const mintAmount = decoded;
|
38176
37768
|
[decoded, o] = new B256Coder().decode(data, o);
|
38177
37769
|
const mintAssetId = decoded;
|
38178
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38179
|
-
const gasPrice = decoded;
|
38180
37770
|
return [
|
38181
37771
|
{
|
38182
37772
|
type: 2,
|
@@ -38184,8 +37774,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38184
37774
|
inputContract,
|
38185
37775
|
outputContract,
|
38186
37776
|
mintAmount,
|
38187
|
-
mintAssetId
|
38188
|
-
gasPrice
|
37777
|
+
mintAssetId
|
38189
37778
|
},
|
38190
37779
|
o
|
38191
37780
|
];
|
@@ -38492,6 +38081,159 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38492
38081
|
// src/providers/provider.ts
|
38493
38082
|
var import_graphql_request = __toESM(require_dist2());
|
38494
38083
|
|
38084
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38085
|
+
function _isPlaceholder(a) {
|
38086
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38087
|
+
}
|
38088
|
+
|
38089
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38090
|
+
function _curry1(fn) {
|
38091
|
+
return function f1(a) {
|
38092
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38093
|
+
return f1;
|
38094
|
+
} else {
|
38095
|
+
return fn.apply(this, arguments);
|
38096
|
+
}
|
38097
|
+
};
|
38098
|
+
}
|
38099
|
+
|
38100
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38101
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
38102
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38103
|
+
};
|
38104
|
+
|
38105
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38106
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38107
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38108
|
+
});
|
38109
|
+
var type_default = type;
|
38110
|
+
|
38111
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38112
|
+
var pad = function pad2(n) {
|
38113
|
+
return (n < 10 ? "0" : "") + n;
|
38114
|
+
};
|
38115
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38116
|
+
return d.toISOString();
|
38117
|
+
} : function _toISOString3(d) {
|
38118
|
+
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
|
38119
|
+
};
|
38120
|
+
|
38121
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38122
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38123
|
+
return n << 0 === n;
|
38124
|
+
};
|
38125
|
+
|
38126
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38127
|
+
function _cloneRegExp(pattern) {
|
38128
|
+
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
38129
|
+
}
|
38130
|
+
|
38131
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38132
|
+
function _clone(value, deep, map) {
|
38133
|
+
map || (map = new _ObjectMap());
|
38134
|
+
if (_isPrimitive(value)) {
|
38135
|
+
return value;
|
38136
|
+
}
|
38137
|
+
var copy = function copy2(copiedValue) {
|
38138
|
+
var cachedCopy = map.get(value);
|
38139
|
+
if (cachedCopy) {
|
38140
|
+
return cachedCopy;
|
38141
|
+
}
|
38142
|
+
map.set(value, copiedValue);
|
38143
|
+
for (var key in value) {
|
38144
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38145
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38146
|
+
}
|
38147
|
+
}
|
38148
|
+
return copiedValue;
|
38149
|
+
};
|
38150
|
+
switch (type_default(value)) {
|
38151
|
+
case "Object":
|
38152
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
38153
|
+
case "Array":
|
38154
|
+
return copy([]);
|
38155
|
+
case "Date":
|
38156
|
+
return new Date(value.valueOf());
|
38157
|
+
case "RegExp":
|
38158
|
+
return _cloneRegExp(value);
|
38159
|
+
case "Int8Array":
|
38160
|
+
case "Uint8Array":
|
38161
|
+
case "Uint8ClampedArray":
|
38162
|
+
case "Int16Array":
|
38163
|
+
case "Uint16Array":
|
38164
|
+
case "Int32Array":
|
38165
|
+
case "Uint32Array":
|
38166
|
+
case "Float32Array":
|
38167
|
+
case "Float64Array":
|
38168
|
+
case "BigInt64Array":
|
38169
|
+
case "BigUint64Array":
|
38170
|
+
return value.slice();
|
38171
|
+
default:
|
38172
|
+
return value;
|
38173
|
+
}
|
38174
|
+
}
|
38175
|
+
function _isPrimitive(param) {
|
38176
|
+
var type3 = typeof param;
|
38177
|
+
return param == null || type3 != "object" && type3 != "function";
|
38178
|
+
}
|
38179
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
38180
|
+
function _ObjectMap2() {
|
38181
|
+
this.map = {};
|
38182
|
+
this.length = 0;
|
38183
|
+
}
|
38184
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
38185
|
+
const hashedKey = this.hash(key);
|
38186
|
+
let bucket = this.map[hashedKey];
|
38187
|
+
if (!bucket) {
|
38188
|
+
this.map[hashedKey] = bucket = [];
|
38189
|
+
}
|
38190
|
+
bucket.push([key, value]);
|
38191
|
+
this.length += 1;
|
38192
|
+
};
|
38193
|
+
_ObjectMap2.prototype.hash = function(key) {
|
38194
|
+
let hashedKey = [];
|
38195
|
+
for (var value in key) {
|
38196
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38197
|
+
}
|
38198
|
+
return hashedKey.join();
|
38199
|
+
};
|
38200
|
+
_ObjectMap2.prototype.get = function(key) {
|
38201
|
+
if (this.length <= 180) {
|
38202
|
+
for (const p in this.map) {
|
38203
|
+
const bucket2 = this.map[p];
|
38204
|
+
for (let i = 0; i < bucket2.length; i += 1) {
|
38205
|
+
const element = bucket2[i];
|
38206
|
+
if (element[0] === key) {
|
38207
|
+
return element[1];
|
38208
|
+
}
|
38209
|
+
}
|
38210
|
+
}
|
38211
|
+
return;
|
38212
|
+
}
|
38213
|
+
const hashedKey = this.hash(key);
|
38214
|
+
const bucket = this.map[hashedKey];
|
38215
|
+
if (!bucket) {
|
38216
|
+
return;
|
38217
|
+
}
|
38218
|
+
for (let i = 0; i < bucket.length; i += 1) {
|
38219
|
+
const element = bucket[i];
|
38220
|
+
if (element[0] === key) {
|
38221
|
+
return element[1];
|
38222
|
+
}
|
38223
|
+
}
|
38224
|
+
};
|
38225
|
+
return _ObjectMap2;
|
38226
|
+
}();
|
38227
|
+
|
38228
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38229
|
+
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38230
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38231
|
+
});
|
38232
|
+
var clone_default = clone2;
|
38233
|
+
|
38234
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38235
|
+
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38236
|
+
|
38495
38237
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38496
38238
|
var __assign = function() {
|
38497
38239
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41659,10 +41401,14 @@ spurious results.`);
|
|
41659
41401
|
// src/providers/__generated__/operations.ts
|
41660
41402
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41661
41403
|
fragment receiptFragment on Receipt {
|
41662
|
-
|
41404
|
+
contract {
|
41405
|
+
id
|
41406
|
+
}
|
41663
41407
|
pc
|
41664
41408
|
is
|
41665
|
-
to
|
41409
|
+
to {
|
41410
|
+
id
|
41411
|
+
}
|
41666
41412
|
toAddress
|
41667
41413
|
amount
|
41668
41414
|
assetId
|
@@ -41700,16 +41446,10 @@ spurious results.`);
|
|
41700
41446
|
id
|
41701
41447
|
}
|
41702
41448
|
time
|
41703
|
-
receipts {
|
41704
|
-
...receiptFragment
|
41705
|
-
}
|
41706
41449
|
programState {
|
41707
41450
|
returnType
|
41708
41451
|
data
|
41709
41452
|
}
|
41710
|
-
receipts {
|
41711
|
-
...receiptFragment
|
41712
|
-
}
|
41713
41453
|
}
|
41714
41454
|
... on FailureStatus {
|
41715
41455
|
block {
|
@@ -41717,24 +41457,26 @@ spurious results.`);
|
|
41717
41457
|
}
|
41718
41458
|
time
|
41719
41459
|
reason
|
41720
|
-
receipts {
|
41721
|
-
...receiptFragment
|
41722
|
-
}
|
41723
41460
|
}
|
41724
41461
|
... on SqueezedOutStatus {
|
41725
41462
|
reason
|
41726
41463
|
}
|
41727
41464
|
}
|
41728
|
-
|
41465
|
+
`;
|
41729
41466
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41730
41467
|
fragment transactionFragment on Transaction {
|
41731
41468
|
id
|
41732
41469
|
rawPayload
|
41470
|
+
gasPrice
|
41471
|
+
receipts {
|
41472
|
+
...receiptFragment
|
41473
|
+
}
|
41733
41474
|
status {
|
41734
41475
|
...transactionStatusFragment
|
41735
41476
|
}
|
41736
41477
|
}
|
41737
|
-
${
|
41478
|
+
${ReceiptFragmentFragmentDoc}
|
41479
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41738
41480
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41739
41481
|
fragment inputEstimatePredicatesFragment on Input {
|
41740
41482
|
... on InputCoin {
|
@@ -41752,46 +41494,6 @@ spurious results.`);
|
|
41752
41494
|
}
|
41753
41495
|
}
|
41754
41496
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41755
|
-
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41756
|
-
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41757
|
-
reason
|
41758
|
-
programState {
|
41759
|
-
returnType
|
41760
|
-
data
|
41761
|
-
}
|
41762
|
-
}
|
41763
|
-
`;
|
41764
|
-
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41765
|
-
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41766
|
-
programState {
|
41767
|
-
returnType
|
41768
|
-
data
|
41769
|
-
}
|
41770
|
-
}
|
41771
|
-
`;
|
41772
|
-
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41773
|
-
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41774
|
-
... on DryRunFailureStatus {
|
41775
|
-
...dryRunFailureStatusFragment
|
41776
|
-
}
|
41777
|
-
... on DryRunSuccessStatus {
|
41778
|
-
...dryRunSuccessStatusFragment
|
41779
|
-
}
|
41780
|
-
}
|
41781
|
-
${DryRunFailureStatusFragmentFragmentDoc}
|
41782
|
-
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41783
|
-
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41784
|
-
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41785
|
-
id
|
41786
|
-
status {
|
41787
|
-
...dryRunTransactionStatusFragment
|
41788
|
-
}
|
41789
|
-
receipts {
|
41790
|
-
...receiptFragment
|
41791
|
-
}
|
41792
|
-
}
|
41793
|
-
${DryRunTransactionStatusFragmentFragmentDoc}
|
41794
|
-
${ReceiptFragmentFragmentDoc}`;
|
41795
41497
|
var CoinFragmentFragmentDoc = lib_default2`
|
41796
41498
|
fragment coinFragment on Coin {
|
41797
41499
|
__typename
|
@@ -41799,6 +41501,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41799
41501
|
owner
|
41800
41502
|
amount
|
41801
41503
|
assetId
|
41504
|
+
maturity
|
41802
41505
|
blockCreated
|
41803
41506
|
txCreatedIdx
|
41804
41507
|
}
|
@@ -41837,32 +41540,26 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41837
41540
|
messageBlockHeader {
|
41838
41541
|
id
|
41839
41542
|
daHeight
|
41840
|
-
consensusParametersVersion
|
41841
|
-
stateTransitionBytecodeVersion
|
41842
41543
|
transactionsCount
|
41843
|
-
messageReceiptCount
|
41844
41544
|
transactionsRoot
|
41845
|
-
messageOutboxRoot
|
41846
|
-
eventInboxRoot
|
41847
41545
|
height
|
41848
41546
|
prevRoot
|
41849
41547
|
time
|
41850
41548
|
applicationHash
|
41549
|
+
messageReceiptRoot
|
41550
|
+
messageReceiptCount
|
41851
41551
|
}
|
41852
41552
|
commitBlockHeader {
|
41853
41553
|
id
|
41854
41554
|
daHeight
|
41855
|
-
consensusParametersVersion
|
41856
|
-
stateTransitionBytecodeVersion
|
41857
41555
|
transactionsCount
|
41858
|
-
messageReceiptCount
|
41859
41556
|
transactionsRoot
|
41860
|
-
messageOutboxRoot
|
41861
|
-
eventInboxRoot
|
41862
41557
|
height
|
41863
41558
|
prevRoot
|
41864
41559
|
time
|
41865
41560
|
applicationHash
|
41561
|
+
messageReceiptRoot
|
41562
|
+
messageReceiptCount
|
41866
41563
|
}
|
41867
41564
|
sender
|
41868
41565
|
recipient
|
@@ -41881,8 +41578,8 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41881
41578
|
var BlockFragmentFragmentDoc = lib_default2`
|
41882
41579
|
fragment blockFragment on Block {
|
41883
41580
|
id
|
41884
|
-
height
|
41885
41581
|
header {
|
41582
|
+
height
|
41886
41583
|
time
|
41887
41584
|
}
|
41888
41585
|
transactions {
|
@@ -41940,11 +41637,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41940
41637
|
`;
|
41941
41638
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41942
41639
|
fragment GasCostsFragment on GasCosts {
|
41943
|
-
version {
|
41944
|
-
... on Version {
|
41945
|
-
value
|
41946
|
-
}
|
41947
|
-
}
|
41948
41640
|
add
|
41949
41641
|
addi
|
41950
41642
|
aloc
|
@@ -41957,6 +41649,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41957
41649
|
cb
|
41958
41650
|
cfei
|
41959
41651
|
cfsi
|
41652
|
+
croo
|
41960
41653
|
div
|
41961
41654
|
divi
|
41962
41655
|
ecr1
|
@@ -42039,9 +41732,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42039
41732
|
ccp {
|
42040
41733
|
...DependentCostFragment
|
42041
41734
|
}
|
42042
|
-
croo {
|
42043
|
-
...DependentCostFragment
|
42044
|
-
}
|
42045
41735
|
csiz {
|
42046
41736
|
...DependentCostFragment
|
42047
41737
|
}
|
@@ -42101,11 +41791,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42101
41791
|
${DependentCostFragmentFragmentDoc}`;
|
42102
41792
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
42103
41793
|
fragment consensusParametersFragment on ConsensusParameters {
|
42104
|
-
version {
|
42105
|
-
... on Version {
|
42106
|
-
value
|
42107
|
-
}
|
42108
|
-
}
|
42109
41794
|
txParams {
|
42110
41795
|
...TxParametersFragment
|
42111
41796
|
}
|
@@ -42165,9 +41850,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42165
41850
|
fragment nodeInfoFragment on NodeInfo {
|
42166
41851
|
utxoValidation
|
42167
41852
|
vmBacktrace
|
41853
|
+
minGasPrice
|
42168
41854
|
maxTx
|
42169
41855
|
maxDepth
|
42170
41856
|
nodeVersion
|
41857
|
+
peers {
|
41858
|
+
id
|
41859
|
+
addresses
|
41860
|
+
clientVersion
|
41861
|
+
blockHeight
|
41862
|
+
lastHeartbeatMs
|
41863
|
+
appScore
|
41864
|
+
}
|
42171
41865
|
}
|
42172
41866
|
`;
|
42173
41867
|
var GetVersionDocument = lib_default2`
|
@@ -42202,9 +41896,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42202
41896
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
42203
41897
|
transaction(id: $transactionId) {
|
42204
41898
|
...transactionFragment
|
41899
|
+
receipts {
|
41900
|
+
...receiptFragment
|
41901
|
+
}
|
42205
41902
|
}
|
42206
41903
|
}
|
42207
|
-
${TransactionFragmentFragmentDoc}
|
41904
|
+
${TransactionFragmentFragmentDoc}
|
41905
|
+
${ReceiptFragmentFragmentDoc}`;
|
42208
41906
|
var GetTransactionsDocument = lib_default2`
|
42209
41907
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
42210
41908
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42332,20 +42030,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42332
42030
|
}
|
42333
42031
|
}
|
42334
42032
|
${BalanceFragmentFragmentDoc}`;
|
42335
|
-
var GetLatestGasPriceDocument = lib_default2`
|
42336
|
-
query getLatestGasPrice {
|
42337
|
-
latestGasPrice {
|
42338
|
-
gasPrice
|
42339
|
-
}
|
42340
|
-
}
|
42341
|
-
`;
|
42342
|
-
var EstimateGasPriceDocument = lib_default2`
|
42343
|
-
query estimateGasPrice($blockHorizon: U32!) {
|
42344
|
-
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42345
|
-
gasPrice
|
42346
|
-
}
|
42347
|
-
}
|
42348
|
-
`;
|
42349
42033
|
var GetBalancesDocument = lib_default2`
|
42350
42034
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42351
42035
|
balances(
|
@@ -42400,12 +42084,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42400
42084
|
}
|
42401
42085
|
`;
|
42402
42086
|
var DryRunDocument = lib_default2`
|
42403
|
-
mutation dryRun($
|
42404
|
-
dryRun(
|
42405
|
-
...
|
42087
|
+
mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
|
42088
|
+
dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
|
42089
|
+
...receiptFragment
|
42406
42090
|
}
|
42407
42091
|
}
|
42408
|
-
${
|
42092
|
+
${ReceiptFragmentFragmentDoc}`;
|
42409
42093
|
var SubmitDocument = lib_default2`
|
42410
42094
|
mutation submit($encodedTransaction: HexString!) {
|
42411
42095
|
submit(tx: $encodedTransaction) {
|
@@ -42488,12 +42172,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42488
42172
|
getBalance(variables, options) {
|
42489
42173
|
return requester(GetBalanceDocument, variables, options);
|
42490
42174
|
},
|
42491
|
-
getLatestGasPrice(variables, options) {
|
42492
|
-
return requester(GetLatestGasPriceDocument, variables, options);
|
42493
|
-
},
|
42494
|
-
estimateGasPrice(variables, options) {
|
42495
|
-
return requester(EstimateGasPriceDocument, variables, options);
|
42496
|
-
},
|
42497
42175
|
getBalances(variables, options) {
|
42498
42176
|
return requester(GetBalancesDocument, variables, options);
|
42499
42177
|
},
|
@@ -42561,14 +42239,11 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42561
42239
|
let data;
|
42562
42240
|
let errors;
|
42563
42241
|
try {
|
42564
|
-
|
42565
|
-
({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
|
42242
|
+
({ data, errors } = JSON.parse(text.replace(/^data:/, "")));
|
42566
42243
|
} catch (e) {
|
42567
42244
|
throw new FuelError(
|
42568
42245
|
ErrorCode.STREAM_PARSING_ERROR,
|
42569
|
-
`Error while parsing stream data response: ${text}
|
42570
|
-
|
42571
|
-
Thrown error: ${e}`
|
42246
|
+
`Error while parsing stream data response: ${text}`
|
42572
42247
|
);
|
42573
42248
|
}
|
42574
42249
|
if (Array.isArray(errors)) {
|
@@ -42652,6 +42327,9 @@ Thrown error: ${e}`
|
|
42652
42327
|
}
|
42653
42328
|
};
|
42654
42329
|
|
42330
|
+
// ../address/dist/configs.mjs
|
42331
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42332
|
+
|
42655
42333
|
// src/providers/transaction-request/input.ts
|
42656
42334
|
var inputify = (value) => {
|
42657
42335
|
const { type: type3 } = value;
|
@@ -42671,9 +42349,10 @@ Thrown error: ${e}`
|
|
42671
42349
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42672
42350
|
},
|
42673
42351
|
witnessIndex: value.witnessIndex,
|
42352
|
+
maturity: value.maturity ?? 0,
|
42674
42353
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42675
|
-
predicateLength:
|
42676
|
-
predicateDataLength:
|
42354
|
+
predicateLength: predicate.length,
|
42355
|
+
predicateDataLength: predicateData.length,
|
42677
42356
|
predicate: hexlify(predicate),
|
42678
42357
|
predicateData: hexlify(predicateData)
|
42679
42358
|
};
|
@@ -42704,8 +42383,8 @@ Thrown error: ${e}`
|
|
42704
42383
|
nonce: hexlify(value.nonce),
|
42705
42384
|
witnessIndex: value.witnessIndex,
|
42706
42385
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42707
|
-
predicateLength:
|
42708
|
-
predicateDataLength:
|
42386
|
+
predicateLength: predicate.length,
|
42387
|
+
predicateDataLength: predicateData.length,
|
42709
42388
|
predicate: hexlify(predicate),
|
42710
42389
|
predicateData: hexlify(predicateData),
|
42711
42390
|
data: hexlify(data),
|
@@ -42862,8 +42541,8 @@ Thrown error: ${e}`
|
|
42862
42541
|
case "CALL" /* Call */: {
|
42863
42542
|
const callReceipt = {
|
42864
42543
|
type: ReceiptType.Call,
|
42865
|
-
from: hexOrZero(receipt.id
|
42866
|
-
to: hexOrZero(receipt?.to),
|
42544
|
+
from: hexOrZero(receipt.contract?.id),
|
42545
|
+
to: hexOrZero(receipt?.to?.id),
|
42867
42546
|
amount: bn(receipt.amount),
|
42868
42547
|
assetId: hexOrZero(receipt.assetId),
|
42869
42548
|
gas: bn(receipt.gas),
|
@@ -42877,7 +42556,7 @@ Thrown error: ${e}`
|
|
42877
42556
|
case "RETURN" /* Return */: {
|
42878
42557
|
const returnReceipt = {
|
42879
42558
|
type: ReceiptType.Return,
|
42880
|
-
id: hexOrZero(receipt.id
|
42559
|
+
id: hexOrZero(receipt.contract?.id),
|
42881
42560
|
val: bn(receipt.val),
|
42882
42561
|
pc: bn(receipt.pc),
|
42883
42562
|
is: bn(receipt.is)
|
@@ -42887,7 +42566,7 @@ Thrown error: ${e}`
|
|
42887
42566
|
case "RETURN_DATA" /* ReturnData */: {
|
42888
42567
|
const returnDataReceipt = {
|
42889
42568
|
type: ReceiptType.ReturnData,
|
42890
|
-
id: hexOrZero(receipt.id
|
42569
|
+
id: hexOrZero(receipt.contract?.id),
|
42891
42570
|
ptr: bn(receipt.ptr),
|
42892
42571
|
len: bn(receipt.len),
|
42893
42572
|
digest: hexOrZero(receipt.digest),
|
@@ -42899,7 +42578,7 @@ Thrown error: ${e}`
|
|
42899
42578
|
case "PANIC" /* Panic */: {
|
42900
42579
|
const panicReceipt = {
|
42901
42580
|
type: ReceiptType.Panic,
|
42902
|
-
id: hexOrZero(receipt.id),
|
42581
|
+
id: hexOrZero(receipt.contract?.id),
|
42903
42582
|
reason: bn(receipt.reason),
|
42904
42583
|
pc: bn(receipt.pc),
|
42905
42584
|
is: bn(receipt.is),
|
@@ -42910,7 +42589,7 @@ Thrown error: ${e}`
|
|
42910
42589
|
case "REVERT" /* Revert */: {
|
42911
42590
|
const revertReceipt = {
|
42912
42591
|
type: ReceiptType.Revert,
|
42913
|
-
id: hexOrZero(receipt.id
|
42592
|
+
id: hexOrZero(receipt.contract?.id),
|
42914
42593
|
val: bn(receipt.ra),
|
42915
42594
|
pc: bn(receipt.pc),
|
42916
42595
|
is: bn(receipt.is)
|
@@ -42920,7 +42599,7 @@ Thrown error: ${e}`
|
|
42920
42599
|
case "LOG" /* Log */: {
|
42921
42600
|
const logReceipt = {
|
42922
42601
|
type: ReceiptType.Log,
|
42923
|
-
id: hexOrZero(receipt.id
|
42602
|
+
id: hexOrZero(receipt.contract?.id),
|
42924
42603
|
val0: bn(receipt.ra),
|
42925
42604
|
val1: bn(receipt.rb),
|
42926
42605
|
val2: bn(receipt.rc),
|
@@ -42933,7 +42612,7 @@ Thrown error: ${e}`
|
|
42933
42612
|
case "LOG_DATA" /* LogData */: {
|
42934
42613
|
const logDataReceipt = {
|
42935
42614
|
type: ReceiptType.LogData,
|
42936
|
-
id: hexOrZero(receipt.id
|
42615
|
+
id: hexOrZero(receipt.contract?.id),
|
42937
42616
|
val0: bn(receipt.ra),
|
42938
42617
|
val1: bn(receipt.rb),
|
42939
42618
|
ptr: bn(receipt.ptr),
|
@@ -42947,8 +42626,8 @@ Thrown error: ${e}`
|
|
42947
42626
|
case "TRANSFER" /* Transfer */: {
|
42948
42627
|
const transferReceipt = {
|
42949
42628
|
type: ReceiptType.Transfer,
|
42950
|
-
from: hexOrZero(receipt.id
|
42951
|
-
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42629
|
+
from: hexOrZero(receipt.contract?.id),
|
42630
|
+
to: hexOrZero(receipt.toAddress || receipt?.to?.id),
|
42952
42631
|
amount: bn(receipt.amount),
|
42953
42632
|
assetId: hexOrZero(receipt.assetId),
|
42954
42633
|
pc: bn(receipt.pc),
|
@@ -42959,8 +42638,8 @@ Thrown error: ${e}`
|
|
42959
42638
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42960
42639
|
const transferOutReceipt = {
|
42961
42640
|
type: ReceiptType.TransferOut,
|
42962
|
-
from: hexOrZero(receipt.id
|
42963
|
-
to: hexOrZero(receipt.toAddress || receipt.to),
|
42641
|
+
from: hexOrZero(receipt.contract?.id),
|
42642
|
+
to: hexOrZero(receipt.toAddress || receipt.to?.id),
|
42964
42643
|
amount: bn(receipt.amount),
|
42965
42644
|
assetId: hexOrZero(receipt.assetId),
|
42966
42645
|
pc: bn(receipt.pc),
|
@@ -43003,7 +42682,7 @@ Thrown error: ${e}`
|
|
43003
42682
|
return receiptMessageOut;
|
43004
42683
|
}
|
43005
42684
|
case "MINT" /* Mint */: {
|
43006
|
-
const contractId = hexOrZero(receipt.id
|
42685
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
43007
42686
|
const subId = hexOrZero(receipt.subId);
|
43008
42687
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
43009
42688
|
const mintReceipt = {
|
@@ -43018,7 +42697,7 @@ Thrown error: ${e}`
|
|
43018
42697
|
return mintReceipt;
|
43019
42698
|
}
|
43020
42699
|
case "BURN" /* Burn */: {
|
43021
|
-
const contractId = hexOrZero(receipt.id
|
42700
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
43022
42701
|
const subId = hexOrZero(receipt.subId);
|
43023
42702
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
43024
42703
|
const burnReceipt = {
|
@@ -43038,6 +42717,7 @@ Thrown error: ${e}`
|
|
43038
42717
|
}
|
43039
42718
|
|
43040
42719
|
// src/providers/utils/gas.ts
|
42720
|
+
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
43041
42721
|
var getGasUsedFromReceipts = (receipts) => {
|
43042
42722
|
const scriptResult = receipts.filter(
|
43043
42723
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -43058,28 +42738,18 @@ Thrown error: ${e}`
|
|
43058
42738
|
}
|
43059
42739
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
43060
42740
|
const witnessCache = [];
|
43061
|
-
const
|
43062
|
-
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43063
|
-
if (isCoinOrMessage) {
|
43064
|
-
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43065
|
-
return true;
|
43066
|
-
}
|
43067
|
-
if (!witnessCache.includes(input.witnessIndex)) {
|
43068
|
-
witnessCache.push(input.witnessIndex);
|
43069
|
-
return true;
|
43070
|
-
}
|
43071
|
-
}
|
43072
|
-
return false;
|
43073
|
-
});
|
43074
|
-
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43075
|
-
const totalGas = chargeableInputs.reduce((total, input) => {
|
42741
|
+
const totalGas = inputs.reduce((total, input) => {
|
43076
42742
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43077
42743
|
return total.add(
|
43078
|
-
|
42744
|
+
resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
43079
42745
|
);
|
43080
42746
|
}
|
43081
|
-
|
43082
|
-
|
42747
|
+
if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
|
42748
|
+
witnessCache.push(input.witnessIndex);
|
42749
|
+
return total.add(gasCosts.ecr1);
|
42750
|
+
}
|
42751
|
+
return total;
|
42752
|
+
}, bn());
|
43083
42753
|
return totalGas;
|
43084
42754
|
}
|
43085
42755
|
function getMinGas(params) {
|
@@ -43091,20 +42761,12 @@ Thrown error: ${e}`
|
|
43091
42761
|
return minGas;
|
43092
42762
|
}
|
43093
42763
|
function getMaxGas(params) {
|
43094
|
-
const {
|
43095
|
-
gasPerByte,
|
43096
|
-
witnessesLength,
|
43097
|
-
witnessLimit,
|
43098
|
-
minGas,
|
43099
|
-
gasLimit = bn(0),
|
43100
|
-
maxGasPerTx
|
43101
|
-
} = params;
|
42764
|
+
const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
|
43102
42765
|
let remainingAllowedWitnessGas = bn(0);
|
43103
42766
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
43104
42767
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
43105
42768
|
}
|
43106
|
-
|
43107
|
-
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42769
|
+
return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43108
42770
|
}
|
43109
42771
|
function calculateMetadataGasForTxCreate({
|
43110
42772
|
gasCosts,
|
@@ -43126,10 +42788,6 @@ Thrown error: ${e}`
|
|
43126
42788
|
}) {
|
43127
42789
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
43128
42790
|
}
|
43129
|
-
var calculateGasFee = (params) => {
|
43130
|
-
const { gas, gasPrice, priceFactor, tip } = params;
|
43131
|
-
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43132
|
-
};
|
43133
42791
|
|
43134
42792
|
// src/providers/utils/json.ts
|
43135
42793
|
function normalize2(object) {
|
@@ -43259,7 +42917,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43259
42917
|
// src/providers/transaction-request/transaction-request.ts
|
43260
42918
|
var BaseTransactionRequest = class {
|
43261
42919
|
/** Gas price for transaction */
|
43262
|
-
|
42920
|
+
gasPrice;
|
43263
42921
|
/** Block until which tx cannot be included */
|
43264
42922
|
maturity;
|
43265
42923
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -43272,34 +42930,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43272
42930
|
outputs = [];
|
43273
42931
|
/** List of witnesses */
|
43274
42932
|
witnesses = [];
|
42933
|
+
/** Base asset ID - should be fetched from the chain */
|
42934
|
+
baseAssetId;
|
43275
42935
|
/**
|
43276
42936
|
* Constructor for initializing a base transaction request.
|
43277
42937
|
*
|
43278
42938
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
43279
42939
|
*/
|
43280
42940
|
constructor({
|
43281
|
-
|
42941
|
+
gasPrice,
|
43282
42942
|
maturity,
|
43283
42943
|
maxFee,
|
43284
42944
|
witnessLimit,
|
43285
42945
|
inputs,
|
43286
42946
|
outputs,
|
43287
|
-
witnesses
|
43288
|
-
|
43289
|
-
|
42947
|
+
witnesses,
|
42948
|
+
baseAssetId
|
42949
|
+
}) {
|
42950
|
+
this.gasPrice = bn(gasPrice);
|
43290
42951
|
this.maturity = maturity ?? 0;
|
43291
42952
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
43292
42953
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
43293
42954
|
this.inputs = inputs ?? [];
|
43294
42955
|
this.outputs = outputs ?? [];
|
43295
42956
|
this.witnesses = witnesses ?? [];
|
42957
|
+
this.baseAssetId = baseAssetId;
|
43296
42958
|
}
|
43297
42959
|
static getPolicyMeta(req) {
|
43298
42960
|
let policyTypes = 0;
|
43299
42961
|
const policies = [];
|
43300
|
-
if (req.
|
43301
|
-
policyTypes += PolicyType.
|
43302
|
-
policies.push({ data: req.
|
42962
|
+
if (req.gasPrice) {
|
42963
|
+
policyTypes += PolicyType.GasPrice;
|
42964
|
+
policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
|
43303
42965
|
}
|
43304
42966
|
if (req.witnessLimit) {
|
43305
42967
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43486,10 +43148,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43486
43148
|
* @param predicate - Predicate bytes.
|
43487
43149
|
* @param predicateData - Predicate data bytes.
|
43488
43150
|
*/
|
43489
|
-
addCoinInput(coin) {
|
43151
|
+
addCoinInput(coin, predicate) {
|
43490
43152
|
const { assetId, owner, amount } = coin;
|
43491
43153
|
let witnessIndex;
|
43492
|
-
if (
|
43154
|
+
if (predicate) {
|
43493
43155
|
witnessIndex = 0;
|
43494
43156
|
} else {
|
43495
43157
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43504,7 +43166,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43504
43166
|
amount,
|
43505
43167
|
assetId,
|
43506
43168
|
txPointer: "0x00000000000000000000000000000000",
|
43507
|
-
witnessIndex
|
43169
|
+
witnessIndex,
|
43170
|
+
predicate: predicate?.bytes
|
43508
43171
|
};
|
43509
43172
|
this.pushInput(input);
|
43510
43173
|
this.addChangeOutput(owner, assetId);
|
@@ -43515,13 +43178,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43515
43178
|
*
|
43516
43179
|
* @param message - Message resource.
|
43517
43180
|
* @param predicate - Predicate bytes.
|
43518
|
-
* @param predicateData - Predicate data bytes.
|
43519
43181
|
*/
|
43520
|
-
addMessageInput(message) {
|
43182
|
+
addMessageInput(message, predicate) {
|
43521
43183
|
const { recipient, sender, amount } = message;
|
43522
|
-
const assetId = BaseAssetId;
|
43523
43184
|
let witnessIndex;
|
43524
|
-
if (
|
43185
|
+
if (predicate) {
|
43525
43186
|
witnessIndex = 0;
|
43526
43187
|
} else {
|
43527
43188
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43535,10 +43196,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43535
43196
|
sender: sender.toB256(),
|
43536
43197
|
recipient: recipient.toB256(),
|
43537
43198
|
amount,
|
43538
|
-
witnessIndex
|
43199
|
+
witnessIndex,
|
43200
|
+
predicate: predicate?.bytes
|
43539
43201
|
};
|
43540
43202
|
this.pushInput(input);
|
43541
|
-
this.addChangeOutput(recipient,
|
43203
|
+
this.addChangeOutput(recipient, this.baseAssetId);
|
43542
43204
|
}
|
43543
43205
|
/**
|
43544
43206
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -43566,6 +43228,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43566
43228
|
resources.forEach((resource) => this.addResource(resource));
|
43567
43229
|
return this;
|
43568
43230
|
}
|
43231
|
+
/**
|
43232
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43233
|
+
* outputs from the related assetIds.
|
43234
|
+
*
|
43235
|
+
* @param resources - The resources to add.
|
43236
|
+
* @returns This transaction.
|
43237
|
+
*/
|
43238
|
+
addPredicateResource(resource, predicate) {
|
43239
|
+
if (isCoin(resource)) {
|
43240
|
+
this.addCoinInput(resource, predicate);
|
43241
|
+
} else {
|
43242
|
+
this.addMessageInput(resource, predicate);
|
43243
|
+
}
|
43244
|
+
return this;
|
43245
|
+
}
|
43246
|
+
/**
|
43247
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43248
|
+
* from the related assetIds.
|
43249
|
+
*
|
43250
|
+
* @param resources - The resources to add.
|
43251
|
+
* @returns This transaction.
|
43252
|
+
*/
|
43253
|
+
addPredicateResources(resources, predicate) {
|
43254
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43255
|
+
return this;
|
43256
|
+
}
|
43569
43257
|
/**
|
43570
43258
|
* Adds a coin output to the transaction.
|
43571
43259
|
*
|
@@ -43573,12 +43261,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43573
43261
|
* @param amount - Amount of coin.
|
43574
43262
|
* @param assetId - Asset ID of coin.
|
43575
43263
|
*/
|
43576
|
-
addCoinOutput(to, amount, assetId
|
43264
|
+
addCoinOutput(to, amount, assetId) {
|
43577
43265
|
this.pushOutput({
|
43578
43266
|
type: OutputType.Coin,
|
43579
43267
|
to: addressify(to).toB256(),
|
43580
43268
|
amount,
|
43581
|
-
assetId
|
43269
|
+
assetId: assetId ?? this.baseAssetId
|
43582
43270
|
});
|
43583
43271
|
return this;
|
43584
43272
|
}
|
@@ -43605,7 +43293,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43605
43293
|
* @param to - Address of the owner.
|
43606
43294
|
* @param assetId - Asset ID of coin.
|
43607
43295
|
*/
|
43608
|
-
addChangeOutput(to, assetId
|
43296
|
+
addChangeOutput(to, assetId) {
|
43609
43297
|
const changeOutput = this.getChangeOutputs().find(
|
43610
43298
|
(output3) => hexlify(output3.assetId) === assetId
|
43611
43299
|
);
|
@@ -43613,7 +43301,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43613
43301
|
this.pushOutput({
|
43614
43302
|
type: OutputType.Change,
|
43615
43303
|
to: addressify(to).toB256(),
|
43616
|
-
assetId
|
43304
|
+
assetId: assetId ?? this.baseAssetId
|
43617
43305
|
});
|
43618
43306
|
}
|
43619
43307
|
}
|
@@ -43645,7 +43333,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43645
43333
|
}
|
43646
43334
|
calculateMaxGas(chainInfo, minGas) {
|
43647
43335
|
const { consensusParameters } = chainInfo;
|
43648
|
-
const { gasPerByte
|
43336
|
+
const { gasPerByte } = consensusParameters;
|
43649
43337
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43650
43338
|
(acc, wit) => acc + wit.dataLength,
|
43651
43339
|
0
|
@@ -43654,8 +43342,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43654
43342
|
gasPerByte,
|
43655
43343
|
minGas,
|
43656
43344
|
witnessesLength,
|
43657
|
-
witnessLimit: this.witnessLimit
|
43658
|
-
maxGasPerTx
|
43345
|
+
witnessLimit: this.witnessLimit
|
43659
43346
|
});
|
43660
43347
|
}
|
43661
43348
|
/**
|
@@ -43673,27 +43360,24 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43673
43360
|
});
|
43674
43361
|
const updateAssetInput = (assetId, quantity) => {
|
43675
43362
|
const assetInput = findAssetInput(assetId);
|
43676
|
-
let usedQuantity = quantity;
|
43677
|
-
if (assetId === BaseAssetId) {
|
43678
|
-
usedQuantity = bn("1000000000000000000");
|
43679
|
-
}
|
43680
43363
|
if (assetInput && "assetId" in assetInput) {
|
43681
43364
|
assetInput.id = hexlify(randomBytes22(UTXO_ID_LEN));
|
43682
|
-
assetInput.amount =
|
43365
|
+
assetInput.amount = quantity;
|
43683
43366
|
} else {
|
43684
43367
|
this.addResources([
|
43685
43368
|
{
|
43686
43369
|
id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
43687
|
-
amount:
|
43370
|
+
amount: quantity,
|
43688
43371
|
assetId,
|
43689
43372
|
owner: resourcesOwner || Address.fromRandom(),
|
43373
|
+
maturity: 0,
|
43690
43374
|
blockCreated: bn(1),
|
43691
43375
|
txCreatedIdx: bn(1)
|
43692
43376
|
}
|
43693
43377
|
]);
|
43694
43378
|
}
|
43695
43379
|
};
|
43696
|
-
updateAssetInput(
|
43380
|
+
updateAssetInput(this.baseAssetId, bn(1e11));
|
43697
43381
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43698
43382
|
}
|
43699
43383
|
/**
|
@@ -43718,7 +43402,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43718
43402
|
toJSON() {
|
43719
43403
|
return normalizeJSON(this);
|
43720
43404
|
}
|
43721
|
-
|
43405
|
+
updatePredicateInputs(inputs) {
|
43722
43406
|
this.inputs.forEach((i) => {
|
43723
43407
|
let correspondingInput;
|
43724
43408
|
switch (i.type) {
|
@@ -43740,15 +43424,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43740
43424
|
}
|
43741
43425
|
});
|
43742
43426
|
}
|
43743
|
-
shiftPredicateData() {
|
43744
|
-
this.inputs.forEach((input) => {
|
43745
|
-
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43746
|
-
input.predicateData = input.paddPredicateData(
|
43747
|
-
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43748
|
-
);
|
43749
|
-
}
|
43750
|
-
});
|
43751
|
-
}
|
43752
43427
|
};
|
43753
43428
|
|
43754
43429
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43859,12 +43534,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43859
43534
|
*
|
43860
43535
|
* @param createTransactionRequestLike - The initial values for the instance
|
43861
43536
|
*/
|
43862
|
-
constructor({
|
43863
|
-
bytecodeWitnessIndex,
|
43864
|
-
salt,
|
43865
|
-
storageSlots,
|
43866
|
-
...rest
|
43867
|
-
} = {}) {
|
43537
|
+
constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
|
43868
43538
|
super(rest);
|
43869
43539
|
this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
|
43870
43540
|
this.salt = hexlify(salt ?? ZeroBytes32);
|
@@ -43882,8 +43552,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43882
43552
|
return {
|
43883
43553
|
type: TransactionType.Create,
|
43884
43554
|
...baseTransaction,
|
43555
|
+
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43885
43556
|
bytecodeWitnessIndex,
|
43886
|
-
storageSlotsCount:
|
43557
|
+
storageSlotsCount: storageSlots.length,
|
43887
43558
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43888
43559
|
storageSlots
|
43889
43560
|
};
|
@@ -43978,7 +43649,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43978
43649
|
*
|
43979
43650
|
* @param scriptTransactionRequestLike - The initial values for the instance.
|
43980
43651
|
*/
|
43981
|
-
constructor({ script, scriptData, gasLimit, ...rest }
|
43652
|
+
constructor({ script, scriptData, gasLimit, ...rest }) {
|
43982
43653
|
super(rest);
|
43983
43654
|
this.gasLimit = bn(gasLimit);
|
43984
43655
|
this.script = arrayify(script ?? returnZeroScript.bytes);
|
@@ -43997,8 +43668,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43997
43668
|
type: TransactionType.Script,
|
43998
43669
|
scriptGasLimit: this.gasLimit,
|
43999
43670
|
...super.getBaseTransaction(),
|
44000
|
-
scriptLength:
|
44001
|
-
scriptDataLength:
|
43671
|
+
scriptLength: script.length,
|
43672
|
+
scriptDataLength: scriptData.length,
|
44002
43673
|
receiptsRoot: ZeroBytes32,
|
44003
43674
|
script: hexlify(script),
|
44004
43675
|
scriptData: hexlify(scriptData)
|
@@ -44062,7 +43733,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44062
43733
|
}
|
44063
43734
|
calculateMaxGas(chainInfo, minGas) {
|
44064
43735
|
const { consensusParameters } = chainInfo;
|
44065
|
-
const { gasPerByte
|
43736
|
+
const { gasPerByte } = consensusParameters;
|
44066
43737
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
44067
43738
|
(acc, wit) => acc + wit.dataLength,
|
44068
43739
|
0
|
@@ -44072,8 +43743,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44072
43743
|
minGas,
|
44073
43744
|
witnessesLength,
|
44074
43745
|
witnessLimit: this.witnessLimit,
|
44075
|
-
gasLimit: this.gasLimit
|
44076
|
-
maxGasPerTx
|
43746
|
+
gasLimit: this.gasLimit
|
44077
43747
|
});
|
44078
43748
|
}
|
44079
43749
|
/**
|
@@ -44146,29 +43816,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44146
43816
|
}
|
44147
43817
|
}
|
44148
43818
|
};
|
44149
|
-
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44150
|
-
(acc, input) => {
|
44151
|
-
if (input.type === InputType.Coin && input.owner === owner) {
|
44152
|
-
acc.utxos.push(input.id);
|
44153
|
-
}
|
44154
|
-
if (input.type === InputType.Message && input.recipient === owner) {
|
44155
|
-
acc.messages.push(input.nonce);
|
44156
|
-
}
|
44157
|
-
return acc;
|
44158
|
-
},
|
44159
|
-
{
|
44160
|
-
utxos: [],
|
44161
|
-
messages: []
|
44162
|
-
}
|
44163
|
-
);
|
44164
43819
|
|
44165
43820
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
44166
43821
|
var calculateTransactionFee = (params) => {
|
44167
43822
|
const {
|
44168
|
-
|
43823
|
+
gasUsed,
|
44169
43824
|
rawPayload,
|
44170
|
-
|
44171
|
-
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43825
|
+
consensusParameters: { gasCosts, feeParams }
|
44172
43826
|
} = params;
|
44173
43827
|
const gasPerByte = bn(feeParams.gasPerByte);
|
44174
43828
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -44178,7 +43832,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44178
43832
|
return {
|
44179
43833
|
fee: bn(0),
|
44180
43834
|
minFee: bn(0),
|
44181
|
-
maxFee: bn(0)
|
43835
|
+
maxFee: bn(0),
|
43836
|
+
feeFromGasUsed: bn(0)
|
44182
43837
|
};
|
44183
43838
|
}
|
44184
43839
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -44210,6 +43865,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44210
43865
|
metadataGas,
|
44211
43866
|
txBytesSize: transactionBytes.length
|
44212
43867
|
});
|
43868
|
+
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
44213
43869
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
44214
43870
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
44215
43871
|
const maxGas = getMaxGas({
|
@@ -44217,25 +43873,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44217
43873
|
minGas,
|
44218
43874
|
witnessesLength,
|
44219
43875
|
gasLimit,
|
44220
|
-
witnessLimit
|
44221
|
-
maxGasPerTx
|
44222
|
-
});
|
44223
|
-
const minFee = calculateGasFee({
|
44224
|
-
gasPrice,
|
44225
|
-
gas: minGas,
|
44226
|
-
priceFactor: gasPriceFactor,
|
44227
|
-
tip
|
44228
|
-
});
|
44229
|
-
const maxFee = calculateGasFee({
|
44230
|
-
gasPrice,
|
44231
|
-
gas: maxGas,
|
44232
|
-
priceFactor: gasPriceFactor,
|
44233
|
-
tip
|
43876
|
+
witnessLimit
|
44234
43877
|
});
|
43878
|
+
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43879
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43880
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43881
|
+
const fee = minFee.add(feeFromGasUsed);
|
44235
43882
|
return {
|
43883
|
+
fee,
|
44236
43884
|
minFee,
|
44237
43885
|
maxFee,
|
44238
|
-
|
43886
|
+
feeFromGasUsed
|
44239
43887
|
};
|
44240
43888
|
};
|
44241
43889
|
|
@@ -44789,9 +44437,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44789
44437
|
gqlTransactionStatus,
|
44790
44438
|
abiMap = {},
|
44791
44439
|
maxInputs,
|
44792
|
-
gasCosts
|
44793
|
-
maxGasPerTx,
|
44794
|
-
gasPrice
|
44440
|
+
gasCosts
|
44795
44441
|
} = params;
|
44796
44442
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44797
44443
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44805,14 +44451,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44805
44451
|
maxInputs
|
44806
44452
|
});
|
44807
44453
|
const typeName = getTransactionTypeName(transaction.type);
|
44808
|
-
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44809
44454
|
const { fee } = calculateTransactionFee({
|
44810
|
-
|
44455
|
+
gasUsed,
|
44811
44456
|
rawPayload,
|
44812
|
-
tip,
|
44813
44457
|
consensusParameters: {
|
44814
44458
|
gasCosts,
|
44815
|
-
maxGasPerTx,
|
44816
44459
|
feeParams: {
|
44817
44460
|
gasPerByte,
|
44818
44461
|
gasPriceFactor
|
@@ -44948,13 +44591,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44948
44591
|
const decodedTransaction = this.decodeTransaction(
|
44949
44592
|
transaction
|
44950
44593
|
);
|
44951
|
-
|
44952
|
-
|
44953
|
-
txReceipts = transaction.status.receipts;
|
44954
|
-
}
|
44955
|
-
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44956
|
-
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44957
|
-
const gasPrice = await this.provider.getLatestGasPrice();
|
44594
|
+
const receipts = transaction.receipts?.map(processGqlReceipt) || [];
|
44595
|
+
const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
|
44958
44596
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44959
44597
|
const transactionSummary = assembleTransactionSummary({
|
44960
44598
|
id: this.id,
|
@@ -44966,9 +44604,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44966
44604
|
gasPriceFactor,
|
44967
44605
|
abiMap: contractsAbiMap,
|
44968
44606
|
maxInputs,
|
44969
|
-
gasCosts
|
44970
|
-
maxGasPerTx,
|
44971
|
-
gasPrice
|
44607
|
+
gasCosts
|
44972
44608
|
});
|
44973
44609
|
return transactionSummary;
|
44974
44610
|
}
|
@@ -45112,12 +44748,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45112
44748
|
gasPerByte: bn(feeParams.gasPerByte),
|
45113
44749
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
45114
44750
|
chainId: bn(consensusParameters.chainId),
|
44751
|
+
baseAssetId: consensusParameters.baseAssetId,
|
45115
44752
|
gasCosts
|
45116
44753
|
},
|
45117
44754
|
gasCosts,
|
45118
44755
|
latestBlock: {
|
45119
44756
|
id: latestBlock.id,
|
45120
|
-
height: bn(latestBlock.height),
|
44757
|
+
height: bn(latestBlock.header.height),
|
45121
44758
|
time: latestBlock.header.time,
|
45122
44759
|
transactions: latestBlock.transactions.map((i) => ({
|
45123
44760
|
id: i.id
|
@@ -45211,8 +44848,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45211
44848
|
* Returns some helpful parameters related to gas fees.
|
45212
44849
|
*/
|
45213
44850
|
getGasConfig() {
|
44851
|
+
const { minGasPrice } = this.getNode();
|
45214
44852
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
45215
44853
|
return {
|
44854
|
+
minGasPrice,
|
45216
44855
|
maxGasPerTx,
|
45217
44856
|
maxGasPerPredicate,
|
45218
44857
|
gasPriceFactor,
|
@@ -45310,7 +44949,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45310
44949
|
*/
|
45311
44950
|
async getBlockNumber() {
|
45312
44951
|
const { chain } = await this.operations.getChain();
|
45313
|
-
return bn(chain.latestBlock.height, 10);
|
44952
|
+
return bn(chain.latestBlock.header.height, 10);
|
45314
44953
|
}
|
45315
44954
|
/**
|
45316
44955
|
* Returns the chain information.
|
@@ -45322,9 +44961,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45322
44961
|
const processedNodeInfo = {
|
45323
44962
|
maxDepth: bn(nodeInfo.maxDepth),
|
45324
44963
|
maxTx: bn(nodeInfo.maxTx),
|
44964
|
+
minGasPrice: bn(nodeInfo.minGasPrice),
|
45325
44965
|
nodeVersion: nodeInfo.nodeVersion,
|
45326
44966
|
utxoValidation: nodeInfo.utxoValidation,
|
45327
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44967
|
+
vmBacktrace: nodeInfo.vmBacktrace,
|
44968
|
+
peers: nodeInfo.peers
|
45328
44969
|
};
|
45329
44970
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
45330
44971
|
return processedNodeInfo;
|
@@ -45350,6 +44991,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45350
44991
|
} = this.getChain();
|
45351
44992
|
return chainId.toNumber();
|
45352
44993
|
}
|
44994
|
+
/**
|
44995
|
+
* Returns the base asset ID
|
44996
|
+
*
|
44997
|
+
* @returns A promise that resolves to the base asset ID
|
44998
|
+
*/
|
44999
|
+
getBaseAssetId() {
|
45000
|
+
const {
|
45001
|
+
consensusParameters: { baseAssetId }
|
45002
|
+
} = this.getChain();
|
45003
|
+
return baseAssetId;
|
45004
|
+
}
|
45353
45005
|
/**
|
45354
45006
|
* Submits a transaction to the chain to be executed.
|
45355
45007
|
*
|
@@ -45410,13 +45062,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45410
45062
|
return this.estimateTxDependencies(transactionRequest);
|
45411
45063
|
}
|
45412
45064
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45413
|
-
const { dryRun:
|
45414
|
-
|
45065
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45066
|
+
encodedTransaction,
|
45415
45067
|
utxoValidation: utxoValidation || false
|
45416
45068
|
});
|
45417
|
-
const
|
45418
|
-
|
45419
|
-
|
45069
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45070
|
+
return {
|
45071
|
+
receipts
|
45072
|
+
};
|
45420
45073
|
}
|
45421
45074
|
/**
|
45422
45075
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45455,6 +45108,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45455
45108
|
* If there are missing variable outputs,
|
45456
45109
|
* `addVariableOutputs` is called on the transaction.
|
45457
45110
|
*
|
45111
|
+
* @privateRemarks
|
45112
|
+
* TODO: Investigate support for missing contract IDs
|
45113
|
+
* TODO: Add support for missing output messages
|
45458
45114
|
*
|
45459
45115
|
* @param transactionRequest - The transaction request object.
|
45460
45116
|
* @returns A promise.
|
@@ -45467,19 +45123,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45467
45123
|
missingContractIds: []
|
45468
45124
|
};
|
45469
45125
|
}
|
45126
|
+
await this.estimatePredicates(transactionRequest);
|
45470
45127
|
let receipts = [];
|
45471
45128
|
const missingContractIds = [];
|
45472
45129
|
let outputVariables = 0;
|
45473
|
-
let dryrunStatus;
|
45474
45130
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45475
|
-
const {
|
45476
|
-
|
45477
|
-
} = await this.operations.dryRun({
|
45478
|
-
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45131
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45132
|
+
encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
|
45479
45133
|
utxoValidation: false
|
45480
45134
|
});
|
45481
|
-
receipts =
|
45482
|
-
dryrunStatus = status;
|
45135
|
+
receipts = gqlReceipts.map(processGqlReceipt);
|
45483
45136
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45484
45137
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45485
45138
|
if (hasMissingOutputs) {
|
@@ -45489,10 +45142,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45489
45142
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45490
45143
|
missingContractIds.push(contractId);
|
45491
45144
|
});
|
45492
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45493
|
-
transactionRequest
|
45494
|
-
});
|
45495
|
-
transactionRequest.maxFee = maxFee;
|
45496
45145
|
} else {
|
45497
45146
|
break;
|
45498
45147
|
}
|
@@ -45500,139 +45149,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45500
45149
|
return {
|
45501
45150
|
receipts,
|
45502
45151
|
outputVariables,
|
45503
|
-
missingContractIds
|
45504
|
-
dryrunStatus
|
45152
|
+
missingContractIds
|
45505
45153
|
};
|
45506
45154
|
}
|
45507
|
-
/**
|
45508
|
-
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45509
|
-
*
|
45510
|
-
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45511
|
-
* further modifications are identified. The method iteratively updates these transactions
|
45512
|
-
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45513
|
-
*
|
45514
|
-
* @param transactionRequests - Array of transaction request objects.
|
45515
|
-
* @returns A promise that resolves to an array of results for each transaction.
|
45516
|
-
*/
|
45517
|
-
async estimateMultipleTxDependencies(transactionRequests) {
|
45518
|
-
const results = transactionRequests.map(() => ({
|
45519
|
-
receipts: [],
|
45520
|
-
outputVariables: 0,
|
45521
|
-
missingContractIds: [],
|
45522
|
-
dryrunStatus: void 0
|
45523
|
-
}));
|
45524
|
-
const allRequests = clone_default(transactionRequests);
|
45525
|
-
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45526
|
-
allRequests.forEach((req, index) => {
|
45527
|
-
if (req.type === TransactionType.Script) {
|
45528
|
-
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45529
|
-
}
|
45530
|
-
});
|
45531
|
-
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45532
|
-
let attempt = 0;
|
45533
|
-
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45534
|
-
const encodedTransactions = transactionsToProcess.map(
|
45535
|
-
(index) => serializedTransactionsMap.get(index)
|
45536
|
-
);
|
45537
|
-
const dryRunResults = await this.operations.dryRun({
|
45538
|
-
encodedTransactions,
|
45539
|
-
utxoValidation: false
|
45540
|
-
});
|
45541
|
-
const nextRoundTransactions = [];
|
45542
|
-
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45543
|
-
const currentResultIndex = transactionsToProcess[i];
|
45544
|
-
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45545
|
-
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45546
|
-
results[currentResultIndex].dryrunStatus = status;
|
45547
|
-
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45548
|
-
results[currentResultIndex].receipts
|
45549
|
-
);
|
45550
|
-
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45551
|
-
const requestToProcess = allRequests[currentResultIndex];
|
45552
|
-
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45553
|
-
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45554
|
-
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45555
|
-
missingOutputContractIds.forEach(({ contractId }) => {
|
45556
|
-
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45557
|
-
results[currentResultIndex].missingContractIds.push(contractId);
|
45558
|
-
});
|
45559
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45560
|
-
transactionRequest: requestToProcess
|
45561
|
-
});
|
45562
|
-
requestToProcess.maxFee = maxFee;
|
45563
|
-
serializedTransactionsMap.set(
|
45564
|
-
currentResultIndex,
|
45565
|
-
hexlify(requestToProcess.toTransactionBytes())
|
45566
|
-
);
|
45567
|
-
nextRoundTransactions.push(currentResultIndex);
|
45568
|
-
allRequests[currentResultIndex] = requestToProcess;
|
45569
|
-
}
|
45570
|
-
}
|
45571
|
-
transactionsToProcess = nextRoundTransactions;
|
45572
|
-
attempt += 1;
|
45573
|
-
}
|
45574
|
-
return results;
|
45575
|
-
}
|
45576
|
-
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45577
|
-
if (estimateTxDependencies) {
|
45578
|
-
return this.estimateMultipleTxDependencies(transactionRequests);
|
45579
|
-
}
|
45580
|
-
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45581
|
-
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45582
|
-
encodedTransactions,
|
45583
|
-
utxoValidation: utxoValidation || false
|
45584
|
-
});
|
45585
|
-
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45586
|
-
const receipts = rawReceipts.map(processGqlReceipt);
|
45587
|
-
return { receipts, dryrunStatus: status };
|
45588
|
-
});
|
45589
|
-
return results;
|
45590
|
-
}
|
45591
45155
|
/**
|
45592
45156
|
* Estimates the transaction gas and fee based on the provided transaction request.
|
45593
45157
|
* @param transactionRequest - The transaction request object.
|
45594
45158
|
* @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
|
45595
45159
|
*/
|
45596
|
-
|
45160
|
+
estimateTxGasAndFee(params) {
|
45597
45161
|
const { transactionRequest } = params;
|
45598
|
-
|
45162
|
+
const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
|
45599
45163
|
const chainInfo = this.getChain();
|
45600
|
-
const
|
45164
|
+
const gasPrice = transactionRequest.gasPrice.eq(0) ? minGasPrice : transactionRequest.gasPrice;
|
45165
|
+
transactionRequest.gasPrice = gasPrice;
|
45601
45166
|
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45602
|
-
|
45603
|
-
gasPrice = await this.estimateGasPrice(10);
|
45604
|
-
}
|
45605
|
-
const minFee = calculateGasFee({
|
45606
|
-
gasPrice: bn(gasPrice),
|
45607
|
-
gas: minGas,
|
45608
|
-
priceFactor: gasPriceFactor,
|
45609
|
-
tip: transactionRequest.tip
|
45610
|
-
}).add(1);
|
45611
|
-
let gasLimit = bn(0);
|
45167
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45612
45168
|
if (transactionRequest.type === TransactionType.Script) {
|
45613
|
-
gasLimit = transactionRequest.gasLimit;
|
45614
45169
|
if (transactionRequest.gasLimit.eq(0)) {
|
45615
45170
|
transactionRequest.gasLimit = minGas;
|
45616
45171
|
transactionRequest.gasLimit = maxGasPerTx.sub(
|
45617
45172
|
transactionRequest.calculateMaxGas(chainInfo, minGas)
|
45618
45173
|
);
|
45619
|
-
gasLimit = transactionRequest.gasLimit;
|
45620
45174
|
}
|
45621
45175
|
}
|
45622
45176
|
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45623
|
-
const maxFee =
|
45624
|
-
gasPrice: bn(gasPrice),
|
45625
|
-
gas: maxGas,
|
45626
|
-
priceFactor: gasPriceFactor,
|
45627
|
-
tip: transactionRequest.tip
|
45628
|
-
}).add(1);
|
45177
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45629
45178
|
return {
|
45630
45179
|
minGas,
|
45631
45180
|
minFee,
|
45632
45181
|
maxGas,
|
45633
|
-
maxFee
|
45634
|
-
gasPrice,
|
45635
|
-
gasLimit
|
45182
|
+
maxFee
|
45636
45183
|
};
|
45637
45184
|
}
|
45638
45185
|
/**
|
@@ -45650,17 +45197,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45650
45197
|
if (estimateTxDependencies) {
|
45651
45198
|
return this.estimateTxDependencies(transactionRequest);
|
45652
45199
|
}
|
45653
|
-
const
|
45654
|
-
const { dryRun:
|
45655
|
-
|
45200
|
+
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45201
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45202
|
+
encodedTransaction,
|
45656
45203
|
utxoValidation: true
|
45657
45204
|
});
|
45658
|
-
const
|
45659
|
-
|
45660
|
-
|
45661
|
-
|
45662
|
-
});
|
45663
|
-
return { receipts: callResult[0].receipts };
|
45205
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45206
|
+
return {
|
45207
|
+
receipts
|
45208
|
+
};
|
45664
45209
|
}
|
45665
45210
|
/**
|
45666
45211
|
* Returns a transaction cost to enable user
|
@@ -45677,79 +45222,77 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45677
45222
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45678
45223
|
* @returns A promise that resolves to the transaction cost object.
|
45679
45224
|
*/
|
45680
|
-
async getTransactionCost(transactionRequestLike,
|
45225
|
+
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
45226
|
+
estimateTxDependencies = true,
|
45227
|
+
estimatePredicates = true,
|
45228
|
+
resourcesOwner,
|
45229
|
+
signatureCallback
|
45230
|
+
} = {}) {
|
45681
45231
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45232
|
+
const { minGasPrice } = this.getGasConfig();
|
45233
|
+
const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45682
45234
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45683
45235
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45684
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45236
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
|
45685
45237
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45686
|
-
txRequestClone.maxFee = bn(0);
|
45687
45238
|
if (isScriptTransaction) {
|
45688
45239
|
txRequestClone.gasLimit = bn(0);
|
45689
45240
|
}
|
45690
|
-
if (
|
45691
|
-
resourcesOwner
|
45241
|
+
if (estimatePredicates) {
|
45242
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45243
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45244
|
+
}
|
45245
|
+
await this.estimatePredicates(txRequestClone);
|
45692
45246
|
}
|
45693
|
-
const signedRequest = clone_default(txRequestClone);
|
45694
|
-
let addedSignatures = 0;
|
45695
45247
|
if (signatureCallback && isScriptTransaction) {
|
45696
|
-
|
45697
|
-
await signatureCallback(signedRequest);
|
45698
|
-
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
45248
|
+
await signatureCallback(txRequestClone);
|
45699
45249
|
}
|
45700
|
-
|
45701
|
-
|
45702
|
-
transactionRequest: signedRequest
|
45250
|
+
let { maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
|
45251
|
+
transactionRequest: txRequestClone
|
45703
45252
|
});
|
45704
45253
|
let receipts = [];
|
45705
45254
|
let missingContractIds = [];
|
45706
45255
|
let outputVariables = 0;
|
45707
45256
|
let gasUsed = bn(0);
|
45708
|
-
|
45709
|
-
|
45710
|
-
if (isScriptTransaction) {
|
45711
|
-
txRequestClone.gasLimit = gasLimit;
|
45712
|
-
if (signatureCallback) {
|
45713
|
-
await signatureCallback(txRequestClone);
|
45714
|
-
}
|
45257
|
+
if (isScriptTransaction && estimateTxDependencies) {
|
45258
|
+
txRequestClone.gasPrice = bn(0);
|
45715
45259
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45716
45260
|
receipts = result.receipts;
|
45717
45261
|
outputVariables = result.outputVariables;
|
45718
45262
|
missingContractIds = result.missingContractIds;
|
45719
45263
|
gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
|
45720
45264
|
txRequestClone.gasLimit = gasUsed;
|
45721
|
-
|
45722
|
-
|
45723
|
-
|
45265
|
+
txRequestClone.gasPrice = setGasPrice;
|
45266
|
+
({ maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
|
45267
|
+
transactionRequest: txRequestClone
|
45724
45268
|
}));
|
45725
45269
|
}
|
45726
45270
|
return {
|
45727
45271
|
requiredQuantities: allQuantities,
|
45728
45272
|
receipts,
|
45729
45273
|
gasUsed,
|
45730
|
-
|
45274
|
+
minGasPrice,
|
45275
|
+
gasPrice: setGasPrice,
|
45731
45276
|
minGas,
|
45732
45277
|
maxGas,
|
45733
45278
|
minFee,
|
45734
45279
|
maxFee,
|
45280
|
+
estimatedInputs: txRequestClone.inputs,
|
45735
45281
|
outputVariables,
|
45736
|
-
missingContractIds
|
45737
|
-
addedSignatures,
|
45738
|
-
estimatedPredicates: txRequestClone.inputs
|
45282
|
+
missingContractIds
|
45739
45283
|
};
|
45740
45284
|
}
|
45741
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45285
|
+
async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
|
45742
45286
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45743
45287
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45744
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45745
|
-
quantitiesToContract
|
45746
|
-
});
|
45288
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
|
45747
45289
|
transactionRequest.addResources(
|
45748
45290
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45749
45291
|
);
|
45750
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45751
|
-
|
45752
|
-
|
45292
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45293
|
+
transactionRequest,
|
45294
|
+
forwardingQuantities
|
45295
|
+
);
|
45753
45296
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45754
45297
|
return {
|
45755
45298
|
resources,
|
@@ -45773,6 +45316,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45773
45316
|
assetId: coin.assetId,
|
45774
45317
|
amount: bn(coin.amount),
|
45775
45318
|
owner: Address.fromAddressOrString(coin.owner),
|
45319
|
+
maturity: bn(coin.maturity).toNumber(),
|
45776
45320
|
blockCreated: bn(coin.blockCreated),
|
45777
45321
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45778
45322
|
}));
|
@@ -45824,6 +45368,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45824
45368
|
amount: bn(coin.amount),
|
45825
45369
|
assetId: coin.assetId,
|
45826
45370
|
owner: Address.fromAddressOrString(coin.owner),
|
45371
|
+
maturity: bn(coin.maturity).toNumber(),
|
45827
45372
|
blockCreated: bn(coin.blockCreated),
|
45828
45373
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45829
45374
|
};
|
@@ -45856,7 +45401,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45856
45401
|
}
|
45857
45402
|
return {
|
45858
45403
|
id: block2.id,
|
45859
|
-
height: bn(block2.height),
|
45404
|
+
height: bn(block2.header.height),
|
45860
45405
|
time: block2.header.time,
|
45861
45406
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45862
45407
|
};
|
@@ -45871,7 +45416,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45871
45416
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45872
45417
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45873
45418
|
id: block2.id,
|
45874
|
-
height: bn(block2.height),
|
45419
|
+
height: bn(block2.header.height),
|
45875
45420
|
time: block2.header.time,
|
45876
45421
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45877
45422
|
}));
|
@@ -45898,7 +45443,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45898
45443
|
}
|
45899
45444
|
return {
|
45900
45445
|
id: block2.id,
|
45901
|
-
height: bn(block2.height, 10),
|
45446
|
+
height: bn(block2.header.height, 10),
|
45902
45447
|
time: block2.header.time,
|
45903
45448
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45904
45449
|
transactions: block2.transactions.map(
|
@@ -46078,11 +45623,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46078
45623
|
prevRoot: messageBlockHeader.prevRoot,
|
46079
45624
|
time: messageBlockHeader.time,
|
46080
45625
|
applicationHash: messageBlockHeader.applicationHash,
|
46081
|
-
|
46082
|
-
|
46083
|
-
consensusParametersVersion: messageBlockHeader.consensusParametersVersion,
|
46084
|
-
eventInboxRoot: messageBlockHeader.eventInboxRoot,
|
46085
|
-
stateTransitionBytecodeVersion: messageBlockHeader.stateTransitionBytecodeVersion
|
45626
|
+
messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
|
45627
|
+
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
|
46086
45628
|
},
|
46087
45629
|
commitBlockHeader: {
|
46088
45630
|
id: commitBlockHeader.id,
|
@@ -46093,11 +45635,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46093
45635
|
prevRoot: commitBlockHeader.prevRoot,
|
46094
45636
|
time: commitBlockHeader.time,
|
46095
45637
|
applicationHash: commitBlockHeader.applicationHash,
|
46096
|
-
|
46097
|
-
|
46098
|
-
consensusParametersVersion: commitBlockHeader.consensusParametersVersion,
|
46099
|
-
eventInboxRoot: commitBlockHeader.eventInboxRoot,
|
46100
|
-
stateTransitionBytecodeVersion: commitBlockHeader.stateTransitionBytecodeVersion
|
45638
|
+
messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
|
45639
|
+
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
|
46101
45640
|
},
|
46102
45641
|
sender: Address.fromAddressOrString(sender),
|
46103
45642
|
recipient: Address.fromAddressOrString(recipient),
|
@@ -46106,16 +45645,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46106
45645
|
data
|
46107
45646
|
};
|
46108
45647
|
}
|
46109
|
-
async getLatestGasPrice() {
|
46110
|
-
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46111
|
-
return bn(latestGasPrice.gasPrice);
|
46112
|
-
}
|
46113
|
-
async estimateGasPrice(blockHorizon) {
|
46114
|
-
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46115
|
-
blockHorizon: String(blockHorizon)
|
46116
|
-
});
|
46117
|
-
return bn(estimateGasPrice.gasPrice);
|
46118
|
-
}
|
46119
45648
|
/**
|
46120
45649
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
46121
45650
|
*
|
@@ -46361,8 +45890,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46361
45890
|
* @param assetId - The asset ID to check the balance for.
|
46362
45891
|
* @returns A promise that resolves to the balance amount.
|
46363
45892
|
*/
|
46364
|
-
async getBalance(assetId
|
46365
|
-
const
|
45893
|
+
async getBalance(assetId) {
|
45894
|
+
const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
|
45895
|
+
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
46366
45896
|
return amount;
|
46367
45897
|
}
|
46368
45898
|
/**
|
@@ -46399,33 +45929,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46399
45929
|
* @param fee - The estimated transaction fee.
|
46400
45930
|
* @returns A promise that resolves when the resources are added to the transaction.
|
46401
45931
|
*/
|
46402
|
-
async fund(request,
|
46403
|
-
const
|
46404
|
-
const
|
46405
|
-
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45932
|
+
async fund(request, coinQuantities, fee) {
|
45933
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
45934
|
+
const updatedQuantities = addAmountToAsset({
|
46406
45935
|
amount: bn(fee),
|
46407
|
-
assetId:
|
46408
|
-
coinQuantities
|
45936
|
+
assetId: baseAssetId,
|
45937
|
+
coinQuantities
|
46409
45938
|
});
|
46410
45939
|
const quantitiesDict = {};
|
46411
|
-
|
45940
|
+
updatedQuantities.forEach(({ amount, assetId }) => {
|
46412
45941
|
quantitiesDict[assetId] = {
|
46413
45942
|
required: amount,
|
46414
45943
|
owned: bn(0)
|
46415
45944
|
};
|
46416
45945
|
});
|
46417
|
-
|
45946
|
+
const cachedUtxos = [];
|
45947
|
+
const cachedMessages = [];
|
45948
|
+
const owner = this.address.toB256();
|
45949
|
+
request.inputs.forEach((input) => {
|
46418
45950
|
const isResource = "amount" in input;
|
46419
45951
|
if (isResource) {
|
46420
45952
|
const isCoin2 = "owner" in input;
|
46421
45953
|
if (isCoin2) {
|
46422
45954
|
const assetId = String(input.assetId);
|
46423
|
-
if (quantitiesDict[assetId]) {
|
45955
|
+
if (input.owner === owner && quantitiesDict[assetId]) {
|
46424
45956
|
const amount = bn(input.amount);
|
46425
45957
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45958
|
+
cachedUtxos.push(input.id);
|
46426
45959
|
}
|
46427
|
-
} else if (input.amount && quantitiesDict[
|
46428
|
-
quantitiesDict[
|
45960
|
+
} else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
|
45961
|
+
quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
|
45962
|
+
cachedMessages.push(input.nonce);
|
46429
45963
|
}
|
46430
45964
|
}
|
46431
45965
|
});
|
@@ -46440,23 +45974,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46440
45974
|
});
|
46441
45975
|
const needsToBeFunded = missingQuantities.length;
|
46442
45976
|
if (needsToBeFunded) {
|
46443
|
-
const
|
46444
|
-
|
46445
|
-
|
46446
|
-
|
46447
|
-
|
46448
|
-
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46449
|
-
const requestToBeReEstimate = clone_default(txRequest);
|
46450
|
-
if (addedSignatures) {
|
46451
|
-
Array.from({ length: addedSignatures }).forEach(
|
46452
|
-
() => requestToBeReEstimate.addEmptyWitness()
|
46453
|
-
);
|
45977
|
+
const resources = await this.getResourcesToSpend(missingQuantities, {
|
45978
|
+
messages: cachedMessages,
|
45979
|
+
utxos: cachedUtxos
|
45980
|
+
});
|
45981
|
+
request.addResources(resources);
|
46454
45982
|
}
|
46455
|
-
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46456
|
-
transactionRequest: requestToBeReEstimate
|
46457
|
-
});
|
46458
|
-
txRequest.maxFee = maxFee;
|
46459
|
-
return txRequest;
|
46460
45983
|
}
|
46461
45984
|
/**
|
46462
45985
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -46464,25 +45987,30 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46464
45987
|
* @param destination - The address of the destination.
|
46465
45988
|
* @param amount - The amount of coins to transfer.
|
46466
45989
|
* @param assetId - The asset ID of the coins to transfer.
|
46467
|
-
* @param txParams - The transaction parameters (gasLimit,
|
45990
|
+
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46468
45991
|
* @returns A promise that resolves to the prepared transaction request.
|
46469
45992
|
*/
|
46470
|
-
async createTransfer(destination, amount, assetId
|
46471
|
-
const
|
46472
|
-
|
46473
|
-
const
|
45993
|
+
async createTransfer(destination, amount, assetId, txParams = {}) {
|
45994
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
45995
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
45996
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
45997
|
+
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
45998
|
+
const request = new ScriptTransactionRequest(params);
|
45999
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
46000
|
+
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46474
46001
|
estimateTxDependencies: true,
|
46475
46002
|
resourcesOwner: this
|
46476
46003
|
});
|
46477
|
-
|
46478
|
-
|
46479
|
-
|
46480
|
-
|
46481
|
-
|
46482
|
-
|
46483
|
-
|
46484
|
-
|
46485
|
-
await this.fund(request,
|
46004
|
+
request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
|
46005
|
+
request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
|
46006
|
+
this.validateGas({
|
46007
|
+
gasUsed,
|
46008
|
+
gasPrice: request.gasPrice,
|
46009
|
+
gasLimit: request.gasLimit,
|
46010
|
+
minGasPrice
|
46011
|
+
});
|
46012
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46013
|
+
request.updatePredicateInputs(estimatedInputs);
|
46486
46014
|
return request;
|
46487
46015
|
}
|
46488
46016
|
/**
|
@@ -46494,14 +46022,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46494
46022
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46495
46023
|
* @returns A promise that resolves to the transaction response.
|
46496
46024
|
*/
|
46497
|
-
async transfer(destination, amount, assetId
|
46025
|
+
async transfer(destination, amount, assetId, txParams = {}) {
|
46498
46026
|
if (bn(amount).lte(0)) {
|
46499
46027
|
throw new FuelError(
|
46500
46028
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
46501
46029
|
"Transfer amount must be a positive number."
|
46502
46030
|
);
|
46503
46031
|
}
|
46504
|
-
const
|
46032
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46033
|
+
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
46505
46034
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
46506
46035
|
}
|
46507
46036
|
/**
|
@@ -46513,7 +46042,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46513
46042
|
* @param txParams - The optional transaction parameters.
|
46514
46043
|
* @returns A promise that resolves to the transaction response.
|
46515
46044
|
*/
|
46516
|
-
async transferToContract(contractId, amount, assetId
|
46045
|
+
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46517
46046
|
if (bn(amount).lte(0)) {
|
46518
46047
|
throw new FuelError(
|
46519
46048
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46521,30 +46050,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46521
46050
|
);
|
46522
46051
|
}
|
46523
46052
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46053
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46054
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46055
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46056
|
+
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
46524
46057
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46525
46058
|
hexlifiedContractId: contractAddress.toB256(),
|
46526
46059
|
amountToTransfer: bn(amount),
|
46527
|
-
assetId
|
46060
|
+
assetId: assetIdToTransfer
|
46528
46061
|
});
|
46529
46062
|
const request = new ScriptTransactionRequest({
|
46530
|
-
...
|
46063
|
+
...params,
|
46531
46064
|
script,
|
46532
46065
|
scriptData
|
46533
46066
|
});
|
46534
46067
|
request.addContractInputAndOutput(contractAddress);
|
46535
|
-
const
|
46536
|
-
|
46537
|
-
|
46068
|
+
const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
|
46069
|
+
request,
|
46070
|
+
[{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
|
46071
|
+
);
|
46072
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46073
|
+
this.validateGas({
|
46074
|
+
gasUsed,
|
46075
|
+
gasPrice: request.gasPrice,
|
46076
|
+
gasLimit: request.gasLimit,
|
46077
|
+
minGasPrice
|
46538
46078
|
});
|
46539
|
-
|
46540
|
-
this.validateGas({
|
46541
|
-
gasUsed: txCost.gasUsed,
|
46542
|
-
gasLimit: request.gasLimit
|
46543
|
-
});
|
46544
|
-
}
|
46545
|
-
request.gasLimit = txCost.gasUsed;
|
46546
|
-
request.maxFee = txCost.maxFee;
|
46547
|
-
await this.fund(request, txCost);
|
46079
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46548
46080
|
return this.sendTransaction(request);
|
46549
46081
|
}
|
46550
46082
|
/**
|
@@ -46556,6 +46088,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46556
46088
|
* @returns A promise that resolves to the transaction response.
|
46557
46089
|
*/
|
46558
46090
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46091
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46092
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46559
46093
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46560
46094
|
const recipientDataArray = arrayify(
|
46561
46095
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46568,19 +46102,26 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46568
46102
|
...recipientDataArray,
|
46569
46103
|
...amountDataArray
|
46570
46104
|
]);
|
46571
|
-
const params = {
|
46105
|
+
const params = {
|
46106
|
+
script,
|
46107
|
+
gasPrice: minGasPrice,
|
46108
|
+
baseAssetId,
|
46109
|
+
...txParams
|
46110
|
+
};
|
46572
46111
|
const request = new ScriptTransactionRequest(params);
|
46573
|
-
const
|
46574
|
-
const
|
46575
|
-
|
46576
|
-
|
46577
|
-
|
46578
|
-
|
46579
|
-
|
46580
|
-
|
46581
|
-
|
46582
|
-
|
46583
|
-
|
46112
|
+
const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
|
46113
|
+
const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
|
46114
|
+
request,
|
46115
|
+
forwardingQuantities
|
46116
|
+
);
|
46117
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46118
|
+
this.validateGas({
|
46119
|
+
gasUsed,
|
46120
|
+
gasPrice: request.gasPrice,
|
46121
|
+
gasLimit: request.gasLimit,
|
46122
|
+
minGasPrice
|
46123
|
+
});
|
46124
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46584
46125
|
return this.sendTransaction(request);
|
46585
46126
|
}
|
46586
46127
|
async signMessage(message) {
|
@@ -46638,7 +46179,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46638
46179
|
}
|
46639
46180
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46640
46181
|
}
|
46641
|
-
validateGas({
|
46182
|
+
validateGas({
|
46183
|
+
gasUsed,
|
46184
|
+
gasPrice,
|
46185
|
+
gasLimit,
|
46186
|
+
minGasPrice
|
46187
|
+
}) {
|
46188
|
+
if (minGasPrice.gt(gasPrice)) {
|
46189
|
+
throw new FuelError(
|
46190
|
+
ErrorCode.GAS_PRICE_TOO_LOW,
|
46191
|
+
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46192
|
+
);
|
46193
|
+
}
|
46642
46194
|
if (gasUsed.gt(gasLimit)) {
|
46643
46195
|
throw new FuelError(
|
46644
46196
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -48021,12 +47573,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48021
47573
|
};
|
48022
47574
|
|
48023
47575
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
|
48024
|
-
var
|
47576
|
+
var import_crypto16 = __toESM(__require("crypto"));
|
48025
47577
|
var rnds8Pool = new Uint8Array(256);
|
48026
47578
|
var poolPtr = rnds8Pool.length;
|
48027
47579
|
function rng() {
|
48028
47580
|
if (poolPtr > rnds8Pool.length - 16) {
|
48029
|
-
|
47581
|
+
import_crypto16.default.randomFillSync(rnds8Pool);
|
48030
47582
|
poolPtr = 0;
|
48031
47583
|
}
|
48032
47584
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
@@ -48042,9 +47594,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48042
47594
|
}
|
48043
47595
|
|
48044
47596
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
|
48045
|
-
var
|
47597
|
+
var import_crypto17 = __toESM(__require("crypto"));
|
48046
47598
|
var native_default = {
|
48047
|
-
randomUUID:
|
47599
|
+
randomUUID: import_crypto17.default.randomUUID
|
48048
47600
|
};
|
48049
47601
|
|
48050
47602
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
|
@@ -48227,7 +47779,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48227
47779
|
* @param transactionRequestLike - The transaction request to send.
|
48228
47780
|
* @returns A promise that resolves to the TransactionResponse object.
|
48229
47781
|
*/
|
48230
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
47782
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
|
48231
47783
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
48232
47784
|
if (estimateTxDependencies) {
|
48233
47785
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50987,15 +50539,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50987
50539
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50988
50540
|
wallet.provider
|
50989
50541
|
);
|
50990
|
-
const
|
50991
|
-
|
50992
|
-
|
50993
|
-
|
50542
|
+
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50543
|
+
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
50544
|
+
const baseAssetId = genesisWallet.provider.getBaseAssetId();
|
50545
|
+
const request = new ScriptTransactionRequest({
|
50546
|
+
baseAssetId,
|
50547
|
+
gasLimit: 1e4,
|
50548
|
+
gasPrice: minGasPrice
|
50994
50549
|
});
|
50995
|
-
|
50996
|
-
request.
|
50997
|
-
request.maxFee = txCost.maxFee;
|
50998
|
-
await genesisWallet.fund(request, txCost);
|
50550
|
+
request.addResources(resources);
|
50551
|
+
quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
|
50999
50552
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
51000
50553
|
};
|
51001
50554
|
|
@@ -51025,7 +50578,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51025
50578
|
|
51026
50579
|
// src/test-utils/launchNode.ts
|
51027
50580
|
var import_child_process = __require("child_process");
|
51028
|
-
var
|
50581
|
+
var import_crypto21 = __require("crypto");
|
51029
50582
|
var import_fs2 = __require("fs");
|
51030
50583
|
var import_os = __toESM(__require("os"));
|
51031
50584
|
var import_path8 = __toESM(__require("path"));
|
@@ -51074,12 +50627,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51074
50627
|
// eslint-disable-next-line no-async-promise-executor
|
51075
50628
|
new Promise(async (resolve, reject) => {
|
51076
50629
|
const remainingArgs = extractRemainingArgs(args, [
|
51077
|
-
"--
|
50630
|
+
"--chain",
|
51078
50631
|
"--consensus-key",
|
51079
50632
|
"--db-type",
|
51080
50633
|
"--poa-instant"
|
51081
50634
|
]);
|
51082
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
50635
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--chain");
|
51083
50636
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
51084
50637
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
51085
50638
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -51097,55 +50650,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51097
50650
|
})).toString();
|
51098
50651
|
let chainConfigPathToUse;
|
51099
50652
|
const prefix = basePath || import_os.default.tmpdir();
|
51100
|
-
const suffix = basePath ? "" : (0,
|
51101
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix
|
50653
|
+
const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
|
50654
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51102
50655
|
if (chainConfigPath) {
|
51103
50656
|
chainConfigPathToUse = chainConfigPath;
|
51104
50657
|
} else {
|
51105
50658
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
51106
50659
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
51107
50660
|
}
|
51108
|
-
|
51109
|
-
|
51110
|
-
stateConfigJson = {
|
51111
|
-
...stateConfigJson,
|
51112
|
-
coins: [
|
51113
|
-
...stateConfigJson.coins.map((coin) => ({
|
51114
|
-
...coin,
|
51115
|
-
amount: "18446744073709551615"
|
51116
|
-
}))
|
51117
|
-
],
|
51118
|
-
messages: stateConfigJson.messages.map((message) => ({
|
51119
|
-
...message,
|
51120
|
-
amount: "18446744073709551615"
|
51121
|
-
}))
|
51122
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51123
|
-
};
|
50661
|
+
const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
50662
|
+
let chainConfig = defaultChainConfig;
|
51124
50663
|
if (!process.env.GENESIS_SECRET) {
|
51125
50664
|
const pk = Signer.generatePrivateKey();
|
51126
50665
|
const signer = new Signer(pk);
|
51127
50666
|
process.env.GENESIS_SECRET = hexlify(pk);
|
51128
|
-
|
51129
|
-
|
51130
|
-
|
51131
|
-
|
51132
|
-
|
51133
|
-
|
51134
|
-
|
51135
|
-
|
51136
|
-
|
51137
|
-
|
50667
|
+
chainConfig = {
|
50668
|
+
...defaultChainConfig,
|
50669
|
+
initial_state: {
|
50670
|
+
...defaultChainConfig.initial_state,
|
50671
|
+
coins: [
|
50672
|
+
...defaultChainConfig.initial_state.coins,
|
50673
|
+
{
|
50674
|
+
owner: signer.address.toHexString(),
|
50675
|
+
amount: toHex(1e9),
|
50676
|
+
asset_id: defaultChainConfig?.consensus_parameters?.base_asset_id ?? ZeroBytes32
|
50677
|
+
}
|
50678
|
+
]
|
50679
|
+
}
|
50680
|
+
};
|
51138
50681
|
}
|
51139
|
-
|
51140
|
-
|
51141
|
-
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51142
|
-
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51143
|
-
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51144
|
-
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51145
|
-
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51146
|
-
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51147
|
-
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51148
|
-
chainConfigPathToUse = tempDirPath;
|
50682
|
+
(0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
|
50683
|
+
chainConfigPathToUse = tempChainConfigFilePath;
|
51149
50684
|
}
|
51150
50685
|
const child = (0, import_child_process.spawn)(
|
51151
50686
|
command,
|
@@ -51154,10 +50689,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51154
50689
|
["--ip", ipToUse],
|
51155
50690
|
["--port", portToUse],
|
51156
50691
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
51157
|
-
["--min-gas-price", "
|
50692
|
+
["--min-gas-price", "0"],
|
51158
50693
|
poaInstant ? ["--poa-instant", "true"] : [],
|
51159
50694
|
["--consensus-key", consensusKey],
|
51160
|
-
["--
|
50695
|
+
["--chain", chainConfigPathToUse],
|
51161
50696
|
"--vm-backtrace",
|
51162
50697
|
"--utxo-validation",
|
51163
50698
|
"--debug",
|
@@ -51204,9 +50739,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51204
50739
|
})
|
51205
50740
|
);
|
51206
50741
|
var generateWallets = async (count, provider) => {
|
50742
|
+
const baseAssetId = provider.getBaseAssetId();
|
51207
50743
|
const wallets = [];
|
51208
50744
|
for (let i = 0; i < count; i += 1) {
|
51209
|
-
const wallet = await generateTestWallet(provider, [[1e3,
|
50745
|
+
const wallet = await generateTestWallet(provider, [[1e3, baseAssetId]]);
|
51210
50746
|
wallets.push(wallet);
|
51211
50747
|
}
|
51212
50748
|
return wallets;
|
@@ -51216,7 +50752,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51216
50752
|
walletCount = 10
|
51217
50753
|
} = {}) => {
|
51218
50754
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
51219
|
-
const provider = await Provider.create(`http://${ip}:${port}/
|
50755
|
+
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51220
50756
|
const wallets = await generateWallets(walletCount, provider);
|
51221
50757
|
const cleanup = () => {
|
51222
50758
|
closeNode();
|