@fuel-ts/account 0.0.0-rc-2021-20240409151049 → 0.0.0-rc-2034-20240410011904
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 +623 -868
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +525 -759
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +406 -639
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +2 -10
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +328 -894
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/coin-quantity.d.ts +1 -1
- package/dist/providers/coin-quantity.d.ts.map +1 -1
- package/dist/providers/coin.d.ts +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 +31 -36
- 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 +25 -8
- 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 +1122 -1582
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +521 -735
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +415 -629
- 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
|
}
|
@@ -31977,6 +31977,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
31977
31977
|
ErrorCode2["INVALID_COMPONENT"] = "invalid-component";
|
31978
31978
|
ErrorCode2["CONFIGURABLE_NOT_FOUND"] = "configurable-not-found";
|
31979
31979
|
ErrorCode2["TYPE_NOT_FOUND"] = "type-not-found";
|
31980
|
+
ErrorCode2["LOG_TYPE_NOT_FOUND"] = "log-type-not-found";
|
31980
31981
|
ErrorCode2["TYPE_NOT_SUPPORTED"] = "type-not-supported";
|
31981
31982
|
ErrorCode2["INVALID_DECODE_VALUE"] = "invalid-decode-value";
|
31982
31983
|
ErrorCode2["JSON_ABI_ERROR"] = "json-abi-error";
|
@@ -32192,753 +32193,520 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32192
32193
|
__publicField3(DateTime, "TAI64_NULL", "");
|
32193
32194
|
var chainConfig_default = {
|
32194
32195
|
chain_name: "local_testnet",
|
32195
|
-
|
32196
|
-
|
32197
|
-
|
32198
|
-
|
32199
|
-
|
32200
|
-
|
32201
|
-
|
32202
|
-
max_gas_per_tx: 3e7,
|
32203
|
-
max_size: 112640
|
32204
|
-
}
|
32205
|
-
},
|
32206
|
-
predicate_params: {
|
32207
|
-
V1: {
|
32208
|
-
max_predicate_length: 102400,
|
32209
|
-
max_predicate_data_length: 102400,
|
32210
|
-
max_message_data_length: 102400,
|
32211
|
-
max_gas_per_predicate: 3e7
|
32212
|
-
}
|
32213
|
-
},
|
32214
|
-
script_params: {
|
32215
|
-
V1: {
|
32216
|
-
max_script_length: 102400,
|
32217
|
-
max_script_data_length: 102400
|
32218
|
-
}
|
32219
|
-
},
|
32220
|
-
contract_params: {
|
32221
|
-
V1: {
|
32222
|
-
contract_max_size: 102400,
|
32223
|
-
max_storage_slots: 1760
|
32224
|
-
}
|
32225
|
-
},
|
32226
|
-
fee_params: {
|
32227
|
-
V1: {
|
32228
|
-
gas_price_factor: 92,
|
32229
|
-
gas_per_byte: 63
|
32230
|
-
}
|
32231
|
-
},
|
32232
|
-
chain_id: 0,
|
32233
|
-
gas_costs: {
|
32234
|
-
V1: {
|
32235
|
-
add: 2,
|
32236
|
-
addi: 2,
|
32237
|
-
aloc: 1,
|
32238
|
-
and: 2,
|
32239
|
-
andi: 2,
|
32240
|
-
bal: 366,
|
32241
|
-
bhei: 2,
|
32242
|
-
bhsh: 2,
|
32243
|
-
burn: 33949,
|
32244
|
-
cb: 2,
|
32245
|
-
cfei: 2,
|
32246
|
-
cfsi: 2,
|
32247
|
-
div: 2,
|
32248
|
-
divi: 2,
|
32249
|
-
eck1: 3347,
|
32250
|
-
ecr1: 46165,
|
32251
|
-
ed19: 4210,
|
32252
|
-
eq: 2,
|
32253
|
-
exp: 2,
|
32254
|
-
expi: 2,
|
32255
|
-
flag: 1,
|
32256
|
-
gm: 2,
|
32257
|
-
gt: 2,
|
32258
|
-
gtf: 16,
|
32259
|
-
ji: 2,
|
32260
|
-
jmp: 2,
|
32261
|
-
jne: 2,
|
32262
|
-
jnei: 2,
|
32263
|
-
jnzi: 2,
|
32264
|
-
jmpf: 2,
|
32265
|
-
jmpb: 2,
|
32266
|
-
jnzf: 2,
|
32267
|
-
jnzb: 2,
|
32268
|
-
jnef: 2,
|
32269
|
-
jneb: 2,
|
32270
|
-
lb: 2,
|
32271
|
-
log: 754,
|
32272
|
-
lt: 2,
|
32273
|
-
lw: 2,
|
32274
|
-
mint: 35718,
|
32275
|
-
mlog: 2,
|
32276
|
-
mod: 2,
|
32277
|
-
modi: 2,
|
32278
|
-
move: 2,
|
32279
|
-
movi: 2,
|
32280
|
-
mroo: 5,
|
32281
|
-
mul: 2,
|
32282
|
-
muli: 2,
|
32283
|
-
mldv: 4,
|
32284
|
-
noop: 1,
|
32285
|
-
not: 2,
|
32286
|
-
or: 2,
|
32287
|
-
ori: 2,
|
32288
|
-
poph: 3,
|
32289
|
-
popl: 3,
|
32290
|
-
pshh: 4,
|
32291
|
-
pshl: 4,
|
32292
|
-
ret_contract: 733,
|
32293
|
-
rvrt_contract: 722,
|
32294
|
-
sb: 2,
|
32295
|
-
sll: 2,
|
32296
|
-
slli: 2,
|
32297
|
-
srl: 2,
|
32298
|
-
srli: 2,
|
32299
|
-
srw: 253,
|
32300
|
-
sub: 2,
|
32301
|
-
subi: 2,
|
32302
|
-
sw: 2,
|
32303
|
-
sww: 29053,
|
32304
|
-
time: 79,
|
32305
|
-
tr: 46242,
|
32306
|
-
tro: 33251,
|
32307
|
-
wdcm: 3,
|
32308
|
-
wqcm: 3,
|
32309
|
-
wdop: 3,
|
32310
|
-
wqop: 3,
|
32311
|
-
wdml: 3,
|
32312
|
-
wqml: 4,
|
32313
|
-
wddv: 5,
|
32314
|
-
wqdv: 7,
|
32315
|
-
wdmd: 11,
|
32316
|
-
wqmd: 18,
|
32317
|
-
wdam: 9,
|
32318
|
-
wqam: 12,
|
32319
|
-
wdmm: 11,
|
32320
|
-
wqmm: 11,
|
32321
|
-
xor: 2,
|
32322
|
-
xori: 2,
|
32323
|
-
call: {
|
32324
|
-
LightOperation: {
|
32325
|
-
base: 21687,
|
32326
|
-
units_per_gas: 4
|
32327
|
-
}
|
32328
|
-
},
|
32329
|
-
ccp: {
|
32330
|
-
LightOperation: {
|
32331
|
-
base: 59,
|
32332
|
-
units_per_gas: 20
|
32333
|
-
}
|
32334
|
-
},
|
32335
|
-
croo: {
|
32336
|
-
LightOperation: {
|
32337
|
-
base: 1,
|
32338
|
-
units_per_gas: 1
|
32339
|
-
}
|
32340
|
-
},
|
32341
|
-
csiz: {
|
32342
|
-
LightOperation: {
|
32343
|
-
base: 59,
|
32344
|
-
units_per_gas: 195
|
32345
|
-
}
|
32346
|
-
},
|
32347
|
-
k256: {
|
32348
|
-
LightOperation: {
|
32349
|
-
base: 282,
|
32350
|
-
units_per_gas: 3
|
32351
|
-
}
|
32352
|
-
},
|
32353
|
-
ldc: {
|
32354
|
-
LightOperation: {
|
32355
|
-
base: 45,
|
32356
|
-
units_per_gas: 65
|
32357
|
-
}
|
32358
|
-
},
|
32359
|
-
logd: {
|
32360
|
-
LightOperation: {
|
32361
|
-
base: 1134,
|
32362
|
-
units_per_gas: 2
|
32363
|
-
}
|
32364
|
-
},
|
32365
|
-
mcl: {
|
32366
|
-
LightOperation: {
|
32367
|
-
base: 3,
|
32368
|
-
units_per_gas: 523
|
32369
|
-
}
|
32370
|
-
},
|
32371
|
-
mcli: {
|
32372
|
-
LightOperation: {
|
32373
|
-
base: 3,
|
32374
|
-
units_per_gas: 526
|
32375
|
-
}
|
32376
|
-
},
|
32377
|
-
mcp: {
|
32378
|
-
LightOperation: {
|
32379
|
-
base: 3,
|
32380
|
-
units_per_gas: 448
|
32381
|
-
}
|
32382
|
-
},
|
32383
|
-
mcpi: {
|
32384
|
-
LightOperation: {
|
32385
|
-
base: 7,
|
32386
|
-
units_per_gas: 585
|
32387
|
-
}
|
32388
|
-
},
|
32389
|
-
meq: {
|
32390
|
-
LightOperation: {
|
32391
|
-
base: 11,
|
32392
|
-
units_per_gas: 1097
|
32393
|
-
}
|
32394
|
-
},
|
32395
|
-
retd_contract: {
|
32396
|
-
LightOperation: {
|
32397
|
-
base: 1086,
|
32398
|
-
units_per_gas: 2
|
32399
|
-
}
|
32400
|
-
},
|
32401
|
-
s256: {
|
32402
|
-
LightOperation: {
|
32403
|
-
base: 45,
|
32404
|
-
units_per_gas: 3
|
32405
|
-
}
|
32406
|
-
},
|
32407
|
-
scwq: {
|
32408
|
-
HeavyOperation: {
|
32409
|
-
base: 30375,
|
32410
|
-
gas_per_unit: 28628
|
32411
|
-
}
|
32412
|
-
},
|
32413
|
-
smo: {
|
32414
|
-
LightOperation: {
|
32415
|
-
base: 64196,
|
32416
|
-
units_per_gas: 1
|
32417
|
-
}
|
32418
|
-
},
|
32419
|
-
srwq: {
|
32420
|
-
HeavyOperation: {
|
32421
|
-
base: 262,
|
32422
|
-
gas_per_unit: 249
|
32423
|
-
}
|
32424
|
-
},
|
32425
|
-
swwq: {
|
32426
|
-
HeavyOperation: {
|
32427
|
-
base: 28484,
|
32428
|
-
gas_per_unit: 26613
|
32429
|
-
}
|
32430
|
-
},
|
32431
|
-
contract_root: {
|
32432
|
-
LightOperation: {
|
32433
|
-
base: 45,
|
32434
|
-
units_per_gas: 1
|
32435
|
-
}
|
32436
|
-
},
|
32437
|
-
state_root: {
|
32438
|
-
HeavyOperation: {
|
32439
|
-
base: 350,
|
32440
|
-
gas_per_unit: 176
|
32441
|
-
}
|
32442
|
-
},
|
32443
|
-
new_storage_per_byte: 63,
|
32444
|
-
vm_initialization: {
|
32445
|
-
LightOperation: {
|
32446
|
-
base: 1645,
|
32447
|
-
units_per_gas: 14
|
32448
|
-
}
|
32449
|
-
}
|
32450
|
-
}
|
32196
|
+
block_gas_limit: 5e9,
|
32197
|
+
initial_state: {
|
32198
|
+
coins: [
|
32199
|
+
{
|
32200
|
+
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32201
|
+
amount: "0xFFFFFFFFFFFFFFFF",
|
32202
|
+
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32451
32203
|
},
|
32452
|
-
|
32453
|
-
|
32454
|
-
|
32455
|
-
|
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
|
+
]
|
32456
32463
|
},
|
32457
|
-
|
32458
|
-
|
32459
|
-
|
32460
|
-
|
32461
|
-
|
32462
|
-
|
32463
|
-
|
32464
|
-
chain_config: "chainConfig.json",
|
32465
|
-
table_encoding: {
|
32466
|
-
Json: {
|
32467
|
-
filepath: "stateConfig.json"
|
32468
|
-
}
|
32469
|
-
}
|
32470
|
-
};
|
32471
|
-
var stateConfig_default = {
|
32472
|
-
coins: [
|
32473
|
-
{
|
32474
|
-
tx_id: "0x260eabfd50937e92939fd92687e9302a72e91c5065f64f853f2ccbe02396fe09d665",
|
32475
|
-
output_index: 0,
|
32476
|
-
tx_pointer_block_height: 0,
|
32477
|
-
tx_pointer_tx_idx: 0,
|
32478
|
-
owner: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d",
|
32479
|
-
amount: 18446744073709552e3,
|
32480
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32481
|
-
},
|
32482
|
-
{
|
32483
|
-
tx_id: "0x2a757c2317236f7883ac9bbbf7d402f034e0b725c544ef1c8725b1d2bd960f8c690f",
|
32484
|
-
output_index: 0,
|
32485
|
-
tx_pointer_block_height: 0,
|
32486
|
-
tx_pointer_tx_idx: 0,
|
32487
|
-
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32488
|
-
amount: 18446744073709552e3,
|
32489
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32490
|
-
},
|
32491
|
-
{
|
32492
|
-
tx_id: "0x634ef6cda00bac63992bbde80c6d694d484d58025a5ca0c9c848f0d35a5a3eee74b2",
|
32493
|
-
output_index: 0,
|
32494
|
-
tx_pointer_block_height: 0,
|
32495
|
-
tx_pointer_tx_idx: 0,
|
32496
|
-
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32497
|
-
amount: 18446744073709552e3,
|
32498
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32499
|
-
},
|
32500
|
-
{
|
32501
|
-
tx_id: "0xd3543bb1da137a7987a96a1bb71681fdd195ff25318c0d4a923aa30eb27ffa80bc7b",
|
32502
|
-
output_index: 0,
|
32503
|
-
tx_pointer_block_height: 0,
|
32504
|
-
tx_pointer_tx_idx: 0,
|
32505
|
-
owner: "0x09c0b2d1a486c439a87bcba6b46a7a1a23f3897cc83a94521a96da5c23bc58db",
|
32506
|
-
amount: 18446744073709552e3,
|
32507
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32508
|
-
},
|
32509
|
-
{
|
32510
|
-
tx_id: "0xa4d42cbb02adb32f5f3a9eab33a0ee7bdab8910ad9f615dfc86a7bb9e49a732bc58c",
|
32511
|
-
output_index: 0,
|
32512
|
-
tx_pointer_block_height: 0,
|
32513
|
-
tx_pointer_tx_idx: 0,
|
32514
|
-
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32515
|
-
amount: 18446744073709552e3,
|
32516
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32517
|
-
},
|
32518
|
-
{
|
32519
|
-
tx_id: "0xc197cb09b1d89a7862b238e9500631bd43f291aadb7ff55c8129335349634e9fde3f",
|
32520
|
-
output_index: 0,
|
32521
|
-
tx_pointer_block_height: 0,
|
32522
|
-
tx_pointer_tx_idx: 0,
|
32523
|
-
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32524
|
-
amount: 18446744073709552e3,
|
32525
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32526
|
-
},
|
32527
|
-
{
|
32528
|
-
tx_id: "0x4c4fc2451b9a9b16c520c1b89ec8968ce46823dd0396d84f7e3155861352fdce12c5",
|
32529
|
-
output_index: 0,
|
32530
|
-
tx_pointer_block_height: 0,
|
32531
|
-
tx_pointer_tx_idx: 0,
|
32532
|
-
owner: "0x5d99ee966b42cd8fc7bdd1364b389153a9e78b42b7d4a691470674e817888d4e",
|
32533
|
-
amount: 18446744073709552e3,
|
32534
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32535
|
-
},
|
32536
|
-
{
|
32537
|
-
tx_id: "0x68df8f08555086a1ab45591e6fe4bf2f538bcb80dd519108030b7e886d6a230c2531",
|
32538
|
-
output_index: 0,
|
32539
|
-
tx_pointer_block_height: 0,
|
32540
|
-
tx_pointer_tx_idx: 0,
|
32541
|
-
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32542
|
-
amount: 18446744073709552e3,
|
32543
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32544
|
-
},
|
32545
|
-
{
|
32546
|
-
tx_id: "0x1b9bdaa290518373eb905e45ce7fcb89acedd24341ca7749ad47a938e4bf3ca9b7ce",
|
32547
|
-
output_index: 0,
|
32548
|
-
tx_pointer_block_height: 0,
|
32549
|
-
tx_pointer_tx_idx: 0,
|
32550
|
-
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32551
|
-
amount: 18446744073709552e3,
|
32552
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32553
|
-
},
|
32554
|
-
{
|
32555
|
-
tx_id: "0xa5a2e9db3d1285337fe1183dc1eabe8f9cdcd470daf95cd5c522bbae292f53977f26",
|
32556
|
-
output_index: 0,
|
32557
|
-
tx_pointer_block_height: 0,
|
32558
|
-
tx_pointer_tx_idx: 0,
|
32559
|
-
owner: "0xbdaad6a89e073e177895b3e5a9ccd15806749eda134a6438dae32fc5b6601f3f",
|
32560
|
-
amount: 18446744073709552e3,
|
32561
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32562
|
-
},
|
32563
|
-
{
|
32564
|
-
tx_id: "0x13b685a1ea7c56309a92d69dd7e4808987ec90d62a1f9c9f2ec18e54746855c8c93c",
|
32565
|
-
output_index: 0,
|
32566
|
-
tx_pointer_block_height: 0,
|
32567
|
-
tx_pointer_tx_idx: 0,
|
32568
|
-
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32569
|
-
amount: 18446744073709552e3,
|
32570
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32571
|
-
},
|
32572
|
-
{
|
32573
|
-
tx_id: "0xf8f00a234cf3fbab86befc3fd9346d7fd1ac085233c9cb58c7447f30c75cbf87ed38",
|
32574
|
-
output_index: 0,
|
32575
|
-
tx_pointer_block_height: 0,
|
32576
|
-
tx_pointer_tx_idx: 0,
|
32577
|
-
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32578
|
-
amount: 18446744073709552e3,
|
32579
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32580
|
-
},
|
32581
|
-
{
|
32582
|
-
tx_id: "0x2a36c870f624b60fbd6f2b71332ca7f704c69296ceae4ddbf3a8ede79408088934be",
|
32583
|
-
output_index: 0,
|
32584
|
-
tx_pointer_block_height: 0,
|
32585
|
-
tx_pointer_tx_idx: 0,
|
32586
|
-
owner: "0x95a7aa6cc32743f8706c40ef49a7423b47da763bb4bbc055b1f07254dc729036",
|
32587
|
-
amount: 18446744073709552e3,
|
32588
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32589
|
-
},
|
32590
|
-
{
|
32591
|
-
tx_id: "0x9cd180d41e67a422da8a7683f036b463a7ed7efc0de31c1692adac90decbfebce78c",
|
32592
|
-
output_index: 0,
|
32593
|
-
tx_pointer_block_height: 0,
|
32594
|
-
tx_pointer_tx_idx: 0,
|
32595
|
-
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32596
|
-
amount: 18446744073709552e3,
|
32597
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32598
|
-
},
|
32599
|
-
{
|
32600
|
-
tx_id: "0xfeb4f2388fa22e6613ff85cf4e655f58acdfaa6299eba7f93b812cd1f0d7bbac48f0",
|
32601
|
-
output_index: 0,
|
32602
|
-
tx_pointer_block_height: 0,
|
32603
|
-
tx_pointer_tx_idx: 0,
|
32604
|
-
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32605
|
-
amount: 18446744073709552e3,
|
32606
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32607
|
-
},
|
32608
|
-
{
|
32609
|
-
tx_id: "0xc4d20299f43358dc32ab853f6631340b09278511b6adbaf34597ade6ef37efd018f1",
|
32610
|
-
output_index: 0,
|
32611
|
-
tx_pointer_block_height: 0,
|
32612
|
-
tx_pointer_tx_idx: 0,
|
32613
|
-
owner: "0xcee104acd38b940c8f1c62c6d7ea00a0ad2241d6dee0509a4bf27297508870d3",
|
32614
|
-
amount: 18446744073709552e3,
|
32615
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32616
|
-
},
|
32617
|
-
{
|
32618
|
-
tx_id: "0x437291414110b0aebaa8be5c0d9ff1e97d1130a24a6c9e028f2b1f6b0576be6aa961",
|
32619
|
-
output_index: 0,
|
32620
|
-
tx_pointer_block_height: 0,
|
32621
|
-
tx_pointer_tx_idx: 0,
|
32622
|
-
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32623
|
-
amount: 18446744073709552e3,
|
32624
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32625
|
-
},
|
32626
|
-
{
|
32627
|
-
tx_id: "0x28131b9acc90c2058ee14f4094a474146ba5b779cb9021867164b3d41abad3d047a7",
|
32628
|
-
output_index: 0,
|
32629
|
-
tx_pointer_block_height: 0,
|
32630
|
-
tx_pointer_tx_idx: 0,
|
32631
|
-
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32632
|
-
amount: 18446744073709552e3,
|
32633
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32634
|
-
},
|
32635
|
-
{
|
32636
|
-
tx_id: "0x033bb5f9b0e4f530d50af3a0f12dd510f799af495ef88baea3cf854a37da728d214b",
|
32637
|
-
output_index: 0,
|
32638
|
-
tx_pointer_block_height: 0,
|
32639
|
-
tx_pointer_tx_idx: 0,
|
32640
|
-
owner: "0x7e3626e306588eba79cafab73f0709e55ab8f4bdfe8c8b75034a430fc56ece89",
|
32641
|
-
amount: 18446744073709552e3,
|
32642
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32643
|
-
},
|
32644
|
-
{
|
32645
|
-
tx_id: "0x460591398552eca338dd9577f362b91b0f9297f308258734870350004dcc303c67e9",
|
32646
|
-
output_index: 0,
|
32647
|
-
tx_pointer_block_height: 0,
|
32648
|
-
tx_pointer_tx_idx: 0,
|
32649
|
-
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32650
|
-
amount: 18446744073709552e3,
|
32651
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32652
|
-
},
|
32653
|
-
{
|
32654
|
-
tx_id: "0x447a7c37aee972dcba72f05255c5145dd63125f0fc46ef98c216f775ee0421e23d2b",
|
32655
|
-
output_index: 0,
|
32656
|
-
tx_pointer_block_height: 0,
|
32657
|
-
tx_pointer_tx_idx: 0,
|
32658
|
-
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32659
|
-
amount: 18446744073709552e3,
|
32660
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32661
|
-
},
|
32662
|
-
{
|
32663
|
-
tx_id: "0xf4a5d727606260c7ac6333fa89e7aef474df8a13326716d4d02f6392ebb7b997d268",
|
32664
|
-
output_index: 0,
|
32665
|
-
tx_pointer_block_height: 0,
|
32666
|
-
tx_pointer_tx_idx: 0,
|
32667
|
-
owner: "0x1c31df52b6df56407dd95f83082e8beb9cfc9532ac111d5bd8491651d95ba775",
|
32668
|
-
amount: 18446744073709552e3,
|
32669
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32670
|
-
},
|
32671
|
-
{
|
32672
|
-
tx_id: "0x25a49b0731bf610f6706aa9e9e96e5967f7c50f4302a3c75d7c8141595896551c18d",
|
32673
|
-
output_index: 0,
|
32674
|
-
tx_pointer_block_height: 0,
|
32675
|
-
tx_pointer_tx_idx: 0,
|
32676
|
-
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32677
|
-
amount: 18446744073709552e3,
|
32678
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32679
|
-
},
|
32680
|
-
{
|
32681
|
-
tx_id: "0x0a6e3585881ef2edf3f7727762799089dc0b5923e8b3718b49044dd9ddcb33b68459",
|
32682
|
-
output_index: 0,
|
32683
|
-
tx_pointer_block_height: 0,
|
32684
|
-
tx_pointer_tx_idx: 0,
|
32685
|
-
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32686
|
-
amount: 18446744073709552e3,
|
32687
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32688
|
-
},
|
32689
|
-
{
|
32690
|
-
tx_id: "0xf73bbe0635f7b6d59a090a21d87288b82164d0f6101da830ce64eff64a2d2ff2ac37",
|
32691
|
-
output_index: 0,
|
32692
|
-
tx_pointer_block_height: 0,
|
32693
|
-
tx_pointer_tx_idx: 0,
|
32694
|
-
owner: "0x09dd7a49174d6fcc9f4c6f7942c18060a935ddd03ee69b594189b8c3581276ea",
|
32695
|
-
amount: 18446744073709552e3,
|
32696
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32697
|
-
},
|
32698
|
-
{
|
32699
|
-
tx_id: "0x6cc44cb8d2a6462a591a77b6b9917eb6b22ad80d23d3cfd4f94c9da49c14b3cbac6e",
|
32700
|
-
output_index: 0,
|
32701
|
-
tx_pointer_block_height: 0,
|
32702
|
-
tx_pointer_tx_idx: 0,
|
32703
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32704
|
-
amount: 18446744073709552e3,
|
32705
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
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
|
32706
32471
|
},
|
32707
|
-
{
|
32708
|
-
|
32709
|
-
|
32710
|
-
|
32711
|
-
|
32712
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32713
|
-
amount: 18446744073709552e3,
|
32714
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
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
|
32715
32477
|
},
|
32716
|
-
{
|
32717
|
-
|
32718
|
-
|
32719
|
-
tx_pointer_block_height: 0,
|
32720
|
-
tx_pointer_tx_idx: 0,
|
32721
|
-
owner: "0x86604282dc604481b809845be49667607c470644f6822fc01eb0d22f167e08cf",
|
32722
|
-
amount: 18446744073709552e3,
|
32723
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32478
|
+
script_params: {
|
32479
|
+
max_script_length: 1048576,
|
32480
|
+
max_script_data_length: 1048576
|
32724
32481
|
},
|
32725
|
-
{
|
32726
|
-
|
32727
|
-
|
32728
|
-
tx_pointer_block_height: 0,
|
32729
|
-
tx_pointer_tx_idx: 0,
|
32730
|
-
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32731
|
-
amount: 18446744073709552e3,
|
32732
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32482
|
+
contract_params: {
|
32483
|
+
contract_max_size: 16777216,
|
32484
|
+
max_storage_slots: 255
|
32733
32485
|
},
|
32734
|
-
{
|
32735
|
-
|
32736
|
-
|
32737
|
-
|
32738
|
-
|
32739
|
-
|
32740
|
-
|
32741
|
-
|
32486
|
+
fee_params: {
|
32487
|
+
gas_price_factor: 92,
|
32488
|
+
gas_per_byte: 4
|
32489
|
+
}
|
32490
|
+
},
|
32491
|
+
gas_costs: {
|
32492
|
+
add: 1,
|
32493
|
+
addi: 1,
|
32494
|
+
aloc: 1,
|
32495
|
+
and: 1,
|
32496
|
+
andi: 1,
|
32497
|
+
bal: 13,
|
32498
|
+
bhei: 1,
|
32499
|
+
bhsh: 1,
|
32500
|
+
burn: 132,
|
32501
|
+
cb: 1,
|
32502
|
+
cfei: 1,
|
32503
|
+
cfsi: 1,
|
32504
|
+
croo: 16,
|
32505
|
+
div: 1,
|
32506
|
+
divi: 1,
|
32507
|
+
ecr1: 3e3,
|
32508
|
+
eck1: 951,
|
32509
|
+
ed19: 3e3,
|
32510
|
+
eq: 1,
|
32511
|
+
exp: 1,
|
32512
|
+
expi: 1,
|
32513
|
+
flag: 1,
|
32514
|
+
gm: 1,
|
32515
|
+
gt: 1,
|
32516
|
+
gtf: 1,
|
32517
|
+
ji: 1,
|
32518
|
+
jmp: 1,
|
32519
|
+
jne: 1,
|
32520
|
+
jnei: 1,
|
32521
|
+
jnzi: 1,
|
32522
|
+
jmpf: 1,
|
32523
|
+
jmpb: 1,
|
32524
|
+
jnzf: 1,
|
32525
|
+
jnzb: 1,
|
32526
|
+
jnef: 1,
|
32527
|
+
jneb: 1,
|
32528
|
+
lb: 1,
|
32529
|
+
log: 9,
|
32530
|
+
lt: 1,
|
32531
|
+
lw: 1,
|
32532
|
+
mint: 135,
|
32533
|
+
mlog: 1,
|
32534
|
+
modOp: 1,
|
32535
|
+
modi: 1,
|
32536
|
+
moveOp: 1,
|
32537
|
+
movi: 1,
|
32538
|
+
mroo: 2,
|
32539
|
+
mul: 1,
|
32540
|
+
muli: 1,
|
32541
|
+
mldv: 1,
|
32542
|
+
noop: 1,
|
32543
|
+
not: 1,
|
32544
|
+
or: 1,
|
32545
|
+
ori: 1,
|
32546
|
+
poph: 2,
|
32547
|
+
popl: 2,
|
32548
|
+
pshh: 2,
|
32549
|
+
pshl: 2,
|
32550
|
+
ret: 13,
|
32551
|
+
rvrt: 13,
|
32552
|
+
sb: 1,
|
32553
|
+
sll: 1,
|
32554
|
+
slli: 1,
|
32555
|
+
srl: 1,
|
32556
|
+
srli: 1,
|
32557
|
+
srw: 12,
|
32558
|
+
sub: 1,
|
32559
|
+
subi: 1,
|
32560
|
+
sw: 1,
|
32561
|
+
sww: 67,
|
32562
|
+
time: 1,
|
32563
|
+
tr: 105,
|
32564
|
+
tro: 60,
|
32565
|
+
wdcm: 1,
|
32566
|
+
wqcm: 1,
|
32567
|
+
wdop: 1,
|
32568
|
+
wqop: 1,
|
32569
|
+
wdml: 1,
|
32570
|
+
wqml: 1,
|
32571
|
+
wddv: 1,
|
32572
|
+
wqdv: 2,
|
32573
|
+
wdmd: 3,
|
32574
|
+
wqmd: 4,
|
32575
|
+
wdam: 2,
|
32576
|
+
wqam: 3,
|
32577
|
+
wdmm: 3,
|
32578
|
+
wqmm: 3,
|
32579
|
+
xor: 1,
|
32580
|
+
xori: 1,
|
32581
|
+
call: {
|
32582
|
+
LightOperation: {
|
32583
|
+
base: 144,
|
32584
|
+
units_per_gas: 214
|
32585
|
+
}
|
32742
32586
|
},
|
32743
|
-
{
|
32744
|
-
|
32745
|
-
|
32746
|
-
|
32747
|
-
|
32748
|
-
owner: "0xbca334a06d19db5041c78fe2f465b07be5bec828f38b7796b2877e7d1542c950",
|
32749
|
-
amount: 18446744073709552e3,
|
32750
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32587
|
+
ccp: {
|
32588
|
+
LightOperation: {
|
32589
|
+
base: 15,
|
32590
|
+
units_per_gas: 103
|
32591
|
+
}
|
32751
32592
|
},
|
32752
|
-
{
|
32753
|
-
|
32754
|
-
|
32755
|
-
|
32756
|
-
|
32757
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32758
|
-
amount: 18446744073709552e3,
|
32759
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32593
|
+
csiz: {
|
32594
|
+
LightOperation: {
|
32595
|
+
base: 17,
|
32596
|
+
units_per_gas: 790
|
32597
|
+
}
|
32760
32598
|
},
|
32761
|
-
{
|
32762
|
-
|
32763
|
-
|
32764
|
-
|
32765
|
-
|
32766
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32767
|
-
amount: 18446744073709552e3,
|
32768
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32599
|
+
k256: {
|
32600
|
+
LightOperation: {
|
32601
|
+
base: 11,
|
32602
|
+
units_per_gas: 214
|
32603
|
+
}
|
32769
32604
|
},
|
32770
|
-
{
|
32771
|
-
|
32772
|
-
|
32773
|
-
|
32774
|
-
|
32775
|
-
owner: "0xbd9a1dc8d3ec3521c43f6c2c01611b4d0204c7610204ff0178488c8738a30bd2",
|
32776
|
-
amount: 18446744073709552e3,
|
32777
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32605
|
+
ldc: {
|
32606
|
+
LightOperation: {
|
32607
|
+
base: 15,
|
32608
|
+
units_per_gas: 272
|
32609
|
+
}
|
32778
32610
|
},
|
32779
|
-
{
|
32780
|
-
|
32781
|
-
|
32782
|
-
|
32783
|
-
|
32784
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32785
|
-
amount: 18446744073709552e3,
|
32786
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32611
|
+
logd: {
|
32612
|
+
LightOperation: {
|
32613
|
+
base: 26,
|
32614
|
+
units_per_gas: 64
|
32615
|
+
}
|
32787
32616
|
},
|
32788
|
-
{
|
32789
|
-
|
32790
|
-
|
32791
|
-
|
32792
|
-
|
32793
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32794
|
-
amount: 18446744073709552e3,
|
32795
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32617
|
+
mcl: {
|
32618
|
+
LightOperation: {
|
32619
|
+
base: 1,
|
32620
|
+
units_per_gas: 3333
|
32621
|
+
}
|
32796
32622
|
},
|
32797
|
-
{
|
32798
|
-
|
32799
|
-
|
32800
|
-
|
32801
|
-
|
32802
|
-
owner: "0xb32197cf75efe05bf453c26178139f09b391582065549c1422bc92555ecffb64",
|
32803
|
-
amount: 18446744073709552e3,
|
32804
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32623
|
+
mcli: {
|
32624
|
+
LightOperation: {
|
32625
|
+
base: 1,
|
32626
|
+
units_per_gas: 3333
|
32627
|
+
}
|
32805
32628
|
},
|
32806
|
-
{
|
32807
|
-
|
32808
|
-
|
32809
|
-
|
32810
|
-
|
32811
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32812
|
-
amount: 18446744073709552e3,
|
32813
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32629
|
+
mcp: {
|
32630
|
+
LightOperation: {
|
32631
|
+
base: 1,
|
32632
|
+
units_per_gas: 2e3
|
32633
|
+
}
|
32814
32634
|
},
|
32815
|
-
{
|
32816
|
-
|
32817
|
-
|
32818
|
-
|
32819
|
-
|
32820
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32821
|
-
amount: 18446744073709552e3,
|
32822
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32635
|
+
mcpi: {
|
32636
|
+
LightOperation: {
|
32637
|
+
base: 3,
|
32638
|
+
units_per_gas: 2e3
|
32639
|
+
}
|
32823
32640
|
},
|
32824
|
-
{
|
32825
|
-
|
32826
|
-
|
32827
|
-
|
32828
|
-
|
32829
|
-
owner: "0x3b24509ed4ab3c7959f5c9391c1445c59290cdb5f13d6f780922f376b7029f30",
|
32830
|
-
amount: 18446744073709552e3,
|
32831
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32641
|
+
meq: {
|
32642
|
+
LightOperation: {
|
32643
|
+
base: 1,
|
32644
|
+
units_per_gas: 2500
|
32645
|
+
}
|
32832
32646
|
},
|
32833
|
-
{
|
32834
|
-
|
32835
|
-
|
32836
|
-
|
32837
|
-
|
32838
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32839
|
-
amount: 18446744073709552e3,
|
32840
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32647
|
+
retd: {
|
32648
|
+
LightOperation: {
|
32649
|
+
base: 29,
|
32650
|
+
units_per_gas: 62
|
32651
|
+
}
|
32841
32652
|
},
|
32842
|
-
{
|
32843
|
-
|
32844
|
-
|
32845
|
-
|
32846
|
-
|
32847
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32848
|
-
amount: 18446744073709552e3,
|
32849
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32653
|
+
s256: {
|
32654
|
+
LightOperation: {
|
32655
|
+
base: 2,
|
32656
|
+
units_per_gas: 214
|
32657
|
+
}
|
32850
32658
|
},
|
32851
|
-
{
|
32852
|
-
|
32853
|
-
|
32854
|
-
|
32855
|
-
|
32856
|
-
owner: "0x77c6f40b7da70d885f68efaad7c661327482a63ea10dcb4271de819438254ae1",
|
32857
|
-
amount: 18446744073709552e3,
|
32858
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32659
|
+
scwq: {
|
32660
|
+
LightOperation: {
|
32661
|
+
base: 13,
|
32662
|
+
units_per_gas: 5
|
32663
|
+
}
|
32859
32664
|
},
|
32860
|
-
{
|
32861
|
-
|
32862
|
-
|
32863
|
-
|
32864
|
-
|
32865
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32866
|
-
amount: 18446744073709552e3,
|
32867
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32665
|
+
smo: {
|
32666
|
+
LightOperation: {
|
32667
|
+
base: 209,
|
32668
|
+
units_per_gas: 55
|
32669
|
+
}
|
32868
32670
|
},
|
32869
|
-
{
|
32870
|
-
|
32871
|
-
|
32872
|
-
|
32873
|
-
|
32874
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32875
|
-
amount: 18446744073709552e3,
|
32876
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32671
|
+
srwq: {
|
32672
|
+
LightOperation: {
|
32673
|
+
base: 47,
|
32674
|
+
units_per_gas: 5
|
32675
|
+
}
|
32877
32676
|
},
|
32878
|
-
{
|
32879
|
-
|
32880
|
-
|
32881
|
-
|
32882
|
-
|
32883
|
-
owner: "0x6a2c4691c547c43924650dbd30620b184b5fe3fb6dbe5c4446110b08f6f405bf",
|
32884
|
-
amount: 18446744073709552e3,
|
32885
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32677
|
+
swwq: {
|
32678
|
+
LightOperation: {
|
32679
|
+
base: 44,
|
32680
|
+
units_per_gas: 5
|
32681
|
+
}
|
32886
32682
|
},
|
32887
|
-
{
|
32888
|
-
|
32889
|
-
|
32890
|
-
|
32891
|
-
|
32892
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32893
|
-
amount: 18446744073709552e3,
|
32894
|
-
asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32683
|
+
contract_root: {
|
32684
|
+
LightOperation: {
|
32685
|
+
base: 75,
|
32686
|
+
units_per_gas: 1
|
32687
|
+
}
|
32895
32688
|
},
|
32896
|
-
{
|
32897
|
-
|
32898
|
-
|
32899
|
-
|
32900
|
-
|
32901
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32902
|
-
amount: 18446744073709552e3,
|
32903
|
-
asset_id: "0x0101010101010101010101010101010101010101010101010101010101010101"
|
32689
|
+
state_root: {
|
32690
|
+
LightOperation: {
|
32691
|
+
base: 412,
|
32692
|
+
units_per_gas: 1
|
32693
|
+
}
|
32904
32694
|
},
|
32905
|
-
{
|
32906
|
-
|
32907
|
-
|
32908
|
-
|
32909
|
-
|
32910
|
-
owner: "0x49075a7538e2c88ebe1926ce4d898198a2a4e790d14512943a9864bc536b3c82",
|
32911
|
-
amount: 18446744073709552e3,
|
32912
|
-
asset_id: "0x0202020202020202020202020202020202020202020202020202020202020202"
|
32913
|
-
}
|
32914
|
-
],
|
32915
|
-
messages: [
|
32916
|
-
{
|
32917
|
-
sender: "0xc43454aa38dd91f88109a4b7aef5efb96ce34e3f24992fe0f81d233ca686f80f",
|
32918
|
-
recipient: "0x69a2b736b60159b43bb8a4f98c0589f6da5fa3a3d101e8e269c499eb942753ba",
|
32919
|
-
nonce: "0101010101010101010101010101010101010101010101010101010101010101",
|
32920
|
-
amount: 18446744073709552e3,
|
32921
|
-
data: "",
|
32922
|
-
da_height: 0
|
32695
|
+
vm_initialization: {
|
32696
|
+
HeavyOperation: {
|
32697
|
+
base: 2e3,
|
32698
|
+
gas_per_unit: 0
|
32699
|
+
}
|
32923
32700
|
},
|
32924
|
-
|
32925
|
-
|
32926
|
-
|
32927
|
-
|
32928
|
-
|
32929
|
-
data: "",
|
32930
|
-
da_height: 0
|
32701
|
+
new_storage_per_byte: 1
|
32702
|
+
},
|
32703
|
+
consensus: {
|
32704
|
+
PoA: {
|
32705
|
+
signing_key: "0x94ffcc53b892684acefaebc8a3d4a595e528a8cf664eeb3ef36f1020b0809d0d"
|
32931
32706
|
}
|
32932
|
-
|
32933
|
-
contracts: [],
|
32934
|
-
block_height: 0,
|
32935
|
-
da_block_height: 0
|
32936
|
-
};
|
32937
|
-
var defaultChainConfigs = {
|
32938
|
-
chainConfigJson: chainConfig_default,
|
32939
|
-
metadataJson: metadata_default,
|
32940
|
-
stateConfigJson: stateConfig_default
|
32707
|
+
}
|
32941
32708
|
};
|
32709
|
+
var defaultChainConfig = chainConfig_default;
|
32942
32710
|
var defaultConsensusKey = "0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298";
|
32943
32711
|
|
32944
32712
|
// ../crypto/dist/index.mjs
|
@@ -35231,182 +34999,32 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35231
34999
|
function toBytes3(value, bytesPadding) {
|
35232
35000
|
return bn(value).toBytes(bytesPadding);
|
35233
35001
|
}
|
35234
|
-
|
35235
|
-
|
35236
|
-
function _isPlaceholder(a) {
|
35237
|
-
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
35002
|
+
function max(...numbers) {
|
35003
|
+
return numbers.reduce((prev, cur) => bn(cur).gt(prev) ? bn(cur) : prev, bn(0));
|
35238
35004
|
}
|
35239
35005
|
|
35240
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
35241
|
-
function _curry1(fn) {
|
35242
|
-
return function f1(a) {
|
35243
|
-
if (arguments.length === 0 || _isPlaceholder(a)) {
|
35244
|
-
return f1;
|
35245
|
-
} else {
|
35246
|
-
return fn.apply(this, arguments);
|
35247
|
-
}
|
35248
|
-
};
|
35249
|
-
}
|
35250
|
-
|
35251
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
35252
|
-
var isArray_default = Array.isArray || function _isArray(val) {
|
35253
|
-
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
35254
|
-
};
|
35255
|
-
|
35256
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
35257
|
-
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
35258
|
-
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
35259
|
-
});
|
35260
|
-
var type_default = type;
|
35261
|
-
|
35262
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
35263
|
-
var pad = function pad2(n) {
|
35264
|
-
return (n < 10 ? "0" : "") + n;
|
35265
|
-
};
|
35266
|
-
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
35267
|
-
return d.toISOString();
|
35268
|
-
} : function _toISOString3(d) {
|
35269
|
-
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";
|
35270
|
-
};
|
35271
|
-
|
35272
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
35273
|
-
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
35274
|
-
return n << 0 === n;
|
35275
|
-
};
|
35276
|
-
|
35277
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
35278
|
-
function _cloneRegExp(pattern) {
|
35279
|
-
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" : ""));
|
35280
|
-
}
|
35281
|
-
|
35282
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
35283
|
-
function _clone(value, deep, map) {
|
35284
|
-
map || (map = new _ObjectMap());
|
35285
|
-
if (_isPrimitive(value)) {
|
35286
|
-
return value;
|
35287
|
-
}
|
35288
|
-
var copy = function copy2(copiedValue) {
|
35289
|
-
var cachedCopy = map.get(value);
|
35290
|
-
if (cachedCopy) {
|
35291
|
-
return cachedCopy;
|
35292
|
-
}
|
35293
|
-
map.set(value, copiedValue);
|
35294
|
-
for (var key in value) {
|
35295
|
-
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
35296
|
-
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
35297
|
-
}
|
35298
|
-
}
|
35299
|
-
return copiedValue;
|
35300
|
-
};
|
35301
|
-
switch (type_default(value)) {
|
35302
|
-
case "Object":
|
35303
|
-
return copy(Object.create(Object.getPrototypeOf(value)));
|
35304
|
-
case "Array":
|
35305
|
-
return copy([]);
|
35306
|
-
case "Date":
|
35307
|
-
return new Date(value.valueOf());
|
35308
|
-
case "RegExp":
|
35309
|
-
return _cloneRegExp(value);
|
35310
|
-
case "Int8Array":
|
35311
|
-
case "Uint8Array":
|
35312
|
-
case "Uint8ClampedArray":
|
35313
|
-
case "Int16Array":
|
35314
|
-
case "Uint16Array":
|
35315
|
-
case "Int32Array":
|
35316
|
-
case "Uint32Array":
|
35317
|
-
case "Float32Array":
|
35318
|
-
case "Float64Array":
|
35319
|
-
case "BigInt64Array":
|
35320
|
-
case "BigUint64Array":
|
35321
|
-
return value.slice();
|
35322
|
-
default:
|
35323
|
-
return value;
|
35324
|
-
}
|
35325
|
-
}
|
35326
|
-
function _isPrimitive(param) {
|
35327
|
-
var type3 = typeof param;
|
35328
|
-
return param == null || type3 != "object" && type3 != "function";
|
35329
|
-
}
|
35330
|
-
var _ObjectMap = /* @__PURE__ */ function() {
|
35331
|
-
function _ObjectMap2() {
|
35332
|
-
this.map = {};
|
35333
|
-
this.length = 0;
|
35334
|
-
}
|
35335
|
-
_ObjectMap2.prototype.set = function(key, value) {
|
35336
|
-
const hashedKey = this.hash(key);
|
35337
|
-
let bucket = this.map[hashedKey];
|
35338
|
-
if (!bucket) {
|
35339
|
-
this.map[hashedKey] = bucket = [];
|
35340
|
-
}
|
35341
|
-
bucket.push([key, value]);
|
35342
|
-
this.length += 1;
|
35343
|
-
};
|
35344
|
-
_ObjectMap2.prototype.hash = function(key) {
|
35345
|
-
let hashedKey = [];
|
35346
|
-
for (var value in key) {
|
35347
|
-
hashedKey.push(Object.prototype.toString.call(key[value]));
|
35348
|
-
}
|
35349
|
-
return hashedKey.join();
|
35350
|
-
};
|
35351
|
-
_ObjectMap2.prototype.get = function(key) {
|
35352
|
-
if (this.length <= 180) {
|
35353
|
-
for (const p in this.map) {
|
35354
|
-
const bucket2 = this.map[p];
|
35355
|
-
for (let i = 0; i < bucket2.length; i += 1) {
|
35356
|
-
const element = bucket2[i];
|
35357
|
-
if (element[0] === key) {
|
35358
|
-
return element[1];
|
35359
|
-
}
|
35360
|
-
}
|
35361
|
-
}
|
35362
|
-
return;
|
35363
|
-
}
|
35364
|
-
const hashedKey = this.hash(key);
|
35365
|
-
const bucket = this.map[hashedKey];
|
35366
|
-
if (!bucket) {
|
35367
|
-
return;
|
35368
|
-
}
|
35369
|
-
for (let i = 0; i < bucket.length; i += 1) {
|
35370
|
-
const element = bucket[i];
|
35371
|
-
if (element[0] === key) {
|
35372
|
-
return element[1];
|
35373
|
-
}
|
35374
|
-
}
|
35375
|
-
};
|
35376
|
-
return _ObjectMap2;
|
35377
|
-
}();
|
35378
|
-
|
35379
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
35380
|
-
var clone = /* @__PURE__ */ _curry1(function clone2(value) {
|
35381
|
-
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
35382
|
-
});
|
35383
|
-
var clone_default = clone;
|
35384
|
-
|
35385
|
-
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
35386
|
-
var hasProtoTrim = typeof String.prototype.trim === "function";
|
35387
|
-
|
35388
35006
|
// src/providers/coin-quantity.ts
|
35389
35007
|
var coinQuantityfy = (coinQuantityLike) => {
|
35390
35008
|
let assetId;
|
35391
35009
|
let amount;
|
35392
|
-
let
|
35010
|
+
let max2;
|
35393
35011
|
if (Array.isArray(coinQuantityLike)) {
|
35394
35012
|
amount = coinQuantityLike[0];
|
35395
35013
|
assetId = coinQuantityLike[1] ?? BaseAssetId;
|
35396
|
-
|
35014
|
+
max2 = coinQuantityLike[2] ?? void 0;
|
35397
35015
|
} else {
|
35398
35016
|
amount = coinQuantityLike.amount;
|
35399
35017
|
assetId = coinQuantityLike.assetId ?? BaseAssetId;
|
35400
|
-
|
35018
|
+
max2 = coinQuantityLike.max ?? void 0;
|
35401
35019
|
}
|
35402
35020
|
const bnAmount = bn(amount);
|
35403
35021
|
return {
|
35404
35022
|
assetId: hexlify(assetId),
|
35405
35023
|
amount: bnAmount.lt(1) ? bn(1) : bnAmount,
|
35406
|
-
max:
|
35024
|
+
max: max2 ? bn(max2) : void 0
|
35407
35025
|
};
|
35408
35026
|
};
|
35409
|
-
var
|
35027
|
+
var addAmountToAsset = (params) => {
|
35410
35028
|
const { amount, assetId } = params;
|
35411
35029
|
const coinQuantities = [...params.coinQuantities];
|
35412
35030
|
const assetIdx = coinQuantities.findIndex((coinQuantity) => coinQuantity.assetId === assetId);
|
@@ -35480,9 +35098,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35480
35098
|
var TX_POINTER_LEN = WORD_SIZE * 2;
|
35481
35099
|
var MAX_BYTES = 2 ** 32 - 1;
|
35482
35100
|
var calculateVmTxMemory = ({ maxInputs }) => BYTES_32 + // Tx ID
|
35483
|
-
|
35101
|
+
WORD_SIZE + // Tx size
|
35484
35102
|
// Asset ID/Balance coin input pairs
|
35485
|
-
maxInputs * (ASSET_ID_LEN + WORD_SIZE)
|
35103
|
+
maxInputs * (ASSET_ID_LEN + WORD_SIZE);
|
35486
35104
|
var SCRIPT_FIXED_SIZE = WORD_SIZE + // Identifier
|
35487
35105
|
WORD_SIZE + // Gas limit
|
35488
35106
|
WORD_SIZE + // Script size
|
@@ -35500,6 +35118,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35500
35118
|
ASSET_ID_LEN + // Asset id
|
35501
35119
|
TX_POINTER_LEN + // TxPointer
|
35502
35120
|
WORD_SIZE + // Witnesses index
|
35121
|
+
WORD_SIZE + // Maturity
|
35503
35122
|
WORD_SIZE + // Predicate size
|
35504
35123
|
WORD_SIZE + // Predicate data size
|
35505
35124
|
WORD_SIZE;
|
@@ -35622,15 +35241,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35622
35241
|
}
|
35623
35242
|
};
|
35624
35243
|
var isHeapType = (type3) => type3 === VEC_CODER_TYPE || type3 === BYTES_CODER_TYPE || type3 === STD_STRING_CODER_TYPE;
|
35625
|
-
function findOrThrow(arr, predicate, throwFn = () => {
|
35626
|
-
throw new FuelError(ErrorCode.ELEMENT_NOT_FOUND, "Element not found in the array.");
|
35627
|
-
}) {
|
35628
|
-
const found = arr.find(predicate);
|
35629
|
-
if (found === void 0) {
|
35630
|
-
throwFn();
|
35631
|
-
}
|
35632
|
-
return found;
|
35633
|
-
}
|
35634
35244
|
var isMultipleOfWordSize = (length) => length % WORD_SIZE === 0;
|
35635
35245
|
var getWordSizePadding = (length) => WORD_SIZE - length % WORD_SIZE;
|
35636
35246
|
var rightPadToWordSize = (encoded) => {
|
@@ -35829,7 +35439,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35829
35439
|
constructor(name, coders) {
|
35830
35440
|
const caseIndexCoder = new BigNumberCoder("u64");
|
35831
35441
|
const encodedValueSize = Object.values(coders).reduce(
|
35832
|
-
(
|
35442
|
+
(max2, coder) => Math.max(max2, coder.encodedLength),
|
35833
35443
|
0
|
35834
35444
|
);
|
35835
35445
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36213,6 +35823,38 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36213
35823
|
];
|
36214
35824
|
}
|
36215
35825
|
};
|
35826
|
+
var findFunctionByName = (abi, name) => {
|
35827
|
+
const fn = abi.functions.find((f2) => f2.name === name);
|
35828
|
+
if (!fn) {
|
35829
|
+
throw new FuelError(
|
35830
|
+
ErrorCode.FUNCTION_NOT_FOUND,
|
35831
|
+
`Function with name '${name}' doesn't exist in the ABI`
|
35832
|
+
);
|
35833
|
+
}
|
35834
|
+
return fn;
|
35835
|
+
};
|
35836
|
+
var findTypeById = (abi, typeId) => {
|
35837
|
+
const type3 = abi.types.find((t) => t.typeId === typeId);
|
35838
|
+
if (!type3) {
|
35839
|
+
throw new FuelError(
|
35840
|
+
ErrorCode.TYPE_NOT_FOUND,
|
35841
|
+
`Type with typeId '${typeId}' doesn't exist in the ABI.`
|
35842
|
+
);
|
35843
|
+
}
|
35844
|
+
return type3;
|
35845
|
+
};
|
35846
|
+
var findNonEmptyInputs = (abi, inputs) => inputs.filter((input) => findTypeById(abi, input.type).type !== "()");
|
35847
|
+
var findVectorBufferArgument = (components) => {
|
35848
|
+
const bufferComponent = components.find((c) => c.name === "buf");
|
35849
|
+
const bufferTypeArgument = bufferComponent?.originalTypeArguments?.[0];
|
35850
|
+
if (!bufferComponent || !bufferTypeArgument) {
|
35851
|
+
throw new FuelError(
|
35852
|
+
ErrorCode.INVALID_COMPONENT,
|
35853
|
+
`The Vec type provided is missing or has a malformed 'buf' component.`
|
35854
|
+
);
|
35855
|
+
}
|
35856
|
+
return bufferTypeArgument;
|
35857
|
+
};
|
36216
35858
|
var ResolvedAbiType = class {
|
36217
35859
|
abi;
|
36218
35860
|
name;
|
@@ -36221,20 +35863,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36221
35863
|
components;
|
36222
35864
|
constructor(abi, argument) {
|
36223
35865
|
this.abi = abi;
|
36224
|
-
const type3 = findOrThrow(
|
36225
|
-
abi.types,
|
36226
|
-
(t) => t.typeId === argument.type,
|
36227
|
-
() => {
|
36228
|
-
throw new FuelError(
|
36229
|
-
ErrorCode.TYPE_NOT_FOUND,
|
36230
|
-
`Type does not exist in the provided abi: ${JSON.stringify({
|
36231
|
-
argument,
|
36232
|
-
abi: this.abi
|
36233
|
-
})}`
|
36234
|
-
);
|
36235
|
-
}
|
36236
|
-
);
|
36237
35866
|
this.name = argument.name;
|
35867
|
+
const type3 = findTypeById(abi, argument.type);
|
36238
35868
|
this.type = type3.type;
|
36239
35869
|
this.originalTypeArguments = argument.typeArguments;
|
36240
35870
|
this.components = ResolvedAbiType.getResolvedGenericComponents(
|
@@ -36286,7 +35916,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36286
35916
|
)
|
36287
35917
|
};
|
36288
35918
|
}
|
36289
|
-
const argType =
|
35919
|
+
const argType = findTypeById(abi, arg.type);
|
36290
35920
|
const implicitTypeParameters = this.getImplicitGenericTypeParameters(abi, argType.components);
|
36291
35921
|
if (implicitTypeParameters && implicitTypeParameters.length > 0) {
|
36292
35922
|
return {
|
@@ -36303,7 +35933,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36303
35933
|
}
|
36304
35934
|
const implicitGenericParameters = implicitGenericParametersParam ?? [];
|
36305
35935
|
args.forEach((a) => {
|
36306
|
-
const argType =
|
35936
|
+
const argType = findTypeById(abi, a.type);
|
36307
35937
|
if (genericRegEx.test(argType.type)) {
|
36308
35938
|
implicitGenericParameters.push(argType.typeId);
|
36309
35939
|
return;
|
@@ -36412,13 +36042,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36412
36042
|
return new ArrayCoder(arrayElementCoder, length);
|
36413
36043
|
}
|
36414
36044
|
if (resolvedAbiType.type === VEC_CODER_TYPE) {
|
36415
|
-
const arg =
|
36416
|
-
if (!arg) {
|
36417
|
-
throw new FuelError(
|
36418
|
-
ErrorCode.INVALID_COMPONENT,
|
36419
|
-
`The provided Vec type is missing the 'type argument'.`
|
36420
|
-
);
|
36421
|
-
}
|
36045
|
+
const arg = findVectorBufferArgument(components);
|
36422
36046
|
const argType = new ResolvedAbiType(resolvedAbiType.abi, arg);
|
36423
36047
|
const itemCoder = getCoder(argType, { isSmallBytes: true, encoding: ENCODING_V0 });
|
36424
36048
|
return new VecCoder(itemCoder);
|
@@ -36516,7 +36140,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36516
36140
|
constructor(name, coders) {
|
36517
36141
|
const caseIndexCoder = new BigNumberCoder("u64");
|
36518
36142
|
const encodedValueSize = Object.values(coders).reduce(
|
36519
|
-
(
|
36143
|
+
(max2, coder) => Math.max(max2, coder.encodedLength),
|
36520
36144
|
0
|
36521
36145
|
);
|
36522
36146
|
super(`enum ${name}`, `enum ${name}`, caseIndexCoder.encodedLength + encodedValueSize);
|
@@ -36887,13 +36511,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36887
36511
|
return new ArrayCoder(arrayElementCoder, length);
|
36888
36512
|
}
|
36889
36513
|
if (resolvedAbiType.type === VEC_CODER_TYPE) {
|
36890
|
-
const arg =
|
36891
|
-
if (!arg) {
|
36892
|
-
throw new FuelError(
|
36893
|
-
ErrorCode.INVALID_COMPONENT,
|
36894
|
-
`The provided Vec type is missing the 'type argument'.`
|
36895
|
-
);
|
36896
|
-
}
|
36514
|
+
const arg = findVectorBufferArgument(components);
|
36897
36515
|
const argType = new ResolvedAbiType(resolvedAbiType.abi, arg);
|
36898
36516
|
const itemCoder = getCoder2(argType, { isSmallBytes: true, encoding: ENCODING_V0 });
|
36899
36517
|
return new VecCoder2(itemCoder);
|
@@ -36964,7 +36582,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36964
36582
|
jsonAbi;
|
36965
36583
|
constructor(jsonAbi, name) {
|
36966
36584
|
this.jsonAbi = jsonAbi;
|
36967
|
-
this.jsonFn =
|
36585
|
+
this.jsonFn = findFunctionByName(this.jsonAbi, name);
|
36968
36586
|
this.name = name;
|
36969
36587
|
this.signature = FunctionFragment.getSignature(this.jsonAbi, this.jsonFn);
|
36970
36588
|
this.selector = FunctionFragment.getFunctionSelector(this.signature);
|
@@ -36988,13 +36606,11 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36988
36606
|
return bn(hashedFunctionSignature.slice(0, 10)).toHex(8);
|
36989
36607
|
}
|
36990
36608
|
#isInputDataPointer() {
|
36991
|
-
const inputTypes = this.jsonFn.inputs.map(
|
36992
|
-
(i) => this.jsonAbi.types.find((t) => t.typeId === i.type)
|
36993
|
-
);
|
36609
|
+
const inputTypes = this.jsonFn.inputs.map((i) => findTypeById(this.jsonAbi, i.type));
|
36994
36610
|
return this.jsonFn.inputs.length > 1 || isPointerType(inputTypes[0]?.type || "");
|
36995
36611
|
}
|
36996
36612
|
#isOutputDataHeap() {
|
36997
|
-
const outputType =
|
36613
|
+
const outputType = findTypeById(this.jsonAbi, this.jsonFn.output.type);
|
36998
36614
|
return isHeapType(outputType?.type || "");
|
36999
36615
|
}
|
37000
36616
|
#getOutputEncodedLength() {
|
@@ -37014,9 +36630,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37014
36630
|
encodeArguments(values, offset = 0) {
|
37015
36631
|
FunctionFragment.verifyArgsAndInputsAlign(values, this.jsonFn.inputs, this.jsonAbi);
|
37016
36632
|
const shallowCopyValues = values.slice();
|
37017
|
-
const nonEmptyInputs = this.jsonFn.inputs
|
37018
|
-
(x) => findOrThrow(this.jsonAbi.types, (t) => t.typeId === x.type).type !== "()"
|
37019
|
-
);
|
36633
|
+
const nonEmptyInputs = findNonEmptyInputs(this.jsonAbi, this.jsonFn.inputs);
|
37020
36634
|
if (Array.isArray(values) && nonEmptyInputs.length !== values.length) {
|
37021
36635
|
shallowCopyValues.length = this.jsonFn.inputs.length;
|
37022
36636
|
shallowCopyValues.fill(void 0, values.length);
|
@@ -37037,7 +36651,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37037
36651
|
if (args.length === inputs.length) {
|
37038
36652
|
return;
|
37039
36653
|
}
|
37040
|
-
const inputTypes = inputs.map((
|
36654
|
+
const inputTypes = inputs.map((input) => findTypeById(abi, input.type));
|
37041
36655
|
const optionalInputs = inputTypes.filter(
|
37042
36656
|
(x) => x.type === OPTION_CODER_TYPE || x.type === "()"
|
37043
36657
|
);
|
@@ -37052,9 +36666,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37052
36666
|
}
|
37053
36667
|
decodeArguments(data) {
|
37054
36668
|
const bytes3 = arrayify(data);
|
37055
|
-
const nonEmptyInputs = this.jsonFn.inputs
|
37056
|
-
(x) => findOrThrow(this.jsonAbi.types, (t) => t.typeId === x.type).type !== "()"
|
37057
|
-
);
|
36669
|
+
const nonEmptyInputs = findNonEmptyInputs(this.jsonAbi, this.jsonFn.inputs);
|
37058
36670
|
if (nonEmptyInputs.length === 0) {
|
37059
36671
|
if (bytes3.length === 0) {
|
37060
36672
|
return void 0;
|
@@ -37089,10 +36701,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37089
36701
|
return result.decoded;
|
37090
36702
|
}
|
37091
36703
|
decodeOutput(data) {
|
37092
|
-
const outputAbiType =
|
37093
|
-
this.jsonAbi.types,
|
37094
|
-
(t) => t.typeId === this.jsonFn.output.type
|
37095
|
-
);
|
36704
|
+
const outputAbiType = findTypeById(this.jsonAbi, this.jsonFn.output.type);
|
37096
36705
|
if (outputAbiType.type === "()") {
|
37097
36706
|
return [void 0, 0];
|
37098
36707
|
}
|
@@ -37144,38 +36753,32 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37144
36753
|
return fragment.decodeOutput(data);
|
37145
36754
|
}
|
37146
36755
|
decodeLog(data, logId) {
|
37147
|
-
const
|
37148
|
-
|
36756
|
+
const loggedType = this.jsonAbi.loggedTypes.find((type3) => type3.logId === logId);
|
36757
|
+
if (!loggedType) {
|
36758
|
+
throw new FuelError(
|
36759
|
+
ErrorCode.LOG_TYPE_NOT_FOUND,
|
36760
|
+
`Log type with logId '${logId}' doesn't exist in the ABI.`
|
36761
|
+
);
|
36762
|
+
}
|
36763
|
+
return AbiCoder.decode(this.jsonAbi, loggedType.loggedType, arrayify(data), 0, {
|
37149
36764
|
encoding: this.jsonAbi.encoding
|
37150
36765
|
});
|
37151
36766
|
}
|
37152
36767
|
encodeConfigurable(name, value) {
|
37153
|
-
const configurable =
|
37154
|
-
|
37155
|
-
|
37156
|
-
|
37157
|
-
|
37158
|
-
|
37159
|
-
|
37160
|
-
);
|
37161
|
-
}
|
37162
|
-
);
|
36768
|
+
const configurable = this.jsonAbi.configurables.find((c) => c.name === name);
|
36769
|
+
if (!configurable) {
|
36770
|
+
throw new FuelError(
|
36771
|
+
ErrorCode.CONFIGURABLE_NOT_FOUND,
|
36772
|
+
`A configurable with the '${name}' was not found in the ABI.`
|
36773
|
+
);
|
36774
|
+
}
|
37163
36775
|
return AbiCoder.encode(this.jsonAbi, configurable.configurableType, value, {
|
37164
36776
|
isRightPadded: true,
|
37165
36777
|
encoding: this.jsonAbi.encoding
|
37166
36778
|
});
|
37167
36779
|
}
|
37168
36780
|
getTypeById(typeId) {
|
37169
|
-
return
|
37170
|
-
this.jsonAbi.types,
|
37171
|
-
(t) => t.typeId === typeId,
|
37172
|
-
() => {
|
37173
|
-
throw new FuelError(
|
37174
|
-
ErrorCode.TYPE_NOT_FOUND,
|
37175
|
-
`Type with typeId '${typeId}' doesn't exist in the ABI.`
|
37176
|
-
);
|
37177
|
-
}
|
37178
|
-
);
|
36781
|
+
return findTypeById(this.jsonAbi, typeId);
|
37179
36782
|
}
|
37180
36783
|
};
|
37181
36784
|
|
@@ -37239,19 +36842,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37239
36842
|
encode(value) {
|
37240
36843
|
const parts = [];
|
37241
36844
|
parts.push(new B256Coder().encode(value.txID));
|
37242
|
-
parts.push(new NumberCoder("
|
36845
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37243
36846
|
parts.push(new B256Coder().encode(value.owner));
|
37244
36847
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37245
36848
|
parts.push(new B256Coder().encode(value.assetId));
|
37246
36849
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
37247
|
-
parts.push(new NumberCoder("
|
36850
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
36851
|
+
parts.push(new NumberCoder("u32").encode(value.maturity));
|
37248
36852
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37249
|
-
parts.push(new
|
37250
|
-
parts.push(new
|
37251
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37252
|
-
parts.push(
|
37253
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37254
|
-
);
|
36853
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36854
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
36855
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36856
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37255
36857
|
return concat(parts);
|
37256
36858
|
}
|
37257
36859
|
decode(data, offset) {
|
@@ -37259,7 +36861,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37259
36861
|
let o = offset;
|
37260
36862
|
[decoded, o] = new B256Coder().decode(data, o);
|
37261
36863
|
const txID = decoded;
|
37262
|
-
[decoded, o] = new NumberCoder("
|
36864
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37263
36865
|
const outputIndex = decoded;
|
37264
36866
|
[decoded, o] = new B256Coder().decode(data, o);
|
37265
36867
|
const owner = decoded;
|
@@ -37269,17 +36871,19 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37269
36871
|
const assetId = decoded;
|
37270
36872
|
[decoded, o] = new TxPointerCoder().decode(data, o);
|
37271
36873
|
const txPointer = decoded;
|
37272
|
-
[decoded, o] = new NumberCoder("
|
36874
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37273
36875
|
const witnessIndex = Number(decoded);
|
36876
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
36877
|
+
const maturity = decoded;
|
37274
36878
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37275
36879
|
const predicateGasUsed = decoded;
|
37276
|
-
[decoded, o] = new
|
36880
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37277
36881
|
const predicateLength = decoded;
|
37278
|
-
[decoded, o] = new
|
36882
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37279
36883
|
const predicateDataLength = decoded;
|
37280
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
36884
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37281
36885
|
const predicate = decoded;
|
37282
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
36886
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37283
36887
|
const predicateData = decoded;
|
37284
36888
|
return [
|
37285
36889
|
{
|
@@ -37291,6 +36895,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37291
36895
|
assetId,
|
37292
36896
|
txPointer,
|
37293
36897
|
witnessIndex,
|
36898
|
+
maturity,
|
37294
36899
|
predicateGasUsed,
|
37295
36900
|
predicateLength,
|
37296
36901
|
predicateDataLength,
|
@@ -37308,7 +36913,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37308
36913
|
encode(value) {
|
37309
36914
|
const parts = [];
|
37310
36915
|
parts.push(new B256Coder().encode(value.txID));
|
37311
|
-
parts.push(new NumberCoder("
|
36916
|
+
parts.push(new NumberCoder("u8").encode(value.outputIndex));
|
37312
36917
|
parts.push(new B256Coder().encode(value.balanceRoot));
|
37313
36918
|
parts.push(new B256Coder().encode(value.stateRoot));
|
37314
36919
|
parts.push(new TxPointerCoder().encode(value.txPointer));
|
@@ -37320,7 +36925,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37320
36925
|
let o = offset;
|
37321
36926
|
[decoded, o] = new B256Coder().decode(data, o);
|
37322
36927
|
const txID = decoded;
|
37323
|
-
[decoded, o] = new NumberCoder("
|
36928
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37324
36929
|
const outputIndex = decoded;
|
37325
36930
|
[decoded, o] = new B256Coder().decode(data, o);
|
37326
36931
|
const balanceRoot = decoded;
|
@@ -37369,16 +36974,14 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37369
36974
|
parts.push(new ByteArrayCoder(32).encode(value.recipient));
|
37370
36975
|
parts.push(new BigNumberCoder("u64").encode(value.amount));
|
37371
36976
|
parts.push(new ByteArrayCoder(32).encode(value.nonce));
|
37372
|
-
parts.push(new NumberCoder("
|
36977
|
+
parts.push(new NumberCoder("u8").encode(value.witnessIndex));
|
37373
36978
|
parts.push(new BigNumberCoder("u64").encode(value.predicateGasUsed));
|
37374
|
-
parts.push(new
|
37375
|
-
parts.push(new
|
37376
|
-
parts.push(new
|
36979
|
+
parts.push(new NumberCoder("u32").encode(data.length));
|
36980
|
+
parts.push(new NumberCoder("u32").encode(value.predicateLength));
|
36981
|
+
parts.push(new NumberCoder("u32").encode(value.predicateDataLength));
|
37377
36982
|
parts.push(new ByteArrayCoder(data.length).encode(data));
|
37378
|
-
parts.push(new ByteArrayCoder(value.predicateLength
|
37379
|
-
parts.push(
|
37380
|
-
new ByteArrayCoder(value.predicateDataLength.toNumber()).encode(value.predicateData)
|
37381
|
-
);
|
36983
|
+
parts.push(new ByteArrayCoder(value.predicateLength).encode(value.predicate));
|
36984
|
+
parts.push(new ByteArrayCoder(value.predicateDataLength).encode(value.predicateData));
|
37382
36985
|
return concat(parts);
|
37383
36986
|
}
|
37384
36987
|
static decodeData(messageData) {
|
@@ -37398,21 +37001,21 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37398
37001
|
const amount = decoded;
|
37399
37002
|
[decoded, o] = new B256Coder().decode(data, o);
|
37400
37003
|
const nonce = decoded;
|
37401
|
-
[decoded, o] = new NumberCoder("
|
37004
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
37402
37005
|
const witnessIndex = Number(decoded);
|
37403
37006
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37404
37007
|
const predicateGasUsed = decoded;
|
37405
37008
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37406
37009
|
const dataLength2 = decoded;
|
37407
|
-
[decoded, o] = new
|
37010
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37408
37011
|
const predicateLength = decoded;
|
37409
|
-
[decoded, o] = new
|
37012
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37410
37013
|
const predicateDataLength = decoded;
|
37411
37014
|
[decoded, o] = new ByteArrayCoder(dataLength2).decode(data, o);
|
37412
37015
|
const messageData = decoded;
|
37413
|
-
[decoded, o] = new ByteArrayCoder(predicateLength
|
37016
|
+
[decoded, o] = new ByteArrayCoder(predicateLength).decode(data, o);
|
37414
37017
|
const predicate = decoded;
|
37415
|
-
[decoded, o] = new ByteArrayCoder(predicateDataLength
|
37018
|
+
[decoded, o] = new ByteArrayCoder(predicateDataLength).decode(data, o);
|
37416
37019
|
const predicateData = decoded;
|
37417
37020
|
return [
|
37418
37021
|
{
|
@@ -37724,7 +37327,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37724
37327
|
}
|
37725
37328
|
};
|
37726
37329
|
var PolicyType = /* @__PURE__ */ ((PolicyType2) => {
|
37727
|
-
PolicyType2[PolicyType2["
|
37330
|
+
PolicyType2[PolicyType2["GasPrice"] = 1] = "GasPrice";
|
37728
37331
|
PolicyType2[PolicyType2["WitnessLimit"] = 2] = "WitnessLimit";
|
37729
37332
|
PolicyType2[PolicyType2["Maturity"] = 4] = "Maturity";
|
37730
37333
|
PolicyType2[PolicyType2["MaxFee"] = 8] = "MaxFee";
|
@@ -37772,9 +37375,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
37772
37375
|
let o = offset;
|
37773
37376
|
const policies = [];
|
37774
37377
|
if (policyTypes & 1) {
|
37775
|
-
const [
|
37378
|
+
const [gasPrice, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
37776
37379
|
o = nextOffset;
|
37777
|
-
policies.push({ type: 1, data:
|
37380
|
+
policies.push({ type: 1, data: gasPrice });
|
37778
37381
|
}
|
37779
37382
|
if (policyTypes & 2) {
|
37780
37383
|
const [witnessLimit, nextOffset] = new BigNumberCoder("u64").decode(data, o);
|
@@ -38006,15 +37609,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38006
37609
|
encode(value) {
|
38007
37610
|
const parts = [];
|
38008
37611
|
parts.push(new BigNumberCoder("u64").encode(value.scriptGasLimit));
|
38009
|
-
parts.push(new
|
38010
|
-
parts.push(new
|
38011
|
-
parts.push(new BigNumberCoder("u64").encode(value.scriptDataLength));
|
37612
|
+
parts.push(new NumberCoder("u32").encode(value.scriptLength));
|
37613
|
+
parts.push(new NumberCoder("u32").encode(value.scriptDataLength));
|
38012
37614
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38013
|
-
parts.push(new NumberCoder("
|
38014
|
-
parts.push(new NumberCoder("
|
38015
|
-
parts.push(new NumberCoder("
|
38016
|
-
parts.push(new
|
38017
|
-
parts.push(new ByteArrayCoder(value.
|
37615
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37616
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37617
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37618
|
+
parts.push(new B256Coder().encode(value.receiptsRoot));
|
37619
|
+
parts.push(new ByteArrayCoder(value.scriptLength).encode(value.script));
|
37620
|
+
parts.push(new ByteArrayCoder(value.scriptDataLength).encode(value.scriptData));
|
38018
37621
|
parts.push(new PoliciesCoder().encode(value.policies));
|
38019
37622
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38020
37623
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
@@ -38026,23 +37629,23 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38026
37629
|
let o = offset;
|
38027
37630
|
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38028
37631
|
const scriptGasLimit = decoded;
|
38029
|
-
[decoded, o] = new
|
38030
|
-
const receiptsRoot = decoded;
|
38031
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
37632
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38032
37633
|
const scriptLength = decoded;
|
38033
|
-
[decoded, o] = new
|
37634
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38034
37635
|
const scriptDataLength = decoded;
|
38035
37636
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38036
37637
|
const policyTypes = decoded;
|
38037
|
-
[decoded, o] = new NumberCoder("
|
37638
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38038
37639
|
const inputsCount = decoded;
|
38039
|
-
[decoded, o] = new NumberCoder("
|
37640
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38040
37641
|
const outputsCount = decoded;
|
38041
|
-
[decoded, o] = new NumberCoder("
|
37642
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38042
37643
|
const witnessesCount = decoded;
|
38043
|
-
[decoded, o] = new
|
37644
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37645
|
+
const receiptsRoot = decoded;
|
37646
|
+
[decoded, o] = new ByteArrayCoder(scriptLength).decode(data, o);
|
38044
37647
|
const script = decoded;
|
38045
|
-
[decoded, o] = new ByteArrayCoder(scriptDataLength
|
37648
|
+
[decoded, o] = new ByteArrayCoder(scriptDataLength).decode(data, o);
|
38046
37649
|
const scriptData = decoded;
|
38047
37650
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38048
37651
|
const policies = decoded;
|
@@ -38080,19 +37683,18 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38080
37683
|
}
|
38081
37684
|
encode(value) {
|
38082
37685
|
const parts = [];
|
38083
|
-
parts.push(new NumberCoder("
|
38084
|
-
parts.push(new
|
38085
|
-
parts.push(new BigNumberCoder("u64").encode(value.storageSlotsCount));
|
37686
|
+
parts.push(new NumberCoder("u32").encode(value.bytecodeLength));
|
37687
|
+
parts.push(new NumberCoder("u8").encode(value.bytecodeWitnessIndex));
|
38086
37688
|
parts.push(new NumberCoder("u32").encode(value.policyTypes));
|
38087
|
-
parts.push(new NumberCoder("u16").encode(value.
|
38088
|
-
parts.push(new NumberCoder("
|
38089
|
-
parts.push(new NumberCoder("
|
37689
|
+
parts.push(new NumberCoder("u16").encode(value.storageSlotsCount));
|
37690
|
+
parts.push(new NumberCoder("u8").encode(value.inputsCount));
|
37691
|
+
parts.push(new NumberCoder("u8").encode(value.outputsCount));
|
37692
|
+
parts.push(new NumberCoder("u8").encode(value.witnessesCount));
|
37693
|
+
parts.push(new B256Coder().encode(value.salt));
|
37694
|
+
parts.push(new PoliciesCoder().encode(value.policies));
|
38090
37695
|
parts.push(
|
38091
|
-
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount
|
38092
|
-
value.storageSlots
|
38093
|
-
)
|
37696
|
+
new ArrayCoder(new StorageSlotCoder(), value.storageSlotsCount).encode(value.storageSlots)
|
38094
37697
|
);
|
38095
|
-
parts.push(new PoliciesCoder().encode(value.policies));
|
38096
37698
|
parts.push(new ArrayCoder(new InputCoder(), value.inputsCount).encode(value.inputs));
|
38097
37699
|
parts.push(new ArrayCoder(new OutputCoder(), value.outputsCount).encode(value.outputs));
|
38098
37700
|
parts.push(new ArrayCoder(new WitnessCoder(), value.witnessesCount).encode(value.witnesses));
|
@@ -38101,27 +37703,26 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38101
37703
|
decode(data, offset) {
|
38102
37704
|
let decoded;
|
38103
37705
|
let o = offset;
|
38104
|
-
[decoded, o] = new NumberCoder("
|
37706
|
+
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
37707
|
+
const bytecodeLength = decoded;
|
37708
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38105
37709
|
const bytecodeWitnessIndex = decoded;
|
38106
|
-
[decoded, o] = new B256Coder().decode(data, o);
|
38107
|
-
const salt = decoded;
|
38108
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38109
|
-
const storageSlotsCount = decoded;
|
38110
37710
|
[decoded, o] = new NumberCoder("u32").decode(data, o);
|
38111
37711
|
const policyTypes = decoded;
|
38112
37712
|
[decoded, o] = new NumberCoder("u16").decode(data, o);
|
37713
|
+
const storageSlotsCount = decoded;
|
37714
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38113
37715
|
const inputsCount = decoded;
|
38114
|
-
[decoded, o] = new NumberCoder("
|
37716
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38115
37717
|
const outputsCount = decoded;
|
38116
|
-
[decoded, o] = new NumberCoder("
|
37718
|
+
[decoded, o] = new NumberCoder("u8").decode(data, o);
|
38117
37719
|
const witnessesCount = decoded;
|
38118
|
-
[decoded, o] = new
|
38119
|
-
|
38120
|
-
o
|
38121
|
-
);
|
38122
|
-
const storageSlots = decoded;
|
37720
|
+
[decoded, o] = new B256Coder().decode(data, o);
|
37721
|
+
const salt = decoded;
|
38123
37722
|
[decoded, o] = new PoliciesCoder().decode(data, o, policyTypes);
|
38124
37723
|
const policies = decoded;
|
37724
|
+
[decoded, o] = new ArrayCoder(new StorageSlotCoder(), storageSlotsCount).decode(data, o);
|
37725
|
+
const storageSlots = decoded;
|
38125
37726
|
[decoded, o] = new ArrayCoder(new InputCoder(), inputsCount).decode(data, o);
|
38126
37727
|
const inputs = decoded;
|
38127
37728
|
[decoded, o] = new ArrayCoder(new OutputCoder(), outputsCount).decode(data, o);
|
@@ -38131,6 +37732,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38131
37732
|
return [
|
38132
37733
|
{
|
38133
37734
|
type: 1,
|
37735
|
+
bytecodeLength,
|
38134
37736
|
bytecodeWitnessIndex,
|
38135
37737
|
policyTypes,
|
38136
37738
|
storageSlotsCount,
|
@@ -38159,7 +37761,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38159
37761
|
parts.push(new OutputContractCoder().encode(value.outputContract));
|
38160
37762
|
parts.push(new BigNumberCoder("u64").encode(value.mintAmount));
|
38161
37763
|
parts.push(new B256Coder().encode(value.mintAssetId));
|
38162
|
-
parts.push(new BigNumberCoder("u64").encode(value.gasPrice));
|
38163
37764
|
return concat(parts);
|
38164
37765
|
}
|
38165
37766
|
decode(data, offset) {
|
@@ -38175,8 +37776,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38175
37776
|
const mintAmount = decoded;
|
38176
37777
|
[decoded, o] = new B256Coder().decode(data, o);
|
38177
37778
|
const mintAssetId = decoded;
|
38178
|
-
[decoded, o] = new BigNumberCoder("u64").decode(data, o);
|
38179
|
-
const gasPrice = decoded;
|
38180
37779
|
return [
|
38181
37780
|
{
|
38182
37781
|
type: 2,
|
@@ -38184,8 +37783,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38184
37783
|
inputContract,
|
38185
37784
|
outputContract,
|
38186
37785
|
mintAmount,
|
38187
|
-
mintAssetId
|
38188
|
-
gasPrice
|
37786
|
+
mintAssetId
|
38189
37787
|
},
|
38190
37788
|
o
|
38191
37789
|
];
|
@@ -38492,6 +38090,159 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
38492
38090
|
// src/providers/provider.ts
|
38493
38091
|
var import_graphql_request = __toESM(require_dist2());
|
38494
38092
|
|
38093
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isPlaceholder.js
|
38094
|
+
function _isPlaceholder(a) {
|
38095
|
+
return a != null && typeof a === "object" && a["@@functional/placeholder"] === true;
|
38096
|
+
}
|
38097
|
+
|
38098
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_curry1.js
|
38099
|
+
function _curry1(fn) {
|
38100
|
+
return function f1(a) {
|
38101
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
38102
|
+
return f1;
|
38103
|
+
} else {
|
38104
|
+
return fn.apply(this, arguments);
|
38105
|
+
}
|
38106
|
+
};
|
38107
|
+
}
|
38108
|
+
|
38109
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isArray.js
|
38110
|
+
var isArray_default = Array.isArray || function _isArray(val) {
|
38111
|
+
return val != null && val.length >= 0 && Object.prototype.toString.call(val) === "[object Array]";
|
38112
|
+
};
|
38113
|
+
|
38114
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/type.js
|
38115
|
+
var type = /* @__PURE__ */ _curry1(function type2(val) {
|
38116
|
+
return val === null ? "Null" : val === void 0 ? "Undefined" : Object.prototype.toString.call(val).slice(8, -1);
|
38117
|
+
});
|
38118
|
+
var type_default = type;
|
38119
|
+
|
38120
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_toISOString.js
|
38121
|
+
var pad = function pad2(n) {
|
38122
|
+
return (n < 10 ? "0" : "") + n;
|
38123
|
+
};
|
38124
|
+
var _toISOString = typeof Date.prototype.toISOString === "function" ? function _toISOString2(d) {
|
38125
|
+
return d.toISOString();
|
38126
|
+
} : function _toISOString3(d) {
|
38127
|
+
return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "." + (d.getUTCMilliseconds() / 1e3).toFixed(3).slice(2, 5) + "Z";
|
38128
|
+
};
|
38129
|
+
|
38130
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_isInteger.js
|
38131
|
+
var isInteger_default = Number.isInteger || function _isInteger(n) {
|
38132
|
+
return n << 0 === n;
|
38133
|
+
};
|
38134
|
+
|
38135
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_cloneRegExp.js
|
38136
|
+
function _cloneRegExp(pattern) {
|
38137
|
+
return new RegExp(pattern.source, pattern.flags ? pattern.flags : (pattern.global ? "g" : "") + (pattern.ignoreCase ? "i" : "") + (pattern.multiline ? "m" : "") + (pattern.sticky ? "y" : "") + (pattern.unicode ? "u" : "") + (pattern.dotAll ? "s" : ""));
|
38138
|
+
}
|
38139
|
+
|
38140
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/internal/_clone.js
|
38141
|
+
function _clone(value, deep, map) {
|
38142
|
+
map || (map = new _ObjectMap());
|
38143
|
+
if (_isPrimitive(value)) {
|
38144
|
+
return value;
|
38145
|
+
}
|
38146
|
+
var copy = function copy2(copiedValue) {
|
38147
|
+
var cachedCopy = map.get(value);
|
38148
|
+
if (cachedCopy) {
|
38149
|
+
return cachedCopy;
|
38150
|
+
}
|
38151
|
+
map.set(value, copiedValue);
|
38152
|
+
for (var key in value) {
|
38153
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
38154
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
38155
|
+
}
|
38156
|
+
}
|
38157
|
+
return copiedValue;
|
38158
|
+
};
|
38159
|
+
switch (type_default(value)) {
|
38160
|
+
case "Object":
|
38161
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
38162
|
+
case "Array":
|
38163
|
+
return copy([]);
|
38164
|
+
case "Date":
|
38165
|
+
return new Date(value.valueOf());
|
38166
|
+
case "RegExp":
|
38167
|
+
return _cloneRegExp(value);
|
38168
|
+
case "Int8Array":
|
38169
|
+
case "Uint8Array":
|
38170
|
+
case "Uint8ClampedArray":
|
38171
|
+
case "Int16Array":
|
38172
|
+
case "Uint16Array":
|
38173
|
+
case "Int32Array":
|
38174
|
+
case "Uint32Array":
|
38175
|
+
case "Float32Array":
|
38176
|
+
case "Float64Array":
|
38177
|
+
case "BigInt64Array":
|
38178
|
+
case "BigUint64Array":
|
38179
|
+
return value.slice();
|
38180
|
+
default:
|
38181
|
+
return value;
|
38182
|
+
}
|
38183
|
+
}
|
38184
|
+
function _isPrimitive(param) {
|
38185
|
+
var type3 = typeof param;
|
38186
|
+
return param == null || type3 != "object" && type3 != "function";
|
38187
|
+
}
|
38188
|
+
var _ObjectMap = /* @__PURE__ */ function() {
|
38189
|
+
function _ObjectMap2() {
|
38190
|
+
this.map = {};
|
38191
|
+
this.length = 0;
|
38192
|
+
}
|
38193
|
+
_ObjectMap2.prototype.set = function(key, value) {
|
38194
|
+
const hashedKey = this.hash(key);
|
38195
|
+
let bucket = this.map[hashedKey];
|
38196
|
+
if (!bucket) {
|
38197
|
+
this.map[hashedKey] = bucket = [];
|
38198
|
+
}
|
38199
|
+
bucket.push([key, value]);
|
38200
|
+
this.length += 1;
|
38201
|
+
};
|
38202
|
+
_ObjectMap2.prototype.hash = function(key) {
|
38203
|
+
let hashedKey = [];
|
38204
|
+
for (var value in key) {
|
38205
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
38206
|
+
}
|
38207
|
+
return hashedKey.join();
|
38208
|
+
};
|
38209
|
+
_ObjectMap2.prototype.get = function(key) {
|
38210
|
+
if (this.length <= 180) {
|
38211
|
+
for (const p in this.map) {
|
38212
|
+
const bucket2 = this.map[p];
|
38213
|
+
for (let i = 0; i < bucket2.length; i += 1) {
|
38214
|
+
const element = bucket2[i];
|
38215
|
+
if (element[0] === key) {
|
38216
|
+
return element[1];
|
38217
|
+
}
|
38218
|
+
}
|
38219
|
+
}
|
38220
|
+
return;
|
38221
|
+
}
|
38222
|
+
const hashedKey = this.hash(key);
|
38223
|
+
const bucket = this.map[hashedKey];
|
38224
|
+
if (!bucket) {
|
38225
|
+
return;
|
38226
|
+
}
|
38227
|
+
for (let i = 0; i < bucket.length; i += 1) {
|
38228
|
+
const element = bucket[i];
|
38229
|
+
if (element[0] === key) {
|
38230
|
+
return element[1];
|
38231
|
+
}
|
38232
|
+
}
|
38233
|
+
};
|
38234
|
+
return _ObjectMap2;
|
38235
|
+
}();
|
38236
|
+
|
38237
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/clone.js
|
38238
|
+
var clone2 = /* @__PURE__ */ _curry1(function clone3(value) {
|
38239
|
+
return value != null && typeof value.clone === "function" ? value.clone() : _clone(value, true);
|
38240
|
+
});
|
38241
|
+
var clone_default = clone2;
|
38242
|
+
|
38243
|
+
// ../../node_modules/.pnpm/ramda@0.29.0/node_modules/ramda/es/trim.js
|
38244
|
+
var hasProtoTrim = typeof String.prototype.trim === "function";
|
38245
|
+
|
38495
38246
|
// ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
|
38496
38247
|
var __assign = function() {
|
38497
38248
|
__assign = Object.assign || function __assign2(t) {
|
@@ -41659,10 +41410,14 @@ spurious results.`);
|
|
41659
41410
|
// src/providers/__generated__/operations.ts
|
41660
41411
|
var ReceiptFragmentFragmentDoc = lib_default2`
|
41661
41412
|
fragment receiptFragment on Receipt {
|
41662
|
-
|
41413
|
+
contract {
|
41414
|
+
id
|
41415
|
+
}
|
41663
41416
|
pc
|
41664
41417
|
is
|
41665
|
-
to
|
41418
|
+
to {
|
41419
|
+
id
|
41420
|
+
}
|
41666
41421
|
toAddress
|
41667
41422
|
amount
|
41668
41423
|
assetId
|
@@ -41700,16 +41455,10 @@ spurious results.`);
|
|
41700
41455
|
id
|
41701
41456
|
}
|
41702
41457
|
time
|
41703
|
-
receipts {
|
41704
|
-
...receiptFragment
|
41705
|
-
}
|
41706
41458
|
programState {
|
41707
41459
|
returnType
|
41708
41460
|
data
|
41709
41461
|
}
|
41710
|
-
receipts {
|
41711
|
-
...receiptFragment
|
41712
|
-
}
|
41713
41462
|
}
|
41714
41463
|
... on FailureStatus {
|
41715
41464
|
block {
|
@@ -41717,24 +41466,26 @@ spurious results.`);
|
|
41717
41466
|
}
|
41718
41467
|
time
|
41719
41468
|
reason
|
41720
|
-
receipts {
|
41721
|
-
...receiptFragment
|
41722
|
-
}
|
41723
41469
|
}
|
41724
41470
|
... on SqueezedOutStatus {
|
41725
41471
|
reason
|
41726
41472
|
}
|
41727
41473
|
}
|
41728
|
-
|
41474
|
+
`;
|
41729
41475
|
var TransactionFragmentFragmentDoc = lib_default2`
|
41730
41476
|
fragment transactionFragment on Transaction {
|
41731
41477
|
id
|
41732
41478
|
rawPayload
|
41479
|
+
gasPrice
|
41480
|
+
receipts {
|
41481
|
+
...receiptFragment
|
41482
|
+
}
|
41733
41483
|
status {
|
41734
41484
|
...transactionStatusFragment
|
41735
41485
|
}
|
41736
41486
|
}
|
41737
|
-
${
|
41487
|
+
${ReceiptFragmentFragmentDoc}
|
41488
|
+
${TransactionStatusFragmentFragmentDoc}`;
|
41738
41489
|
var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
|
41739
41490
|
fragment inputEstimatePredicatesFragment on Input {
|
41740
41491
|
... on InputCoin {
|
@@ -41752,46 +41503,6 @@ spurious results.`);
|
|
41752
41503
|
}
|
41753
41504
|
}
|
41754
41505
|
${InputEstimatePredicatesFragmentFragmentDoc}`;
|
41755
|
-
var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
|
41756
|
-
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
41757
|
-
reason
|
41758
|
-
programState {
|
41759
|
-
returnType
|
41760
|
-
data
|
41761
|
-
}
|
41762
|
-
}
|
41763
|
-
`;
|
41764
|
-
var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
|
41765
|
-
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
41766
|
-
programState {
|
41767
|
-
returnType
|
41768
|
-
data
|
41769
|
-
}
|
41770
|
-
}
|
41771
|
-
`;
|
41772
|
-
var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
|
41773
|
-
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
41774
|
-
... on DryRunFailureStatus {
|
41775
|
-
...dryRunFailureStatusFragment
|
41776
|
-
}
|
41777
|
-
... on DryRunSuccessStatus {
|
41778
|
-
...dryRunSuccessStatusFragment
|
41779
|
-
}
|
41780
|
-
}
|
41781
|
-
${DryRunFailureStatusFragmentFragmentDoc}
|
41782
|
-
${DryRunSuccessStatusFragmentFragmentDoc}`;
|
41783
|
-
var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
|
41784
|
-
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
41785
|
-
id
|
41786
|
-
status {
|
41787
|
-
...dryRunTransactionStatusFragment
|
41788
|
-
}
|
41789
|
-
receipts {
|
41790
|
-
...receiptFragment
|
41791
|
-
}
|
41792
|
-
}
|
41793
|
-
${DryRunTransactionStatusFragmentFragmentDoc}
|
41794
|
-
${ReceiptFragmentFragmentDoc}`;
|
41795
41506
|
var CoinFragmentFragmentDoc = lib_default2`
|
41796
41507
|
fragment coinFragment on Coin {
|
41797
41508
|
__typename
|
@@ -41799,6 +41510,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41799
41510
|
owner
|
41800
41511
|
amount
|
41801
41512
|
assetId
|
41513
|
+
maturity
|
41802
41514
|
blockCreated
|
41803
41515
|
txCreatedIdx
|
41804
41516
|
}
|
@@ -41843,6 +41555,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41843
41555
|
prevRoot
|
41844
41556
|
time
|
41845
41557
|
applicationHash
|
41558
|
+
messageReceiptRoot
|
41846
41559
|
messageReceiptCount
|
41847
41560
|
}
|
41848
41561
|
commitBlockHeader {
|
@@ -41854,6 +41567,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41854
41567
|
prevRoot
|
41855
41568
|
time
|
41856
41569
|
applicationHash
|
41570
|
+
messageReceiptRoot
|
41857
41571
|
messageReceiptCount
|
41858
41572
|
}
|
41859
41573
|
sender
|
@@ -41873,8 +41587,8 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41873
41587
|
var BlockFragmentFragmentDoc = lib_default2`
|
41874
41588
|
fragment blockFragment on Block {
|
41875
41589
|
id
|
41876
|
-
height
|
41877
41590
|
header {
|
41591
|
+
height
|
41878
41592
|
time
|
41879
41593
|
}
|
41880
41594
|
transactions {
|
@@ -41932,11 +41646,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41932
41646
|
`;
|
41933
41647
|
var GasCostsFragmentFragmentDoc = lib_default2`
|
41934
41648
|
fragment GasCostsFragment on GasCosts {
|
41935
|
-
version {
|
41936
|
-
... on Version {
|
41937
|
-
value
|
41938
|
-
}
|
41939
|
-
}
|
41940
41649
|
add
|
41941
41650
|
addi
|
41942
41651
|
aloc
|
@@ -41949,6 +41658,7 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
41949
41658
|
cb
|
41950
41659
|
cfei
|
41951
41660
|
cfsi
|
41661
|
+
croo
|
41952
41662
|
div
|
41953
41663
|
divi
|
41954
41664
|
ecr1
|
@@ -42031,9 +41741,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42031
41741
|
ccp {
|
42032
41742
|
...DependentCostFragment
|
42033
41743
|
}
|
42034
|
-
croo {
|
42035
|
-
...DependentCostFragment
|
42036
|
-
}
|
42037
41744
|
csiz {
|
42038
41745
|
...DependentCostFragment
|
42039
41746
|
}
|
@@ -42093,11 +41800,6 @@ ${ReceiptFragmentFragmentDoc}`;
|
|
42093
41800
|
${DependentCostFragmentFragmentDoc}`;
|
42094
41801
|
var ConsensusParametersFragmentFragmentDoc = lib_default2`
|
42095
41802
|
fragment consensusParametersFragment on ConsensusParameters {
|
42096
|
-
version {
|
42097
|
-
... on Version {
|
42098
|
-
value
|
42099
|
-
}
|
42100
|
-
}
|
42101
41803
|
txParams {
|
42102
41804
|
...TxParametersFragment
|
42103
41805
|
}
|
@@ -42157,9 +41859,18 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42157
41859
|
fragment nodeInfoFragment on NodeInfo {
|
42158
41860
|
utxoValidation
|
42159
41861
|
vmBacktrace
|
41862
|
+
minGasPrice
|
42160
41863
|
maxTx
|
42161
41864
|
maxDepth
|
42162
41865
|
nodeVersion
|
41866
|
+
peers {
|
41867
|
+
id
|
41868
|
+
addresses
|
41869
|
+
clientVersion
|
41870
|
+
blockHeight
|
41871
|
+
lastHeartbeatMs
|
41872
|
+
appScore
|
41873
|
+
}
|
42163
41874
|
}
|
42164
41875
|
`;
|
42165
41876
|
var GetVersionDocument = lib_default2`
|
@@ -42194,9 +41905,13 @@ ${ConsensusParametersFragmentFragmentDoc}`;
|
|
42194
41905
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
42195
41906
|
transaction(id: $transactionId) {
|
42196
41907
|
...transactionFragment
|
41908
|
+
receipts {
|
41909
|
+
...receiptFragment
|
41910
|
+
}
|
42197
41911
|
}
|
42198
41912
|
}
|
42199
|
-
${TransactionFragmentFragmentDoc}
|
41913
|
+
${TransactionFragmentFragmentDoc}
|
41914
|
+
${ReceiptFragmentFragmentDoc}`;
|
42200
41915
|
var GetTransactionsDocument = lib_default2`
|
42201
41916
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
42202
41917
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -42324,20 +42039,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42324
42039
|
}
|
42325
42040
|
}
|
42326
42041
|
${BalanceFragmentFragmentDoc}`;
|
42327
|
-
var GetLatestGasPriceDocument = lib_default2`
|
42328
|
-
query getLatestGasPrice {
|
42329
|
-
latestGasPrice {
|
42330
|
-
gasPrice
|
42331
|
-
}
|
42332
|
-
}
|
42333
|
-
`;
|
42334
|
-
var EstimateGasPriceDocument = lib_default2`
|
42335
|
-
query estimateGasPrice($blockHorizon: U32!) {
|
42336
|
-
estimateGasPrice(blockHorizon: $blockHorizon) {
|
42337
|
-
gasPrice
|
42338
|
-
}
|
42339
|
-
}
|
42340
|
-
`;
|
42341
42042
|
var GetBalancesDocument = lib_default2`
|
42342
42043
|
query getBalances($filter: BalanceFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
42343
42044
|
balances(
|
@@ -42392,12 +42093,12 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42392
42093
|
}
|
42393
42094
|
`;
|
42394
42095
|
var DryRunDocument = lib_default2`
|
42395
|
-
mutation dryRun($
|
42396
|
-
dryRun(
|
42397
|
-
...
|
42096
|
+
mutation dryRun($encodedTransaction: HexString!, $utxoValidation: Boolean) {
|
42097
|
+
dryRun(tx: $encodedTransaction, utxoValidation: $utxoValidation) {
|
42098
|
+
...receiptFragment
|
42398
42099
|
}
|
42399
42100
|
}
|
42400
|
-
${
|
42101
|
+
${ReceiptFragmentFragmentDoc}`;
|
42401
42102
|
var SubmitDocument = lib_default2`
|
42402
42103
|
mutation submit($encodedTransaction: HexString!) {
|
42403
42104
|
submit(tx: $encodedTransaction) {
|
@@ -42480,12 +42181,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42480
42181
|
getBalance(variables, options) {
|
42481
42182
|
return requester(GetBalanceDocument, variables, options);
|
42482
42183
|
},
|
42483
|
-
getLatestGasPrice(variables, options) {
|
42484
|
-
return requester(GetLatestGasPriceDocument, variables, options);
|
42485
|
-
},
|
42486
|
-
estimateGasPrice(variables, options) {
|
42487
|
-
return requester(EstimateGasPriceDocument, variables, options);
|
42488
|
-
},
|
42489
42184
|
getBalances(variables, options) {
|
42490
42185
|
return requester(GetBalancesDocument, variables, options);
|
42491
42186
|
},
|
@@ -42553,14 +42248,11 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42553
42248
|
let data;
|
42554
42249
|
let errors;
|
42555
42250
|
try {
|
42556
|
-
|
42557
|
-
({ data, errors } = JSON.parse(sanitizedText.replace(/^data:/, "")));
|
42251
|
+
({ data, errors } = JSON.parse(text.replace(/^data:/, "")));
|
42558
42252
|
} catch (e) {
|
42559
42253
|
throw new FuelError(
|
42560
42254
|
ErrorCode.STREAM_PARSING_ERROR,
|
42561
|
-
`Error while parsing stream data response: ${text}
|
42562
|
-
|
42563
|
-
Thrown error: ${e}`
|
42255
|
+
`Error while parsing stream data response: ${text}`
|
42564
42256
|
);
|
42565
42257
|
}
|
42566
42258
|
if (Array.isArray(errors)) {
|
@@ -42654,7 +42346,7 @@ Thrown error: ${e}`
|
|
42654
42346
|
return {
|
42655
42347
|
type: InputType.Coin,
|
42656
42348
|
txID: hexlify(arrayify(value.id).slice(0, 32)),
|
42657
|
-
outputIndex: toNumber2(arrayify(value.id).slice(32,
|
42349
|
+
outputIndex: toNumber2(arrayify(value.id).slice(32, 33)),
|
42658
42350
|
owner: hexlify(value.owner),
|
42659
42351
|
amount: bn(value.amount),
|
42660
42352
|
assetId: hexlify(value.assetId),
|
@@ -42663,9 +42355,10 @@ Thrown error: ${e}`
|
|
42663
42355
|
txIndex: toNumber2(arrayify(value.txPointer).slice(8, 16))
|
42664
42356
|
},
|
42665
42357
|
witnessIndex: value.witnessIndex,
|
42358
|
+
maturity: value.maturity ?? 0,
|
42666
42359
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42667
|
-
predicateLength:
|
42668
|
-
predicateDataLength:
|
42360
|
+
predicateLength: predicate.length,
|
42361
|
+
predicateDataLength: predicateData.length,
|
42669
42362
|
predicate: hexlify(predicate),
|
42670
42363
|
predicateData: hexlify(predicateData)
|
42671
42364
|
};
|
@@ -42696,8 +42389,8 @@ Thrown error: ${e}`
|
|
42696
42389
|
nonce: hexlify(value.nonce),
|
42697
42390
|
witnessIndex: value.witnessIndex,
|
42698
42391
|
predicateGasUsed: bn(value.predicateGasUsed),
|
42699
|
-
predicateLength:
|
42700
|
-
predicateDataLength:
|
42392
|
+
predicateLength: predicate.length,
|
42393
|
+
predicateDataLength: predicateData.length,
|
42701
42394
|
predicate: hexlify(predicate),
|
42702
42395
|
predicateData: hexlify(predicateData),
|
42703
42396
|
data: hexlify(data),
|
@@ -42854,8 +42547,8 @@ Thrown error: ${e}`
|
|
42854
42547
|
case "CALL" /* Call */: {
|
42855
42548
|
const callReceipt = {
|
42856
42549
|
type: ReceiptType.Call,
|
42857
|
-
from: hexOrZero(receipt.id
|
42858
|
-
to: hexOrZero(receipt?.to),
|
42550
|
+
from: hexOrZero(receipt.contract?.id),
|
42551
|
+
to: hexOrZero(receipt?.to?.id),
|
42859
42552
|
amount: bn(receipt.amount),
|
42860
42553
|
assetId: hexOrZero(receipt.assetId),
|
42861
42554
|
gas: bn(receipt.gas),
|
@@ -42869,7 +42562,7 @@ Thrown error: ${e}`
|
|
42869
42562
|
case "RETURN" /* Return */: {
|
42870
42563
|
const returnReceipt = {
|
42871
42564
|
type: ReceiptType.Return,
|
42872
|
-
id: hexOrZero(receipt.id
|
42565
|
+
id: hexOrZero(receipt.contract?.id),
|
42873
42566
|
val: bn(receipt.val),
|
42874
42567
|
pc: bn(receipt.pc),
|
42875
42568
|
is: bn(receipt.is)
|
@@ -42879,7 +42572,7 @@ Thrown error: ${e}`
|
|
42879
42572
|
case "RETURN_DATA" /* ReturnData */: {
|
42880
42573
|
const returnDataReceipt = {
|
42881
42574
|
type: ReceiptType.ReturnData,
|
42882
|
-
id: hexOrZero(receipt.id
|
42575
|
+
id: hexOrZero(receipt.contract?.id),
|
42883
42576
|
ptr: bn(receipt.ptr),
|
42884
42577
|
len: bn(receipt.len),
|
42885
42578
|
digest: hexOrZero(receipt.digest),
|
@@ -42891,7 +42584,7 @@ Thrown error: ${e}`
|
|
42891
42584
|
case "PANIC" /* Panic */: {
|
42892
42585
|
const panicReceipt = {
|
42893
42586
|
type: ReceiptType.Panic,
|
42894
|
-
id: hexOrZero(receipt.id),
|
42587
|
+
id: hexOrZero(receipt.contract?.id),
|
42895
42588
|
reason: bn(receipt.reason),
|
42896
42589
|
pc: bn(receipt.pc),
|
42897
42590
|
is: bn(receipt.is),
|
@@ -42902,7 +42595,7 @@ Thrown error: ${e}`
|
|
42902
42595
|
case "REVERT" /* Revert */: {
|
42903
42596
|
const revertReceipt = {
|
42904
42597
|
type: ReceiptType.Revert,
|
42905
|
-
id: hexOrZero(receipt.id
|
42598
|
+
id: hexOrZero(receipt.contract?.id),
|
42906
42599
|
val: bn(receipt.ra),
|
42907
42600
|
pc: bn(receipt.pc),
|
42908
42601
|
is: bn(receipt.is)
|
@@ -42912,7 +42605,7 @@ Thrown error: ${e}`
|
|
42912
42605
|
case "LOG" /* Log */: {
|
42913
42606
|
const logReceipt = {
|
42914
42607
|
type: ReceiptType.Log,
|
42915
|
-
id: hexOrZero(receipt.id
|
42608
|
+
id: hexOrZero(receipt.contract?.id),
|
42916
42609
|
val0: bn(receipt.ra),
|
42917
42610
|
val1: bn(receipt.rb),
|
42918
42611
|
val2: bn(receipt.rc),
|
@@ -42925,7 +42618,7 @@ Thrown error: ${e}`
|
|
42925
42618
|
case "LOG_DATA" /* LogData */: {
|
42926
42619
|
const logDataReceipt = {
|
42927
42620
|
type: ReceiptType.LogData,
|
42928
|
-
id: hexOrZero(receipt.id
|
42621
|
+
id: hexOrZero(receipt.contract?.id),
|
42929
42622
|
val0: bn(receipt.ra),
|
42930
42623
|
val1: bn(receipt.rb),
|
42931
42624
|
ptr: bn(receipt.ptr),
|
@@ -42939,8 +42632,8 @@ Thrown error: ${e}`
|
|
42939
42632
|
case "TRANSFER" /* Transfer */: {
|
42940
42633
|
const transferReceipt = {
|
42941
42634
|
type: ReceiptType.Transfer,
|
42942
|
-
from: hexOrZero(receipt.id
|
42943
|
-
to: hexOrZero(receipt.toAddress || receipt?.to),
|
42635
|
+
from: hexOrZero(receipt.contract?.id),
|
42636
|
+
to: hexOrZero(receipt.toAddress || receipt?.to?.id),
|
42944
42637
|
amount: bn(receipt.amount),
|
42945
42638
|
assetId: hexOrZero(receipt.assetId),
|
42946
42639
|
pc: bn(receipt.pc),
|
@@ -42951,8 +42644,8 @@ Thrown error: ${e}`
|
|
42951
42644
|
case "TRANSFER_OUT" /* TransferOut */: {
|
42952
42645
|
const transferOutReceipt = {
|
42953
42646
|
type: ReceiptType.TransferOut,
|
42954
|
-
from: hexOrZero(receipt.id
|
42955
|
-
to: hexOrZero(receipt.toAddress || receipt.to),
|
42647
|
+
from: hexOrZero(receipt.contract?.id),
|
42648
|
+
to: hexOrZero(receipt.toAddress || receipt.to?.id),
|
42956
42649
|
amount: bn(receipt.amount),
|
42957
42650
|
assetId: hexOrZero(receipt.assetId),
|
42958
42651
|
pc: bn(receipt.pc),
|
@@ -42995,7 +42688,7 @@ Thrown error: ${e}`
|
|
42995
42688
|
return receiptMessageOut;
|
42996
42689
|
}
|
42997
42690
|
case "MINT" /* Mint */: {
|
42998
|
-
const contractId = hexOrZero(receipt.id
|
42691
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
42999
42692
|
const subId = hexOrZero(receipt.subId);
|
43000
42693
|
const assetId = ReceiptMintCoder.getAssetId(contractId, subId);
|
43001
42694
|
const mintReceipt = {
|
@@ -43010,7 +42703,7 @@ Thrown error: ${e}`
|
|
43010
42703
|
return mintReceipt;
|
43011
42704
|
}
|
43012
42705
|
case "BURN" /* Burn */: {
|
43013
|
-
const contractId = hexOrZero(receipt.id
|
42706
|
+
const contractId = hexOrZero(receipt.contract?.id);
|
43014
42707
|
const subId = hexOrZero(receipt.subId);
|
43015
42708
|
const assetId = ReceiptBurnCoder.getAssetId(contractId, subId);
|
43016
42709
|
const burnReceipt = {
|
@@ -43030,6 +42723,7 @@ Thrown error: ${e}`
|
|
43030
42723
|
}
|
43031
42724
|
|
43032
42725
|
// src/providers/utils/gas.ts
|
42726
|
+
var calculatePriceWithFactor = (gas, gasPrice, priceFactor) => bn(Math.ceil(gas.mul(gasPrice).toNumber() / priceFactor.toNumber()));
|
43033
42727
|
var getGasUsedFromReceipts = (receipts) => {
|
43034
42728
|
const scriptResult = receipts.filter(
|
43035
42729
|
(receipt) => receipt.type === ReceiptType.ScriptResult
|
@@ -43050,28 +42744,18 @@ Thrown error: ${e}`
|
|
43050
42744
|
}
|
43051
42745
|
function gasUsedByInputs(inputs, txBytesSize, gasCosts) {
|
43052
42746
|
const witnessCache = [];
|
43053
|
-
const
|
43054
|
-
const isCoinOrMessage = "owner" in input || "sender" in input;
|
43055
|
-
if (isCoinOrMessage) {
|
43056
|
-
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43057
|
-
return true;
|
43058
|
-
}
|
43059
|
-
if (!witnessCache.includes(input.witnessIndex)) {
|
43060
|
-
witnessCache.push(input.witnessIndex);
|
43061
|
-
return true;
|
43062
|
-
}
|
43063
|
-
}
|
43064
|
-
return false;
|
43065
|
-
});
|
43066
|
-
const vmInitializationCost = resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization);
|
43067
|
-
const totalGas = chargeableInputs.reduce((total, input) => {
|
42747
|
+
const totalGas = inputs.reduce((total, input) => {
|
43068
42748
|
if ("predicate" in input && input.predicate && input.predicate !== "0x") {
|
43069
42749
|
return total.add(
|
43070
|
-
|
42750
|
+
resolveGasDependentCosts(txBytesSize, gasCosts.vmInitialization).add(resolveGasDependentCosts(arrayify(input.predicate).length, gasCosts.contractRoot)).add(bn(input.predicateGasUsed))
|
43071
42751
|
);
|
43072
42752
|
}
|
43073
|
-
|
43074
|
-
|
42753
|
+
if ("witnessIndex" in input && !witnessCache.includes(input.witnessIndex)) {
|
42754
|
+
witnessCache.push(input.witnessIndex);
|
42755
|
+
return total.add(gasCosts.ecr1);
|
42756
|
+
}
|
42757
|
+
return total;
|
42758
|
+
}, bn());
|
43075
42759
|
return totalGas;
|
43076
42760
|
}
|
43077
42761
|
function getMinGas(params) {
|
@@ -43083,20 +42767,12 @@ Thrown error: ${e}`
|
|
43083
42767
|
return minGas;
|
43084
42768
|
}
|
43085
42769
|
function getMaxGas(params) {
|
43086
|
-
const {
|
43087
|
-
gasPerByte,
|
43088
|
-
witnessesLength,
|
43089
|
-
witnessLimit,
|
43090
|
-
minGas,
|
43091
|
-
gasLimit = bn(0),
|
43092
|
-
maxGasPerTx
|
43093
|
-
} = params;
|
42770
|
+
const { gasPerByte, witnessesLength, witnessLimit, minGas, gasLimit = bn(0) } = params;
|
43094
42771
|
let remainingAllowedWitnessGas = bn(0);
|
43095
42772
|
if (witnessLimit?.gt(0) && witnessLimit.gte(witnessesLength)) {
|
43096
42773
|
remainingAllowedWitnessGas = bn(witnessLimit).sub(witnessesLength).mul(gasPerByte);
|
43097
42774
|
}
|
43098
|
-
|
43099
|
-
return maxGas.gte(maxGasPerTx) ? maxGasPerTx : maxGas;
|
42775
|
+
return remainingAllowedWitnessGas.add(minGas).add(gasLimit);
|
43100
42776
|
}
|
43101
42777
|
function calculateMetadataGasForTxCreate({
|
43102
42778
|
gasCosts,
|
@@ -43118,10 +42794,6 @@ Thrown error: ${e}`
|
|
43118
42794
|
}) {
|
43119
42795
|
return resolveGasDependentCosts(txBytesSize, gasCosts.s256);
|
43120
42796
|
}
|
43121
|
-
var calculateGasFee = (params) => {
|
43122
|
-
const { gas, gasPrice, priceFactor, tip } = params;
|
43123
|
-
return gas.mul(gasPrice).div(priceFactor).add(tip);
|
43124
|
-
};
|
43125
42797
|
|
43126
42798
|
// src/providers/utils/json.ts
|
43127
42799
|
function normalize2(object) {
|
@@ -43251,7 +42923,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43251
42923
|
// src/providers/transaction-request/transaction-request.ts
|
43252
42924
|
var BaseTransactionRequest = class {
|
43253
42925
|
/** Gas price for transaction */
|
43254
|
-
|
42926
|
+
gasPrice;
|
43255
42927
|
/** Block until which tx cannot be included */
|
43256
42928
|
maturity;
|
43257
42929
|
/** The maximum fee payable by this transaction using BASE_ASSET. */
|
@@ -43270,7 +42942,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43270
42942
|
* @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
|
43271
42943
|
*/
|
43272
42944
|
constructor({
|
43273
|
-
|
42945
|
+
gasPrice,
|
43274
42946
|
maturity,
|
43275
42947
|
maxFee,
|
43276
42948
|
witnessLimit,
|
@@ -43278,7 +42950,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43278
42950
|
outputs,
|
43279
42951
|
witnesses
|
43280
42952
|
} = {}) {
|
43281
|
-
this.
|
42953
|
+
this.gasPrice = bn(gasPrice);
|
43282
42954
|
this.maturity = maturity ?? 0;
|
43283
42955
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
43284
42956
|
this.maxFee = maxFee ? bn(maxFee) : void 0;
|
@@ -43289,9 +42961,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43289
42961
|
static getPolicyMeta(req) {
|
43290
42962
|
let policyTypes = 0;
|
43291
42963
|
const policies = [];
|
43292
|
-
if (req.
|
43293
|
-
policyTypes += PolicyType.
|
43294
|
-
policies.push({ data: req.
|
42964
|
+
if (req.gasPrice) {
|
42965
|
+
policyTypes += PolicyType.GasPrice;
|
42966
|
+
policies.push({ data: req.gasPrice, type: PolicyType.GasPrice });
|
43295
42967
|
}
|
43296
42968
|
if (req.witnessLimit) {
|
43297
42969
|
policyTypes += PolicyType.WitnessLimit;
|
@@ -43478,10 +43150,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43478
43150
|
* @param predicate - Predicate bytes.
|
43479
43151
|
* @param predicateData - Predicate data bytes.
|
43480
43152
|
*/
|
43481
|
-
addCoinInput(coin) {
|
43153
|
+
addCoinInput(coin, predicate) {
|
43482
43154
|
const { assetId, owner, amount } = coin;
|
43483
43155
|
let witnessIndex;
|
43484
|
-
if (
|
43156
|
+
if (predicate) {
|
43485
43157
|
witnessIndex = 0;
|
43486
43158
|
} else {
|
43487
43159
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
@@ -43496,7 +43168,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43496
43168
|
amount,
|
43497
43169
|
assetId,
|
43498
43170
|
txPointer: "0x00000000000000000000000000000000",
|
43499
|
-
witnessIndex
|
43171
|
+
witnessIndex,
|
43172
|
+
predicate: predicate?.bytes,
|
43173
|
+
predicateData: predicate?.predicateDataBytes
|
43500
43174
|
};
|
43501
43175
|
this.pushInput(input);
|
43502
43176
|
this.addChangeOutput(owner, assetId);
|
@@ -43509,11 +43183,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43509
43183
|
* @param predicate - Predicate bytes.
|
43510
43184
|
* @param predicateData - Predicate data bytes.
|
43511
43185
|
*/
|
43512
|
-
addMessageInput(message) {
|
43186
|
+
addMessageInput(message, predicate) {
|
43513
43187
|
const { recipient, sender, amount } = message;
|
43514
43188
|
const assetId = BaseAssetId;
|
43515
43189
|
let witnessIndex;
|
43516
|
-
if (
|
43190
|
+
if (predicate) {
|
43517
43191
|
witnessIndex = 0;
|
43518
43192
|
} else {
|
43519
43193
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
@@ -43527,7 +43201,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43527
43201
|
sender: sender.toB256(),
|
43528
43202
|
recipient: recipient.toB256(),
|
43529
43203
|
amount,
|
43530
|
-
witnessIndex
|
43204
|
+
witnessIndex,
|
43205
|
+
predicate: predicate?.bytes,
|
43206
|
+
predicateData: predicate?.predicateDataBytes
|
43531
43207
|
};
|
43532
43208
|
this.pushInput(input);
|
43533
43209
|
this.addChangeOutput(recipient, assetId);
|
@@ -43558,6 +43234,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43558
43234
|
resources.forEach((resource) => this.addResource(resource));
|
43559
43235
|
return this;
|
43560
43236
|
}
|
43237
|
+
/**
|
43238
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43239
|
+
* outputs from the related assetIds.
|
43240
|
+
*
|
43241
|
+
* @param resources - The resources to add.
|
43242
|
+
* @returns This transaction.
|
43243
|
+
*/
|
43244
|
+
addPredicateResource(resource, predicate) {
|
43245
|
+
if (isCoin(resource)) {
|
43246
|
+
this.addCoinInput(resource, predicate);
|
43247
|
+
} else {
|
43248
|
+
this.addMessageInput(resource, predicate);
|
43249
|
+
}
|
43250
|
+
return this;
|
43251
|
+
}
|
43252
|
+
/**
|
43253
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43254
|
+
* from the related assetIds.
|
43255
|
+
*
|
43256
|
+
* @param resources - The resources to add.
|
43257
|
+
* @returns This transaction.
|
43258
|
+
*/
|
43259
|
+
addPredicateResources(resources, predicate) {
|
43260
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43261
|
+
return this;
|
43262
|
+
}
|
43561
43263
|
/**
|
43562
43264
|
* Adds a coin output to the transaction.
|
43563
43265
|
*
|
@@ -43637,7 +43339,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43637
43339
|
}
|
43638
43340
|
calculateMaxGas(chainInfo, minGas) {
|
43639
43341
|
const { consensusParameters } = chainInfo;
|
43640
|
-
const { gasPerByte
|
43342
|
+
const { gasPerByte } = consensusParameters;
|
43641
43343
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
43642
43344
|
(acc, wit) => acc + wit.dataLength,
|
43643
43345
|
0
|
@@ -43646,8 +43348,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43646
43348
|
gasPerByte,
|
43647
43349
|
minGas,
|
43648
43350
|
witnessesLength,
|
43649
|
-
witnessLimit: this.witnessLimit
|
43650
|
-
maxGasPerTx
|
43351
|
+
witnessLimit: this.witnessLimit
|
43651
43352
|
});
|
43652
43353
|
}
|
43653
43354
|
/**
|
@@ -43665,20 +43366,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43665
43366
|
});
|
43666
43367
|
const updateAssetInput = (assetId, quantity) => {
|
43667
43368
|
const assetInput = findAssetInput(assetId);
|
43668
|
-
let usedQuantity = quantity;
|
43669
|
-
if (assetId === BaseAssetId) {
|
43670
|
-
usedQuantity = bn("1000000000000000000");
|
43671
|
-
}
|
43672
43369
|
if (assetInput && "assetId" in assetInput) {
|
43673
|
-
assetInput.id = hexlify(randomBytes3(
|
43674
|
-
assetInput.amount =
|
43370
|
+
assetInput.id = hexlify(randomBytes3(33));
|
43371
|
+
assetInput.amount = quantity;
|
43675
43372
|
} else {
|
43676
43373
|
this.addResources([
|
43677
43374
|
{
|
43678
|
-
id: hexlify(randomBytes3(
|
43679
|
-
amount:
|
43375
|
+
id: hexlify(randomBytes3(33)),
|
43376
|
+
amount: quantity,
|
43680
43377
|
assetId,
|
43681
43378
|
owner: resourcesOwner || Address.fromRandom(),
|
43379
|
+
maturity: 0,
|
43682
43380
|
blockCreated: bn(1),
|
43683
43381
|
txCreatedIdx: bn(1)
|
43684
43382
|
}
|
@@ -43710,7 +43408,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43710
43408
|
toJSON() {
|
43711
43409
|
return normalizeJSON(this);
|
43712
43410
|
}
|
43713
|
-
|
43411
|
+
updatePredicateInputs(inputs) {
|
43714
43412
|
this.inputs.forEach((i) => {
|
43715
43413
|
let correspondingInput;
|
43716
43414
|
switch (i.type) {
|
@@ -43732,15 +43430,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43732
43430
|
}
|
43733
43431
|
});
|
43734
43432
|
}
|
43735
|
-
shiftPredicateData() {
|
43736
|
-
this.inputs.forEach((input) => {
|
43737
|
-
if ("predicateData" in input && "paddPredicateData" in input && typeof input.paddPredicateData === "function") {
|
43738
|
-
input.predicateData = input.paddPredicateData(
|
43739
|
-
BaseTransactionRequest.getPolicyMeta(this).policies.length
|
43740
|
-
);
|
43741
|
-
}
|
43742
|
-
});
|
43743
|
-
}
|
43744
43433
|
};
|
43745
43434
|
|
43746
43435
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -43874,8 +43563,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43874
43563
|
return {
|
43875
43564
|
type: TransactionType.Create,
|
43876
43565
|
...baseTransaction,
|
43566
|
+
bytecodeLength: baseTransaction.witnesses[bytecodeWitnessIndex].dataLength / 4,
|
43877
43567
|
bytecodeWitnessIndex,
|
43878
|
-
storageSlotsCount:
|
43568
|
+
storageSlotsCount: storageSlots.length,
|
43879
43569
|
salt: this.salt ? hexlify(this.salt) : ZeroBytes32,
|
43880
43570
|
storageSlots
|
43881
43571
|
};
|
@@ -43989,8 +43679,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43989
43679
|
type: TransactionType.Script,
|
43990
43680
|
scriptGasLimit: this.gasLimit,
|
43991
43681
|
...super.getBaseTransaction(),
|
43992
|
-
scriptLength:
|
43993
|
-
scriptDataLength:
|
43682
|
+
scriptLength: script.length,
|
43683
|
+
scriptDataLength: scriptData.length,
|
43994
43684
|
receiptsRoot: ZeroBytes32,
|
43995
43685
|
script: hexlify(script),
|
43996
43686
|
scriptData: hexlify(scriptData)
|
@@ -44054,7 +43744,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44054
43744
|
}
|
44055
43745
|
calculateMaxGas(chainInfo, minGas) {
|
44056
43746
|
const { consensusParameters } = chainInfo;
|
44057
|
-
const { gasPerByte
|
43747
|
+
const { gasPerByte } = consensusParameters;
|
44058
43748
|
const witnessesLength = this.toTransaction().witnesses.reduce(
|
44059
43749
|
(acc, wit) => acc + wit.dataLength,
|
44060
43750
|
0
|
@@ -44064,8 +43754,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44064
43754
|
minGas,
|
44065
43755
|
witnessesLength,
|
44066
43756
|
witnessLimit: this.witnessLimit,
|
44067
|
-
gasLimit: this.gasLimit
|
44068
|
-
maxGasPerTx
|
43757
|
+
gasLimit: this.gasLimit
|
44069
43758
|
});
|
44070
43759
|
}
|
44071
43760
|
/**
|
@@ -44138,29 +43827,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44138
43827
|
}
|
44139
43828
|
}
|
44140
43829
|
};
|
44141
|
-
var cacheTxInputsFromOwner = (inputs, owner) => inputs.reduce(
|
44142
|
-
(acc, input) => {
|
44143
|
-
if (input.type === InputType.Coin && input.owner === owner) {
|
44144
|
-
acc.utxos.push(input.id);
|
44145
|
-
}
|
44146
|
-
if (input.type === InputType.Message && input.recipient === owner) {
|
44147
|
-
acc.messages.push(input.nonce);
|
44148
|
-
}
|
44149
|
-
return acc;
|
44150
|
-
},
|
44151
|
-
{
|
44152
|
-
utxos: [],
|
44153
|
-
messages: []
|
44154
|
-
}
|
44155
|
-
);
|
44156
43830
|
|
44157
43831
|
// src/providers/transaction-summary/calculate-transaction-fee.ts
|
44158
43832
|
var calculateTransactionFee = (params) => {
|
44159
43833
|
const {
|
44160
|
-
|
43834
|
+
gasUsed,
|
44161
43835
|
rawPayload,
|
44162
|
-
|
44163
|
-
consensusParameters: { gasCosts, feeParams, maxGasPerTx }
|
43836
|
+
consensusParameters: { gasCosts, feeParams }
|
44164
43837
|
} = params;
|
44165
43838
|
const gasPerByte = bn(feeParams.gasPerByte);
|
44166
43839
|
const gasPriceFactor = bn(feeParams.gasPriceFactor);
|
@@ -44170,7 +43843,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44170
43843
|
return {
|
44171
43844
|
fee: bn(0),
|
44172
43845
|
minFee: bn(0),
|
44173
|
-
maxFee: bn(0)
|
43846
|
+
maxFee: bn(0),
|
43847
|
+
feeFromGasUsed: bn(0)
|
44174
43848
|
};
|
44175
43849
|
}
|
44176
43850
|
const { type: type3, witnesses, inputs, policies } = transaction;
|
@@ -44202,6 +43876,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44202
43876
|
metadataGas,
|
44203
43877
|
txBytesSize: transactionBytes.length
|
44204
43878
|
});
|
43879
|
+
const gasPrice = bn(policies.find((policy) => policy.type === PolicyType.GasPrice)?.data);
|
44205
43880
|
const witnessLimit = policies.find((policy) => policy.type === PolicyType.WitnessLimit)?.data;
|
44206
43881
|
const witnessesLength = witnesses.reduce((acc, wit) => acc + wit.dataLength, 0);
|
44207
43882
|
const maxGas = getMaxGas({
|
@@ -44209,25 +43884,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44209
43884
|
minGas,
|
44210
43885
|
witnessesLength,
|
44211
43886
|
gasLimit,
|
44212
|
-
witnessLimit
|
44213
|
-
maxGasPerTx
|
44214
|
-
});
|
44215
|
-
const minFee = calculateGasFee({
|
44216
|
-
gasPrice,
|
44217
|
-
gas: minGas,
|
44218
|
-
priceFactor: gasPriceFactor,
|
44219
|
-
tip
|
44220
|
-
});
|
44221
|
-
const maxFee = calculateGasFee({
|
44222
|
-
gasPrice,
|
44223
|
-
gas: maxGas,
|
44224
|
-
priceFactor: gasPriceFactor,
|
44225
|
-
tip
|
43887
|
+
witnessLimit
|
44226
43888
|
});
|
43889
|
+
const feeFromGasUsed = calculatePriceWithFactor(gasUsed, gasPrice, gasPriceFactor);
|
43890
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor);
|
43891
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor);
|
43892
|
+
const fee = minFee.add(feeFromGasUsed);
|
44227
43893
|
return {
|
43894
|
+
fee,
|
44228
43895
|
minFee,
|
44229
43896
|
maxFee,
|
44230
|
-
|
43897
|
+
feeFromGasUsed
|
44231
43898
|
};
|
44232
43899
|
};
|
44233
43900
|
|
@@ -44781,9 +44448,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44781
44448
|
gqlTransactionStatus,
|
44782
44449
|
abiMap = {},
|
44783
44450
|
maxInputs,
|
44784
|
-
gasCosts
|
44785
|
-
maxGasPerTx,
|
44786
|
-
gasPrice
|
44451
|
+
gasCosts
|
44787
44452
|
} = params;
|
44788
44453
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
44789
44454
|
const rawPayload = hexlify(transactionBytes);
|
@@ -44797,14 +44462,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44797
44462
|
maxInputs
|
44798
44463
|
});
|
44799
44464
|
const typeName = getTransactionTypeName(transaction.type);
|
44800
|
-
const tip = bn(transaction.policies?.find((policy) => policy.type === PolicyType.Tip)?.data);
|
44801
44465
|
const { fee } = calculateTransactionFee({
|
44802
|
-
|
44466
|
+
gasUsed,
|
44803
44467
|
rawPayload,
|
44804
|
-
tip,
|
44805
44468
|
consensusParameters: {
|
44806
44469
|
gasCosts,
|
44807
|
-
maxGasPerTx,
|
44808
44470
|
feeParams: {
|
44809
44471
|
gasPerByte,
|
44810
44472
|
gasPriceFactor
|
@@ -44940,13 +44602,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44940
44602
|
const decodedTransaction = this.decodeTransaction(
|
44941
44603
|
transaction
|
44942
44604
|
);
|
44943
|
-
|
44944
|
-
|
44945
|
-
txReceipts = transaction.status.receipts;
|
44946
|
-
}
|
44947
|
-
const receipts = txReceipts.map(processGqlReceipt) || [];
|
44948
|
-
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
44949
|
-
const gasPrice = await this.provider.getLatestGasPrice();
|
44605
|
+
const receipts = transaction.receipts?.map(processGqlReceipt) || [];
|
44606
|
+
const { gasPerByte, gasPriceFactor, gasCosts } = this.provider.getGasConfig();
|
44950
44607
|
const maxInputs = this.provider.getChain().consensusParameters.maxInputs;
|
44951
44608
|
const transactionSummary = assembleTransactionSummary({
|
44952
44609
|
id: this.id,
|
@@ -44958,9 +44615,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44958
44615
|
gasPriceFactor,
|
44959
44616
|
abiMap: contractsAbiMap,
|
44960
44617
|
maxInputs,
|
44961
|
-
gasCosts
|
44962
|
-
maxGasPerTx,
|
44963
|
-
gasPrice
|
44618
|
+
gasCosts
|
44964
44619
|
});
|
44965
44620
|
return transactionSummary;
|
44966
44621
|
}
|
@@ -45109,7 +44764,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45109
44764
|
gasCosts,
|
45110
44765
|
latestBlock: {
|
45111
44766
|
id: latestBlock.id,
|
45112
|
-
height: bn(latestBlock.height),
|
44767
|
+
height: bn(latestBlock.header.height),
|
45113
44768
|
time: latestBlock.header.time,
|
45114
44769
|
transactions: latestBlock.transactions.map((i) => ({
|
45115
44770
|
id: i.id
|
@@ -45203,8 +44858,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45203
44858
|
* Returns some helpful parameters related to gas fees.
|
45204
44859
|
*/
|
45205
44860
|
getGasConfig() {
|
44861
|
+
const { minGasPrice } = this.getNode();
|
45206
44862
|
const { maxGasPerTx, maxGasPerPredicate, gasPriceFactor, gasPerByte, gasCosts } = this.getChain().consensusParameters;
|
45207
44863
|
return {
|
44864
|
+
minGasPrice,
|
45208
44865
|
maxGasPerTx,
|
45209
44866
|
maxGasPerPredicate,
|
45210
44867
|
gasPriceFactor,
|
@@ -45302,7 +44959,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45302
44959
|
*/
|
45303
44960
|
async getBlockNumber() {
|
45304
44961
|
const { chain } = await this.operations.getChain();
|
45305
|
-
return bn(chain.latestBlock.height, 10);
|
44962
|
+
return bn(chain.latestBlock.header.height, 10);
|
45306
44963
|
}
|
45307
44964
|
/**
|
45308
44965
|
* Returns the chain information.
|
@@ -45314,9 +44971,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45314
44971
|
const processedNodeInfo = {
|
45315
44972
|
maxDepth: bn(nodeInfo.maxDepth),
|
45316
44973
|
maxTx: bn(nodeInfo.maxTx),
|
44974
|
+
minGasPrice: bn(nodeInfo.minGasPrice),
|
45317
44975
|
nodeVersion: nodeInfo.nodeVersion,
|
45318
44976
|
utxoValidation: nodeInfo.utxoValidation,
|
45319
|
-
vmBacktrace: nodeInfo.vmBacktrace
|
44977
|
+
vmBacktrace: nodeInfo.vmBacktrace,
|
44978
|
+
peers: nodeInfo.peers
|
45320
44979
|
};
|
45321
44980
|
_Provider.nodeInfoCache[this.url] = processedNodeInfo;
|
45322
44981
|
return processedNodeInfo;
|
@@ -45402,13 +45061,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45402
45061
|
return this.estimateTxDependencies(transactionRequest);
|
45403
45062
|
}
|
45404
45063
|
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45405
|
-
const { dryRun:
|
45406
|
-
|
45064
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45065
|
+
encodedTransaction,
|
45407
45066
|
utxoValidation: utxoValidation || false
|
45408
45067
|
});
|
45409
|
-
const
|
45410
|
-
|
45411
|
-
|
45068
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45069
|
+
return {
|
45070
|
+
receipts
|
45071
|
+
};
|
45412
45072
|
}
|
45413
45073
|
/**
|
45414
45074
|
* Verifies whether enough gas is available to complete transaction.
|
@@ -45447,6 +45107,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45447
45107
|
* If there are missing variable outputs,
|
45448
45108
|
* `addVariableOutputs` is called on the transaction.
|
45449
45109
|
*
|
45110
|
+
* @privateRemarks
|
45111
|
+
* TODO: Investigate support for missing contract IDs
|
45112
|
+
* TODO: Add support for missing output messages
|
45450
45113
|
*
|
45451
45114
|
* @param transactionRequest - The transaction request object.
|
45452
45115
|
* @returns A promise.
|
@@ -45459,19 +45122,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45459
45122
|
missingContractIds: []
|
45460
45123
|
};
|
45461
45124
|
}
|
45125
|
+
await this.estimatePredicates(transactionRequest);
|
45462
45126
|
let receipts = [];
|
45463
45127
|
const missingContractIds = [];
|
45464
45128
|
let outputVariables = 0;
|
45465
|
-
let dryrunStatus;
|
45466
45129
|
for (let attempt = 0; attempt < MAX_RETRIES; attempt++) {
|
45467
|
-
const {
|
45468
|
-
|
45469
|
-
} = await this.operations.dryRun({
|
45470
|
-
encodedTransactions: [hexlify(transactionRequest.toTransactionBytes())],
|
45130
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45131
|
+
encodedTransaction: hexlify(transactionRequest.toTransactionBytes()),
|
45471
45132
|
utxoValidation: false
|
45472
45133
|
});
|
45473
|
-
receipts =
|
45474
|
-
dryrunStatus = status;
|
45134
|
+
receipts = gqlReceipts.map(processGqlReceipt);
|
45475
45135
|
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(receipts);
|
45476
45136
|
const hasMissingOutputs = missingOutputVariables.length !== 0 || missingOutputContractIds.length !== 0;
|
45477
45137
|
if (hasMissingOutputs) {
|
@@ -45481,11 +45141,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45481
45141
|
transactionRequest.addContractInputAndOutput(Address.fromString(contractId));
|
45482
45142
|
missingContractIds.push(contractId);
|
45483
45143
|
});
|
45484
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45485
|
-
transactionRequest,
|
45486
|
-
optimizeGas: false
|
45487
|
-
});
|
45488
|
-
transactionRequest.maxFee = maxFee;
|
45489
45144
|
} else {
|
45490
45145
|
break;
|
45491
45146
|
}
|
@@ -45493,133 +45148,38 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45493
45148
|
return {
|
45494
45149
|
receipts,
|
45495
45150
|
outputVariables,
|
45496
|
-
missingContractIds
|
45497
|
-
dryrunStatus
|
45151
|
+
missingContractIds
|
45498
45152
|
};
|
45499
45153
|
}
|
45500
45154
|
/**
|
45501
|
-
*
|
45502
|
-
*
|
45503
|
-
*
|
45504
|
-
*
|
45505
|
-
|
45506
|
-
|
45507
|
-
|
45508
|
-
|
45509
|
-
*/
|
45510
|
-
async estimateMultipleTxDependencies(transactionRequests) {
|
45511
|
-
const results = transactionRequests.map(() => ({
|
45512
|
-
receipts: [],
|
45513
|
-
outputVariables: 0,
|
45514
|
-
missingContractIds: [],
|
45515
|
-
dryrunStatus: void 0
|
45516
|
-
}));
|
45517
|
-
const allRequests = clone_default(transactionRequests);
|
45518
|
-
const serializedTransactionsMap = /* @__PURE__ */ new Map();
|
45519
|
-
allRequests.forEach((req, index) => {
|
45520
|
-
if (req.type === TransactionType.Script) {
|
45521
|
-
serializedTransactionsMap.set(index, hexlify(req.toTransactionBytes()));
|
45522
|
-
}
|
45523
|
-
});
|
45524
|
-
let transactionsToProcess = Array.from(serializedTransactionsMap.keys());
|
45525
|
-
let attempt = 0;
|
45526
|
-
while (transactionsToProcess.length > 0 && attempt < MAX_RETRIES) {
|
45527
|
-
const encodedTransactions = transactionsToProcess.map(
|
45528
|
-
(index) => serializedTransactionsMap.get(index)
|
45529
|
-
);
|
45530
|
-
const dryRunResults = await this.operations.dryRun({
|
45531
|
-
encodedTransactions,
|
45532
|
-
utxoValidation: false
|
45533
|
-
});
|
45534
|
-
const nextRoundTransactions = [];
|
45535
|
-
for (let i = 0; i < dryRunResults.dryRun.length; i++) {
|
45536
|
-
const currentResultIndex = transactionsToProcess[i];
|
45537
|
-
const { receipts: rawReceipts, status } = dryRunResults.dryRun[i];
|
45538
|
-
results[currentResultIndex].receipts = rawReceipts.map(processGqlReceipt);
|
45539
|
-
results[currentResultIndex].dryrunStatus = status;
|
45540
|
-
const { missingOutputVariables, missingOutputContractIds } = getReceiptsWithMissingData(
|
45541
|
-
results[currentResultIndex].receipts
|
45542
|
-
);
|
45543
|
-
const hasMissingOutputs = missingOutputVariables.length > 0 || missingOutputContractIds.length > 0;
|
45544
|
-
const requestToProcess = allRequests[currentResultIndex];
|
45545
|
-
if (hasMissingOutputs && requestToProcess?.type === TransactionType.Script) {
|
45546
|
-
results[currentResultIndex].outputVariables += missingOutputVariables.length;
|
45547
|
-
requestToProcess.addVariableOutputs(missingOutputVariables.length);
|
45548
|
-
missingOutputContractIds.forEach(({ contractId }) => {
|
45549
|
-
requestToProcess.addContractInputAndOutput(Address.fromString(contractId));
|
45550
|
-
results[currentResultIndex].missingContractIds.push(contractId);
|
45551
|
-
});
|
45552
|
-
const { maxFee } = await this.estimateTxGasAndFee({
|
45553
|
-
transactionRequest: requestToProcess,
|
45554
|
-
optimizeGas: false
|
45555
|
-
});
|
45556
|
-
requestToProcess.maxFee = maxFee;
|
45557
|
-
serializedTransactionsMap.set(
|
45558
|
-
currentResultIndex,
|
45559
|
-
hexlify(requestToProcess.toTransactionBytes())
|
45560
|
-
);
|
45561
|
-
nextRoundTransactions.push(currentResultIndex);
|
45562
|
-
allRequests[currentResultIndex] = requestToProcess;
|
45563
|
-
}
|
45564
|
-
}
|
45565
|
-
transactionsToProcess = nextRoundTransactions;
|
45566
|
-
attempt += 1;
|
45567
|
-
}
|
45568
|
-
return results;
|
45569
|
-
}
|
45570
|
-
async dryRunMultipleTransactions(transactionRequests, { utxoValidation, estimateTxDependencies = true } = {}) {
|
45571
|
-
if (estimateTxDependencies) {
|
45572
|
-
return this.estimateMultipleTxDependencies(transactionRequests);
|
45573
|
-
}
|
45574
|
-
const encodedTransactions = transactionRequests.map((tx) => hexlify(tx.toTransactionBytes()));
|
45575
|
-
const { dryRun: dryRunStatuses } = await this.operations.dryRun({
|
45576
|
-
encodedTransactions,
|
45577
|
-
utxoValidation: utxoValidation || false
|
45578
|
-
});
|
45579
|
-
const results = dryRunStatuses.map(({ receipts: rawReceipts, status }) => {
|
45580
|
-
const receipts = rawReceipts.map(processGqlReceipt);
|
45581
|
-
return { receipts, dryrunStatus: status };
|
45582
|
-
});
|
45583
|
-
return results;
|
45584
|
-
}
|
45585
|
-
async estimateTxGasAndFee(params) {
|
45586
|
-
const { transactionRequest, optimizeGas = true } = params;
|
45587
|
-
let { gasPrice } = params;
|
45155
|
+
* Estimates the transaction gas and fee based on the provided transaction request.
|
45156
|
+
* @param transactionRequest - The transaction request object.
|
45157
|
+
* @param optimizeGas - Optional. Specifies whether to optimize the gas. Default is false.
|
45158
|
+
* @returns An object containing the estimated minimum gas, minimum fee, maximum gas, and maximum fee.
|
45159
|
+
*/
|
45160
|
+
estimateTxGasAndFee(params) {
|
45161
|
+
const { transactionRequest } = params;
|
45162
|
+
const { gasPriceFactor, minGasPrice, maxGasPerTx } = this.getGasConfig();
|
45588
45163
|
const chainInfo = this.getChain();
|
45589
|
-
const
|
45164
|
+
const gasPrice = transactionRequest.gasPrice.eq(0) ? minGasPrice : transactionRequest.gasPrice;
|
45165
|
+
transactionRequest.gasPrice = gasPrice;
|
45590
45166
|
const minGas = transactionRequest.calculateMinGas(chainInfo);
|
45591
|
-
|
45592
|
-
gasPrice = await this.estimateGasPrice(10);
|
45593
|
-
}
|
45594
|
-
const minFee = calculateGasFee({
|
45595
|
-
gasPrice: bn(gasPrice),
|
45596
|
-
gas: minGas,
|
45597
|
-
priceFactor: gasPriceFactor,
|
45598
|
-
tip: transactionRequest.tip
|
45599
|
-
}).add(1);
|
45600
|
-
let gasLimit = bn(0);
|
45167
|
+
const minFee = calculatePriceWithFactor(minGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45601
45168
|
if (transactionRequest.type === TransactionType.Script) {
|
45602
|
-
|
45603
|
-
if (!optimizeGas) {
|
45169
|
+
if (transactionRequest.gasLimit.eq(0)) {
|
45604
45170
|
transactionRequest.gasLimit = minGas;
|
45605
|
-
gasLimit =
|
45606
|
-
|
45171
|
+
transactionRequest.gasLimit = maxGasPerTx.sub(
|
45172
|
+
transactionRequest.calculateMaxGas(chainInfo, minGas)
|
45173
|
+
);
|
45607
45174
|
}
|
45608
45175
|
}
|
45609
45176
|
const maxGas = transactionRequest.calculateMaxGas(chainInfo, minGas);
|
45610
|
-
const maxFee =
|
45611
|
-
gasPrice: bn(gasPrice),
|
45612
|
-
gas: maxGas,
|
45613
|
-
priceFactor: gasPriceFactor,
|
45614
|
-
tip: transactionRequest.tip
|
45615
|
-
}).add(1);
|
45177
|
+
const maxFee = calculatePriceWithFactor(maxGas, gasPrice, gasPriceFactor).normalizeZeroToOne();
|
45616
45178
|
return {
|
45617
45179
|
minGas,
|
45618
45180
|
minFee,
|
45619
45181
|
maxGas,
|
45620
|
-
maxFee
|
45621
|
-
gasPrice,
|
45622
|
-
gasLimit
|
45182
|
+
maxFee
|
45623
45183
|
};
|
45624
45184
|
}
|
45625
45185
|
/**
|
@@ -45637,17 +45197,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45637
45197
|
if (estimateTxDependencies) {
|
45638
45198
|
return this.estimateTxDependencies(transactionRequest);
|
45639
45199
|
}
|
45640
|
-
const
|
45641
|
-
const { dryRun:
|
45642
|
-
|
45200
|
+
const encodedTransaction = hexlify(transactionRequest.toTransactionBytes());
|
45201
|
+
const { dryRun: gqlReceipts } = await this.operations.dryRun({
|
45202
|
+
encodedTransaction,
|
45643
45203
|
utxoValidation: true
|
45644
45204
|
});
|
45645
|
-
const
|
45646
|
-
|
45647
|
-
|
45648
|
-
|
45649
|
-
});
|
45650
|
-
return { receipts: callResult[0].receipts };
|
45205
|
+
const receipts = gqlReceipts.map(processGqlReceipt);
|
45206
|
+
return {
|
45207
|
+
receipts
|
45208
|
+
};
|
45651
45209
|
}
|
45652
45210
|
/**
|
45653
45211
|
* Returns a transaction cost to enable user
|
@@ -45664,80 +45222,77 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45664
45222
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
45665
45223
|
* @returns A promise that resolves to the transaction cost object.
|
45666
45224
|
*/
|
45667
|
-
async getTransactionCost(transactionRequestLike,
|
45225
|
+
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
45226
|
+
estimateTxDependencies = true,
|
45227
|
+
estimatePredicates = true,
|
45228
|
+
resourcesOwner,
|
45229
|
+
signatureCallback
|
45230
|
+
} = {}) {
|
45668
45231
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45232
|
+
const { minGasPrice } = this.getGasConfig();
|
45233
|
+
const setGasPrice = max(txRequestClone.gasPrice, minGasPrice);
|
45669
45234
|
const isScriptTransaction = txRequestClone.type === TransactionType.Script;
|
45670
45235
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
45671
|
-
const allQuantities = mergeQuantities(coinOutputsQuantities,
|
45236
|
+
const allQuantities = mergeQuantities(coinOutputsQuantities, forwardingQuantities);
|
45672
45237
|
txRequestClone.fundWithFakeUtxos(allQuantities, resourcesOwner?.address);
|
45673
|
-
txRequestClone.maxFee = bn(0);
|
45674
45238
|
if (isScriptTransaction) {
|
45675
45239
|
txRequestClone.gasLimit = bn(0);
|
45676
45240
|
}
|
45677
|
-
if (
|
45678
|
-
resourcesOwner
|
45241
|
+
if (estimatePredicates) {
|
45242
|
+
if (resourcesOwner && "populateTransactionPredicateData" in resourcesOwner) {
|
45243
|
+
resourcesOwner.populateTransactionPredicateData(txRequestClone);
|
45244
|
+
}
|
45245
|
+
await this.estimatePredicates(txRequestClone);
|
45679
45246
|
}
|
45680
|
-
const signedRequest = clone_default(txRequestClone);
|
45681
|
-
let addedSignatures = 0;
|
45682
45247
|
if (signatureCallback && isScriptTransaction) {
|
45683
|
-
|
45684
|
-
|
45685
|
-
|
45686
|
-
|
45687
|
-
await this.estimatePredicates(signedRequest);
|
45688
|
-
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
45689
|
-
transactionRequest: signedRequest,
|
45690
|
-
optimizeGas: false
|
45248
|
+
await signatureCallback(txRequestClone);
|
45249
|
+
}
|
45250
|
+
let { maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
|
45251
|
+
transactionRequest: txRequestClone
|
45691
45252
|
});
|
45692
|
-
txRequestClone.maxFee = maxFee;
|
45693
45253
|
let receipts = [];
|
45694
45254
|
let missingContractIds = [];
|
45695
45255
|
let outputVariables = 0;
|
45696
45256
|
let gasUsed = bn(0);
|
45697
|
-
|
45698
|
-
|
45699
|
-
if (signatureCallback) {
|
45700
|
-
await signatureCallback(txRequestClone);
|
45701
|
-
}
|
45702
|
-
txRequestClone.gasLimit = gasLimit;
|
45257
|
+
if (isScriptTransaction && estimateTxDependencies) {
|
45258
|
+
txRequestClone.gasPrice = bn(0);
|
45703
45259
|
const result = await this.estimateTxDependencies(txRequestClone);
|
45704
45260
|
receipts = result.receipts;
|
45705
45261
|
outputVariables = result.outputVariables;
|
45706
45262
|
missingContractIds = result.missingContractIds;
|
45707
|
-
gasUsed = getGasUsedFromReceipts(receipts);
|
45263
|
+
gasUsed = isScriptTransaction ? getGasUsedFromReceipts(receipts) : gasUsed;
|
45708
45264
|
txRequestClone.gasLimit = gasUsed;
|
45709
|
-
|
45710
|
-
|
45711
|
-
|
45265
|
+
txRequestClone.gasPrice = setGasPrice;
|
45266
|
+
({ maxFee, maxGas, minFee, minGas } = this.estimateTxGasAndFee({
|
45267
|
+
transactionRequest: txRequestClone
|
45712
45268
|
}));
|
45713
45269
|
}
|
45714
45270
|
return {
|
45715
45271
|
requiredQuantities: allQuantities,
|
45716
45272
|
receipts,
|
45717
45273
|
gasUsed,
|
45718
|
-
|
45274
|
+
minGasPrice,
|
45275
|
+
gasPrice: setGasPrice,
|
45719
45276
|
minGas,
|
45720
45277
|
maxGas,
|
45721
45278
|
minFee,
|
45722
45279
|
maxFee,
|
45280
|
+
estimatedInputs: txRequestClone.inputs,
|
45723
45281
|
outputVariables,
|
45724
|
-
missingContractIds
|
45725
|
-
addedSignatures,
|
45726
|
-
estimatedPredicates: txRequestClone.inputs
|
45282
|
+
missingContractIds
|
45727
45283
|
};
|
45728
45284
|
}
|
45729
|
-
async getResourcesForTransaction(owner, transactionRequestLike,
|
45285
|
+
async getResourcesForTransaction(owner, transactionRequestLike, forwardingQuantities = []) {
|
45730
45286
|
const ownerAddress = Address.fromAddressOrString(owner);
|
45731
45287
|
const transactionRequest = transactionRequestify(clone_default(transactionRequestLike));
|
45732
|
-
const transactionCost = await this.getTransactionCost(transactionRequest,
|
45733
|
-
quantitiesToContract
|
45734
|
-
});
|
45288
|
+
const transactionCost = await this.getTransactionCost(transactionRequest, forwardingQuantities);
|
45735
45289
|
transactionRequest.addResources(
|
45736
45290
|
await this.getResourcesToSpend(ownerAddress, transactionCost.requiredQuantities)
|
45737
45291
|
);
|
45738
|
-
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45739
|
-
|
45740
|
-
|
45292
|
+
const { requiredQuantities, ...txCost } = await this.getTransactionCost(
|
45293
|
+
transactionRequest,
|
45294
|
+
forwardingQuantities
|
45295
|
+
);
|
45741
45296
|
const resources = await this.getResourcesToSpend(ownerAddress, requiredQuantities);
|
45742
45297
|
return {
|
45743
45298
|
resources,
|
@@ -45761,6 +45316,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45761
45316
|
assetId: coin.assetId,
|
45762
45317
|
amount: bn(coin.amount),
|
45763
45318
|
owner: Address.fromAddressOrString(coin.owner),
|
45319
|
+
maturity: bn(coin.maturity).toNumber(),
|
45764
45320
|
blockCreated: bn(coin.blockCreated),
|
45765
45321
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45766
45322
|
}));
|
@@ -45812,6 +45368,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45812
45368
|
amount: bn(coin.amount),
|
45813
45369
|
assetId: coin.assetId,
|
45814
45370
|
owner: Address.fromAddressOrString(coin.owner),
|
45371
|
+
maturity: bn(coin.maturity).toNumber(),
|
45815
45372
|
blockCreated: bn(coin.blockCreated),
|
45816
45373
|
txCreatedIdx: bn(coin.txCreatedIdx)
|
45817
45374
|
};
|
@@ -45844,7 +45401,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45844
45401
|
}
|
45845
45402
|
return {
|
45846
45403
|
id: block2.id,
|
45847
|
-
height: bn(block2.height),
|
45404
|
+
height: bn(block2.header.height),
|
45848
45405
|
time: block2.header.time,
|
45849
45406
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45850
45407
|
};
|
@@ -45859,7 +45416,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45859
45416
|
const { blocks: fetchedData } = await this.operations.getBlocks(params);
|
45860
45417
|
const blocks = fetchedData.edges.map(({ node: block2 }) => ({
|
45861
45418
|
id: block2.id,
|
45862
|
-
height: bn(block2.height),
|
45419
|
+
height: bn(block2.header.height),
|
45863
45420
|
time: block2.header.time,
|
45864
45421
|
transactionIds: block2.transactions.map((tx) => tx.id)
|
45865
45422
|
}));
|
@@ -45886,7 +45443,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45886
45443
|
}
|
45887
45444
|
return {
|
45888
45445
|
id: block2.id,
|
45889
|
-
height: bn(block2.height, 10),
|
45446
|
+
height: bn(block2.header.height, 10),
|
45890
45447
|
time: block2.header.time,
|
45891
45448
|
transactionIds: block2.transactions.map((tx) => tx.id),
|
45892
45449
|
transactions: block2.transactions.map(
|
@@ -46066,6 +45623,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46066
45623
|
prevRoot: messageBlockHeader.prevRoot,
|
46067
45624
|
time: messageBlockHeader.time,
|
46068
45625
|
applicationHash: messageBlockHeader.applicationHash,
|
45626
|
+
messageReceiptRoot: messageBlockHeader.messageReceiptRoot,
|
46069
45627
|
messageReceiptCount: bn(messageBlockHeader.messageReceiptCount)
|
46070
45628
|
},
|
46071
45629
|
commitBlockHeader: {
|
@@ -46077,6 +45635,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46077
45635
|
prevRoot: commitBlockHeader.prevRoot,
|
46078
45636
|
time: commitBlockHeader.time,
|
46079
45637
|
applicationHash: commitBlockHeader.applicationHash,
|
45638
|
+
messageReceiptRoot: commitBlockHeader.messageReceiptRoot,
|
46080
45639
|
messageReceiptCount: bn(commitBlockHeader.messageReceiptCount)
|
46081
45640
|
},
|
46082
45641
|
sender: Address.fromAddressOrString(sender),
|
@@ -46086,16 +45645,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46086
45645
|
data
|
46087
45646
|
};
|
46088
45647
|
}
|
46089
|
-
async getLatestGasPrice() {
|
46090
|
-
const { latestGasPrice } = await this.operations.getLatestGasPrice();
|
46091
|
-
return bn(latestGasPrice.gasPrice);
|
46092
|
-
}
|
46093
|
-
async estimateGasPrice(blockHorizon) {
|
46094
|
-
const { estimateGasPrice } = await this.operations.estimateGasPrice({
|
46095
|
-
blockHorizon: String(blockHorizon)
|
46096
|
-
});
|
46097
|
-
return bn(estimateGasPrice.gasPrice);
|
46098
|
-
}
|
46099
45648
|
/**
|
46100
45649
|
* Returns Message Proof for given transaction id and the message id from MessageOut receipt.
|
46101
45650
|
*
|
@@ -46379,33 +45928,36 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46379
45928
|
* @param fee - The estimated transaction fee.
|
46380
45929
|
* @returns A promise that resolves when the resources are added to the transaction.
|
46381
45930
|
*/
|
46382
|
-
async fund(request,
|
46383
|
-
const
|
46384
|
-
const txRequest = request;
|
46385
|
-
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
45931
|
+
async fund(request, coinQuantities, fee) {
|
45932
|
+
const updatedQuantities = addAmountToAsset({
|
46386
45933
|
amount: bn(fee),
|
46387
45934
|
assetId: BaseAssetId,
|
46388
|
-
coinQuantities
|
45935
|
+
coinQuantities
|
46389
45936
|
});
|
46390
45937
|
const quantitiesDict = {};
|
46391
|
-
|
45938
|
+
updatedQuantities.forEach(({ amount, assetId }) => {
|
46392
45939
|
quantitiesDict[assetId] = {
|
46393
45940
|
required: amount,
|
46394
45941
|
owned: bn(0)
|
46395
45942
|
};
|
46396
45943
|
});
|
46397
|
-
|
45944
|
+
const cachedUtxos = [];
|
45945
|
+
const cachedMessages = [];
|
45946
|
+
const owner = this.address.toB256();
|
45947
|
+
request.inputs.forEach((input) => {
|
46398
45948
|
const isResource = "amount" in input;
|
46399
45949
|
if (isResource) {
|
46400
45950
|
const isCoin2 = "owner" in input;
|
46401
45951
|
if (isCoin2) {
|
46402
45952
|
const assetId = String(input.assetId);
|
46403
|
-
if (quantitiesDict[assetId]) {
|
45953
|
+
if (input.owner === owner && quantitiesDict[assetId]) {
|
46404
45954
|
const amount = bn(input.amount);
|
46405
45955
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45956
|
+
cachedUtxos.push(input.id);
|
46406
45957
|
}
|
46407
|
-
} else if (input.amount && quantitiesDict[BaseAssetId]) {
|
45958
|
+
} else if (input.recipient === owner && input.amount && quantitiesDict[BaseAssetId]) {
|
46408
45959
|
quantitiesDict[BaseAssetId].owned = quantitiesDict[BaseAssetId].owned.add(input.amount);
|
45960
|
+
cachedMessages.push(input.nonce);
|
46409
45961
|
}
|
46410
45962
|
}
|
46411
45963
|
});
|
@@ -46420,23 +45972,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46420
45972
|
});
|
46421
45973
|
const needsToBeFunded = missingQuantities.length;
|
46422
45974
|
if (needsToBeFunded) {
|
46423
|
-
const
|
46424
|
-
|
46425
|
-
|
46426
|
-
|
46427
|
-
|
46428
|
-
txRequest.updatePredicateGasUsed(estimatedPredicates);
|
46429
|
-
const requestToBeReEstimate = clone_default(txRequest);
|
46430
|
-
if (addedSignatures) {
|
46431
|
-
Array.from({ length: addedSignatures }).forEach(
|
46432
|
-
() => requestToBeReEstimate.addEmptyWitness()
|
46433
|
-
);
|
45975
|
+
const resources = await this.getResourcesToSpend(missingQuantities, {
|
45976
|
+
messages: cachedMessages,
|
45977
|
+
utxos: cachedUtxos
|
45978
|
+
});
|
45979
|
+
request.addResources(resources);
|
46434
45980
|
}
|
46435
|
-
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
46436
|
-
transactionRequest: requestToBeReEstimate
|
46437
|
-
});
|
46438
|
-
txRequest.maxFee = maxFee;
|
46439
|
-
return txRequest;
|
46440
45981
|
}
|
46441
45982
|
/**
|
46442
45983
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -46444,25 +45985,28 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46444
45985
|
* @param destination - The address of the destination.
|
46445
45986
|
* @param amount - The amount of coins to transfer.
|
46446
45987
|
* @param assetId - The asset ID of the coins to transfer.
|
46447
|
-
* @param txParams - The transaction parameters (gasLimit,
|
45988
|
+
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
46448
45989
|
* @returns A promise that resolves to the prepared transaction request.
|
46449
45990
|
*/
|
46450
45991
|
async createTransfer(destination, amount, assetId = BaseAssetId, txParams = {}) {
|
46451
|
-
const
|
45992
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
45993
|
+
const params = { gasPrice: minGasPrice, ...txParams };
|
45994
|
+
const request = new ScriptTransactionRequest(params);
|
46452
45995
|
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetId);
|
46453
|
-
const
|
45996
|
+
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
46454
45997
|
estimateTxDependencies: true,
|
46455
45998
|
resourcesOwner: this
|
46456
45999
|
});
|
46457
|
-
|
46458
|
-
|
46459
|
-
|
46460
|
-
|
46461
|
-
|
46462
|
-
|
46463
|
-
|
46464
|
-
|
46465
|
-
await this.fund(request,
|
46000
|
+
request.gasPrice = bn(txParams.gasPrice ?? minGasPrice);
|
46001
|
+
request.gasLimit = bn(txParams.gasLimit ?? gasUsed);
|
46002
|
+
this.validateGas({
|
46003
|
+
gasUsed,
|
46004
|
+
gasPrice: request.gasPrice,
|
46005
|
+
gasLimit: request.gasLimit,
|
46006
|
+
minGasPrice
|
46007
|
+
});
|
46008
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46009
|
+
request.updatePredicateInputs(estimatedInputs);
|
46466
46010
|
return request;
|
46467
46011
|
}
|
46468
46012
|
/**
|
@@ -46501,30 +46045,31 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46501
46045
|
);
|
46502
46046
|
}
|
46503
46047
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46048
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46049
|
+
const params = { gasPrice: minGasPrice, ...txParams };
|
46504
46050
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46505
46051
|
hexlifiedContractId: contractAddress.toB256(),
|
46506
46052
|
amountToTransfer: bn(amount),
|
46507
46053
|
assetId
|
46508
46054
|
});
|
46509
46055
|
const request = new ScriptTransactionRequest({
|
46510
|
-
...
|
46056
|
+
...params,
|
46511
46057
|
script,
|
46512
46058
|
scriptData
|
46513
46059
|
});
|
46514
46060
|
request.addContractInputAndOutput(contractAddress);
|
46515
|
-
const
|
46516
|
-
|
46517
|
-
|
46061
|
+
const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
|
46062
|
+
request,
|
46063
|
+
[{ amount: bn(amount), assetId: String(assetId) }]
|
46064
|
+
);
|
46065
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46066
|
+
this.validateGas({
|
46067
|
+
gasUsed,
|
46068
|
+
gasPrice: request.gasPrice,
|
46069
|
+
gasLimit: request.gasLimit,
|
46070
|
+
minGasPrice
|
46518
46071
|
});
|
46519
|
-
|
46520
|
-
this.validateGas({
|
46521
|
-
gasUsed: txCost.gasUsed,
|
46522
|
-
gasLimit: request.gasLimit
|
46523
|
-
});
|
46524
|
-
}
|
46525
|
-
request.gasLimit = txCost.gasUsed;
|
46526
|
-
request.maxFee = txCost.maxFee;
|
46527
|
-
await this.fund(request, txCost);
|
46072
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46528
46073
|
return this.sendTransaction(request);
|
46529
46074
|
}
|
46530
46075
|
/**
|
@@ -46536,6 +46081,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46536
46081
|
* @returns A promise that resolves to the transaction response.
|
46537
46082
|
*/
|
46538
46083
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46084
|
+
const { minGasPrice } = this.provider.getGasConfig();
|
46539
46085
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46540
46086
|
const recipientDataArray = arrayify(
|
46541
46087
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46548,19 +46094,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46548
46094
|
...recipientDataArray,
|
46549
46095
|
...amountDataArray
|
46550
46096
|
]);
|
46551
|
-
const params = { script, ...txParams };
|
46097
|
+
const params = { script, gasPrice: minGasPrice, ...txParams };
|
46552
46098
|
const request = new ScriptTransactionRequest(params);
|
46553
|
-
const
|
46554
|
-
const
|
46555
|
-
|
46556
|
-
|
46557
|
-
|
46558
|
-
|
46559
|
-
|
46560
|
-
|
46561
|
-
|
46562
|
-
|
46563
|
-
|
46099
|
+
const forwardingQuantities = [{ amount: bn(amount), assetId: BaseAssetId }];
|
46100
|
+
const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
|
46101
|
+
request,
|
46102
|
+
forwardingQuantities
|
46103
|
+
);
|
46104
|
+
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46105
|
+
this.validateGas({
|
46106
|
+
gasUsed,
|
46107
|
+
gasPrice: request.gasPrice,
|
46108
|
+
gasLimit: request.gasLimit,
|
46109
|
+
minGasPrice
|
46110
|
+
});
|
46111
|
+
await this.fund(request, requiredQuantities, maxFee);
|
46564
46112
|
return this.sendTransaction(request);
|
46565
46113
|
}
|
46566
46114
|
async signMessage(message) {
|
@@ -46618,7 +46166,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46618
46166
|
}
|
46619
46167
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
46620
46168
|
}
|
46621
|
-
validateGas({
|
46169
|
+
validateGas({
|
46170
|
+
gasUsed,
|
46171
|
+
gasPrice,
|
46172
|
+
gasLimit,
|
46173
|
+
minGasPrice
|
46174
|
+
}) {
|
46175
|
+
if (minGasPrice.gt(gasPrice)) {
|
46176
|
+
throw new FuelError(
|
46177
|
+
ErrorCode.GAS_PRICE_TOO_LOW,
|
46178
|
+
`Gas price '${gasPrice}' is lower than the required: '${minGasPrice}'.`
|
46179
|
+
);
|
46180
|
+
}
|
46622
46181
|
if (gasUsed.gt(gasLimit)) {
|
46623
46182
|
throw new FuelError(
|
46624
46183
|
ErrorCode.GAS_LIMIT_TOO_LOW,
|
@@ -48207,7 +47766,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
48207
47766
|
* @param transactionRequestLike - The transaction request to send.
|
48208
47767
|
* @returns A promise that resolves to the TransactionResponse object.
|
48209
47768
|
*/
|
48210
|
-
async sendTransaction(transactionRequestLike, { estimateTxDependencies =
|
47769
|
+
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, awaitExecution } = {}) {
|
48211
47770
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
48212
47771
|
if (estimateTxDependencies) {
|
48213
47772
|
await this.provider.estimateTxDependencies(transactionRequest);
|
@@ -50967,15 +50526,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50967
50526
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50968
50527
|
wallet.provider
|
50969
50528
|
);
|
50970
|
-
const
|
50971
|
-
|
50972
|
-
|
50973
|
-
|
50529
|
+
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50530
|
+
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
50531
|
+
const request = new ScriptTransactionRequest({
|
50532
|
+
gasLimit: 1e4,
|
50533
|
+
gasPrice: minGasPrice
|
50974
50534
|
});
|
50975
|
-
|
50976
|
-
request.
|
50977
|
-
request.maxFee = txCost.maxFee;
|
50978
|
-
await genesisWallet.fund(request, txCost);
|
50535
|
+
request.addResources(resources);
|
50536
|
+
quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
|
50979
50537
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50980
50538
|
};
|
50981
50539
|
|
@@ -51054,12 +50612,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51054
50612
|
// eslint-disable-next-line no-async-promise-executor
|
51055
50613
|
new Promise(async (resolve, reject) => {
|
51056
50614
|
const remainingArgs = extractRemainingArgs(args, [
|
51057
|
-
"--
|
50615
|
+
"--chain",
|
51058
50616
|
"--consensus-key",
|
51059
50617
|
"--db-type",
|
51060
50618
|
"--poa-instant"
|
51061
50619
|
]);
|
51062
|
-
const chainConfigPath = getFlagValueFromArgs(args, "--
|
50620
|
+
const chainConfigPath = getFlagValueFromArgs(args, "--chain");
|
51063
50621
|
const consensusKey = getFlagValueFromArgs(args, "--consensus-key") || defaultConsensusKey;
|
51064
50622
|
const dbTypeFlagValue = getFlagValueFromArgs(args, "--db-type");
|
51065
50623
|
const useInMemoryDb = dbTypeFlagValue === "in-memory" || dbTypeFlagValue === void 0;
|
@@ -51078,54 +50636,36 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51078
50636
|
let chainConfigPathToUse;
|
51079
50637
|
const prefix = basePath || import_os.default.tmpdir();
|
51080
50638
|
const suffix = basePath ? "" : (0, import_crypto21.randomUUID)();
|
51081
|
-
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix
|
50639
|
+
const tempDirPath = import_path8.default.join(prefix, ".fuels", suffix);
|
51082
50640
|
if (chainConfigPath) {
|
51083
50641
|
chainConfigPathToUse = chainConfigPath;
|
51084
50642
|
} else {
|
51085
50643
|
if (!(0, import_fs2.existsSync)(tempDirPath)) {
|
51086
50644
|
(0, import_fs2.mkdirSync)(tempDirPath, { recursive: true });
|
51087
50645
|
}
|
51088
|
-
|
51089
|
-
|
51090
|
-
stateConfigJson = {
|
51091
|
-
...stateConfigJson,
|
51092
|
-
coins: [
|
51093
|
-
...stateConfigJson.coins.map((coin) => ({
|
51094
|
-
...coin,
|
51095
|
-
amount: "18446744073709551615"
|
51096
|
-
}))
|
51097
|
-
],
|
51098
|
-
messages: stateConfigJson.messages.map((message) => ({
|
51099
|
-
...message,
|
51100
|
-
amount: "18446744073709551615"
|
51101
|
-
}))
|
51102
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
51103
|
-
};
|
50646
|
+
const tempChainConfigFilePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
50647
|
+
let chainConfig = defaultChainConfig;
|
51104
50648
|
if (!process.env.GENESIS_SECRET) {
|
51105
50649
|
const pk = Signer.generatePrivateKey();
|
51106
50650
|
const signer = new Signer(pk);
|
51107
50651
|
process.env.GENESIS_SECRET = hexlify(pk);
|
51108
|
-
|
51109
|
-
|
51110
|
-
|
51111
|
-
|
51112
|
-
|
51113
|
-
|
51114
|
-
|
51115
|
-
|
51116
|
-
|
51117
|
-
|
50652
|
+
chainConfig = {
|
50653
|
+
...defaultChainConfig,
|
50654
|
+
initial_state: {
|
50655
|
+
...defaultChainConfig.initial_state,
|
50656
|
+
coins: [
|
50657
|
+
...defaultChainConfig.initial_state.coins,
|
50658
|
+
{
|
50659
|
+
owner: signer.address.toHexString(),
|
50660
|
+
amount: toHex(1e9),
|
50661
|
+
asset_id: BaseAssetId
|
50662
|
+
}
|
50663
|
+
]
|
50664
|
+
}
|
50665
|
+
};
|
51118
50666
|
}
|
51119
|
-
|
51120
|
-
|
51121
|
-
fixedStateConfigJSON = fixedStateConfigJSON.replace(regexMakeNumber, "$1$2");
|
51122
|
-
const chainConfigWritePath = import_path8.default.join(tempDirPath, "chainConfig.json");
|
51123
|
-
const stateConfigWritePath = import_path8.default.join(tempDirPath, "stateConfig.json");
|
51124
|
-
const metadataWritePath = import_path8.default.join(tempDirPath, "metadata.json");
|
51125
|
-
(0, import_fs2.writeFileSync)(chainConfigWritePath, JSON.stringify(chainConfigJson), "utf8");
|
51126
|
-
(0, import_fs2.writeFileSync)(stateConfigWritePath, fixedStateConfigJSON, "utf8");
|
51127
|
-
(0, import_fs2.writeFileSync)(metadataWritePath, JSON.stringify(metadataJson), "utf8");
|
51128
|
-
chainConfigPathToUse = tempDirPath;
|
50667
|
+
(0, import_fs2.writeFileSync)(tempChainConfigFilePath, JSON.stringify(chainConfig), "utf8");
|
50668
|
+
chainConfigPathToUse = tempChainConfigFilePath;
|
51129
50669
|
}
|
51130
50670
|
const child = (0, import_child_process.spawn)(
|
51131
50671
|
command,
|
@@ -51134,10 +50674,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51134
50674
|
["--ip", ipToUse],
|
51135
50675
|
["--port", portToUse],
|
51136
50676
|
useInMemoryDb ? ["--db-type", "in-memory"] : ["--db-path", tempDirPath],
|
51137
|
-
["--min-gas-price", "
|
50677
|
+
["--min-gas-price", "0"],
|
51138
50678
|
poaInstant ? ["--poa-instant", "true"] : [],
|
51139
50679
|
["--consensus-key", consensusKey],
|
51140
|
-
["--
|
50680
|
+
["--chain", chainConfigPathToUse],
|
51141
50681
|
"--vm-backtrace",
|
51142
50682
|
"--utxo-validation",
|
51143
50683
|
"--debug",
|
@@ -51196,7 +50736,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51196
50736
|
walletCount = 10
|
51197
50737
|
} = {}) => {
|
51198
50738
|
const { cleanup: closeNode, ip, port } = await launchNode(launchNodeOptions || {});
|
51199
|
-
const provider = await Provider.create(`http://${ip}:${port}/
|
50739
|
+
const provider = await Provider.create(`http://${ip}:${port}/graphql`);
|
51200
50740
|
const wallets = await generateWallets(walletCount, provider);
|
51201
50741
|
const cleanup = () => {
|
51202
50742
|
closeNode();
|