@transia/ripple-binary-codec 1.4.6-alpha.1 → 1.4.6-alpha.3
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.
- package/dist/binary.d.ts +2 -1
- package/dist/binary.js +9 -3
- package/dist/binary.js.map +1 -1
- package/dist/enums/definitions.json +186 -1
- package/dist/enums/src/enums/definitions.json +186 -1
- package/dist/types/st-object.js.map +1 -1
- package/package.json +2 -2
- package/test/definitions.test.js +1 -1
- package/test/signing-data-encoding.test.js +21 -50
package/dist/binary.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { sha512Half, transactionID } from './hashes';
|
|
|
5
5
|
import { type XrplDefinitionsBase } from './enums';
|
|
6
6
|
import { JsonObject } from './types/serialized-type';
|
|
7
7
|
import { Buffer } from 'buffer/';
|
|
8
|
+
import { AmountObject } from './types/amount';
|
|
8
9
|
/**
|
|
9
10
|
* Construct a BinaryParser
|
|
10
11
|
*
|
|
@@ -67,7 +68,7 @@ declare function signingData(transaction: JsonObject, prefix?: Buffer, opts?: {
|
|
|
67
68
|
*/
|
|
68
69
|
interface ClaimObject extends JsonObject {
|
|
69
70
|
channel: string;
|
|
70
|
-
amount:
|
|
71
|
+
amount: AmountObject;
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
73
74
|
* Serialize a signingClaim
|
package/dist/binary.js
CHANGED
|
@@ -93,14 +93,20 @@ exports.signingData = signingData;
|
|
|
93
93
|
* @returns the serialized object with appropriate prefix
|
|
94
94
|
*/
|
|
95
95
|
function signingClaimData(claim) {
|
|
96
|
-
const num = bigInt(String(claim.amount));
|
|
97
96
|
const prefix = hash_prefixes_1.HashPrefix.paymentChannelClaim;
|
|
98
97
|
const channel = types_1.coreTypes.Hash256.from(claim.channel).toBytes();
|
|
99
|
-
const amount = types_1.coreTypes.UInt64.from(num).toBytes();
|
|
100
98
|
const bytesList = new binary_serializer_1.BytesList();
|
|
101
99
|
bytesList.put(prefix);
|
|
102
100
|
bytesList.put(channel);
|
|
103
|
-
|
|
101
|
+
if (typeof claim.amount === 'string') {
|
|
102
|
+
const num = bigInt(String(claim.amount));
|
|
103
|
+
const amount = types_1.coreTypes.UInt64.from(num).toBytes();
|
|
104
|
+
bytesList.put(amount);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const amount = types_1.coreTypes.Amount.from(claim.amount).toBytes();
|
|
108
|
+
bytesList.put(amount);
|
|
109
|
+
}
|
|
104
110
|
return bytesList.toBytes();
|
|
105
111
|
}
|
|
106
112
|
exports.signingClaimData = signingClaimData;
|
package/dist/binary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,mCAAmC;AACnC,0DAAqD;
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,mCAAmC;AACnC,0DAAqD;AA+KnD,6FA/KO,4BAAY,OA+KP;AA7Kd,mDAA4C;AAC5C,kEAAwE;AA6KtE,iGA7KO,oCAAgB,OA6KP;AAChB,0FA9KyB,6BAAS,OA8KzB;AA7KX,qCAAoD;AAsLlD,2FAtLO,mBAAU,OAsLP;AACV,8FAvLmB,sBAAa,OAuLnB;AAtLf,mCAIgB;AAIhB,sCAAsC;AAGtC;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CACjB,KAAa,EACb,WAAiC,EACnB,EAAE,CAAC,IAAI,4BAAY,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;AAwJrD,gCAAU;AAtJZ;;;;;;;GAOG;AACH,MAAM,QAAQ,GAAG,CACf,MAAoB,EACpB,cAAmC,2BAAmB,EAC1C,EAAE,CACb,MAAM,CAAC,QAAQ,CAAC,iBAAS,CAAC,QAAQ,CAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;AA4IrE,4BAAQ;AA1IV;;;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
|
37
37
|
"LedgerHashes": 104,
|
|
38
38
|
"Amendments": 102,
|
|
39
39
|
"FeeSettings": 115,
|
|
40
|
+
"ImportVlseq": 73,
|
|
40
41
|
"Escrow": 117,
|
|
41
42
|
"PayChannel": 120,
|
|
42
43
|
"Check": 67,
|
|
@@ -796,6 +797,16 @@
|
|
|
796
797
|
"type": "UInt32"
|
|
797
798
|
}
|
|
798
799
|
],
|
|
800
|
+
[
|
|
801
|
+
"XahauActivationLgrSeq",
|
|
802
|
+
{
|
|
803
|
+
"nth": 96,
|
|
804
|
+
"isVLEncoded": false,
|
|
805
|
+
"isSerialized": true,
|
|
806
|
+
"isSigningField": true,
|
|
807
|
+
"type": "UInt32"
|
|
808
|
+
}
|
|
809
|
+
],
|
|
799
810
|
[
|
|
800
811
|
"ImportSequence",
|
|
801
812
|
{
|
|
@@ -806,6 +817,36 @@
|
|
|
806
817
|
"type": "UInt32"
|
|
807
818
|
}
|
|
808
819
|
],
|
|
820
|
+
[
|
|
821
|
+
"RewardTime",
|
|
822
|
+
{
|
|
823
|
+
"nth": 98,
|
|
824
|
+
"isVLEncoded": false,
|
|
825
|
+
"isSerialized": true,
|
|
826
|
+
"isSigningField": true,
|
|
827
|
+
"type": "UInt32"
|
|
828
|
+
}
|
|
829
|
+
],
|
|
830
|
+
[
|
|
831
|
+
"RewardLgrFirst",
|
|
832
|
+
{
|
|
833
|
+
"nth": 99,
|
|
834
|
+
"isVLEncoded": false,
|
|
835
|
+
"isSerialized": true,
|
|
836
|
+
"isSigningField": true,
|
|
837
|
+
"type": "UInt32"
|
|
838
|
+
}
|
|
839
|
+
],
|
|
840
|
+
[
|
|
841
|
+
"RewardLgrLast",
|
|
842
|
+
{
|
|
843
|
+
"nth": 100,
|
|
844
|
+
"isVLEncoded": false,
|
|
845
|
+
"isSerialized": true,
|
|
846
|
+
"isSigningField": true,
|
|
847
|
+
"type": "UInt32"
|
|
848
|
+
}
|
|
849
|
+
],
|
|
809
850
|
[
|
|
810
851
|
"IndexNext",
|
|
811
852
|
{
|
|
@@ -966,6 +1007,36 @@
|
|
|
966
1007
|
"type": "UInt64"
|
|
967
1008
|
}
|
|
968
1009
|
],
|
|
1010
|
+
[
|
|
1011
|
+
"AccountIndex",
|
|
1012
|
+
{
|
|
1013
|
+
"nth": 98,
|
|
1014
|
+
"isVLEncoded": false,
|
|
1015
|
+
"isSerialized": true,
|
|
1016
|
+
"isSigningField": true,
|
|
1017
|
+
"type": "UInt64"
|
|
1018
|
+
}
|
|
1019
|
+
],
|
|
1020
|
+
[
|
|
1021
|
+
"AccountCount",
|
|
1022
|
+
{
|
|
1023
|
+
"nth": 99,
|
|
1024
|
+
"isVLEncoded": false,
|
|
1025
|
+
"isSerialized": true,
|
|
1026
|
+
"isSigningField": true,
|
|
1027
|
+
"type": "UInt64"
|
|
1028
|
+
}
|
|
1029
|
+
],
|
|
1030
|
+
[
|
|
1031
|
+
"RewardAccumulator",
|
|
1032
|
+
{
|
|
1033
|
+
"nth": 100,
|
|
1034
|
+
"isVLEncoded": false,
|
|
1035
|
+
"isSerialized": true,
|
|
1036
|
+
"isSigningField": true,
|
|
1037
|
+
"type": "UInt64"
|
|
1038
|
+
}
|
|
1039
|
+
],
|
|
969
1040
|
[
|
|
970
1041
|
"EmailHash",
|
|
971
1042
|
{
|
|
@@ -1356,6 +1427,36 @@
|
|
|
1356
1427
|
"type": "Hash256"
|
|
1357
1428
|
}
|
|
1358
1429
|
],
|
|
1430
|
+
[
|
|
1431
|
+
"GovernanceFlags",
|
|
1432
|
+
{
|
|
1433
|
+
"nth": 99,
|
|
1434
|
+
"isVLEncoded": false,
|
|
1435
|
+
"isSerialized": true,
|
|
1436
|
+
"isSigningField": true,
|
|
1437
|
+
"type": "Hash256"
|
|
1438
|
+
}
|
|
1439
|
+
],
|
|
1440
|
+
[
|
|
1441
|
+
"GovernanceMarks",
|
|
1442
|
+
{
|
|
1443
|
+
"nth": 98,
|
|
1444
|
+
"isVLEncoded": false,
|
|
1445
|
+
"isSerialized": true,
|
|
1446
|
+
"isSigningField": true,
|
|
1447
|
+
"type": "Hash256"
|
|
1448
|
+
}
|
|
1449
|
+
],
|
|
1450
|
+
[
|
|
1451
|
+
"EmittedTxnID",
|
|
1452
|
+
{
|
|
1453
|
+
"nth": 97,
|
|
1454
|
+
"isVLEncoded": false,
|
|
1455
|
+
"isSerialized": true,
|
|
1456
|
+
"isSigningField": true,
|
|
1457
|
+
"type": "Hash256"
|
|
1458
|
+
}
|
|
1459
|
+
],
|
|
1359
1460
|
[
|
|
1360
1461
|
"Amount",
|
|
1361
1462
|
{
|
|
@@ -2166,6 +2267,46 @@
|
|
|
2166
2267
|
"type": "STObject"
|
|
2167
2268
|
}
|
|
2168
2269
|
],
|
|
2270
|
+
[
|
|
2271
|
+
"GenesisMint",
|
|
2272
|
+
{
|
|
2273
|
+
"nth": 96,
|
|
2274
|
+
"isVLEncoded": false,
|
|
2275
|
+
"isSerialized": true,
|
|
2276
|
+
"isSigningField": true,
|
|
2277
|
+
"type": "STObject"
|
|
2278
|
+
}
|
|
2279
|
+
],
|
|
2280
|
+
[
|
|
2281
|
+
"ActiveValidator",
|
|
2282
|
+
{
|
|
2283
|
+
"nth": 95,
|
|
2284
|
+
"isVLEncoded": false,
|
|
2285
|
+
"isSerialized": true,
|
|
2286
|
+
"isSigningField": true,
|
|
2287
|
+
"type": "STObject"
|
|
2288
|
+
}
|
|
2289
|
+
],
|
|
2290
|
+
[
|
|
2291
|
+
"ImportVLKey",
|
|
2292
|
+
{
|
|
2293
|
+
"nth": 94,
|
|
2294
|
+
"isVLEncoded": false,
|
|
2295
|
+
"isSerialized": true,
|
|
2296
|
+
"isSigningField": true,
|
|
2297
|
+
"type": "STObject"
|
|
2298
|
+
}
|
|
2299
|
+
],
|
|
2300
|
+
[
|
|
2301
|
+
"HookEmission",
|
|
2302
|
+
{
|
|
2303
|
+
"nth": 93,
|
|
2304
|
+
"isVLEncoded": false,
|
|
2305
|
+
"isSerialized": true,
|
|
2306
|
+
"isSigningField": true,
|
|
2307
|
+
"type": "STObject"
|
|
2308
|
+
}
|
|
2309
|
+
],
|
|
2169
2310
|
[
|
|
2170
2311
|
"Signers",
|
|
2171
2312
|
{
|
|
@@ -2305,6 +2446,46 @@
|
|
|
2305
2446
|
"isSigningField": true,
|
|
2306
2447
|
"type": "STArray"
|
|
2307
2448
|
}
|
|
2449
|
+
],
|
|
2450
|
+
[
|
|
2451
|
+
"GenesisMints",
|
|
2452
|
+
{
|
|
2453
|
+
"nth": 96,
|
|
2454
|
+
"isVLEncoded": false,
|
|
2455
|
+
"isSerialized": true,
|
|
2456
|
+
"isSigningField": true,
|
|
2457
|
+
"type": "STArray"
|
|
2458
|
+
}
|
|
2459
|
+
],
|
|
2460
|
+
[
|
|
2461
|
+
"ActiveValidators",
|
|
2462
|
+
{
|
|
2463
|
+
"nth": 95,
|
|
2464
|
+
"isVLEncoded": false,
|
|
2465
|
+
"isSerialized": true,
|
|
2466
|
+
"isSigningField": true,
|
|
2467
|
+
"type": "STArray"
|
|
2468
|
+
}
|
|
2469
|
+
],
|
|
2470
|
+
[
|
|
2471
|
+
"ImportVLKeys",
|
|
2472
|
+
{
|
|
2473
|
+
"nth": 94,
|
|
2474
|
+
"isVLEncoded": false,
|
|
2475
|
+
"isSerialized": true,
|
|
2476
|
+
"isSigningField": true,
|
|
2477
|
+
"type": "STArray"
|
|
2478
|
+
}
|
|
2479
|
+
],
|
|
2480
|
+
[
|
|
2481
|
+
"HookEmissions",
|
|
2482
|
+
{
|
|
2483
|
+
"nth": 93,
|
|
2484
|
+
"isVLEncoded": false,
|
|
2485
|
+
"isSerialized": true,
|
|
2486
|
+
"isSigningField": true,
|
|
2487
|
+
"type": "STArray"
|
|
2488
|
+
}
|
|
2308
2489
|
]
|
|
2309
2490
|
],
|
|
2310
2491
|
"TRANSACTION_RESULTS": {
|
|
@@ -2397,6 +2578,7 @@
|
|
|
2397
2578
|
"tefNO_TICKET": -180,
|
|
2398
2579
|
"tefNFTOKEN_IS_NOT_TRANSFERABLE": -179,
|
|
2399
2580
|
"tefPAST_IMPORT_SEQ": -178,
|
|
2581
|
+
"tefPAST_IMPORT_VL_SEQ": -177,
|
|
2400
2582
|
"terRETRY": -99,
|
|
2401
2583
|
"terFUNDS_SPENT": -98,
|
|
2402
2584
|
"terINSUF_FEE_B": -97,
|
|
@@ -2521,11 +2703,14 @@
|
|
|
2521
2703
|
"URITokenBuy": 47,
|
|
2522
2704
|
"URITokenCreateSellOffer": 48,
|
|
2523
2705
|
"URITokenCancelSellOffer": 49,
|
|
2706
|
+
"GenesisMint": 96,
|
|
2524
2707
|
"Import": 97,
|
|
2708
|
+
"ClaimReward": 98,
|
|
2525
2709
|
"Invoke": 99,
|
|
2526
2710
|
"EnableAmendment": 100,
|
|
2527
2711
|
"SetFee": 101,
|
|
2528
2712
|
"UNLModify": 102,
|
|
2529
|
-
"EmitFailure": 103
|
|
2713
|
+
"EmitFailure": 103,
|
|
2714
|
+
"UNLReport": 104
|
|
2530
2715
|
}
|
|
2531
2716
|
}
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"LedgerHashes": 104,
|
|
38
38
|
"Amendments": 102,
|
|
39
39
|
"FeeSettings": 115,
|
|
40
|
+
"ImportVlseq": 73,
|
|
40
41
|
"Escrow": 117,
|
|
41
42
|
"PayChannel": 120,
|
|
42
43
|
"Check": 67,
|
|
@@ -796,6 +797,16 @@
|
|
|
796
797
|
"type": "UInt32"
|
|
797
798
|
}
|
|
798
799
|
],
|
|
800
|
+
[
|
|
801
|
+
"XahauActivationLgrSeq",
|
|
802
|
+
{
|
|
803
|
+
"nth": 96,
|
|
804
|
+
"isVLEncoded": false,
|
|
805
|
+
"isSerialized": true,
|
|
806
|
+
"isSigningField": true,
|
|
807
|
+
"type": "UInt32"
|
|
808
|
+
}
|
|
809
|
+
],
|
|
799
810
|
[
|
|
800
811
|
"ImportSequence",
|
|
801
812
|
{
|
|
@@ -806,6 +817,36 @@
|
|
|
806
817
|
"type": "UInt32"
|
|
807
818
|
}
|
|
808
819
|
],
|
|
820
|
+
[
|
|
821
|
+
"RewardTime",
|
|
822
|
+
{
|
|
823
|
+
"nth": 98,
|
|
824
|
+
"isVLEncoded": false,
|
|
825
|
+
"isSerialized": true,
|
|
826
|
+
"isSigningField": true,
|
|
827
|
+
"type": "UInt32"
|
|
828
|
+
}
|
|
829
|
+
],
|
|
830
|
+
[
|
|
831
|
+
"RewardLgrFirst",
|
|
832
|
+
{
|
|
833
|
+
"nth": 99,
|
|
834
|
+
"isVLEncoded": false,
|
|
835
|
+
"isSerialized": true,
|
|
836
|
+
"isSigningField": true,
|
|
837
|
+
"type": "UInt32"
|
|
838
|
+
}
|
|
839
|
+
],
|
|
840
|
+
[
|
|
841
|
+
"RewardLgrLast",
|
|
842
|
+
{
|
|
843
|
+
"nth": 100,
|
|
844
|
+
"isVLEncoded": false,
|
|
845
|
+
"isSerialized": true,
|
|
846
|
+
"isSigningField": true,
|
|
847
|
+
"type": "UInt32"
|
|
848
|
+
}
|
|
849
|
+
],
|
|
809
850
|
[
|
|
810
851
|
"IndexNext",
|
|
811
852
|
{
|
|
@@ -966,6 +1007,36 @@
|
|
|
966
1007
|
"type": "UInt64"
|
|
967
1008
|
}
|
|
968
1009
|
],
|
|
1010
|
+
[
|
|
1011
|
+
"AccountIndex",
|
|
1012
|
+
{
|
|
1013
|
+
"nth": 98,
|
|
1014
|
+
"isVLEncoded": false,
|
|
1015
|
+
"isSerialized": true,
|
|
1016
|
+
"isSigningField": true,
|
|
1017
|
+
"type": "UInt64"
|
|
1018
|
+
}
|
|
1019
|
+
],
|
|
1020
|
+
[
|
|
1021
|
+
"AccountCount",
|
|
1022
|
+
{
|
|
1023
|
+
"nth": 99,
|
|
1024
|
+
"isVLEncoded": false,
|
|
1025
|
+
"isSerialized": true,
|
|
1026
|
+
"isSigningField": true,
|
|
1027
|
+
"type": "UInt64"
|
|
1028
|
+
}
|
|
1029
|
+
],
|
|
1030
|
+
[
|
|
1031
|
+
"RewardAccumulator",
|
|
1032
|
+
{
|
|
1033
|
+
"nth": 100,
|
|
1034
|
+
"isVLEncoded": false,
|
|
1035
|
+
"isSerialized": true,
|
|
1036
|
+
"isSigningField": true,
|
|
1037
|
+
"type": "UInt64"
|
|
1038
|
+
}
|
|
1039
|
+
],
|
|
969
1040
|
[
|
|
970
1041
|
"EmailHash",
|
|
971
1042
|
{
|
|
@@ -1356,6 +1427,36 @@
|
|
|
1356
1427
|
"type": "Hash256"
|
|
1357
1428
|
}
|
|
1358
1429
|
],
|
|
1430
|
+
[
|
|
1431
|
+
"GovernanceFlags",
|
|
1432
|
+
{
|
|
1433
|
+
"nth": 99,
|
|
1434
|
+
"isVLEncoded": false,
|
|
1435
|
+
"isSerialized": true,
|
|
1436
|
+
"isSigningField": true,
|
|
1437
|
+
"type": "Hash256"
|
|
1438
|
+
}
|
|
1439
|
+
],
|
|
1440
|
+
[
|
|
1441
|
+
"GovernanceMarks",
|
|
1442
|
+
{
|
|
1443
|
+
"nth": 98,
|
|
1444
|
+
"isVLEncoded": false,
|
|
1445
|
+
"isSerialized": true,
|
|
1446
|
+
"isSigningField": true,
|
|
1447
|
+
"type": "Hash256"
|
|
1448
|
+
}
|
|
1449
|
+
],
|
|
1450
|
+
[
|
|
1451
|
+
"EmittedTxnID",
|
|
1452
|
+
{
|
|
1453
|
+
"nth": 97,
|
|
1454
|
+
"isVLEncoded": false,
|
|
1455
|
+
"isSerialized": true,
|
|
1456
|
+
"isSigningField": true,
|
|
1457
|
+
"type": "Hash256"
|
|
1458
|
+
}
|
|
1459
|
+
],
|
|
1359
1460
|
[
|
|
1360
1461
|
"Amount",
|
|
1361
1462
|
{
|
|
@@ -2166,6 +2267,46 @@
|
|
|
2166
2267
|
"type": "STObject"
|
|
2167
2268
|
}
|
|
2168
2269
|
],
|
|
2270
|
+
[
|
|
2271
|
+
"GenesisMint",
|
|
2272
|
+
{
|
|
2273
|
+
"nth": 96,
|
|
2274
|
+
"isVLEncoded": false,
|
|
2275
|
+
"isSerialized": true,
|
|
2276
|
+
"isSigningField": true,
|
|
2277
|
+
"type": "STObject"
|
|
2278
|
+
}
|
|
2279
|
+
],
|
|
2280
|
+
[
|
|
2281
|
+
"ActiveValidator",
|
|
2282
|
+
{
|
|
2283
|
+
"nth": 95,
|
|
2284
|
+
"isVLEncoded": false,
|
|
2285
|
+
"isSerialized": true,
|
|
2286
|
+
"isSigningField": true,
|
|
2287
|
+
"type": "STObject"
|
|
2288
|
+
}
|
|
2289
|
+
],
|
|
2290
|
+
[
|
|
2291
|
+
"ImportVLKey",
|
|
2292
|
+
{
|
|
2293
|
+
"nth": 94,
|
|
2294
|
+
"isVLEncoded": false,
|
|
2295
|
+
"isSerialized": true,
|
|
2296
|
+
"isSigningField": true,
|
|
2297
|
+
"type": "STObject"
|
|
2298
|
+
}
|
|
2299
|
+
],
|
|
2300
|
+
[
|
|
2301
|
+
"HookEmission",
|
|
2302
|
+
{
|
|
2303
|
+
"nth": 93,
|
|
2304
|
+
"isVLEncoded": false,
|
|
2305
|
+
"isSerialized": true,
|
|
2306
|
+
"isSigningField": true,
|
|
2307
|
+
"type": "STObject"
|
|
2308
|
+
}
|
|
2309
|
+
],
|
|
2169
2310
|
[
|
|
2170
2311
|
"Signers",
|
|
2171
2312
|
{
|
|
@@ -2305,6 +2446,46 @@
|
|
|
2305
2446
|
"isSigningField": true,
|
|
2306
2447
|
"type": "STArray"
|
|
2307
2448
|
}
|
|
2449
|
+
],
|
|
2450
|
+
[
|
|
2451
|
+
"GenesisMints",
|
|
2452
|
+
{
|
|
2453
|
+
"nth": 96,
|
|
2454
|
+
"isVLEncoded": false,
|
|
2455
|
+
"isSerialized": true,
|
|
2456
|
+
"isSigningField": true,
|
|
2457
|
+
"type": "STArray"
|
|
2458
|
+
}
|
|
2459
|
+
],
|
|
2460
|
+
[
|
|
2461
|
+
"ActiveValidators",
|
|
2462
|
+
{
|
|
2463
|
+
"nth": 95,
|
|
2464
|
+
"isVLEncoded": false,
|
|
2465
|
+
"isSerialized": true,
|
|
2466
|
+
"isSigningField": true,
|
|
2467
|
+
"type": "STArray"
|
|
2468
|
+
}
|
|
2469
|
+
],
|
|
2470
|
+
[
|
|
2471
|
+
"ImportVLKeys",
|
|
2472
|
+
{
|
|
2473
|
+
"nth": 94,
|
|
2474
|
+
"isVLEncoded": false,
|
|
2475
|
+
"isSerialized": true,
|
|
2476
|
+
"isSigningField": true,
|
|
2477
|
+
"type": "STArray"
|
|
2478
|
+
}
|
|
2479
|
+
],
|
|
2480
|
+
[
|
|
2481
|
+
"HookEmissions",
|
|
2482
|
+
{
|
|
2483
|
+
"nth": 93,
|
|
2484
|
+
"isVLEncoded": false,
|
|
2485
|
+
"isSerialized": true,
|
|
2486
|
+
"isSigningField": true,
|
|
2487
|
+
"type": "STArray"
|
|
2488
|
+
}
|
|
2308
2489
|
]
|
|
2309
2490
|
],
|
|
2310
2491
|
"TRANSACTION_RESULTS": {
|
|
@@ -2399,6 +2580,7 @@
|
|
|
2399
2580
|
"tefNO_TICKET": -180,
|
|
2400
2581
|
"tefNFTOKEN_IS_NOT_TRANSFERABLE": -179,
|
|
2401
2582
|
"tefPAST_IMPORT_SEQ": -178,
|
|
2583
|
+
"tefPAST_IMPORT_VL_SEQ": -177,
|
|
2402
2584
|
|
|
2403
2585
|
"terRETRY": -99,
|
|
2404
2586
|
"terFUNDS_SPENT": -98,
|
|
@@ -2526,11 +2708,14 @@
|
|
|
2526
2708
|
"URITokenBuy": 47,
|
|
2527
2709
|
"URITokenCreateSellOffer": 48,
|
|
2528
2710
|
"URITokenCancelSellOffer": 49,
|
|
2711
|
+
"GenesisMint": 96,
|
|
2529
2712
|
"Import": 97,
|
|
2713
|
+
"ClaimReward": 98,
|
|
2530
2714
|
"Invoke": 99,
|
|
2531
2715
|
"EnableAmendment": 100,
|
|
2532
2716
|
"SetFee": 101,
|
|
2533
2717
|
"UNLModify": 102,
|
|
2534
|
-
"EmitFailure": 103
|
|
2718
|
+
"EmitFailure": 103,
|
|
2719
|
+
"UNLReport": 104
|
|
2535
2720
|
}
|
|
2536
2721
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"st-object.js","sourceRoot":"","sources":["../../src/types/st-object.ts"],"names":[],"mappings":";;;AAAA,oCAKiB;AACjB,uDAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"st-object.js","sourceRoot":"","sources":["../../src/types/st-object.ts"],"names":[],"mappings":";;;AAAA,oCAKiB;AACjB,uDAA8D;AAC9D,wEAGsC;AACtC,2DAAsD;AACtD,mEAAyE;AACzE,oCAAgC;AAEhC,MAAM,sBAAsB,GAAG,eAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;AAClD,MAAM,iBAAiB,GAAG,iBAAiB,CAAA;AAC3C,MAAM,SAAS,GAAG,UAAU,CAAA;AAC5B,MAAM,WAAW,GAAG,aAAa,CAAA;AACjC,MAAM,OAAO,GAAG,SAAS,CAAA;AACzB,MAAM,UAAU,GAAG,WAAW,CAAA;AAC9B,MAAM,QAAQ,GAAG,gBAAgB,CAAA;AAEjC;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAa,EAAE,QAAgB;IACrD,MAAM,OAAO,GAAG,IAAA,+CAAwB,EAAC,QAAQ,CAAC,CAAA;IAElD,IAAI,OAAO,CAAA;IACX,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO,GAAG,QAAQ,CAAA;SACxC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,GAAG,UAAU,CAAA;SAC3C,IAAI,OAAO,CAAC,GAAG,KAAK,KAAK;QAC5B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,gCAAgC,CAAC,CAAA;IAE3D,OAAO,OAAO,CAAC,GAAG,KAAK,KAAK;QAC1B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG,EAAE;QAC7D,CAAC,CAAC,EAAE,CAAC,KAAK,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;YACtC,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE;gBACpC,MAAK;aACN;YACD,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAA;SACtE;QAED,OAAO,WAAW,CAAA;IACpB,CAAC;CACF;AAEQ,4BAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transia/ripple-binary-codec",
|
|
3
|
-
"version": "1.4.6-alpha.
|
|
3
|
+
"version": "1.4.6-alpha.3",
|
|
4
4
|
"description": "XRP Ledger binary codec",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/*",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">= 10"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "edc11a1f88e4be861e7dace7ab48f4c670a46194"
|
|
44
44
|
}
|
package/test/definitions.test.js
CHANGED
|
@@ -170,62 +170,31 @@ describe('Signing data', function () {
|
|
|
170
170
|
].join(''),
|
|
171
171
|
)
|
|
172
172
|
})
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const newDefs = new XrplDefinitions(customPaymentDefinitions)
|
|
181
|
-
const signingAccount = 'rJZdUusLDtY9NEsGea7ijqhVrXv98rYBYN'
|
|
182
|
-
const signingJson = { ...tx_json, SigningPubKey: '' }
|
|
183
|
-
const actual = encodeForMultisigning(signingJson, signingAccount, newDefs)
|
|
173
|
+
test('can create native claim blob', function () {
|
|
174
|
+
const channel =
|
|
175
|
+
'43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1'
|
|
176
|
+
const amount = '1000'
|
|
177
|
+
const json = { channel, amount }
|
|
178
|
+
const actual = encodeForSigningClaim(json)
|
|
184
179
|
expect(actual).toBe(
|
|
185
180
|
[
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
'
|
|
190
|
-
//
|
|
191
|
-
'
|
|
192
|
-
'80000000',
|
|
193
|
-
// Sequence
|
|
194
|
-
'24',
|
|
195
|
-
'00000001',
|
|
196
|
-
// Amount
|
|
197
|
-
'61',
|
|
198
|
-
// native amount
|
|
199
|
-
'40000000000003E8',
|
|
200
|
-
// Fee
|
|
201
|
-
'68',
|
|
202
|
-
// native amount
|
|
203
|
-
'400000000000000A',
|
|
204
|
-
// SigningPubKey
|
|
205
|
-
'73',
|
|
206
|
-
// VLLength
|
|
207
|
-
'00',
|
|
208
|
-
// '',
|
|
209
|
-
// Account
|
|
210
|
-
'81',
|
|
211
|
-
// VLLength
|
|
212
|
-
'14',
|
|
213
|
-
'5B812C9D57731E27A2DA8B1830195F88EF32A3B6',
|
|
214
|
-
// Destination
|
|
215
|
-
'83',
|
|
216
|
-
// VLLength
|
|
217
|
-
'14',
|
|
218
|
-
'B5F762798A53D543A014CAF8B297CFF8F2F937E8',
|
|
219
|
-
// signingAccount suffix
|
|
220
|
-
'C0A5ABEF242802EFED4B041E8F2D4A8CC86AE3D1',
|
|
181
|
+
// hash prefix
|
|
182
|
+
'434C4D00',
|
|
183
|
+
// channel ID
|
|
184
|
+
'43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1',
|
|
185
|
+
// amount as a uint64
|
|
186
|
+
'00000000000003E8',
|
|
221
187
|
].join(''),
|
|
222
188
|
)
|
|
223
189
|
})
|
|
224
|
-
|
|
225
|
-
test('can create claim blob', function () {
|
|
190
|
+
test('can create ic claim blob', function () {
|
|
226
191
|
const channel =
|
|
227
192
|
'43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1'
|
|
228
|
-
const amount =
|
|
193
|
+
const amount = {
|
|
194
|
+
issuer: 'rJZdUusLDtY9NEsGea7ijqhVrXv98rYBYN',
|
|
195
|
+
currency: 'USD',
|
|
196
|
+
value: '10',
|
|
197
|
+
}
|
|
229
198
|
const json = { channel, amount }
|
|
230
199
|
const actual = encodeForSigningClaim(json)
|
|
231
200
|
expect(actual).toBe(
|
|
@@ -235,7 +204,9 @@ describe('Signing data', function () {
|
|
|
235
204
|
// channel ID
|
|
236
205
|
'43904CBFCDCEC530B4037871F86EE90BF799DF8D2E0EA564BC8A3F332E4F5FB1',
|
|
237
206
|
// amount as a uint64
|
|
238
|
-
'
|
|
207
|
+
'D4C38D7EA4C680000000000000000000000000005553440000000000C0A5ABEF',
|
|
208
|
+
// amount as a uint64
|
|
209
|
+
'242802EFED4B041E8F2D4A8CC86AE3D1',
|
|
239
210
|
].join(''),
|
|
240
211
|
)
|
|
241
212
|
})
|