@fuel-ts/account 0.0.0-rc-2021-20240410132122 → 0.0.0-rc-1976-20240410141707
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 +615 -871
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +609 -851
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +452 -693
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +2 -11
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +328 -894
- 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 -3
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +34 -45
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/input.d.ts +2 -2
- package/dist/providers/transaction-request/input.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +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.global.js +1116 -1585
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +606 -826
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +464 -684
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +17 -17
@@ -280,7 +280,7 @@
|
|
280
280
|
}
|
281
281
|
return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words);
|
282
282
|
};
|
283
|
-
BN2.max = function
|
283
|
+
BN2.max = function max2(left, right) {
|
284
284
|
if (left.cmp(right) > 0)
|
285
285
|
return left;
|
286
286
|
return right;
|
@@ -5104,7 +5104,7 @@
|
|
5104
5104
|
function isBlob(obj) {
|
5105
5105
|
return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
|
5106
5106
|
}
|
5107
|
-
function
|
5107
|
+
function 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.79.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,182 +34975,32 @@ 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) => {
|
35391
34984
|
let assetId;
|
35392
34985
|
let amount;
|
35393
|
-
let
|
34986
|
+
let max2;
|
35394
34987
|
if (Array.isArray(coinQuantityLike)) {
|
35395
34988
|
amount = coinQuantityLike[0];
|
35396
|
-
assetId = coinQuantityLike[1]
|
35397
|
-
|
34989
|
+
assetId = coinQuantityLike[1];
|
34990
|
+
max2 = coinQuantityLike[2];
|
35398
34991
|
} else {
|
35399
34992
|
amount = coinQuantityLike.amount;
|
35400
|
-
assetId = coinQuantityLike.assetId
|
35401
|
-
|
34993
|
+
assetId = coinQuantityLike.assetId;
|
34994
|
+
max2 = coinQuantityLike.max ?? void 0;
|
35402
34995
|
}
|
35403
34996
|
const bnAmount = bn(amount);
|
35404
34997
|
return {
|
35405
34998
|
assetId: hexlify(assetId),
|
35406
34999
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35407
|
-
max:
|
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);
|
@@ -35481,9 +35074,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35481
35074
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35482
35075
|
var MAX_BYTES = 2 ** 32 - 1;
|
35483
35076
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35484
|
-
|
35077
|
+
WORD_SIZE + // Tx size
|
35485
35078
|
// Asset ID/Balance coin input pairs
|
35486
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE)
|
35079
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35487
35080
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35488
35081
|
WORD_SIZE + // Gas limit
|
35489
35082
|
WORD_SIZE + // Script size
|
@@ -35501,6 +35094,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35501
35094
|
ASSET_ID_LEN + // Asset id
|
35502
35095
|
TX_POINTER_LEN + // TxPointer
|
35503
35096
|
WORD_SIZE + // Witnesses index
|
35097
|
+
WORD_SIZE + // Maturity
|
35504
35098
|
WORD_SIZE + // Predicate size
|
35505
35099
|
WORD_SIZE + // Predicate data size
|
35506
35100
|
WORD_SIZE;
|
@@ -35822,7 +35416,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35822
35416
|
constructor(name, coders) {
|
35823
35417
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35824
35418
|
const encodedValueSize = Object.values(coders).reduce(
|
35825
|
-
(
|
35419
|
+
(max2, coder) => Math.max(max2, coder.encodedLength),
|
35826
35420
|
0
|
35827
35421
|
);
|
35828
35422
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36526,7 +36120,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36526
36120
|
constructor(name, coders) {
|
36527
36121
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36528
36122
|
const encodedValueSize = Object.values(coders).reduce(
|
36529
|
-
(
|
36123
|
+
(max2, coder) => Math.max(max2, coder.encodedLength),
|
36530
36124
|
0
|
36531
36125
|
);
|
36532
36126
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -37228,19 +36822,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37228
36822
|
encode(value) {
|
37229
36823
|
const parts = [];
|
37230
36824
|
parts.push(new B256Coder().encode(value.txID));
|
37231
|
-
parts.push(new NumberCoder("
|
36825
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37232
36826
|
parts.push(new B256Coder().encode(value.owner));
|
37233
36827
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37234
36828
|
parts.push(new B256Coder().encode(value.assetId));
|
37235
36829
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
37236
|
-
parts.push(new NumberCoder("
|
36830
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
36831
|
+
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37237
36832
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37238
|
-
parts.push(new
|
37239
|
-
parts.push(new
|
37240
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37241
|
-
parts.push(
|
37242
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37243
|
-
);
|
36833
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36834
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
36835
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36836
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37244
36837
|
return concat(parts);
|
37245
36838
|
}
|
37246
36839
|
decode(data, offset) {
|
@@ -37248,7 +36841,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37248
36841
|
let o = offset;
|
37249
36842
|
[decoded, o] = new B256Coder().decode(data, o);
|
37250
36843
|
const txID = decoded;
|
37251
|
-
[decoded, o] = new NumberCoder("
|
36844
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37252
36845
|
const outputIndex = decoded;
|
37253
36846
|
[decoded, o] = new B256Coder().decode(data, o);
|
37254
36847
|
const owner = decoded;
|
@@ -37258,17 +36851,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37258
36851
|
const assetId = decoded;
|
37259
36852
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
37260
36853
|
const txPointer = decoded;
|
37261
|
-
[decoded, o] = new NumberCoder("
|
36854
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37262
36855
|
const witnessIndex = Number(decoded);
|
36856
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36857
|
+
const maturity = decoded;
|
37263
36858
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37264
36859
|
const predicateGasUsed = decoded;
|
37265
|
-
[decoded, o] = new
|
36860
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37266
36861
|
const predicateLength = decoded;
|
37267
|
-
[decoded, o] = new
|
36862
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37268
36863
|
const predicateDataLength = decoded;
|
37269
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
36864
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37270
36865
|
const predicate = decoded;
|
37271
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
36866
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37272
36867
|
const predicateData = decoded;
|
37273
36868
|
return [
|
37274
36869
|
{
|
@@ -37280,6 +36875,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37280
36875
|
assetId,
|
37281
36876
|
txPointer,
|
37282
36877
|
witnessIndex,
|
36878
|
+
maturity,
|
37283
36879
|
predicateGasUsed,
|
37284
36880
|
predicateLength,
|
37285
36881
|
predicateDataLength,
|
@@ -37297,7 +36893,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37297
36893
|
encode(value) {
|
37298
36894
|
const parts = [];
|
37299
36895
|
parts.push(new B256Coder().encode(value.txID));
|
37300
|
-
parts.push(new NumberCoder("
|
36896
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37301
36897
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
37302
36898
|
parts.push(new B256Coder().encode(value.stateRoot));
|
37303
36899
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -37309,7 +36905,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37309
36905
|
let o = offset;
|
37310
36906
|
[decoded, o] = new B256Coder().decode(data, o);
|
37311
36907
|
const txID = decoded;
|
37312
|
-
[decoded, o] = new NumberCoder("
|
36908
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37313
36909
|
const outputIndex = decoded;
|
37314
36910
|
[decoded, o] = new B256Coder().decode(data, o);
|
37315
36911
|
const balanceRoot = decoded;
|
@@ -37358,16 +36954,14 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37358
36954
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
37359
36955
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37360
36956
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
37361
|
-
parts.push(new NumberCoder("
|
36957
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
37362
36958
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37363
|
-
parts.push(new
|
37364
|
-
parts.push(new
|
37365
|
-
parts.push(new
|
36959
|
+
parts.push(new NumberCoder("u32").encode(data.length));
|
36960
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36961
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
37366
36962
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
37367
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37368
|
-
parts.push(
|
37369
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37370
|
-
);
|
36963
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36964
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37371
36965
|
return concat(parts);
|
37372
36966
|
}
|
37373
36967
|
static decodeData(messageData) {
|
@@ -37387,21 +36981,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37387
36981
|
const amount = decoded;
|
37388
36982
|
[decoded, o] = new B256Coder().decode(data, o);
|
37389
36983
|
const nonce = decoded;
|
37390
|
-
[decoded, o] = new NumberCoder("
|
36984
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37391
36985
|
const witnessIndex = Number(decoded);
|
37392
36986
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37393
36987
|
const predicateGasUsed = decoded;
|
37394
36988
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37395
36989
|
const dataLength2 = decoded;
|
37396
|
-
[decoded, o] = new
|
36990
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37397
36991
|
const predicateLength = decoded;
|
37398
|
-
[decoded, o] = new
|
36992
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37399
36993
|
const predicateDataLength = decoded;
|
37400
36994
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37401
36995
|
const messageData = decoded;
|
37402
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
36996
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37403
36997
|
const predicate = decoded;
|
37404
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
36998
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37405
36999
|
const predicateData = decoded;
|
37406
37000
|
return [
|
37407
37001
|
{
|
@@ -37713,7 +37307,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37713
37307
|
}
|
37714
37308
|
};
|
37715
37309
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37716
|
-
PolicyType2[PolicyType2["
|
37310
|
+
PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
|
37717
37311
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37718
37312
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37719
37313
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37761,9 +37355,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37761
37355
|
let o = offset;
|
37762
37356
|
const policies = [];
|
37763
37357
|
if (policyTypes & 1) {
|
37764
|
-
const [
|
37358
|
+
const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37765
37359
|
o = nextOffset;
|
37766
|
-
policies.push({ type: 1, data:
|
37360
|
+
policies.push({ type: 1, data: gasPrice });
|
37767
37361
|
}
|
37768
37362
|
if (policyTypes & 2) {
|
37769
37363
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -37995,15 +37589,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37995
37589
|
encode(value) {
|
37996
37590
|
const parts = [];
|
37997
37591
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
37998
|
-
parts.push(new
|
37999
|
-
parts.push(new
|
38000
|
-
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
37592
|
+
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37593
|
+
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
38001
37594
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38002
|
-
parts.push(new NumberCoder("
|
38003
|
-
parts.push(new NumberCoder("
|
38004
|
-
parts.push(new NumberCoder("
|
38005
|
-
parts.push(new
|
38006
|
-
parts.push(new ByteArrayCoder(value.
|
37595
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37596
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37597
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37598
|
+
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37599
|
+
parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
|
37600
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
|
38007
37601
|
parts.push(new PoliciesCoder().encode(value.policies));
|
38008
37602
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38009
37603
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -38015,23 +37609,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38015
37609
|
let o = offset;
|
38016
37610
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38017
37611
|
const scriptGasLimit = decoded;
|
38018
|
-
[decoded, o] = new
|
38019
|
-
const receiptsRoot = decoded;
|
38020
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37612
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38021
37613
|
const scriptLength = decoded;
|
38022
|
-
[decoded, o] = new
|
37614
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38023
37615
|
const scriptDataLength = decoded;
|
38024
37616
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38025
37617
|
const policyTypes = decoded;
|
38026
|
-
[decoded, o] = new NumberCoder("
|
37618
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38027
37619
|
const inputsCount = decoded;
|
38028
|
-
[decoded, o] = new NumberCoder("
|
37620
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38029
37621
|
const outputsCount = decoded;
|
38030
|
-
[decoded, o] = new NumberCoder("
|
37622
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38031
37623
|
const witnessesCount = decoded;
|
38032
|
-
[decoded, o] = new
|
37624
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37625
|
+
const receiptsRoot = decoded;
|
37626
|
+
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38033
37627
|
const script = decoded;
|
38034
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength
|
37628
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38035
37629
|
const scriptData = decoded;
|
38036
37630
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38037
37631
|
const policies = decoded;
|
@@ -38069,19 +37663,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38069
37663
|
}
|
38070
37664
|
encode(value) {
|
38071
37665
|
const parts = [];
|
38072
|
-
parts.push(new NumberCoder("
|
38073
|
-
parts.push(new
|
38074
|
-
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
37666
|
+
parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
|
37667
|
+
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
38075
37668
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38076
|
-
parts.push(new NumberCoder("u16").encode(value.
|
38077
|
-
parts.push(new NumberCoder("
|
38078
|
-
parts.push(new NumberCoder("
|
37669
|
+
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37670
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37671
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37672
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37673
|
+
parts.push(new B256Coder().encode(value.salt));
|
37674
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
38079
37675
|
parts.push(
|
38080
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount
|
38081
|
-
value.storageSlots
|
38082
|
-
)
|
37676
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
|
38083
37677
|
);
|
38084
|
-
parts.push(new PoliciesCoder().encode(value.policies));
|
38085
37678
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38086
37679
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
38087
37680
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -38090,27 +37683,26 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38090
37683
|
decode(data, offset) {
|
38091
37684
|
let decoded;
|
38092
37685
|
let o = offset;
|
38093
|
-
[decoded, o] = new NumberCoder("
|
37686
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37687
|
+
const bytecodeLength = decoded;
|
37688
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38094
37689
|
const bytecodeWitnessIndex = decoded;
|
38095
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38096
|
-
const salt = decoded;
|
38097
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38098
|
-
const storageSlotsCount = decoded;
|
38099
37690
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38100
37691
|
const policyTypes = decoded;
|
38101
37692
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37693
|
+
const storageSlotsCount = decoded;
|
37694
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38102
37695
|
const inputsCount = decoded;
|
38103
|
-
[decoded, o] = new NumberCoder("
|
37696
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38104
37697
|
const outputsCount = decoded;
|
38105
|
-
[decoded, o] = new NumberCoder("
|
37698
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38106
37699
|
const witnessesCount = decoded;
|
38107
|
-
[decoded, o] = new
|
38108
|
-
|
38109
|
-
o
|
38110
|
-
);
|
38111
|
-
const storageSlots = decoded;
|
37700
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37701
|
+
const salt = decoded;
|
38112
37702
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38113
37703
|
const policies = decoded;
|
37704
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37705
|
+
const storageSlots = decoded;
|
38114
37706
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
38115
37707
|
const inputs = decoded;
|
38116
37708
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -38120,6 +37712,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38120
37712
|
return [
|
38121
37713
|
{
|
38122
37714
|
type: 1,
|
37715
|
+
bytecodeLength,
|
38123
37716
|
bytecodeWitnessIndex,
|
38124
37717
|
policyTypes,
|
38125
37718
|
storageSlotsCount,
|
@@ -38148,7 +37741,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38148
37741
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
38149
37742
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
38150
37743
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38151
|
-
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
38152
37744
|
return concat(parts);
|
38153
37745
|
}
|
38154
37746
|
decode(data, offset) {
|
@@ -38164,8 +37756,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38164
37756
|
const mintAmount = decoded;
|
38165
37757
|
[decoded, o] = new B256Coder().decode(data, o);
|
38166
37758
|
const mintAssetId = decoded;
|
38167
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38168
|
-
const gasPrice = decoded;
|
38169
37759
|
return [
|
38170
37760
|
{
|
38171
37761
|
type: 2,
|
@@ -38173,8 +37763,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38173
37763
|
inputContract,
|
38174
37764
|
outputContract,
|
38175
37765
|
mintAmount,
|
38176
|
-
mintAssetId
|
38177
|
-
gasPrice
|
37766
|
+
mintAssetId
|
38178
37767
|
},
|
38179
37768
|
o
|
38180
37769
|
];
|
@@ -38481,6 +38070,159 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38481
38070
|
// src/providers/provider.ts
|
38482
38071
|
var import_graphql_request = __toESM(require_dist2());
|
38483
38072
|
|
38073
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38074
|
+
function _isPlaceholder(a) {
|
38075
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38076
|
+
}
|
38077
|
+
|
38078
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38079
|
+
function _curry1(fn) {
|
38080
|
+
return function f1(a) {
|
38081
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38082
|
+
return f1;
|
38083
|
+
} else {
|
38084
|
+
return fn.apply(this, arguments);
|
38085
|
+
}
|
38086
|
+
};
|
38087
|
+
}
|
38088
|
+
|
38089
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38090
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
38091
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38092
|
+
};
|
38093
|
+
|
38094
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38095
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38096
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38097
|
+
});
|
38098
|
+
var type_default = type;
|
38099
|
+
|
38100
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38101
|
+
var pad = function pad2(n) {
|
38102
|
+
return (n < 10 ? "0" : "") + n;
|
38103
|
+
};
|
38104
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38105
|
+
return d.toISOString();
|
38106
|
+
} : function _toISOString3(d) {
|
38107
|
+
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";
|
38108
|
+
};
|
38109
|
+
|
38110
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38111
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38112
|
+
return n << 0 === n;
|
38113
|
+
};
|
38114
|
+
|
38115
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38116
|
+
function _cloneRegExp(pattern) {
|
38117
|
+
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" : ""));
|
38118
|
+
}
|
38119
|
+
|
38120
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38121
|
+
function _clone(value, deep, map) {
|
38122
|
+
map || (map = new _ObjectMap());
|
38123
|
+
if (_isPrimitive(value)) {
|
38124
|
+
return value;
|
38125
|
+
}
|
38126
|
+
var copy = function copy2(copiedValue) {
|
38127
|
+
var cachedCopy = map.get(value);
|
38128
|
+
if (cachedCopy) {
|
38129
|
+
return cachedCopy;
|
38130
|
+
}
|
38131
|
+
map.set(value, copiedValue);
|
38132
|
+
for (var key in value) {
|
38133
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38134
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38135
|
+
}
|
38136
|
+
}
|
38137
|
+
return copiedValue;
|
38138
|
+
};
|
38139
|
+
switch (type_default(value)) {
|
38140
|
+
case "Object":
|
38141
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
38142
|
+
case "Array":
|
38143
|
+
return copy([]);
|
38144
|
+
case "Date":
|
38145
|
+
return new Date(value.valueOf());
|
38146
|
+
case "RegExp":
|
38147
|
+
return _cloneRegExp(value);
|
38148
|
+
case "Int8Array":
|
38149
|
+
case "Uint8Array":
|
38150
|
+
case "Uint8ClampedArray":
|
38151
|
+
case "Int16Array":
|
38152
|
+
case "Uint16Array":
|
38153
|
+
case "Int32Array":
|
38154
|
+
case "Uint32Array":
|
38155
|
+
case "Float32Array":
|
38156
|
+
case "Float64Array":
|
38157
|
+
case "BigInt64Array":
|
38158
|
+
case "BigUint64Array":
|
38159
|
+
return value.slice();
|
38160
|
+
default:
|
38161
|
+
return value;
|
38162
|
+
}
|
38163
|
+
}
|
38164
|
+
function _isPrimitive(param) {
|
38165
|
+
var type3 = typeof param;
|
38166
|
+
return param == null || type3 != "object" && type3 != "function";
|
38167
|
+
}
|
38168
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
38169
|
+
function _ObjectMap2() {
|
38170
|
+
this.map = {};
|
38171
|
+
this.length = 0;
|
38172
|
+
}
|
38173
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
38174
|
+
const hashedKey = this.hash(key);
|
38175
|
+
let bucket = this.map[hashedKey];
|
38176
|
+
if (!bucket) {
|
38177
|
+
this.map[hashedKey] = bucket = [];
|
38178
|
+
}
|
38179
|
+
bucket.push([key, value]);
|
38180
|
+
this.length += 1;
|
38181
|
+
};
|
38182
|
+
_ObjectMap2.prototype.hash = function(key) {
|
38183
|
+
let hashedKey = [];
|
38184
|
+
for (var value in key) {
|
38185
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38186
|
+
}
|
38187
|
+
return hashedKey.join();
|
38188
|
+
};
|
38189
|
+
_ObjectMap2.prototype.get = function(key) {
|
38190
|
+
if (this.length <= 180) {
|
38191
|
+
for (const p in this.map) {
|
38192
|
+
const bucket2 = this.map[p];
|
38193
|
+
for (let i = 0; i < bucket2.length; i += 1) {
|
38194
|
+
const element = bucket2[i];
|
38195
|
+
if (element[0] === key) {
|
38196
|
+
return element[1];
|
38197
|
+
}
|
38198
|
+
}
|
38199
|
+
}
|
38200
|
+
return;
|
38201
|
+
}
|
38202
|
+
const hashedKey = this.hash(key);
|
38203
|
+
const bucket = this.map[hashedKey];
|
38204
|
+
if (!bucket) {
|
38205
|
+
return;
|
38206
|
+
}
|
38207
|
+
for (let i = 0; i < bucket.length; i += 1) {
|
38208
|
+
const element = bucket[i];
|
38209
|
+
if (element[0] === key) {
|
38210
|
+
return element[1];
|
38211
|
+
}
|
38212
|
+
}
|
38213
|
+
};
|
38214
|
+
return _ObjectMap2;
|
38215
|
+
}();
|
38216
|
+
|
38217
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38218
|
+
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38219
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38220
|
+
});
|
38221
|
+
var clone_default = clone2;
|
38222
|
+
|
38223
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38224
|
+
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38225
|
+
|
38484
38226
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38485
38227
|
var __assign = function() {
|
38486
38228
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41648,10 +41390,14 @@ spurious results.`);
|
|
41648
41390
|
// src/providers/__generated__/operations.ts
|
41649
41391
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41650
41392
|
fragment receiptFragment on Receipt {
|
41651
|
-
|
41393
|
+
contract {
|
41394
|
+
id
|
41395
|
+
}
|
41652
41396
|
pc
|
41653
41397
|
is
|
41654
|
-
to
|
41398
|
+
to {
|
41399
|
+
id
|
41400
|
+
}
|
41655
41401
|
toAddress
|
41656
41402
|
amount
|
41657
41403
|
assetId
|
@@ -41689,16 +41435,10 @@ spurious results.`);
|
|
41689
41435
|
id
|
41690
41436
|
}
|
41691
41437
|
time
|
41692
|
-
receipts {
|
41693
|
-
...receiptFragment
|
41694
|
-
}
|
41695
41438
|
programState {
|
41696
41439
|
returnType
|
41697
41440
|
data
|
41698
41441
|
}
|
41699
|
-
receipts {
|
41700
|
-
...receiptFragment
|
41701
|
-
}
|
41702
41442
|
}
|
41703
41443
|
... on FailureStatus {
|
41704
41444
|
block {
|
@@ -41706,24 +41446,26 @@ spurious results.`);
|
|
41706
41446
|
}
|
41707
41447
|
time
|
41708
41448
|
reason
|
41709
|
-
receipts {
|
41710
|
-
...receiptFragment
|
41711
|
-
}
|
41712
41449
|
}
|
41713
41450
|
... on SqueezedOutStatus {
|
41714
41451
|
reason
|
41715
41452
|
}
|
41716
41453
|
}
|
41717
|
-
|
41454
|
+
`;
|
41718
41455
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41719
41456
|
fragment transactionFragment on Transaction {
|
41720
41457
|
id
|
41721
41458
|
rawPayload
|
41459
|
+
gasPrice
|
41460
|
+
receipts {
|
41461
|
+
...receiptFragment
|
41462
|
+
}
|
41722
41463
|
status {
|
41723
41464
|
...transactionStatusFragment
|
41724
41465
|
}
|
41725
41466
|
}
|
41726
|
-
${
|
41467
|
+
${ReceiptFragmentFragmentDoc}
|
41468
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41727
41469
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41728
41470
|
fragment inputEstimatePredicatesFragment on Input {
|
41729
41471
|
... on InputCoin {
|
@@ -41741,46 +41483,6 @@ spurious results.`);
|
|
41741
41483
|
}
|
41742
41484
|
}
|
41743
41485
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41744
|
-
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41745
|
-
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41746
|
-
reason
|
41747
|
-
programState {
|
41748
|
-
returnType
|
41749
|
-
data
|
41750
|
-
}
|
41751
|
-
}
|
41752
|
-
`;
|
41753
|
-
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41754
|
-
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41755
|
-
programState {
|
41756
|
-
returnType
|
41757
|
-
data
|
41758
|
-
}
|
41759
|
-
}
|
41760
|
-
`;
|
41761
|
-
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41762
|
-
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41763
|
-
... on DryRunFailureStatus {
|
41764
|
-
...dryRunFailureStatusFragment
|
41765
|
-
}
|
41766
|
-
... on DryRunSuccessStatus {
|
41767
|
-
...dryRunSuccessStatusFragment
|
41768
|
-
}
|
41769
|
-
}
|
41770
|
-
${DryRunFailureStatusFragmentFragmentDoc}
|
41771
|
-
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41772
|
-
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41773
|
-
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41774
|
-
id
|
41775
|
-
status {
|
41776
|
-
...dryRunTransactionStatusFragment
|
41777
|
-
}
|
41778
|
-
receipts {
|
41779
|
-
...receiptFragment
|
41780
|
-
}
|
41781
|
-
}
|
41782
|
-
${DryRunTransactionStatusFragmentFragmentDoc}
|
41783
|
-
${ReceiptFragmentFragmentDoc}`;
|
41784
41486
|
var CoinFragmentFragmentDoc = lib_default2`
|
41785
41487
|
fragment coinFragment on Coin {
|
41786
41488
|
__typename
|
@@ -41788,6 +41490,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41788
41490
|
owner
|
41789
41491
|
amount
|
41790
41492
|
assetId
|
41493
|
+
maturity
|
41791
41494
|
blockCreated
|
41792
41495
|
txCreatedIdx
|
41793
41496
|
}
|
@@ -41832,6 +41535,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41832
41535
|
prevRoot
|
41833
41536
|
time
|
41834
41537
|
applicationHash
|
41538
|
+
messageReceiptRoot
|
41835
41539
|
messageReceiptCount
|
41836
41540
|
}
|
41837
41541
|
commitBlockHeader {
|
@@ -41843,6 +41547,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41843
41547
|
prevRoot
|
41844
41548
|
time
|
41845
41549
|
applicationHash
|
41550
|
+
messageReceiptRoot
|
41846
41551
|
messageReceiptCount
|
41847
41552
|
}
|
41848
41553
|
sender
|
@@ -41862,8 +41567,8 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41862
41567
|
var BlockFragmentFragmentDoc = lib_default2`
|
41863
41568
|
fragment blockFragment on Block {
|
41864
41569
|
id
|
41865
|
-
height
|
41866
41570
|
header {
|
41571
|
+
height
|
41867
41572
|
time
|
41868
41573
|
}
|
41869
41574
|
transactions {
|
@@ -41921,11 +41626,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41921
41626
|
`;
|
41922
41627
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41923
41628
|
fragment GasCostsFragment on GasCosts {
|
41924
|
-
version {
|
41925
|
-
... on Version {
|
41926
|
-
value
|
41927
|
-
}
|
41928
|
-
}
|
41929
41629
|
add
|
41930
41630
|
addi
|
41931
41631
|
aloc
|
@@ -41938,6 +41638,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41938
41638
|
cb
|
41939
41639
|
cfei
|
41940
41640
|
cfsi
|
41641
|
+
croo
|
41941
41642
|
div
|
41942
41643
|
divi
|
41943
41644
|
ecr1
|
@@ -42020,9 +41721,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42020
41721
|
ccp {
|
42021
41722
|
...DependentCostFragment
|
42022
41723
|
}
|
42023
|
-
croo {
|
42024
|
-
...DependentCostFragment
|
42025
|
-
}
|
42026
41724
|
csiz {
|
42027
41725
|
...DependentCostFragment
|
42028
41726
|
}
|
@@ -42082,11 +41780,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42082
41780
|
${DependentCostFragmentFragmentDoc}`;
|
42083
41781
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
42084
41782
|
fragment consensusParametersFragment on ConsensusParameters {
|
42085
|
-
version {
|
42086
|
-
... on Version {
|
42087
|
-
value
|
42088
|
-
}
|
42089
|
-
}
|
42090
41783
|
txParams {
|
42091
41784
|
...TxParametersFragment
|
42092
41785
|
}
|
@@ -42146,9 +41839,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42146
41839
|
fragment nodeInfoFragment on NodeInfo {
|
42147
41840
|
utxoValidation
|
42148
41841
|
vmBacktrace
|
41842
|
+
minGasPrice
|
42149
41843
|
maxTx
|
42150
41844
|
maxDepth
|
42151
41845
|
nodeVersion
|
41846
|
+
peers {
|
41847
|
+
id
|
41848
|
+
addresses
|
41849
|
+
clientVersion
|
41850
|
+
blockHeight
|
41851
|
+
lastHeartbeatMs
|
41852
|
+
appScore
|
41853
|
+
}
|
42152
41854
|
}
|
42153
41855
|
`;
|
42154
41856
|
var GetVersionDocument = lib_default2`
|
@@ -42183,9 +41885,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42183
41885
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
42184
41886
|
transaction(id: $transactionId) {
|
42185
41887
|
...transactionFragment
|
41888
|
+
receipts {
|
41889
|
+
...receiptFragment
|
41890
|
+
}
|
42186
41891
|
}
|
42187
41892
|
}
|
42188
|
-
${TransactionFragmentFragmentDoc}
|
41893
|
+
${TransactionFragmentFragmentDoc}
|
41894
|
+
${ReceiptFragmentFragmentDoc}`;
|
42189
41895
|
var GetTransactionsDocument = lib_default2`
|
42190
41896
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
42191
41897
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42313,20 +42019,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42313
42019
|
}
|
42314
42020
|
}
|
42315
42021
|
${BalanceFragmentFragmentDoc}`;
|
42316
|
-
var GetLatestGasPriceDocument = lib_default2`
|
42317
|
-
query getLatestGasPrice {
|
42318
|
-
latestGasPrice {
|
42319
|
-
gasPrice
|
42320
|
-
}
|
42321
|
-
}
|
42322
|
-
`;
|
42323
|
-
var EstimateGasPriceDocument = lib_default2`
|
42324
|
-
query estimateGasPrice($blockHorizon: U32!) {
|
42325
|
-
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42326
|
-
gasPrice
|
42327
|
-
}
|
42328
|
-
}
|
42329
|
-
`;
|
42330
42022
|
var GetBalancesDocument = lib_default2`
|
42331
42023
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42332
42024
|
balances(
|
@@ -42381,12 +42073,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42381
42073
|
}
|
42382
42074
|
`;
|
42383
42075
|
var DryRunDocument = lib_default2`
|
42384
|
-
mutation dryRun($
|
42385
|
-
dryRun(
|
42386
|
-
...
|
42076
|
+
mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
|
42077
|
+
dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
|
42078
|
+
...receiptFragment
|
42387
42079
|
}
|
42388
42080
|
}
|
42389
|
-
${
|
42081
|
+
${ReceiptFragmentFragmentDoc}`;
|
42390
42082
|
var SubmitDocument = lib_default2`
|
42391
42083
|
mutation submit($encodedTransaction: HexString!) {
|
42392
42084
|
submit(tx: $encodedTransaction) {
|
@@ -42469,12 +42161,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42469
42161
|
getBalance(variables, options) {
|
42470
42162
|
return requester(GetBalanceDocument, variables, options);
|
42471
42163
|
},
|
42472
|
-
getLatestGasPrice(variables, options) {
|
42473
|
-
return requester(GetLatestGasPriceDocument, variables, options);
|
42474
|
-
},
|
42475
|
-
estimateGasPrice(variables, options) {
|
42476
|
-
return requester(EstimateGasPriceDocument, variables, options);
|
42477
|
-
},
|
42478
42164
|
getBalances(variables, options) {
|
42479
42165
|
return requester(GetBalancesDocument, variables, options);
|
42480
42166
|
},
|
@@ -42542,14 +42228,11 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42542
42228
|
let data;
|
42543
42229
|
let errors;
|
42544
42230
|
try {
|
42545
|
-
|
42546
|
-
({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
|
42231
|
+
({ data, errors } = JSON.parse(text.replace(/^data:/, "")));
|
42547
42232
|
} catch (e) {
|
42548
42233
|
throw new FuelError(
|
42549
42234
|
ErrorCode.STREAM_PARSING_ERROR,
|
42550
|
-
`Error while parsing stream data response: ${text}
|
42551
|
-
|
42552
|
-
Thrown error: ${e}`
|
42235
|
+
`Error while parsing stream data response: ${text}`
|
42553
42236
|
);
|
42554
42237
|
}
|
42555
42238
|
if (Array.isArray(errors)) {
|
@@ -42633,6 +42316,9 @@ Thrown error: ${e}`
|
|
42633
42316
|
}
|
42634
42317
|
};
|
42635
42318
|
|
42319
|
+
// ../address/dist/configs.mjs
|
42320
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42321
|
+
|
42636
42322
|
// src/providers/transaction-request/input.ts
|
42637
42323
|
var inputify = (value) => {
|
42638
42324
|
const { type: type3 } = value;
|
@@ -42643,7 +42329,7 @@ Thrown error: ${e}`
|
|
42643
42329
|
return {
|
42644
42330
|
type: InputType.Coin,
|
42645
42331
|
txID: hexlify(arrayify(value.id).slice(0, 32)),
|
42646
|
-
outputIndex:
|
42332
|
+
outputIndex: arrayify(value.id)[32],
|
42647
42333
|
owner: hexlify(value.owner),
|
42648
42334
|
amount: bn(value.amount),
|
42649
42335
|
assetId: hexlify(value.assetId),
|
@@ -42652,9 +42338,10 @@ Thrown error: ${e}`
|
|
42652
42338
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42653
42339
|
},
|
42654
42340
|
witnessIndex: value.witnessIndex,
|
42341
|
+
maturity: value.maturity ?? 0,
|
42655
42342
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42656
|
-
predicateLength:
|
42657
|
-
predicateDataLength:
|
42343
|
+
predicateLength: predicate.length,
|
42344
|
+
predicateDataLength: predicateData.length,
|
42658
42345
|
predicate: hexlify(predicate),
|
42659
42346
|
predicateData: hexlify(predicateData)
|
42660
42347
|
};
|
@@ -42685,8 +42372,8 @@ Thrown error: ${e}`
|
|
42685
42372
|
nonce: hexlify(value.nonce),
|
42686
42373
|
witnessIndex: value.witnessIndex,
|
42687
42374
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42688
|
-
predicateLength:
|
42689
|
-
predicateDataLength:
|
42375
|
+
predicateLength: predicate.length,
|
42376
|
+
predicateDataLength: predicateData.length,
|
42690
42377
|
predicate: hexlify(predicate),
|
42691
42378
|
predicateData: hexlify(predicateData),
|
42692
42379
|
data: hexlify(data),
|
@@ -42843,8 +42530,8 @@ Thrown error: ${e}`
|
|
42843
42530
|
case "CALL" /* Call */: {
|
42844
42531
|
const callReceipt = {
|
42845
42532
|
type: ReceiptType.Call,
|
42846
|
-
from: hexOrZero(receipt.id
|
42847
|
-
to: hexOrZero(receipt?.to),
|
42533
|
+
from: hexOrZero(receipt.contract?.id),
|
42534
|
+
to: hexOrZero(receipt?.to?.id),
|
42848
42535
|
amount: bn(receipt.amount),
|
42849
42536
|
assetId: hexOrZero(receipt.assetId),
|
42850
42537
|
gas: bn(receipt.gas),
|
@@ -42858,7 +42545,7 @@ Thrown error: ${e}`
|
|
42858
42545
|
case "RETURN" /* Return */: {
|
42859
42546
|
const returnReceipt = {
|
42860
42547
|
type: ReceiptType.Return,
|
42861
|
-
id: hexOrZero(receipt.id
|
42548
|
+
id: hexOrZero(receipt.contract?.id),
|
42862
42549
|
val: bn(receipt.val),
|
42863
42550
|
pc: bn(receipt.pc),
|
42864
42551
|
is: bn(receipt.is)
|
@@ -42868,7 +42555,7 @@ Thrown error: ${e}`
|
|
42868
42555
|
case "RETURN_DATA" /* ReturnData */: {
|
42869
42556
|
const returnDataReceipt = {
|
42870
42557
|
type: ReceiptType.ReturnData,
|
42871
|
-
id: hexOrZero(receipt.id
|
42558
|
+
id: hexOrZero(receipt.contract?.id),
|
42872
42559
|
ptr: bn(receipt.ptr),
|
42873
42560
|
len: bn(receipt.len),
|
42874
42561
|
digest: hexOrZero(receipt.digest),
|
@@ -42880,7 +42567,7 @@ Thrown error: ${e}`
|
|
42880
42567
|
case "PANIC" /* Panic */: {
|
42881
42568
|
const panicReceipt = {
|
42882
42569
|
type: ReceiptType.Panic,
|
42883
|
-
id: hexOrZero(receipt.id),
|
42570
|
+
id: hexOrZero(receipt.contract?.id),
|
42884
42571
|
reason: bn(receipt.reason),
|
42885
42572
|
pc: bn(receipt.pc),
|
42886
42573
|
is: bn(receipt.is),
|
@@ -42891,7 +42578,7 @@ Thrown error: ${e}`
|
|
42891
42578
|
case "REVERT" /* Revert */: {
|
42892
42579
|
const revertReceipt = {
|
42893
42580
|
type: ReceiptType.Revert,
|
42894
|
-
id: hexOrZero(receipt.id
|
42581
|
+
id: hexOrZero(receipt.contract?.id),
|
42895
42582
|
val: bn(receipt.ra),
|
42896
42583
|
pc: bn(receipt.pc),
|
42897
42584
|
is: bn(receipt.is)
|
@@ -42901,7 +42588,7 @@ Thrown error: ${e}`
|
|
42901
42588
|
case "LOG" /* Log */: {
|
42902
42589
|
const logReceipt = {
|
42903
42590
|
type: ReceiptType.Log,
|
42904
|
-
id: hexOrZero(receipt.id
|
42591
|
+
id: hexOrZero(receipt.contract?.id),
|
42905
42592
|
val0: bn(receipt.ra),
|
42906
42593
|
val1: bn(receipt.rb),
|
42907
42594
|
val2: bn(receipt.rc),
|
@@ -42914,7 +42601,7 @@ Thrown error: ${e}`
|
|
42914
42601
|
case "LOG_DATA" /* LogData */: {
|
42915
42602
|
const logDataReceipt = {
|
42916
42603
|
type: ReceiptType.LogData,
|
42917
|
-
id: hexOrZero(receipt.id
|
42604
|
+
id: hexOrZero(receipt.contract?.id),
|
42918
42605
|
val0: bn(receipt.ra),
|
42919
42606
|
val1: bn(receipt.rb),
|
42920
42607
|
ptr: bn(receipt.ptr),
|
@@ -42928,8 +42615,8 @@ Thrown error: ${e}`
|
|
42928
42615
|
case "TRANSFER" /* Transfer */: {
|
42929
42616
|
const transferReceipt = {
|
42930
42617
|
type: ReceiptType.Transfer,
|
42931
|
-
from: hexOrZero(receipt.id
|
42932
|
-
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42618
|
+
from: hexOrZero(receipt.contract?.id),
|
42619
|
+
to: hexOrZero(receipt.toAddress || receipt?.to?.id),
|
42933
42620
|
amount: bn(receipt.amount),
|
42934
42621
|
assetId: hexOrZero(receipt.assetId),
|
42935
42622
|
pc: bn(receipt.pc),
|
@@ -42940,8 +42627,8 @@ Thrown error: ${e}`
|
|
42940
42627
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42941
42628
|
const transferOutReceipt = {
|
42942
42629
|
type: ReceiptType.TransferOut,
|
42943
|
-
from: hexOrZero(receipt.id
|
42944
|
-
to: hexOrZero(receipt.toAddress || receipt.to),
|
42630
|
+
from: hexOrZero(receipt.contract?.id),
|
42631
|
+
to: hexOrZero(receipt.toAddress || receipt.to?.id),
|
42945
42632
|
amount: bn(receipt.amount),
|
42946
42633
|
assetId: hexOrZero(receipt.assetId),
|
42947
42634
|
pc: bn(receipt.pc),
|
@@ -42984,7 +42671,7 @@ Thrown error: ${e}`
|
|
42984
42671
|
return receiptMessageOut;
|
42985
42672
|
}
|
42986
42673
|
case "MINT" /* Mint */: {
|
42987
|
-
const contractId = hexOrZero(receipt.id
|
42674
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
42988
42675
|
const subId = hexOrZero(receipt.subId);
|
42989
42676
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
42990
42677
|
const mintReceipt = {
|
@@ -42999,7 +42686,7 @@ Thrown error: ${e}`
|
|
42999
42686
|
return mintReceipt;
|
43000
42687
|
}
|
43001
42688
|
case "BURN" /* Burn */: {
|
43002
|
-
const contractId = hexOrZero(receipt.id
|
42689
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
43003
42690
|
const subId = hexOrZero(receipt.subId);
|
43004
42691
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
43005
42692
|
const burnReceipt = {
|
@@ -43019,6 +42706,7 @@ Thrown error: ${e}`
|
|
43019
42706
|
}
|
43020
42707
|
|
43021
42708
|
// src/providers/utils/gas.ts
|
42709
|
+
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
43022
42710
|
var getGasUsedFromReceipts = (receipts) => {
|
43023
42711
|
const scriptResult = receipts.filter(
|
43024
42712
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -43039,28 +42727,18 @@ Thrown error: ${e}`
|
|
43039
42727
|
}
|
43040
42728
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
43041
42729
|
const witnessCache = [];
|
43042
|
-
const
|
43043
|
-
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43044
|
-
if (isCoinOrMessage) {
|
43045
|
-
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43046
|
-
return true;
|
43047
|
-
}
|
43048
|
-
if (!witnessCache.includes(input.witnessIndex)) {
|
43049
|
-
witnessCache.push(input.witnessIndex);
|
43050
|
-
return true;
|
43051
|
-
}
|
43052
|
-
}
|
43053
|
-
return false;
|
43054
|
-
});
|
43055
|
-
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43056
|
-
const totalGas = chargeableInputs.reduce((total, input) => {
|
42730
|
+
const totalGas = inputs.reduce((total, input) => {
|
43057
42731
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43058
42732
|
return total.add(
|
43059
|
-
|
42733
|
+
resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
43060
42734
|
);
|
43061
42735
|
}
|
43062
|
-
|
43063
|
-
|
42736
|
+
if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
|
42737
|
+
witnessCache.push(input.witnessIndex);
|
42738
|
+
return total.add(gasCosts.ecr1);
|
42739
|
+
}
|
42740
|
+
return total;
|
42741
|
+
}, bn());
|
43064
42742
|
return totalGas;
|
43065
42743
|
}
|
43066
42744
|
function getMinGas(params) {
|
@@ -43072,20 +42750,12 @@ Thrown error: ${e}`
|
|
43072
42750
|
return minGas;
|
43073
42751
|
}
|
43074
42752
|
function getMaxGas(params) {
|
43075
|
-
const {
|
43076
|
-
gasPerByte,
|
43077
|
-
witnessesLength,
|
43078
|
-
witnessLimit,
|
43079
|
-
minGas,
|
43080
|
-
gasLimit = bn(0),
|
43081
|
-
maxGasPerTx
|
43082
|
-
} = params;
|
42753
|
+
const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
|
43083
42754
|
let remainingAllowedWitnessGas = bn(0);
|
43084
42755
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
43085
42756
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
43086
42757
|
}
|
43087
|
-
|
43088
|
-
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42758
|
+
return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43089
42759
|
}
|
43090
42760
|
function calculateMetadataGasForTxCreate({
|
43091
42761
|
gasCosts,
|
@@ -43107,10 +42777,6 @@ Thrown error: ${e}`
|
|
43107
42777
|
}) {
|
43108
42778
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
43109
42779
|
}
|
43110
|
-
var calculateGasFee = (params) => {
|
43111
|
-
const { gas, gasPrice, priceFactor, tip } = params;
|
43112
|
-
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43113
|
-
};
|
43114
42780
|
|
43115
42781
|
// src/providers/utils/json.ts
|
43116
42782
|
function normalize2(object) {
|
@@ -43240,7 +42906,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43240
42906
|
// src/providers/transaction-request/transaction-request.ts
|
43241
42907
|
var BaseTransactionRequest = class {
|
43242
42908
|
/** Gas price for transaction */
|
43243
|
-
|
42909
|
+
gasPrice;
|
43244
42910
|
/** Block until which tx cannot be included */
|
43245
42911
|
maturity;
|
43246
42912
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -43253,34 +42919,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43253
42919
|
outputs = [];
|
43254
42920
|
/** List of witnesses */
|
43255
42921
|
witnesses = [];
|
42922
|
+
/** Base asset ID - should be fetched from the chain */
|
42923
|
+
baseAssetId = ZeroBytes32;
|
43256
42924
|
/**
|
43257
42925
|
* Constructor for initializing a base transaction request.
|
43258
42926
|
*
|
43259
42927
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
43260
42928
|
*/
|
43261
42929
|
constructor({
|
43262
|
-
|
42930
|
+
gasPrice,
|
43263
42931
|
maturity,
|
43264
42932
|
maxFee,
|
43265
42933
|
witnessLimit,
|
43266
42934
|
inputs,
|
43267
42935
|
outputs,
|
43268
|
-
witnesses
|
42936
|
+
witnesses,
|
42937
|
+
baseAssetId
|
43269
42938
|
} = {}) {
|
43270
|
-
this.
|
42939
|
+
this.gasPrice = bn(gasPrice);
|
43271
42940
|
this.maturity = maturity ?? 0;
|
43272
42941
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
43273
42942
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
43274
42943
|
this.inputs = inputs ?? [];
|
43275
42944
|
this.outputs = outputs ?? [];
|
43276
42945
|
this.witnesses = witnesses ?? [];
|
42946
|
+
this.baseAssetId = baseAssetId ?? ZeroBytes32;
|
43277
42947
|
}
|
43278
42948
|
static getPolicyMeta(req) {
|
43279
42949
|
let policyTypes = 0;
|
43280
42950
|
const policies = [];
|
43281
|
-
if (req.
|
43282
|
-
policyTypes += PolicyType.
|
43283
|
-
policies.push({ data: req.
|
42951
|
+
if (req.gasPrice) {
|
42952
|
+
policyTypes += PolicyType.GasPrice;
|
42953
|
+
policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
|
43284
42954
|
}
|
43285
42955
|
if (req.witnessLimit) {
|
43286
42956
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43467,10 +43137,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43467
43137
|
* @param predicate - Predicate bytes.
|
43468
43138
|
* @param predicateData - Predicate data bytes.
|
43469
43139
|
*/
|
43470
|
-
addCoinInput(coin) {
|
43140
|
+
addCoinInput(coin, predicate) {
|
43471
43141
|
const { assetId, owner, amount } = coin;
|
43472
43142
|
let witnessIndex;
|
43473
|
-
if (
|
43143
|
+
if (predicate) {
|
43474
43144
|
witnessIndex = 0;
|
43475
43145
|
} else {
|
43476
43146
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43485,7 +43155,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43485
43155
|
amount,
|
43486
43156
|
assetId,
|
43487
43157
|
txPointer: "0x00000000000000000000000000000000",
|
43488
|
-
witnessIndex
|
43158
|
+
witnessIndex,
|
43159
|
+
predicate: predicate?.bytes
|
43489
43160
|
};
|
43490
43161
|
this.pushInput(input);
|
43491
43162
|
this.addChangeOutput(owner, assetId);
|
@@ -43496,13 +43167,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43496
43167
|
*
|
43497
43168
|
* @param message - Message resource.
|
43498
43169
|
* @param predicate - Predicate bytes.
|
43499
|
-
* @param predicateData - Predicate data bytes.
|
43500
43170
|
*/
|
43501
|
-
addMessageInput(message) {
|
43171
|
+
addMessageInput(message, predicate) {
|
43502
43172
|
const { recipient, sender, amount } = message;
|
43503
|
-
const assetId = BaseAssetId;
|
43504
43173
|
let witnessIndex;
|
43505
|
-
if (
|
43174
|
+
if (predicate) {
|
43506
43175
|
witnessIndex = 0;
|
43507
43176
|
} else {
|
43508
43177
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43516,10 +43185,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43516
43185
|
sender: sender.toB256(),
|
43517
43186
|
recipient: recipient.toB256(),
|
43518
43187
|
amount,
|
43519
|
-
witnessIndex
|
43188
|
+
witnessIndex,
|
43189
|
+
predicate: predicate?.bytes
|
43520
43190
|
};
|
43521
43191
|
this.pushInput(input);
|
43522
|
-
this.addChangeOutput(recipient,
|
43192
|
+
this.addChangeOutput(recipient, this.baseAssetId);
|
43523
43193
|
}
|
43524
43194
|
/**
|
43525
43195
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -43547,6 +43217,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43547
43217
|
resources.forEach((resource) => this.addResource(resource));
|
43548
43218
|
return this;
|
43549
43219
|
}
|
43220
|
+
/**
|
43221
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43222
|
+
* outputs from the related assetIds.
|
43223
|
+
*
|
43224
|
+
* @param resources - The resources to add.
|
43225
|
+
* @returns This transaction.
|
43226
|
+
*/
|
43227
|
+
addPredicateResource(resource, predicate) {
|
43228
|
+
if (isCoin(resource)) {
|
43229
|
+
this.addCoinInput(resource, predicate);
|
43230
|
+
} else {
|
43231
|
+
this.addMessageInput(resource, predicate);
|
43232
|
+
}
|
43233
|
+
return this;
|
43234
|
+
}
|
43235
|
+
/**
|
43236
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43237
|
+
* from the related assetIds.
|
43238
|
+
*
|
43239
|
+
* @param resources - The resources to add.
|
43240
|
+
* @returns This transaction.
|
43241
|
+
*/
|
43242
|
+
addPredicateResources(resources, predicate) {
|
43243
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43244
|
+
return this;
|
43245
|
+
}
|
43550
43246
|
/**
|
43551
43247
|
* Adds a coin output to the transaction.
|
43552
43248
|
*
|
@@ -43554,12 +43250,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43554
43250
|
* @param amount - Amount of coin.
|
43555
43251
|
* @param assetId - Asset ID of coin.
|
43556
43252
|
*/
|
43557
|
-
addCoinOutput(to, amount, assetId
|
43253
|
+
addCoinOutput(to, amount, assetId) {
|
43558
43254
|
this.pushOutput({
|
43559
43255
|
type: OutputType.Coin,
|
43560
43256
|
to: addressify(to).toB256(),
|
43561
43257
|
amount,
|
43562
|
-
assetId
|
43258
|
+
assetId: assetId ?? this.baseAssetId
|
43563
43259
|
});
|
43564
43260
|
return this;
|
43565
43261
|
}
|
@@ -43586,7 +43282,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43586
43282
|
* @param to - Address of the owner.
|
43587
43283
|
* @param assetId - Asset ID of coin.
|
43588
43284
|
*/
|
43589
|
-
addChangeOutput(to, assetId
|
43285
|
+
addChangeOutput(to, assetId) {
|
43590
43286
|
const changeOutput = this.getChangeOutputs().find(
|
43591
43287
|
(output3) => hexlify(output3.assetId) === assetId
|
43592
43288
|
);
|
@@ -43594,7 +43290,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43594
43290
|
this.pushOutput({
|
43595
43291
|
type: OutputType.Change,
|
43596
43292
|
to: addressify(to).toB256(),
|
43597
|
-
assetId
|
43293
|
+
assetId: assetId ?? this.baseAssetId
|
43598
43294
|
});
|
43599
43295
|
}
|
43600
43296
|
}
|
@@ -43626,7 +43322,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43626
43322
|
}
|
43627
43323
|
calculateMaxGas(chainInfo, minGas) {
|
43628
43324
|
const { consensusParameters } = chainInfo;
|
43629
|
-
const { gasPerByte
|
43325
|
+
const { gasPerByte } = consensusParameters;
|
43630
43326
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43631
43327
|
(acc, wit) => acc + wit.dataLength,
|
43632
43328
|
0
|
@@ -43635,8 +43331,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43635
43331
|
gasPerByte,
|
43636
43332
|
minGas,
|
43637
43333
|
witnessesLength,
|
43638
|
-
witnessLimit: this.witnessLimit
|
43639
|
-
maxGasPerTx
|
43334
|
+
witnessLimit: this.witnessLimit
|
43640
43335
|
});
|
43641
43336
|
}
|
43642
43337
|
/**
|
@@ -43646,6 +43341,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43646
43341
|
* @param quantities - CoinQuantity Array.
|
43647
43342
|
*/
|
43648
43343
|
fundWithFakeUtxos(quantities, resourcesOwner) {
|
43344
|
+
let idCounter = 0;
|
43345
|
+
const generateId = () => {
|
43346
|
+
const counterString = String(idCounter++);
|
43347
|
+
const id = ZeroBytes32.slice(0, -counterString.length).concat(counterString);
|
43348
|
+
return id;
|
43349
|
+
};
|
43649
43350
|
const findAssetInput = (assetId) => this.inputs.find((input) => {
|
43650
43351
|
if ("assetId" in input) {
|
43651
43352
|
return input.assetId === assetId;
|
@@ -43654,27 +43355,24 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43654
43355
|
});
|
43655
43356
|
const updateAssetInput = (assetId, quantity) => {
|
43656
43357
|
const assetInput = findAssetInput(assetId);
|
43657
|
-
let usedQuantity = quantity;
|
43658
|
-
if (assetId === BaseAssetId) {
|
43659
|
-
usedQuantity = bn("1000000000000000000");
|
43660
|
-
}
|
43661
43358
|
if (assetInput && "assetId" in assetInput) {
|
43662
|
-
assetInput.id =
|
43663
|
-
assetInput.amount =
|
43359
|
+
assetInput.id = generateId();
|
43360
|
+
assetInput.amount = quantity;
|
43664
43361
|
} else {
|
43665
43362
|
this.addResources([
|
43666
43363
|
{
|
43667
|
-
id:
|
43668
|
-
amount:
|
43364
|
+
id: generateId(),
|
43365
|
+
amount: quantity,
|
43669
43366
|
assetId,
|
43670
43367
|
owner: resourcesOwner || Address.fromRandom(),
|
43368
|
+
maturity: 0,
|
43671
43369
|
blockCreated: bn(1),
|
43672
43370
|
txCreatedIdx: bn(1)
|
43673
43371
|
}
|
43674
43372
|
]);
|
43675
43373
|
}
|
43676
43374
|
};
|
43677
|
-
updateAssetInput(
|
43375
|
+
updateAssetInput(this.baseAssetId, bn(1e11));
|
43678
43376
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43679
43377
|
}
|
43680
43378
|
/**
|
@@ -43699,7 +43397,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43699
43397
|
toJSON() {
|
43700
43398
|
return normalizeJSON(this);
|
43701
43399
|
}
|
43702
|
-
|
43400
|
+
updatePredicateInputs(inputs) {
|
43703
43401
|
this.inputs.forEach((i) => {
|
43704
43402
|
let correspondingInput;
|
43705
43403
|
switch (i.type) {
|
@@ -43721,15 +43419,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43721
43419
|
}
|
43722
43420
|
});
|
43723
43421
|
}
|
43724
|
-
shiftPredicateData() {
|
43725
|
-
this.inputs.forEach((input) => {
|
43726
|
-
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43727
|
-
input.predicateData = input.paddPredicateData(
|
43728
|
-
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43729
|
-
);
|
43730
|
-
}
|
43731
|
-
});
|
43732
|
-
}
|
43733
43422
|
};
|
43734
43423
|
|
43735
43424
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43863,8 +43552,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43863
43552
|
return {
|
43864
43553
|
type: TransactionType.Create,
|
43865
43554
|
...baseTransaction,
|
43555
|
+
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43866
43556
|
bytecodeWitnessIndex,
|
43867
|
-
storageSlotsCount:
|
43557
|
+
storageSlotsCount: storageSlots.length,
|
43868
43558
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43869
43559
|
storageSlots
|
43870
43560
|
};
|
@@ -43978,8 +43668,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43978
43668
|
type: TransactionType.Script,
|
43979
43669
|
scriptGasLimit: this.gasLimit,
|
43980
43670
|
...super.getBaseTransaction(),
|
43981
|
-
scriptLength:
|
43982
|
-
scriptDataLength:
|
43671
|
+
scriptLength: script.length,
|
43672
|
+
scriptDataLength: scriptData.length,
|
43983
43673
|
receiptsRoot: ZeroBytes32,
|
43984
43674
|
script: hexlify(script),
|
43985
43675
|
scriptData: hexlify(scriptData)
|
@@ -44043,7 +43733,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44043
43733
|
}
|
44044
43734
|
calculateMaxGas(chainInfo, minGas) {
|
44045
43735
|
const { consensusParameters } = chainInfo;
|
44046
|
-
const { gasPerByte
|
43736
|
+
const { gasPerByte } = consensusParameters;
|
44047
43737
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
44048
43738
|
(acc, wit) => acc + wit.dataLength,
|
44049
43739
|
0
|
@@ -44053,8 +43743,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44053
43743
|
minGas,
|
44054
43744
|
witnessesLength,
|
44055
43745
|
witnessLimit: this.witnessLimit,
|
44056
|
-
gasLimit: this.gasLimit
|
44057
|
-
maxGasPerTx
|
43746
|
+
gasLimit: this.gasLimit
|
44058
43747
|
});
|
44059
43748
|
}
|
44060
43749
|
/**
|
@@ -44127,29 +43816,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44127
43816
|
}
|
44128
43817
|
}
|
44129
43818
|
};
|
44130
|
-
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44131
|
-
(acc, input) => {
|
44132
|
-
if (input.type === InputType.Coin && input.owner === owner) {
|
44133
|
-
acc.utxos.push(input.id);
|
44134
|
-
}
|
44135
|
-
if (input.type === InputType.Message && input.recipient === owner) {
|
44136
|
-
acc.messages.push(input.nonce);
|
44137
|
-
}
|
44138
|
-
return acc;
|
44139
|
-
},
|
44140
|
-
{
|
44141
|
-
utxos: [],
|
44142
|
-
messages: []
|
44143
|
-
}
|
44144
|
-
);
|
44145
43819
|
|
44146
43820
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
44147
43821
|
var calculateTransactionFee = (params) => {
|
44148
43822
|
const {
|
44149
|
-
|
43823
|
+
gasUsed,
|
44150
43824
|
rawPayload,
|
44151
|
-
|
44152
|
-
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43825
|
+
consensusParameters: { gasCosts, feeParams }
|
44153
43826
|
} = params;
|
44154
43827
|
const gasPerByte = bn(feeParams.gasPerByte);
|
44155
43828
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -44159,7 +43832,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44159
43832
|
return {
|
44160
43833
|
fee: bn(0),
|
44161
43834
|
minFee: bn(0),
|
44162
|
-
maxFee: bn(0)
|
43835
|
+
maxFee: bn(0),
|
43836
|
+
feeFromGasUsed: bn(0)
|
44163
43837
|
};
|
44164
43838
|
}
|
44165
43839
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -44191,6 +43865,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44191
43865
|
metadataGas,
|
44192
43866
|
txBytesSize: transactionBytes.length
|
44193
43867
|
});
|
43868
|
+
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
44194
43869
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
44195
43870
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
44196
43871
|
const maxGas = getMaxGas({
|
@@ -44198,25 +43873,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44198
43873
|
minGas,
|
44199
43874
|
witnessesLength,
|
44200
43875
|
gasLimit,
|
44201
|
-
witnessLimit
|
44202
|
-
maxGasPerTx
|
44203
|
-
});
|
44204
|
-
const minFee = calculateGasFee({
|
44205
|
-
gasPrice,
|
44206
|
-
gas: minGas,
|
44207
|
-
priceFactor: gasPriceFactor,
|
44208
|
-
tip
|
44209
|
-
});
|
44210
|
-
const maxFee = calculateGasFee({
|
44211
|
-
gasPrice,
|
44212
|
-
gas: maxGas,
|
44213
|
-
priceFactor: gasPriceFactor,
|
44214
|
-
tip
|
43876
|
+
witnessLimit
|
44215
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);
|
44216
43882
|
return {
|
43883
|
+
fee,
|
44217
43884
|
minFee,
|
44218
43885
|
maxFee,
|
44219
|
-
|
43886
|
+
feeFromGasUsed
|
44220
43887
|
};
|
44221
43888
|
};
|
44222
43889
|
|
@@ -44770,9 +44437,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44770
44437
|
gqlTransactionStatus,
|
44771
44438
|
abiMap = {},
|
44772
44439
|
maxInputs,
|
44773
|
-
gasCosts
|
44774
|
-
maxGasPerTx,
|
44775
|
-
gasPrice
|
44440
|
+
gasCosts
|
44776
44441
|
} = params;
|
44777
44442
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44778
44443
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44786,14 +44451,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44786
44451
|
maxInputs
|
44787
44452
|
});
|
44788
44453
|
const typeName = getTransactionTypeName(transaction.type);
|
44789
|
-
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44790
44454
|
const { fee } = calculateTransactionFee({
|
44791
|
-
|
44455
|
+
gasUsed,
|
44792
44456
|
rawPayload,
|
44793
|
-
tip,
|
44794
44457
|
consensusParameters: {
|
44795
44458
|
gasCosts,
|
44796
|
-
maxGasPerTx,
|
44797
44459
|
feeParams: {
|
44798
44460
|
gasPerByte,
|
44799
44461
|
gasPriceFactor
|
@@ -44929,13 +44591,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44929
44591
|
const decodedTransaction = this.decodeTransaction(
|
44930
44592
|
transaction
|
44931
44593
|
);
|
44932
|
-
|
44933
|
-
|
44934
|
-
txReceipts = transaction.status.receipts;
|
44935
|
-
}
|
44936
|
-
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44937
|
-
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44938
|
-
const gasPrice = await this.provider.getLatestGasPrice();
|
44594
|
+
const receipts = transaction.receipts?.map(processGqlReceipt) || [];
|
44595
|
+
const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
|
44939
44596
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44940
44597
|
const transactionSummary = assembleTransactionSummary({
|
44941
44598
|
id: this.id,
|
@@ -44947,9 +44604,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44947
44604
|
gasPriceFactor,
|
44948
44605
|
abiMap: contractsAbiMap,
|
44949
44606
|
maxInputs,
|
44950
|
-
gasCosts
|
44951
|
-
maxGasPerTx,
|
44952
|
-
gasPrice
|
44607
|
+
gasCosts
|
44953
44608
|
});
|
44954
44609
|
return transactionSummary;
|
44955
44610
|
}
|
@@ -45093,12 +44748,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45093
44748
|
gasPerByte: bn(feeParams.gasPerByte),
|
45094
44749
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
45095
44750
|
chainId: bn(consensusParameters.chainId),
|
44751
|
+
baseAssetId: consensusParameters.baseAssetId,
|
45096
44752
|
gasCosts
|
45097
44753
|
},
|
45098
44754
|
gasCosts,
|
45099
44755
|
latestBlock: {
|
45100
44756
|
id: latestBlock.id,
|
45101
|
-
height: bn(latestBlock.height),
|
44757
|
+
height: bn(latestBlock.header.height),
|
45102
44758
|
time: latestBlock.header.time,
|
45103
44759
|
transactions: latestBlock.transactions.map((i) => ({
|
45104
44760
|
id: i.id
|
@@ -45192,8 +44848,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45192
44848
|
* Returns some helpful parameters related to gas fees.
|
45193
44849
|
*/
|
45194
44850
|
getGasConfig() {
|
44851
|
+
const { minGasPrice } = this.getNode();
|
45195
44852
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
45196
44853
|
return {
|
44854
|
+
minGasPrice,
|
45197
44855
|
maxGasPerTx,
|
45198
44856
|
maxGasPerPredicate,
|
45199
44857
|
gasPriceFactor,
|
@@ -45291,7 +44949,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45291
44949
|
*/
|
45292
44950
|
async getBlockNumber() {
|
45293
44951
|
const { chain } = await this.operations.getChain();
|
45294
|
-
return bn(chain.latestBlock.height, 10);
|
44952
|
+
return bn(chain.latestBlock.header.height, 10);
|
45295
44953
|
}
|
45296
44954
|
/**
|
45297
44955
|
* Returns the chain information.
|
@@ -45303,9 +44961,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45303
44961
|
const processedNodeInfo = {
|
45304
44962
|
maxDepth: bn(nodeInfo.maxDepth),
|
45305
44963
|
maxTx: bn(nodeInfo.maxTx),
|
44964
|
+
minGasPrice: bn(nodeInfo.minGasPrice),
|
45306
44965
|
nodeVersion: nodeInfo.nodeVersion,
|
45307
44966
|
utxoValidation: nodeInfo.utxoValidation,
|
45308
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44967
|
+
vmBacktrace: nodeInfo.vmBacktrace,
|
44968
|
+
peers: nodeInfo.peers
|
45309
44969
|
};
|
45310
44970
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
45311
44971
|
return processedNodeInfo;
|
@@ -45331,6 +44991,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45331
44991
|
} = this.getChain();
|
45332
44992
|
return chainId.toNumber();
|
45333
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
|
+
}
|
45334
45005
|
/**
|
45335
45006
|
* Submits a transaction to the chain to be executed.
|
45336
45007
|
*
|
@@ -45391,13 +45062,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45391
45062
|
return this.estimateTxDependencies(transactionRequest);
|
45392
45063
|
}
|
45393
45064
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45394
|
-
const { dryRun:
|
45395
|
-
|
45065
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45066
|
+
encodedTransaction,
|
45396
45067
|
utxoValidation: utxoValidation || false
|
45397
45068
|
});
|
45398
|
-
const
|
45399
|
-
|
45400
|
-
|
45069
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45070
|
+
return {
|
45071
|
+
receipts
|
45072
|
+
};
|
45401
45073
|
}
|
45402
45074
|
/**
|
45403
45075
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45436,6 +45108,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45436
45108
|
* If there are missing variable outputs,
|
45437
45109
|
* `addVariableOutputs` is called on the transaction.
|
45438
45110
|
*
|
45111
|
+
* @privateRemarks
|
45112
|
+
* TODO: Investigate support for missing contract IDs
|
45113
|
+
* TODO: Add support for missing output messages
|
45439
45114
|
*
|
45440
45115
|
* @param transactionRequest - The transaction request object.
|
45441
45116
|
* @returns A promise.
|
@@ -45448,19 +45123,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45448
45123
|
missingContractIds: []
|
45449
45124
|
};
|
45450
45125
|
}
|
45126
|
+
await this.estimatePredicates(transactionRequest);
|
45451
45127
|
let receipts = [];
|
45452
45128
|
const missingContractIds = [];
|
45453
45129
|
let outputVariables = 0;
|
45454
|
-
let dryrunStatus;
|
45455
45130
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45456
|
-
const {
|
45457
|
-
|
45458
|
-
} = await this.operations.dryRun({
|
45459
|
-
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45131
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45132
|
+
encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
|
45460
45133
|
utxoValidation: false
|
45461
45134
|
});
|
45462
|
-
receipts =
|
45463
|
-
dryrunStatus = status;
|
45135
|
+
receipts = gqlReceipts.map(processGqlReceipt);
|
45464
45136
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45465
45137
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45466
45138
|
if (hasMissingOutputs) {
|
@@ -45470,11 +45142,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45470
45142
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45471
45143
|
missingContractIds.push(contractId);
|
45472
45144
|
});
|
45473
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45474
|
-
transactionRequest,
|
45475
|
-
optimizeGas: false
|
45476
|
-
});
|
45477
|
-
transactionRequest.maxFee = maxFee;
|
45478
45145
|
} else {
|
45479
45146
|
break;
|
45480
45147
|
}
|
@@ -45482,133 +45149,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45482
45149
|
return {
|
45483
45150
|
receipts,
|
45484
45151
|
outputVariables,
|
45485
|
-
missingContractIds
|
45486
|
-
dryrunStatus
|
45487
|
-
};
|
45488
|
-
}
|
45489
|
-
/**
|
45490
|
-
* Dry runs multiple transactions and checks for missing dependencies in batches.
|
45491
|
-
*
|
45492
|
-
* Transactions are dry run in batches. After each dry run, transactions requiring
|
45493
|
-
* further modifications are identified. The method iteratively updates these transactions
|
45494
|
-
* and performs subsequent dry runs until all dependencies for each transaction are satisfied.
|
45495
|
-
*
|
45496
|
-
* @param transactionRequests - Array of transaction request objects.
|
45497
|
-
* @returns A promise that resolves to an array of results for each transaction.
|
45498
|
-
*/
|
45499
|
-
async estimateMultipleTxDependencies(transactionRequests) {
|
45500
|
-
const results = transactionRequests.map(() => ({
|
45501
|
-
receipts: [],
|
45502
|
-
outputVariables: 0,
|
45503
|
-
missingContractIds: [],
|
45504
|
-
dryrunStatus: void 0
|
45505
|
-
}));
|
45506
|
-
const allRequests = clone_default(transactionRequests);
|
45507
|
-
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45508
|
-
allRequests.forEach((req, index) => {
|
45509
|
-
if (req.type === TransactionType.Script) {
|
45510
|
-
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45511
|
-
}
|
45512
|
-
});
|
45513
|
-
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45514
|
-
let attempt = 0;
|
45515
|
-
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45516
|
-
const encodedTransactions = transactionsToProcess.map(
|
45517
|
-
(index) => serializedTransactionsMap.get(index)
|
45518
|
-
);
|
45519
|
-
const dryRunResults = await this.operations.dryRun({
|
45520
|
-
encodedTransactions,
|
45521
|
-
utxoValidation: false
|
45522
|
-
});
|
45523
|
-
const nextRoundTransactions = [];
|
45524
|
-
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45525
|
-
const currentResultIndex = transactionsToProcess[i];
|
45526
|
-
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45527
|
-
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45528
|
-
results[currentResultIndex].dryrunStatus = status;
|
45529
|
-
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45530
|
-
results[currentResultIndex].receipts
|
45531
|
-
);
|
45532
|
-
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45533
|
-
const requestToProcess = allRequests[currentResultIndex];
|
45534
|
-
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45535
|
-
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45536
|
-
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45537
|
-
missingOutputContractIds.forEach(({ contractId }) => {
|
45538
|
-
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45539
|
-
results[currentResultIndex].missingContractIds.push(contractId);
|
45540
|
-
});
|
45541
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45542
|
-
transactionRequest: requestToProcess,
|
45543
|
-
optimizeGas: false
|
45544
|
-
});
|
45545
|
-
requestToProcess.maxFee = maxFee;
|
45546
|
-
serializedTransactionsMap.set(
|
45547
|
-
currentResultIndex,
|
45548
|
-
hexlify(requestToProcess.toTransactionBytes())
|
45549
|
-
);
|
45550
|
-
nextRoundTransactions.push(currentResultIndex);
|
45551
|
-
allRequests[currentResultIndex] = requestToProcess;
|
45552
|
-
}
|
45553
|
-
}
|
45554
|
-
transactionsToProcess = nextRoundTransactions;
|
45555
|
-
attempt += 1;
|
45556
|
-
}
|
45557
|
-
return results;
|
45558
|
-
}
|
45559
|
-
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45560
|
-
if (estimateTxDependencies) {
|
45561
|
-
return this.estimateMultipleTxDependencies(transactionRequests);
|
45562
|
-
}
|
45563
|
-
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45564
|
-
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45565
|
-
encodedTransactions,
|
45566
|
-
utxoValidation: utxoValidation || false
|
45567
|
-
});
|
45568
|
-
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45569
|
-
const receipts = rawReceipts.map(processGqlReceipt);
|
45570
|
-
return { receipts, dryrunStatus: status };
|
45571
|
-
});
|
45572
|
-
return results;
|
45573
|
-
}
|
45574
|
-
async estimateTxGasAndFee(params) {
|
45575
|
-
const { transactionRequest, optimizeGas = true } = params;
|
45576
|
-
let { gasPrice } = params;
|
45577
|
-
const chainInfo = this.getChain();
|
45578
|
-
const { gasPriceFactor } = this.getGasConfig();
|
45579
|
-
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45580
|
-
if (!gasPrice) {
|
45581
|
-
gasPrice = await this.estimateGasPrice(10);
|
45582
|
-
}
|
45583
|
-
const minFee = calculateGasFee({
|
45584
|
-
gasPrice: bn(gasPrice),
|
45585
|
-
gas: minGas,
|
45586
|
-
priceFactor: gasPriceFactor,
|
45587
|
-
tip: transactionRequest.tip
|
45588
|
-
}).add(1);
|
45589
|
-
let gasLimit = bn(0);
|
45590
|
-
if (transactionRequest.type === TransactionType.Script) {
|
45591
|
-
gasLimit = transactionRequest.gasLimit;
|
45592
|
-
if (!optimizeGas) {
|
45593
|
-
transactionRequest.gasLimit = minGas;
|
45594
|
-
gasLimit = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45595
|
-
transactionRequest.gasLimit = gasLimit;
|
45596
|
-
}
|
45597
|
-
}
|
45598
|
-
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45599
|
-
const maxFee = calculateGasFee({
|
45600
|
-
gasPrice: bn(gasPrice),
|
45601
|
-
gas: maxGas,
|
45602
|
-
priceFactor: gasPriceFactor,
|
45603
|
-
tip: transactionRequest.tip
|
45604
|
-
}).add(1);
|
45605
|
-
return {
|
45606
|
-
minGas,
|
45607
|
-
minFee,
|
45608
|
-
maxGas,
|
45609
|
-
maxFee,
|
45610
|
-
gasPrice,
|
45611
|
-
gasLimit
|
45152
|
+
missingContractIds
|
45612
45153
|
};
|
45613
45154
|
}
|
45614
45155
|
/**
|
@@ -45626,17 +45167,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45626
45167
|
if (estimateTxDependencies) {
|
45627
45168
|
return this.estimateTxDependencies(transactionRequest);
|
45628
45169
|
}
|
45629
|
-
const
|
45630
|
-
const { dryRun:
|
45631
|
-
|
45170
|
+
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45171
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45172
|
+
encodedTransaction,
|
45632
45173
|
utxoValidation: true
|
45633
45174
|
});
|
45634
|
-
const
|
45635
|
-
|
45636
|
-
|
45637
|
-
|
45638
|
-
});
|
45639
|
-
return { receipts: callResult[0].receipts };
|
45175
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45176
|
+
return {
|
45177
|
+
receipts
|
45178
|
+
};
|
45640
45179
|
}
|
45641
45180
|
/**
|
45642
45181
|
* Returns a transaction cost to enable user
|
@@ -45653,80 +45192,80 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45653
45192
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45654
45193
|
* @returns A promise that resolves to the transaction cost object.
|
45655
45194
|
*/
|
45656
|
-
async getTransactionCost(transactionRequestLike,
|
45195
|
+
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
45196
|
+
estimateTxDependencies = true,
|
45197
|
+
estimatePredicates = true,
|
45198
|
+
resourcesOwner,
|
45199
|
+
signatureCallback
|
45200
|
+
} = {}) {
|
45657
45201
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45202
|
+
const chainInfo = this.getChain();
|
45203
|
+
const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
|
45204
|
+
const gasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45658
45205
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45659
45206
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45660
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45207
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
|
45661
45208
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45662
|
-
|
45663
|
-
|
45664
|
-
|
45665
|
-
|
45666
|
-
|
45667
|
-
|
45209
|
+
if (estimatePredicates) {
|
45210
|
+
if (isScriptTransaction) {
|
45211
|
+
txRequestClone.gasLimit = bn(0);
|
45212
|
+
}
|
45213
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45214
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45215
|
+
}
|
45216
|
+
await this.estimatePredicates(txRequestClone);
|
45668
45217
|
}
|
45669
|
-
const signedRequest = clone_default(txRequestClone);
|
45670
|
-
let addedSignatures = 0;
|
45671
45218
|
if (signatureCallback && isScriptTransaction) {
|
45672
|
-
|
45673
|
-
|
45674
|
-
|
45675
|
-
|
45676
|
-
await this.estimatePredicates(signedRequest);
|
45677
|
-
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45678
|
-
transactionRequest: signedRequest,
|
45679
|
-
optimizeGas: false
|
45680
|
-
});
|
45681
|
-
txRequestClone.maxFee = maxFee;
|
45219
|
+
await signatureCallback(txRequestClone);
|
45220
|
+
}
|
45221
|
+
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
45222
|
+
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
45682
45223
|
let receipts = [];
|
45683
45224
|
let missingContractIds = [];
|
45684
45225
|
let outputVariables = 0;
|
45685
|
-
|
45686
|
-
|
45687
|
-
|
45688
|
-
if (signatureCallback) {
|
45689
|
-
await signatureCallback(txRequestClone);
|
45690
|
-
}
|
45691
|
-
txRequestClone.gasLimit = gasLimit;
|
45226
|
+
if (isScriptTransaction && estimateTxDependencies) {
|
45227
|
+
txRequestClone.gasPrice = bn(0);
|
45228
|
+
txRequestClone.gasLimit = bn(maxGasPerTx.sub(maxGas).toNumber() * 0.9);
|
45692
45229
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45693
45230
|
receipts = result.receipts;
|
45694
45231
|
outputVariables = result.outputVariables;
|
45695
45232
|
missingContractIds = result.missingContractIds;
|
45696
|
-
gasUsed = getGasUsedFromReceipts(receipts);
|
45697
|
-
txRequestClone.gasLimit = gasUsed;
|
45698
|
-
({ maxFee, maxGas, minFee, minGas, gasPrice } = await this.estimateTxGasAndFee({
|
45699
|
-
transactionRequest: txRequestClone,
|
45700
|
-
gasPrice
|
45701
|
-
}));
|
45702
45233
|
}
|
45234
|
+
const gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : minGas;
|
45235
|
+
const usedFee = calculatePriceWithFactor(
|
45236
|
+
gasUsed,
|
45237
|
+
gasPrice,
|
45238
|
+
gasPriceFactor
|
45239
|
+
).normalizeZeroToOne();
|
45240
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45241
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45703
45242
|
return {
|
45704
45243
|
requiredQuantities: allQuantities,
|
45705
45244
|
receipts,
|
45706
45245
|
gasUsed,
|
45246
|
+
minGasPrice,
|
45707
45247
|
gasPrice,
|
45708
45248
|
minGas,
|
45709
45249
|
maxGas,
|
45250
|
+
usedFee,
|
45710
45251
|
minFee,
|
45711
45252
|
maxFee,
|
45253
|
+
estimatedInputs: txRequestClone.inputs,
|
45712
45254
|
outputVariables,
|
45713
|
-
missingContractIds
|
45714
|
-
addedSignatures,
|
45715
|
-
estimatedPredicates: txRequestClone.inputs
|
45255
|
+
missingContractIds
|
45716
45256
|
};
|
45717
45257
|
}
|
45718
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45258
|
+
async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
|
45719
45259
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45720
45260
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45721
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45722
|
-
quantitiesToContract
|
45723
|
-
});
|
45261
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
|
45724
45262
|
transactionRequest.addResources(
|
45725
45263
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45726
45264
|
);
|
45727
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45728
|
-
|
45729
|
-
|
45265
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45266
|
+
transactionRequest,
|
45267
|
+
forwardingQuantities
|
45268
|
+
);
|
45730
45269
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45731
45270
|
return {
|
45732
45271
|
resources,
|
@@ -45750,6 +45289,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45750
45289
|
assetId: coin.assetId,
|
45751
45290
|
amount: bn(coin.amount),
|
45752
45291
|
owner: Address.fromAddressOrString(coin.owner),
|
45292
|
+
maturity: bn(coin.maturity).toNumber(),
|
45753
45293
|
blockCreated: bn(coin.blockCreated),
|
45754
45294
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45755
45295
|
}));
|
@@ -45801,6 +45341,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45801
45341
|
amount: bn(coin.amount),
|
45802
45342
|
assetId: coin.assetId,
|
45803
45343
|
owner: Address.fromAddressOrString(coin.owner),
|
45344
|
+
maturity: bn(coin.maturity).toNumber(),
|
45804
45345
|
blockCreated: bn(coin.blockCreated),
|
45805
45346
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45806
45347
|
};
|
@@ -45833,7 +45374,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45833
45374
|
}
|
45834
45375
|
return {
|
45835
45376
|
id: block2.id,
|
45836
|
-
height: bn(block2.height),
|
45377
|
+
height: bn(block2.header.height),
|
45837
45378
|
time: block2.header.time,
|
45838
45379
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45839
45380
|
};
|
@@ -45848,7 +45389,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45848
45389
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45849
45390
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45850
45391
|
id: block2.id,
|
45851
|
-
height: bn(block2.height),
|
45392
|
+
height: bn(block2.header.height),
|
45852
45393
|
time: block2.header.time,
|
45853
45394
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45854
45395
|
}));
|
@@ -45875,7 +45416,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45875
45416
|
}
|
45876
45417
|
return {
|
45877
45418
|
id: block2.id,
|
45878
|
-
height: bn(block2.height, 10),
|
45419
|
+
height: bn(block2.header.height, 10),
|
45879
45420
|
time: block2.header.time,
|
45880
45421
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45881
45422
|
transactions: block2.transactions.map(
|
@@ -46055,6 +45596,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46055
45596
|
prevRoot: messageBlockHeader.prevRoot,
|
46056
45597
|
time: messageBlockHeader.time,
|
46057
45598
|
applicationHash: messageBlockHeader.applicationHash,
|
45599
|
+
messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
|
46058
45600
|
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
|
46059
45601
|
},
|
46060
45602
|
commitBlockHeader: {
|
@@ -46066,6 +45608,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46066
45608
|
prevRoot: commitBlockHeader.prevRoot,
|
46067
45609
|
time: commitBlockHeader.time,
|
46068
45610
|
applicationHash: commitBlockHeader.applicationHash,
|
45611
|
+
messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
|
46069
45612
|
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
|
46070
45613
|
},
|
46071
45614
|
sender: Address.fromAddressOrString(sender),
|
@@ -46075,16 +45618,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46075
45618
|
data
|
46076
45619
|
};
|
46077
45620
|
}
|
46078
|
-
async getLatestGasPrice() {
|
46079
|
-
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46080
|
-
return bn(latestGasPrice.gasPrice);
|
46081
|
-
}
|
46082
|
-
async estimateGasPrice(blockHorizon) {
|
46083
|
-
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46084
|
-
blockHorizon: String(blockHorizon)
|
46085
|
-
});
|
46086
|
-
return bn(estimateGasPrice.gasPrice);
|
46087
|
-
}
|
46088
45621
|
/**
|
46089
45622
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
46090
45623
|
*
|
@@ -46330,8 +45863,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46330
45863
|
* @param assetId - The asset ID to check the balance for.
|
46331
45864
|
* @returns A promise that resolves to the balance amount.
|
46332
45865
|
*/
|
46333
|
-
async getBalance(assetId
|
46334
|
-
const
|
45866
|
+
async getBalance(assetId) {
|
45867
|
+
const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
|
45868
|
+
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
46335
45869
|
return amount;
|
46336
45870
|
}
|
46337
45871
|
/**
|
@@ -46368,33 +45902,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46368
45902
|
* @param fee - The estimated transaction fee.
|
46369
45903
|
* @returns A promise that resolves when the resources are added to the transaction.
|
46370
45904
|
*/
|
46371
|
-
async fund(request,
|
46372
|
-
const
|
46373
|
-
const
|
46374
|
-
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45905
|
+
async fund(request, coinQuantities, fee) {
|
45906
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
45907
|
+
const updatedQuantities = addAmountToAsset({
|
46375
45908
|
amount: bn(fee),
|
46376
|
-
assetId:
|
46377
|
-
coinQuantities
|
45909
|
+
assetId: baseAssetId,
|
45910
|
+
coinQuantities
|
46378
45911
|
});
|
46379
45912
|
const quantitiesDict = {};
|
46380
|
-
|
45913
|
+
updatedQuantities.forEach(({ amount, assetId }) => {
|
46381
45914
|
quantitiesDict[assetId] = {
|
46382
45915
|
required: amount,
|
46383
45916
|
owned: bn(0)
|
46384
45917
|
};
|
46385
45918
|
});
|
46386
|
-
|
45919
|
+
const cachedUtxos = [];
|
45920
|
+
const cachedMessages = [];
|
45921
|
+
const owner = this.address.toB256();
|
45922
|
+
request.inputs.forEach((input) => {
|
46387
45923
|
const isResource = "amount" in input;
|
46388
45924
|
if (isResource) {
|
46389
45925
|
const isCoin2 = "owner" in input;
|
46390
45926
|
if (isCoin2) {
|
46391
45927
|
const assetId = String(input.assetId);
|
46392
|
-
if (quantitiesDict[assetId]) {
|
45928
|
+
if (input.owner === owner && quantitiesDict[assetId]) {
|
46393
45929
|
const amount = bn(input.amount);
|
46394
45930
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45931
|
+
cachedUtxos.push(input.id);
|
46395
45932
|
}
|
46396
|
-
} else if (input.amount && quantitiesDict[
|
46397
|
-
quantitiesDict[
|
45933
|
+
} else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
|
45934
|
+
quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
|
45935
|
+
cachedMessages.push(input.nonce);
|
46398
45936
|
}
|
46399
45937
|
}
|
46400
45938
|
});
|
@@ -46409,23 +45947,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46409
45947
|
});
|
46410
45948
|
const needsToBeFunded = missingQuantities.length;
|
46411
45949
|
if (needsToBeFunded) {
|
46412
|
-
const
|
46413
|
-
|
46414
|
-
|
46415
|
-
|
46416
|
-
|
46417
|
-
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46418
|
-
const requestToBeReEstimate = clone_default(txRequest);
|
46419
|
-
if (addedSignatures) {
|
46420
|
-
Array.from({ length: addedSignatures }).forEach(
|
46421
|
-
() => requestToBeReEstimate.addEmptyWitness()
|
46422
|
-
);
|
45950
|
+
const resources = await this.getResourcesToSpend(missingQuantities, {
|
45951
|
+
messages: cachedMessages,
|
45952
|
+
utxos: cachedUtxos
|
45953
|
+
});
|
45954
|
+
request.addResources(resources);
|
46423
45955
|
}
|
46424
|
-
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46425
|
-
transactionRequest: requestToBeReEstimate
|
46426
|
-
});
|
46427
|
-
txRequest.maxFee = maxFee;
|
46428
|
-
return txRequest;
|
46429
45956
|
}
|
46430
45957
|
/**
|
46431
45958
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -46433,25 +45960,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46433
45960
|
* @param destination - The address of the destination.
|
46434
45961
|
* @param amount - The amount of coins to transfer.
|
46435
45962
|
* @param assetId - The asset ID of the coins to transfer.
|
46436
|
-
* @param txParams - The transaction parameters (gasLimit,
|
45963
|
+
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46437
45964
|
* @returns A promise that resolves to the prepared transaction request.
|
46438
45965
|
*/
|
46439
|
-
async createTransfer(destination, amount, assetId
|
46440
|
-
const
|
46441
|
-
|
46442
|
-
const
|
45966
|
+
async createTransfer(destination, amount, assetId, txParams = {}) {
|
45967
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
45968
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
45969
|
+
const params = { gasPrice: minGasPrice, ...txParams };
|
45970
|
+
const request = new ScriptTransactionRequest(params);
|
45971
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
45972
|
+
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46443
45973
|
estimateTxDependencies: true,
|
46444
45974
|
resourcesOwner: this
|
46445
45975
|
});
|
46446
|
-
|
46447
|
-
|
46448
|
-
|
46449
|
-
|
46450
|
-
|
46451
|
-
|
46452
|
-
|
46453
|
-
|
46454
|
-
await this.fund(request,
|
45976
|
+
request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
|
45977
|
+
request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
|
45978
|
+
this.validateGas({
|
45979
|
+
gasUsed,
|
45980
|
+
gasPrice: request.gasPrice,
|
45981
|
+
gasLimit: request.gasLimit,
|
45982
|
+
minGasPrice
|
45983
|
+
});
|
45984
|
+
await this.fund(request, requiredQuantities, maxFee);
|
45985
|
+
request.updatePredicateInputs(estimatedInputs);
|
46455
45986
|
return request;
|
46456
45987
|
}
|
46457
45988
|
/**
|
@@ -46463,14 +45994,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46463
45994
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46464
45995
|
* @returns A promise that resolves to the transaction response.
|
46465
45996
|
*/
|
46466
|
-
async transfer(destination, amount, assetId
|
45997
|
+
async transfer(destination, amount, assetId, txParams = {}) {
|
46467
45998
|
if (bn(amount).lte(0)) {
|
46468
45999
|
throw new FuelError(
|
46469
46000
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
46470
46001
|
"Transfer amount must be a positive number."
|
46471
46002
|
);
|
46472
46003
|
}
|
46473
|
-
const
|
46004
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46005
|
+
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
46474
46006
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
46475
46007
|
}
|
46476
46008
|
/**
|
@@ -46482,7 +46014,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46482
46014
|
* @param txParams - The optional transaction parameters.
|
46483
46015
|
* @returns A promise that resolves to the transaction response.
|
46484
46016
|
*/
|
46485
|
-
async transferToContract(contractId, amount, assetId
|
46017
|
+
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46486
46018
|
if (bn(amount).lte(0)) {
|
46487
46019
|
throw new FuelError(
|
46488
46020
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46490,30 +46022,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46490
46022
|
);
|
46491
46023
|
}
|
46492
46024
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46025
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46026
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46027
|
+
const params = { gasPrice: minGasPrice, ...txParams };
|
46493
46028
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46494
46029
|
hexlifiedContractId: contractAddress.toB256(),
|
46495
46030
|
amountToTransfer: bn(amount),
|
46496
|
-
assetId
|
46031
|
+
assetId: assetIdToTransfer
|
46497
46032
|
});
|
46498
46033
|
const request = new ScriptTransactionRequest({
|
46499
|
-
...
|
46034
|
+
...params,
|
46500
46035
|
script,
|
46501
46036
|
scriptData
|
46502
46037
|
});
|
46503
46038
|
request.addContractInputAndOutput(contractAddress);
|
46504
|
-
const
|
46505
|
-
|
46506
|
-
|
46039
|
+
const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
|
46040
|
+
request,
|
46041
|
+
[{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
|
46042
|
+
);
|
46043
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46044
|
+
this.validateGas({
|
46045
|
+
gasUsed,
|
46046
|
+
gasPrice: request.gasPrice,
|
46047
|
+
gasLimit: request.gasLimit,
|
46048
|
+
minGasPrice
|
46507
46049
|
});
|
46508
|
-
|
46509
|
-
this.validateGas({
|
46510
|
-
gasUsed: txCost.gasUsed,
|
46511
|
-
gasLimit: request.gasLimit
|
46512
|
-
});
|
46513
|
-
}
|
46514
|
-
request.gasLimit = txCost.gasUsed;
|
46515
|
-
request.maxFee = txCost.maxFee;
|
46516
|
-
await this.fund(request, txCost);
|
46050
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46517
46051
|
return this.sendTransaction(request);
|
46518
46052
|
}
|
46519
46053
|
/**
|
@@ -46525,6 +46059,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46525
46059
|
* @returns A promise that resolves to the transaction response.
|
46526
46060
|
*/
|
46527
46061
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46062
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46063
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46528
46064
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46529
46065
|
const recipientDataArray = arrayify(
|
46530
46066
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46537,19 +46073,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46537
46073
|
...recipientDataArray,
|
46538
46074
|
...amountDataArray
|
46539
46075
|
]);
|
46540
|
-
const params = { script, ...txParams };
|
46076
|
+
const params = { script, gasPrice: minGasPrice, ...txParams };
|
46541
46077
|
const request = new ScriptTransactionRequest(params);
|
46542
|
-
const
|
46543
|
-
const
|
46544
|
-
|
46545
|
-
|
46546
|
-
|
46547
|
-
|
46548
|
-
|
46549
|
-
|
46550
|
-
|
46551
|
-
|
46552
|
-
|
46078
|
+
const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
|
46079
|
+
const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
|
46080
|
+
request,
|
46081
|
+
forwardingQuantities
|
46082
|
+
);
|
46083
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46084
|
+
this.validateGas({
|
46085
|
+
gasUsed,
|
46086
|
+
gasPrice: request.gasPrice,
|
46087
|
+
gasLimit: request.gasLimit,
|
46088
|
+
minGasPrice
|
46089
|
+
});
|
46090
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46553
46091
|
return this.sendTransaction(request);
|
46554
46092
|
}
|
46555
46093
|
async signMessage(message) {
|
@@ -46607,7 +46145,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46607
46145
|
}
|
46608
46146
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46609
46147
|
}
|
46610
|
-
validateGas({
|
46148
|
+
validateGas({
|
46149
|
+
gasUsed,
|
46150
|
+
gasPrice,
|
46151
|
+
gasLimit,
|
46152
|
+
minGasPrice
|
46153
|
+
}) {
|
46154
|
+
if (minGasPrice.gt(gasPrice)) {
|
46155
|
+
throw new FuelError(
|
46156
|
+
ErrorCode.GAS_PRICE_TOO_LOW,
|
46157
|
+
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46158
|
+
);
|
46159
|
+
}
|
46611
46160
|
if (gasUsed.gt(gasLimit)) {
|
46612
46161
|
throw new FuelError(
|
46613
46162
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -47990,12 +47539,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
47990
47539
|
};
|
47991
47540
|
|
47992
47541
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/rng.js
|
47993
|
-
var
|
47542
|
+
var import_crypto15 = __toESM(__require("crypto"));
|
47994
47543
|
var rnds8Pool = new Uint8Array(256);
|
47995
47544
|
var poolPtr = rnds8Pool.length;
|
47996
47545
|
function rng() {
|
47997
47546
|
if (poolPtr > rnds8Pool.length - 16) {
|
47998
|
-
|
47547
|
+
import_crypto15.default.randomFillSync(rnds8Pool);
|
47999
47548
|
poolPtr = 0;
|
48000
47549
|
}
|
48001
47550
|
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
@@ -48011,9 +47560,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48011
47560
|
}
|
48012
47561
|
|
48013
47562
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/native.js
|
48014
|
-
var
|
47563
|
+
var import_crypto16 = __toESM(__require("crypto"));
|
48015
47564
|
var native_default = {
|
48016
|
-
randomUUID:
|
47565
|
+
randomUUID: import_crypto16.default.randomUUID
|
48017
47566
|
};
|
48018
47567
|
|
48019
47568
|
// ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-node/v4.js
|
@@ -48196,7 +47745,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48196
47745
|
* @param transactionRequestLike - The transaction request to send.
|
48197
47746
|
* @returns A promise that resolves to the TransactionResponse object.
|
48198
47747
|
*/
|
48199
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
47748
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
|
48200
47749
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
48201
47750
|
if (estimateTxDependencies) {
|
48202
47751
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50956,15 +50505,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50956
50505
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50957
50506
|
wallet.provider
|
50958
50507
|
);
|
50959
|
-
const
|
50960
|
-
|
50961
|
-
|
50962
|
-
|
50508
|
+
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50509
|
+
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
50510
|
+
const request = new ScriptTransactionRequest({
|
50511
|
+
gasLimit: 1e4,
|
50512
|
+
gasPrice: minGasPrice
|
50963
50513
|
});
|
50964
|
-
|
50965
|
-
request.
|
50966
|
-
request.maxFee = txCost.maxFee;
|
50967
|
-
await genesisWallet.fund(request, txCost);
|
50514
|
+
request.addResources(resources);
|
50515
|
+
quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
|
50968
50516
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50969
50517
|
};
|
50970
50518
|
|
@@ -50994,7 +50542,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50994
50542
|
|
50995
50543
|
// src/test-utils/launchNode.ts
|
50996
50544
|
var import_child_process = __require("child_process");
|
50997
|
-
var
|
50545
|
+
var import_crypto20 = __require("crypto");
|
50998
50546
|
var import_fs2 = __require("fs");
|
50999
50547
|
var import_os = __toESM(__require("os"));
|
51000
50548
|
var import_path8 = __toESM(__require("path"));
|
@@ -51043,12 +50591,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51043
50591
|
// eslint-disable-next-line no-async-promise-executor
|
51044
50592
|
new Promise(async (resolve, reject) => {
|
51045
50593
|
const remainingArgs = extractRemainingArgs(args, [
|
51046
|
-
"--
|
50594
|
+
"--chain",
|
51047
50595
|
"--consensus-key",
|
51048
50596
|
"--db-type",
|
51049
50597
|
"--poa-instant"
|
51050
50598
|
]);
|
51051
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
50599
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--chain");
|
51052
50600
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
51053
50601
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
51054
50602
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -51066,55 +50614,37 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51066
50614
|
})).toString();
|
51067
50615
|
let chainConfigPathToUse;
|
51068
50616
|
const prefix = basePath || import_os.default.tmpdir();
|
51069
|
-
const suffix = basePath ? "" : (0,
|
51070
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix
|
50617
|
+
const suffix = basePath ? "" : (0, import_crypto20.randomUUID)();
|
50618
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51071
50619
|
if (chainConfigPath) {
|
51072
50620
|
chainConfigPathToUse = chainConfigPath;
|
51073
50621
|
} else {
|
51074
50622
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
51075
50623
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
51076
50624
|
}
|
51077
|
-
|
51078
|
-
|
51079
|
-
stateConfigJson = {
|
51080
|
-
...stateConfigJson,
|
51081
|
-
coins: [
|
51082
|
-
...stateConfigJson.coins.map((coin) => ({
|
51083
|
-
...coin,
|
51084
|
-
amount: "18446744073709551615"
|
51085
|
-
}))
|
51086
|
-
],
|
51087
|
-
messages: stateConfigJson.messages.map((message) => ({
|
51088
|
-
...message,
|
51089
|
-
amount: "18446744073709551615"
|
51090
|
-
}))
|
51091
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51092
|
-
};
|
50625
|
+
const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
50626
|
+
let chainConfig = defaultChainConfig;
|
51093
50627
|
if (!process.env.GENESIS_SECRET) {
|
51094
50628
|
const pk = Signer.generatePrivateKey();
|
51095
50629
|
const signer = new Signer(pk);
|
51096
50630
|
process.env.GENESIS_SECRET = hexlify(pk);
|
51097
|
-
|
51098
|
-
|
51099
|
-
|
51100
|
-
|
51101
|
-
|
51102
|
-
|
51103
|
-
|
51104
|
-
|
51105
|
-
|
51106
|
-
|
50631
|
+
chainConfig = {
|
50632
|
+
...defaultChainConfig,
|
50633
|
+
initial_state: {
|
50634
|
+
...defaultChainConfig.initial_state,
|
50635
|
+
coins: [
|
50636
|
+
...defaultChainConfig.initial_state.coins,
|
50637
|
+
{
|
50638
|
+
owner: signer.address.toHexString(),
|
50639
|
+
amount: toHex(1e9),
|
50640
|
+
asset_id: defaultChainConfig?.consensus_parameters?.base_asset_id ?? ZeroBytes32
|
50641
|
+
}
|
50642
|
+
]
|
50643
|
+
}
|
50644
|
+
};
|
51107
50645
|
}
|
51108
|
-
|
51109
|
-
|
51110
|
-
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51111
|
-
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51112
|
-
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51113
|
-
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51114
|
-
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51115
|
-
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51116
|
-
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51117
|
-
chainConfigPathToUse = tempDirPath;
|
50646
|
+
(0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
|
50647
|
+
chainConfigPathToUse = tempChainConfigFilePath;
|
51118
50648
|
}
|
51119
50649
|
const child = (0, import_child_process.spawn)(
|
51120
50650
|
command,
|
@@ -51123,10 +50653,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51123
50653
|
["--ip", ipToUse],
|
51124
50654
|
["--port", portToUse],
|
51125
50655
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
51126
|
-
["--min-gas-price", "
|
50656
|
+
["--min-gas-price", "0"],
|
51127
50657
|
poaInstant ? ["--poa-instant", "true"] : [],
|
51128
50658
|
["--consensus-key", consensusKey],
|
51129
|
-
["--
|
50659
|
+
["--chain", chainConfigPathToUse],
|
51130
50660
|
"--vm-backtrace",
|
51131
50661
|
"--utxo-validation",
|
51132
50662
|
"--debug",
|
@@ -51173,9 +50703,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51173
50703
|
})
|
51174
50704
|
);
|
51175
50705
|
var generateWallets = async (count, provider) => {
|
50706
|
+
const baseAssetId = provider.getBaseAssetId();
|
51176
50707
|
const wallets = [];
|
51177
50708
|
for (let i = 0; i < count; i += 1) {
|
51178
|
-
const wallet = await generateTestWallet(provider, [[1e3,
|
50709
|
+
const wallet = await generateTestWallet(provider, [[1e3, baseAssetId]]);
|
51179
50710
|
wallets.push(wallet);
|
51180
50711
|
}
|
51181
50712
|
return wallets;
|
@@ -51185,7 +50716,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51185
50716
|
walletCount = 10
|
51186
50717
|
} = {}) => {
|
51187
50718
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
51188
|
-
const provider = await Provider.create(`http://${ip}:${port}/
|
50719
|
+
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51189
50720
|
const wallets = await generateWallets(walletCount, provider);
|
51190
50721
|
const cleanup = () => {
|
51191
50722
|
closeNode();
|