ripple-binary-codec 2.4.0-smartescrow.2 → 2.4.0
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 +17 -1
- package/dist/binary.js +27 -1
- package/dist/binary.js.map +1 -1
- package/dist/enums/definitions.json +32 -63
- package/dist/enums/src/enums/definitions.json +32 -63
- package/dist/hash-prefixes.js +2 -0
- package/dist/hash-prefixes.js.map +1 -1
- package/dist/index.d.ts +15 -10
- package/dist/index.js +22 -11
- package/dist/index.js.map +1 -1
- package/dist/src/binary.d.ts +17 -1
- package/dist/src/binary.js +27 -1
- package/dist/src/binary.js.map +1 -1
- package/dist/src/enums/definitions.json +32 -63
- package/dist/src/hash-prefixes.js +2 -0
- package/dist/src/hash-prefixes.js.map +1 -1
- package/dist/src/index.d.ts +15 -10
- package/dist/src/index.js +22 -11
- package/dist/src/index.js.map +1 -1
- package/dist/src/types/hash.js +3 -0
- package/dist/src/types/hash.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/hash.js +3 -0
- package/dist/types/hash.js.map +1 -1
- package/package.json +2 -2
- package/src/binary.ts +41 -0
- package/src/enums/definitions.json +32 -63
- package/src/hash-prefixes.ts +2 -0
- package/src/index.ts +23 -10
- package/src/types/hash.ts +4 -1
- package/src/.DS_Store +0 -0
package/dist/binary.d.ts
CHANGED
|
@@ -87,4 +87,20 @@ declare function signingClaimData(claim: ClaimObject): Uint8Array;
|
|
|
87
87
|
declare function multiSigningData(transaction: JsonObject, signingAccount: string | AccountID, opts?: {
|
|
88
88
|
definitions: XrplDefinitionsBase;
|
|
89
89
|
}): Uint8Array;
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Interface describing fields required for a Batch signer
|
|
92
|
+
* @property flags - Flags indicating Batch transaction properties
|
|
93
|
+
* @property txIDs - Array of transaction IDs included in the Batch
|
|
94
|
+
*/
|
|
95
|
+
interface BatchObject extends JsonObject {
|
|
96
|
+
flags: number;
|
|
97
|
+
txIDs: string[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Serialize a signingClaim
|
|
101
|
+
*
|
|
102
|
+
* @param batch A Batch object to serialize.
|
|
103
|
+
* @returns the serialized object with appropriate prefix
|
|
104
|
+
*/
|
|
105
|
+
declare function signingBatchData(batch: BatchObject): Uint8Array;
|
|
106
|
+
export { BinaryParser, BinarySerializer, BytesList, ClaimObject, BatchObject, makeParser, serializeObject, readJSON, multiSigningData, signingData, signingClaimData, binaryToJSON, sha512Half, transactionID, signingBatchData, };
|
package/dist/binary.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable func-style */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.transactionID = exports.sha512Half = exports.binaryToJSON = exports.signingClaimData = exports.signingData = exports.multiSigningData = exports.readJSON = exports.serializeObject = exports.makeParser = exports.BytesList = exports.BinarySerializer = exports.BinaryParser = void 0;
|
|
4
|
+
exports.signingBatchData = exports.transactionID = exports.sha512Half = exports.binaryToJSON = exports.signingClaimData = exports.signingData = exports.multiSigningData = exports.readJSON = exports.serializeObject = exports.makeParser = exports.BytesList = exports.BinarySerializer = exports.BinaryParser = void 0;
|
|
5
5
|
const utils_1 = require("@xrplf/isomorphic/utils");
|
|
6
6
|
const types_1 = require("./types");
|
|
7
7
|
const binary_parser_1 = require("./serdes/binary-parser");
|
|
@@ -125,4 +125,30 @@ function multiSigningData(transaction, signingAccount, opts = {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
exports.multiSigningData = multiSigningData;
|
|
128
|
+
/**
|
|
129
|
+
* Serialize a signingClaim
|
|
130
|
+
*
|
|
131
|
+
* @param batch A Batch object to serialize.
|
|
132
|
+
* @returns the serialized object with appropriate prefix
|
|
133
|
+
*/
|
|
134
|
+
function signingBatchData(batch) {
|
|
135
|
+
if (batch.flags == null) {
|
|
136
|
+
throw Error("No field `flags'");
|
|
137
|
+
}
|
|
138
|
+
if (batch.txIDs == null) {
|
|
139
|
+
throw Error('No field `txIDs`');
|
|
140
|
+
}
|
|
141
|
+
const prefix = hash_prefixes_1.HashPrefix.batch;
|
|
142
|
+
const flags = types_1.coreTypes.UInt32.from(batch.flags).toBytes();
|
|
143
|
+
const txIDsLength = types_1.coreTypes.UInt32.from(batch.txIDs.length).toBytes();
|
|
144
|
+
const bytesList = new binary_serializer_1.BytesList();
|
|
145
|
+
bytesList.put(prefix);
|
|
146
|
+
bytesList.put(flags);
|
|
147
|
+
bytesList.put(txIDsLength);
|
|
148
|
+
batch.txIDs.forEach((txID) => {
|
|
149
|
+
bytesList.put(types_1.coreTypes.Hash256.from(txID).toBytes());
|
|
150
|
+
});
|
|
151
|
+
return bytesList.toBytes();
|
|
152
|
+
}
|
|
153
|
+
exports.signingBatchData = signingBatchData;
|
|
128
154
|
//# sourceMappingURL=binary.js.map
|
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,mDAAoD;AACpD,mCAAmC;AACnC,0DAAqD;
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,mDAAoD;AACpD,mCAAmC;AACnC,0DAAqD;AAuNnD,6FAvNO,4BAAY,OAuNP;AArNd,mDAA4C;AAC5C,kEAAwE;AAqNtE,iGArNO,oCAAgB,OAqNP;AAChB,0FAtNyB,6BAAS,OAsNzB;AArNX,qCAAoD;AA+NlD,2FA/NO,mBAAU,OA+NP;AACV,8FAhOmB,sBAAa,OAgOnB;AA/Nf,mCAIgB;AAIhB;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CACjB,KAA0B,EAC1B,WAAiC,EACnB,EAAE,CAChB,IAAI,4BAAY,CACd,KAAK,YA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"isSerialized": true,
|
|
687
|
-
"isSigningField": true,
|
|
688
|
-
"isVLEncoded": false,
|
|
689
|
-
"nth": 53,
|
|
690
|
-
"type": "UInt32"
|
|
691
|
-
}
|
|
692
|
-
],
|
|
693
|
-
[
|
|
694
|
-
"ExtensionSizeLimit",
|
|
695
|
-
{
|
|
696
|
-
"isSerialized": true,
|
|
697
|
-
"isSigningField": true,
|
|
698
|
-
"isVLEncoded": false,
|
|
699
|
-
"nth": 54,
|
|
700
|
-
"type": "UInt32"
|
|
701
|
-
}
|
|
702
|
-
],
|
|
703
|
-
[
|
|
704
|
-
"GasPrice",
|
|
705
|
-
{
|
|
706
|
-
"isSerialized": true,
|
|
707
|
-
"isSigningField": true,
|
|
708
|
-
"isVLEncoded": false,
|
|
709
|
-
"nth": 55,
|
|
710
|
-
"type": "UInt32"
|
|
711
|
-
}
|
|
712
|
-
],
|
|
713
|
-
[
|
|
714
|
-
"ComputationAllowance",
|
|
715
|
-
{
|
|
716
|
-
"isSerialized": true,
|
|
717
|
-
"isSigningField": true,
|
|
718
|
-
"isVLEncoded": false,
|
|
719
|
-
"nth": 56,
|
|
720
|
-
"type": "UInt32"
|
|
721
|
-
}
|
|
722
|
-
],
|
|
723
|
-
[
|
|
724
|
-
"GasUsed",
|
|
725
|
-
{
|
|
726
|
-
"isSerialized": true,
|
|
727
|
-
"isSigningField": true,
|
|
728
|
-
"isVLEncoded": false,
|
|
729
|
-
"nth": 57,
|
|
730
|
-
"type": "UInt32"
|
|
731
|
-
}
|
|
732
|
-
],
|
|
733
683
|
[
|
|
734
684
|
"IndexNext",
|
|
735
685
|
{
|
|
@@ -990,6 +940,16 @@
|
|
|
990
940
|
"type": "UInt64"
|
|
991
941
|
}
|
|
992
942
|
],
|
|
943
|
+
[
|
|
944
|
+
"LockedAmount",
|
|
945
|
+
{
|
|
946
|
+
"isSerialized": true,
|
|
947
|
+
"isSigningField": true,
|
|
948
|
+
"isVLEncoded": false,
|
|
949
|
+
"nth": 29,
|
|
950
|
+
"type": "UInt64"
|
|
951
|
+
}
|
|
952
|
+
],
|
|
993
953
|
[
|
|
994
954
|
"EmailHash",
|
|
995
955
|
{
|
|
@@ -1930,16 +1890,6 @@
|
|
|
1930
1890
|
"type": "Blob"
|
|
1931
1891
|
}
|
|
1932
1892
|
],
|
|
1933
|
-
[
|
|
1934
|
-
"FinishFunction",
|
|
1935
|
-
{
|
|
1936
|
-
"isSerialized": true,
|
|
1937
|
-
"isSigningField": true,
|
|
1938
|
-
"isVLEncoded": true,
|
|
1939
|
-
"nth": 32,
|
|
1940
|
-
"type": "Blob"
|
|
1941
|
-
}
|
|
1942
|
-
],
|
|
1943
1893
|
[
|
|
1944
1894
|
"Account",
|
|
1945
1895
|
{
|
|
@@ -2510,6 +2460,16 @@
|
|
|
2510
2460
|
"type": "STObject"
|
|
2511
2461
|
}
|
|
2512
2462
|
],
|
|
2463
|
+
[
|
|
2464
|
+
"Book",
|
|
2465
|
+
{
|
|
2466
|
+
"isSerialized": true,
|
|
2467
|
+
"isSigningField": true,
|
|
2468
|
+
"isVLEncoded": false,
|
|
2469
|
+
"nth": 36,
|
|
2470
|
+
"type": "STObject"
|
|
2471
|
+
}
|
|
2472
|
+
],
|
|
2513
2473
|
[
|
|
2514
2474
|
"Signers",
|
|
2515
2475
|
{
|
|
@@ -2610,6 +2570,16 @@
|
|
|
2610
2570
|
"type": "STArray"
|
|
2611
2571
|
}
|
|
2612
2572
|
],
|
|
2573
|
+
[
|
|
2574
|
+
"AdditionalBooks",
|
|
2575
|
+
{
|
|
2576
|
+
"isSerialized": true,
|
|
2577
|
+
"isSigningField": true,
|
|
2578
|
+
"isVLEncoded": false,
|
|
2579
|
+
"nth": 13,
|
|
2580
|
+
"type": "STArray"
|
|
2581
|
+
}
|
|
2582
|
+
],
|
|
2613
2583
|
[
|
|
2614
2584
|
"Majorities",
|
|
2615
2585
|
{
|
|
@@ -3163,6 +3133,7 @@
|
|
|
3163
3133
|
"tecNFTOKEN_OFFER_TYPE_MISMATCH": 157,
|
|
3164
3134
|
"tecNO_ALTERNATIVE_KEY": 130,
|
|
3165
3135
|
"tecNO_AUTH": 134,
|
|
3136
|
+
"tecNO_DELEGATE_PERMISSION": 198,
|
|
3166
3137
|
"tecNO_DST": 124,
|
|
3167
3138
|
"tecNO_DST_INSUF_XRP": 125,
|
|
3168
3139
|
"tecNO_ENTRY": 140,
|
|
@@ -3179,6 +3150,7 @@
|
|
|
3179
3150
|
"tecOWNERS": 132,
|
|
3180
3151
|
"tecPATH_DRY": 128,
|
|
3181
3152
|
"tecPATH_PARTIAL": 101,
|
|
3153
|
+
"tecPRECISION_LOSS": 197,
|
|
3182
3154
|
"tecPSEUDO_ACCOUNT": 196,
|
|
3183
3155
|
"tecTOKEN_PAIR_NOT_FOUND": 189,
|
|
3184
3156
|
"tecTOO_SOON": 152,
|
|
@@ -3187,7 +3159,6 @@
|
|
|
3187
3159
|
"tecUNFUNDED_AMM": 162,
|
|
3188
3160
|
"tecUNFUNDED_OFFER": 103,
|
|
3189
3161
|
"tecUNFUNDED_PAYMENT": 104,
|
|
3190
|
-
"tecWASM_REJECTED": 197,
|
|
3191
3162
|
"tecWRONG_ASSET": 194,
|
|
3192
3163
|
"tecXCHAIN_ACCOUNT_CREATE_PAST": 181,
|
|
3193
3164
|
"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182,
|
|
@@ -3225,10 +3196,8 @@
|
|
|
3225
3196
|
"tefNOT_MULTI_SIGNING": -184,
|
|
3226
3197
|
"tefNO_AUTH_REQUIRED": -191,
|
|
3227
3198
|
"tefNO_TICKET": -180,
|
|
3228
|
-
"tefNO_WASM": -177,
|
|
3229
3199
|
"tefPAST_SEQ": -190,
|
|
3230
3200
|
"tefTOO_BIG": -181,
|
|
3231
|
-
"tefWASM_FIELD_NOT_INCLUDED": -176,
|
|
3232
3201
|
"tefWRONG_PRIOR": -189,
|
|
3233
3202
|
"telBAD_DOMAIN": -398,
|
|
3234
3203
|
"telBAD_PATH_COUNT": -397,
|
|
@@ -680,56 +680,6 @@
|
|
|
680
680
|
"type": "UInt32"
|
|
681
681
|
}
|
|
682
682
|
],
|
|
683
|
-
[
|
|
684
|
-
"ExtensionComputeLimit",
|
|
685
|
-
{
|
|
686
|
-
"isSerialized": true,
|
|
687
|
-
"isSigningField": true,
|
|
688
|
-
"isVLEncoded": false,
|
|
689
|
-
"nth": 53,
|
|
690
|
-
"type": "UInt32"
|
|
691
|
-
}
|
|
692
|
-
],
|
|
693
|
-
[
|
|
694
|
-
"ExtensionSizeLimit",
|
|
695
|
-
{
|
|
696
|
-
"isSerialized": true,
|
|
697
|
-
"isSigningField": true,
|
|
698
|
-
"isVLEncoded": false,
|
|
699
|
-
"nth": 54,
|
|
700
|
-
"type": "UInt32"
|
|
701
|
-
}
|
|
702
|
-
],
|
|
703
|
-
[
|
|
704
|
-
"GasPrice",
|
|
705
|
-
{
|
|
706
|
-
"isSerialized": true,
|
|
707
|
-
"isSigningField": true,
|
|
708
|
-
"isVLEncoded": false,
|
|
709
|
-
"nth": 55,
|
|
710
|
-
"type": "UInt32"
|
|
711
|
-
}
|
|
712
|
-
],
|
|
713
|
-
[
|
|
714
|
-
"ComputationAllowance",
|
|
715
|
-
{
|
|
716
|
-
"isSerialized": true,
|
|
717
|
-
"isSigningField": true,
|
|
718
|
-
"isVLEncoded": false,
|
|
719
|
-
"nth": 56,
|
|
720
|
-
"type": "UInt32"
|
|
721
|
-
}
|
|
722
|
-
],
|
|
723
|
-
[
|
|
724
|
-
"GasUsed",
|
|
725
|
-
{
|
|
726
|
-
"isSerialized": true,
|
|
727
|
-
"isSigningField": true,
|
|
728
|
-
"isVLEncoded": false,
|
|
729
|
-
"nth": 57,
|
|
730
|
-
"type": "UInt32"
|
|
731
|
-
}
|
|
732
|
-
],
|
|
733
683
|
[
|
|
734
684
|
"IndexNext",
|
|
735
685
|
{
|
|
@@ -990,6 +940,16 @@
|
|
|
990
940
|
"type": "UInt64"
|
|
991
941
|
}
|
|
992
942
|
],
|
|
943
|
+
[
|
|
944
|
+
"LockedAmount",
|
|
945
|
+
{
|
|
946
|
+
"isSerialized": true,
|
|
947
|
+
"isSigningField": true,
|
|
948
|
+
"isVLEncoded": false,
|
|
949
|
+
"nth": 29,
|
|
950
|
+
"type": "UInt64"
|
|
951
|
+
}
|
|
952
|
+
],
|
|
993
953
|
[
|
|
994
954
|
"EmailHash",
|
|
995
955
|
{
|
|
@@ -1930,16 +1890,6 @@
|
|
|
1930
1890
|
"type": "Blob"
|
|
1931
1891
|
}
|
|
1932
1892
|
],
|
|
1933
|
-
[
|
|
1934
|
-
"FinishFunction",
|
|
1935
|
-
{
|
|
1936
|
-
"isSerialized": true,
|
|
1937
|
-
"isSigningField": true,
|
|
1938
|
-
"isVLEncoded": true,
|
|
1939
|
-
"nth": 32,
|
|
1940
|
-
"type": "Blob"
|
|
1941
|
-
}
|
|
1942
|
-
],
|
|
1943
1893
|
[
|
|
1944
1894
|
"Account",
|
|
1945
1895
|
{
|
|
@@ -2510,6 +2460,16 @@
|
|
|
2510
2460
|
"type": "STObject"
|
|
2511
2461
|
}
|
|
2512
2462
|
],
|
|
2463
|
+
[
|
|
2464
|
+
"Book",
|
|
2465
|
+
{
|
|
2466
|
+
"isSerialized": true,
|
|
2467
|
+
"isSigningField": true,
|
|
2468
|
+
"isVLEncoded": false,
|
|
2469
|
+
"nth": 36,
|
|
2470
|
+
"type": "STObject"
|
|
2471
|
+
}
|
|
2472
|
+
],
|
|
2513
2473
|
[
|
|
2514
2474
|
"Signers",
|
|
2515
2475
|
{
|
|
@@ -2610,6 +2570,16 @@
|
|
|
2610
2570
|
"type": "STArray"
|
|
2611
2571
|
}
|
|
2612
2572
|
],
|
|
2573
|
+
[
|
|
2574
|
+
"AdditionalBooks",
|
|
2575
|
+
{
|
|
2576
|
+
"isSerialized": true,
|
|
2577
|
+
"isSigningField": true,
|
|
2578
|
+
"isVLEncoded": false,
|
|
2579
|
+
"nth": 13,
|
|
2580
|
+
"type": "STArray"
|
|
2581
|
+
}
|
|
2582
|
+
],
|
|
2613
2583
|
[
|
|
2614
2584
|
"Majorities",
|
|
2615
2585
|
{
|
|
@@ -3163,6 +3133,7 @@
|
|
|
3163
3133
|
"tecNFTOKEN_OFFER_TYPE_MISMATCH": 157,
|
|
3164
3134
|
"tecNO_ALTERNATIVE_KEY": 130,
|
|
3165
3135
|
"tecNO_AUTH": 134,
|
|
3136
|
+
"tecNO_DELEGATE_PERMISSION": 198,
|
|
3166
3137
|
"tecNO_DST": 124,
|
|
3167
3138
|
"tecNO_DST_INSUF_XRP": 125,
|
|
3168
3139
|
"tecNO_ENTRY": 140,
|
|
@@ -3179,6 +3150,7 @@
|
|
|
3179
3150
|
"tecOWNERS": 132,
|
|
3180
3151
|
"tecPATH_DRY": 128,
|
|
3181
3152
|
"tecPATH_PARTIAL": 101,
|
|
3153
|
+
"tecPRECISION_LOSS": 197,
|
|
3182
3154
|
"tecPSEUDO_ACCOUNT": 196,
|
|
3183
3155
|
"tecTOKEN_PAIR_NOT_FOUND": 189,
|
|
3184
3156
|
"tecTOO_SOON": 152,
|
|
@@ -3187,7 +3159,6 @@
|
|
|
3187
3159
|
"tecUNFUNDED_AMM": 162,
|
|
3188
3160
|
"tecUNFUNDED_OFFER": 103,
|
|
3189
3161
|
"tecUNFUNDED_PAYMENT": 104,
|
|
3190
|
-
"tecWASM_REJECTED": 197,
|
|
3191
3162
|
"tecWRONG_ASSET": 194,
|
|
3192
3163
|
"tecXCHAIN_ACCOUNT_CREATE_PAST": 181,
|
|
3193
3164
|
"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182,
|
|
@@ -3226,10 +3197,8 @@
|
|
|
3226
3197
|
"tefNOT_MULTI_SIGNING": -184,
|
|
3227
3198
|
"tefNO_AUTH_REQUIRED": -191,
|
|
3228
3199
|
"tefNO_TICKET": -180,
|
|
3229
|
-
"tefNO_WASM": -177,
|
|
3230
3200
|
"tefPAST_SEQ": -190,
|
|
3231
3201
|
"tefTOO_BIG": -181,
|
|
3232
|
-
"tefWASM_FIELD_NOT_INCLUDED": -176,
|
|
3233
3202
|
"tefWRONG_PRIOR": -189,
|
|
3234
3203
|
|
|
3235
3204
|
"telBAD_DOMAIN": -398,
|
package/dist/hash-prefixes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-prefixes.js","sourceRoot":"","sources":["../src/hash-prefixes.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AAEvC;;;;;GAKG;AACH,SAAS,KAAK,CAAC,MAAc;IAC3B,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;IAChC,IAAA,qBAAa,EAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IAChC,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAA+B;IAC7C,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC;IAChC,4BAA4B;IAC5B,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC;IAC9B,gBAAgB;IAChB,iBAAiB,EAAE,KAAK,CAAC,UAAU,CAAC;IACpC,qBAAqB;IACrB,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC;IAC5B,iCAAiC;IACjC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC;IAC/B,4BAA4B;IAC5B,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC;IACjC,4BAA4B;IAC5B,mBAAmB,EAAE,KAAK,CAAC,UAAU,CAAC;IACtC,yBAAyB;IACzB,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;IAC7B,uBAAuB;IACvB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC;IAC3B,wBAAwB;IACxB,mBAAmB,EAAE,KAAK,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"hash-prefixes.js","sourceRoot":"","sources":["../src/hash-prefixes.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AAEvC;;;;;GAKG;AACH,SAAS,KAAK,CAAC,MAAc;IAC3B,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAA;IAChC,IAAA,qBAAa,EAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IAChC,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAA+B;IAC7C,aAAa,EAAE,KAAK,CAAC,UAAU,CAAC;IAChC,4BAA4B;IAC5B,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC;IAC9B,gBAAgB;IAChB,iBAAiB,EAAE,KAAK,CAAC,UAAU,CAAC;IACpC,qBAAqB;IACrB,SAAS,EAAE,KAAK,CAAC,UAAU,CAAC;IAC5B,iCAAiC;IACjC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC;IAC/B,4BAA4B;IAC5B,cAAc,EAAE,KAAK,CAAC,UAAU,CAAC;IACjC,4BAA4B;IAC5B,mBAAmB,EAAE,KAAK,CAAC,UAAU,CAAC;IACtC,yBAAyB;IACzB,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;IAC7B,uBAAuB;IACvB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC;IAC3B,wBAAwB;IACxB,mBAAmB,EAAE,KAAK,CAAC,UAAU,CAAC;IACtC,QAAQ;IACR,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC;CACzB,CAAA;AAEQ,gCAAU"}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,23 +30,28 @@ declare function encode(json: object, definitions?: XrplDefinitionsBase): string
|
|
|
30
30
|
*/
|
|
31
31
|
declare function encodeForSigning(json: object, definitions?: XrplDefinitionsBase): string;
|
|
32
32
|
/**
|
|
33
|
-
* Encode a
|
|
33
|
+
* Encode a payment channel claim for signing.
|
|
34
34
|
*
|
|
35
|
-
* @param json JSON object representing the
|
|
36
|
-
* @
|
|
37
|
-
* @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
|
|
38
|
-
* @returns a hex string of the encoded transaction
|
|
35
|
+
* @param json JSON object representing the claim.
|
|
36
|
+
* @returns a hex string of the encoded claim.
|
|
39
37
|
*/
|
|
40
38
|
declare function encodeForSigningClaim(json: object): string;
|
|
41
39
|
/**
|
|
42
|
-
* Encode a transaction and prepare for multi-signing
|
|
40
|
+
* Encode a transaction and prepare for multi-signing.
|
|
43
41
|
*
|
|
44
|
-
* @param json JSON object representing the transaction
|
|
45
|
-
* @param signer string representing the account to sign the transaction with
|
|
42
|
+
* @param json JSON object representing the transaction.
|
|
43
|
+
* @param signer string representing the account to sign the transaction with.
|
|
46
44
|
* @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
|
|
47
|
-
* @returns a hex string of the encoded transaction
|
|
45
|
+
* @returns a hex string of the encoded transaction.
|
|
48
46
|
*/
|
|
49
47
|
declare function encodeForMultisigning(json: object, signer: string, definitions?: XrplDefinitionsBase): string;
|
|
48
|
+
/**
|
|
49
|
+
* Encode a Batch transaction for signing.
|
|
50
|
+
*
|
|
51
|
+
* @param json JSON object representing the transaction.
|
|
52
|
+
* @returns a hex string of the encoded transaction.
|
|
53
|
+
*/
|
|
54
|
+
declare function encodeForSigningBatch(json: object): string;
|
|
50
55
|
/**
|
|
51
56
|
* Encode a quality value
|
|
52
57
|
*
|
|
@@ -61,4 +66,4 @@ declare function encodeQuality(value: string): string;
|
|
|
61
66
|
* @returns a string representing the quality
|
|
62
67
|
*/
|
|
63
68
|
declare function decodeQuality(value: string): string;
|
|
64
|
-
export { decode, encode, encodeForSigning, encodeForSigningClaim, encodeForMultisigning, encodeQuality, decodeQuality, decodeLedgerData, TRANSACTION_TYPES, XrplDefinitions, XrplDefinitionsBase, DEFAULT_DEFINITIONS, coreTypes, };
|
|
69
|
+
export { decode, encode, encodeForSigning, encodeForSigningClaim, encodeForMultisigning, encodeForSigningBatch, encodeQuality, decodeQuality, decodeLedgerData, TRANSACTION_TYPES, XrplDefinitions, XrplDefinitionsBase, DEFAULT_DEFINITIONS, coreTypes, };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.coreTypes = exports.DEFAULT_DEFINITIONS = exports.XrplDefinitionsBase = exports.XrplDefinitions = exports.TRANSACTION_TYPES = exports.decodeLedgerData = exports.decodeQuality = exports.encodeQuality = exports.encodeForMultisigning = exports.encodeForSigningClaim = exports.encodeForSigning = exports.encode = exports.decode = void 0;
|
|
3
|
+
exports.coreTypes = exports.DEFAULT_DEFINITIONS = exports.XrplDefinitionsBase = exports.XrplDefinitions = exports.TRANSACTION_TYPES = exports.decodeLedgerData = exports.decodeQuality = exports.encodeQuality = exports.encodeForSigningBatch = exports.encodeForMultisigning = exports.encodeForSigningClaim = exports.encodeForSigning = exports.encode = exports.decode = void 0;
|
|
4
4
|
const coretypes_1 = require("./coretypes");
|
|
5
5
|
const ledger_hashes_1 = require("./ledger-hashes");
|
|
6
6
|
Object.defineProperty(exports, "decodeLedgerData", { enumerable: true, get: function () { return ledger_hashes_1.decodeLedgerData; } });
|
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "XrplDefinitions", { enumerable: true, get: funct
|
|
|
13
13
|
const types_1 = require("./types");
|
|
14
14
|
Object.defineProperty(exports, "coreTypes", { enumerable: true, get: function () { return types_1.coreTypes; } });
|
|
15
15
|
const utils_1 = require("@xrplf/isomorphic/utils");
|
|
16
|
-
const { signingData, signingClaimData, multiSigningData, binaryToJSON, serializeObject, } = coretypes_1.binary;
|
|
16
|
+
const { signingData, signingClaimData, multiSigningData, signingBatchData, binaryToJSON, serializeObject, } = coretypes_1.binary;
|
|
17
17
|
/**
|
|
18
18
|
* Decode a transaction
|
|
19
19
|
*
|
|
@@ -61,12 +61,10 @@ function encodeForSigning(json, definitions) {
|
|
|
61
61
|
}
|
|
62
62
|
exports.encodeForSigning = encodeForSigning;
|
|
63
63
|
/**
|
|
64
|
-
* Encode a
|
|
64
|
+
* Encode a payment channel claim for signing.
|
|
65
65
|
*
|
|
66
|
-
* @param json JSON object representing the
|
|
67
|
-
* @
|
|
68
|
-
* @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
|
|
69
|
-
* @returns a hex string of the encoded transaction
|
|
66
|
+
* @param json JSON object representing the claim.
|
|
67
|
+
* @returns a hex string of the encoded claim.
|
|
70
68
|
*/
|
|
71
69
|
function encodeForSigningClaim(json) {
|
|
72
70
|
if (typeof json !== 'object') {
|
|
@@ -76,12 +74,12 @@ function encodeForSigningClaim(json) {
|
|
|
76
74
|
}
|
|
77
75
|
exports.encodeForSigningClaim = encodeForSigningClaim;
|
|
78
76
|
/**
|
|
79
|
-
* Encode a transaction and prepare for multi-signing
|
|
77
|
+
* Encode a transaction and prepare for multi-signing.
|
|
80
78
|
*
|
|
81
|
-
* @param json JSON object representing the transaction
|
|
82
|
-
* @param signer string representing the account to sign the transaction with
|
|
79
|
+
* @param json JSON object representing the transaction.
|
|
80
|
+
* @param signer string representing the account to sign the transaction with.
|
|
83
81
|
* @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
|
|
84
|
-
* @returns a hex string of the encoded transaction
|
|
82
|
+
* @returns a hex string of the encoded transaction.
|
|
85
83
|
*/
|
|
86
84
|
function encodeForMultisigning(json, signer, definitions) {
|
|
87
85
|
if (typeof json !== 'object') {
|
|
@@ -94,6 +92,19 @@ function encodeForMultisigning(json, signer, definitions) {
|
|
|
94
92
|
return (0, utils_1.bytesToHex)(multiSigningData(json, signer, definitionsOpt));
|
|
95
93
|
}
|
|
96
94
|
exports.encodeForMultisigning = encodeForMultisigning;
|
|
95
|
+
/**
|
|
96
|
+
* Encode a Batch transaction for signing.
|
|
97
|
+
*
|
|
98
|
+
* @param json JSON object representing the transaction.
|
|
99
|
+
* @returns a hex string of the encoded transaction.
|
|
100
|
+
*/
|
|
101
|
+
function encodeForSigningBatch(json) {
|
|
102
|
+
if (typeof json !== 'object') {
|
|
103
|
+
throw new Error('Need an object to encode a Batch transaction');
|
|
104
|
+
}
|
|
105
|
+
return (0, utils_1.bytesToHex)(signingBatchData(json));
|
|
106
|
+
}
|
|
107
|
+
exports.encodeForSigningBatch = encodeForSigningBatch;
|
|
97
108
|
/**
|
|
98
109
|
* Encode a quality value
|
|
99
110
|
*
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,mDAAkD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,mDAAkD;AA8JhD,iGA9JO,gCAAgB,OA8JP;AA3JlB,mCAIgB;AA0Jd,oGA7JA,2BAAmB,OA6JA;AAFnB,kGA1JA,yBAAiB,OA0JA;AAGjB,oGA5JA,2BAAmB,OA4JA;AA1JrB,+DAA0D;AAwJxD,gGAxJO,kCAAe,OAwJP;AAvJjB,mCAAmC;AA0JjC,0FA1JO,iBAAS,OA0JP;AAzJX,mDAAoD;AAEpD,MAAM,EACJ,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,GAAG,kBAAM,CAAA;AAEV;;;;;;GAMG;AACH,SAAS,MAAM,CAAC,MAAc,EAAE,WAAiC;IAC/D,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;KAC/C;IACD,OAAO,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;AAC1C,CAAC;AAqHC,wBAAM;AAnHR;;;;;;;GAOG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,WAAiC;IAC7D,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI,KAAK,EAAE,CAAA;KAClB;IACD,OAAO,IAAA,kBAAU,EAAC,eAAe,CAAC,IAAkB,EAAE,EAAE,WAAW,E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AC,gBAAgB,CAAC,IAAmB,CAAC,CAAC,CAAA;AAC1D,CAAC;AAkCC,sDAAqB;AAhCvB;;;;;GAKG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,IAAI,KAAK,EAAE,CAAA;KAClB;IACD,OAAO,IAAA,kBAAU,EAAC,mBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AAC1C,CAAC;AAsBC,sCAAa;AApBf;;;;;GAKG;AACH,SAAS,aAAa,CAAC,KAAa;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,IAAI,KAAK,EAAE,CAAA;KAClB;IACD,OAAO,mBAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAA;AACzC,CAAC;AAUC,sCAAa"}
|
package/dist/src/binary.d.ts
CHANGED
|
@@ -87,4 +87,20 @@ declare function signingClaimData(claim: ClaimObject): Uint8Array;
|
|
|
87
87
|
declare function multiSigningData(transaction: JsonObject, signingAccount: string | AccountID, opts?: {
|
|
88
88
|
definitions: XrplDefinitionsBase;
|
|
89
89
|
}): Uint8Array;
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Interface describing fields required for a Batch signer
|
|
92
|
+
* @property flags - Flags indicating Batch transaction properties
|
|
93
|
+
* @property txIDs - Array of transaction IDs included in the Batch
|
|
94
|
+
*/
|
|
95
|
+
interface BatchObject extends JsonObject {
|
|
96
|
+
flags: number;
|
|
97
|
+
txIDs: string[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Serialize a signingClaim
|
|
101
|
+
*
|
|
102
|
+
* @param batch A Batch object to serialize.
|
|
103
|
+
* @returns the serialized object with appropriate prefix
|
|
104
|
+
*/
|
|
105
|
+
declare function signingBatchData(batch: BatchObject): Uint8Array;
|
|
106
|
+
export { BinaryParser, BinarySerializer, BytesList, ClaimObject, BatchObject, makeParser, serializeObject, readJSON, multiSigningData, signingData, signingClaimData, binaryToJSON, sha512Half, transactionID, signingBatchData, };
|
package/dist/src/binary.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* eslint-disable func-style */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.transactionID = exports.sha512Half = exports.binaryToJSON = exports.signingClaimData = exports.signingData = exports.multiSigningData = exports.readJSON = exports.serializeObject = exports.makeParser = exports.BytesList = exports.BinarySerializer = exports.BinaryParser = void 0;
|
|
4
|
+
exports.signingBatchData = exports.transactionID = exports.sha512Half = exports.binaryToJSON = exports.signingClaimData = exports.signingData = exports.multiSigningData = exports.readJSON = exports.serializeObject = exports.makeParser = exports.BytesList = exports.BinarySerializer = exports.BinaryParser = void 0;
|
|
5
5
|
const utils_1 = require("@xrplf/isomorphic/utils");
|
|
6
6
|
const types_1 = require("./types");
|
|
7
7
|
const binary_parser_1 = require("./serdes/binary-parser");
|
|
@@ -125,4 +125,30 @@ function multiSigningData(transaction, signingAccount, opts = {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
exports.multiSigningData = multiSigningData;
|
|
128
|
+
/**
|
|
129
|
+
* Serialize a signingClaim
|
|
130
|
+
*
|
|
131
|
+
* @param batch A Batch object to serialize.
|
|
132
|
+
* @returns the serialized object with appropriate prefix
|
|
133
|
+
*/
|
|
134
|
+
function signingBatchData(batch) {
|
|
135
|
+
if (batch.flags == null) {
|
|
136
|
+
throw Error("No field `flags'");
|
|
137
|
+
}
|
|
138
|
+
if (batch.txIDs == null) {
|
|
139
|
+
throw Error('No field `txIDs`');
|
|
140
|
+
}
|
|
141
|
+
const prefix = hash_prefixes_1.HashPrefix.batch;
|
|
142
|
+
const flags = types_1.coreTypes.UInt32.from(batch.flags).toBytes();
|
|
143
|
+
const txIDsLength = types_1.coreTypes.UInt32.from(batch.txIDs.length).toBytes();
|
|
144
|
+
const bytesList = new binary_serializer_1.BytesList();
|
|
145
|
+
bytesList.put(prefix);
|
|
146
|
+
bytesList.put(flags);
|
|
147
|
+
bytesList.put(txIDsLength);
|
|
148
|
+
batch.txIDs.forEach((txID) => {
|
|
149
|
+
bytesList.put(types_1.coreTypes.Hash256.from(txID).toBytes());
|
|
150
|
+
});
|
|
151
|
+
return bytesList.toBytes();
|
|
152
|
+
}
|
|
153
|
+
exports.signingBatchData = signingBatchData;
|
|
128
154
|
//# sourceMappingURL=binary.js.map
|
package/dist/src/binary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../src/binary.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,mDAAoD;AACpD,mCAAmC;AACnC,0DAAqD;
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../../src/binary.ts"],"names":[],"mappings":";AAAA,+BAA+B;;;AAE/B,mDAAoD;AACpD,mCAAmC;AACnC,0DAAqD;AAuNnD,6FAvNO,4BAAY,OAuNP;AArNd,mDAA4C;AAC5C,kEAAwE;AAqNtE,iGArNO,oCAAgB,OAqNP;AAChB,0FAtNyB,6BAAS,OAsNzB;AArNX,qCAAoD;AA+NlD,2FA/NO,mBAAU,OA+NP;AACV,8FAhOmB,sBAAa,OAgOnB;AA/Nf,mCAIgB;AAIhB;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CACjB,KAA0B,EAC1B,WAAiC,EACnB,EAAE,CAChB,IAAI,4BAAY,CACd,KAAK,YAAY,UAAU,CAAC,CAAC,CAAC,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EACvD,WAAW,CACZ,CAAA;AAgMD,gCAAU;AA9LZ;;;;;;;GAOG;AACH,MAAM,QAAQ,GAAG,CACf,MAAoB,EACpB,cAAmC,2BAAmB,EAC1C,EAAE,CACb,MAAM,CAAC,QAAQ,CAAC,iBAAS,CAAC,QAAQ,CAAc,CAAC,MAAM,CA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