ripple-binary-codec 2.2.0 → 2.3.0-batch.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 +16 -1
- package/dist/binary.js +28 -1
- package/dist/binary.js.map +1 -1
- package/dist/enums/definitions.json +103 -14
- package/dist/enums/src/enums/definitions.json +108 -14
- package/dist/hash-prefixes.js +2 -0
- package/dist/hash-prefixes.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/src/binary.d.ts +16 -1
- package/dist/src/binary.js +28 -1
- package/dist/src/binary.js.map +1 -1
- package/dist/src/enums/definitions.json +103 -14
- package/dist/src/hash-prefixes.js +2 -0
- package/dist/src/hash-prefixes.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +9 -2
- package/dist/src/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/binary.ts +40 -0
- package/src/enums/definitions.json +108 -14
- package/src/hash-prefixes.ts +2 -0
- package/src/index.ts +10 -1
|
@@ -913,20 +913,20 @@
|
|
|
913
913
|
[
|
|
914
914
|
"IssuerNode",
|
|
915
915
|
{
|
|
916
|
-
"nth": 27,
|
|
917
|
-
"isVLEncoded": false,
|
|
918
916
|
"isSerialized": true,
|
|
919
917
|
"isSigningField": true,
|
|
918
|
+
"isVLEncoded": false,
|
|
919
|
+
"nth": 27,
|
|
920
920
|
"type": "UInt64"
|
|
921
921
|
}
|
|
922
922
|
],
|
|
923
923
|
[
|
|
924
924
|
"SubjectNode",
|
|
925
925
|
{
|
|
926
|
-
"nth": 28,
|
|
927
|
-
"isVLEncoded": false,
|
|
928
926
|
"isSerialized": true,
|
|
929
927
|
"isSigningField": true,
|
|
928
|
+
"isVLEncoded": false,
|
|
929
|
+
"nth": 28,
|
|
930
930
|
"type": "UInt64"
|
|
931
931
|
}
|
|
932
932
|
],
|
|
@@ -1250,6 +1250,26 @@
|
|
|
1250
1250
|
"type": "Hash256"
|
|
1251
1251
|
}
|
|
1252
1252
|
],
|
|
1253
|
+
[
|
|
1254
|
+
"DomainID",
|
|
1255
|
+
{
|
|
1256
|
+
"isSerialized": true,
|
|
1257
|
+
"isSigningField": true,
|
|
1258
|
+
"isVLEncoded": false,
|
|
1259
|
+
"nth": 34,
|
|
1260
|
+
"type": "Hash256"
|
|
1261
|
+
}
|
|
1262
|
+
],
|
|
1263
|
+
[
|
|
1264
|
+
"ParentBatchID",
|
|
1265
|
+
{
|
|
1266
|
+
"isSerialized": true,
|
|
1267
|
+
"isSigningField": true,
|
|
1268
|
+
"isVLEncoded": false,
|
|
1269
|
+
"nth": 35,
|
|
1270
|
+
"type": "Hash256"
|
|
1271
|
+
}
|
|
1272
|
+
],
|
|
1253
1273
|
[
|
|
1254
1274
|
"hash",
|
|
1255
1275
|
{
|
|
@@ -1833,10 +1853,10 @@
|
|
|
1833
1853
|
[
|
|
1834
1854
|
"CredentialType",
|
|
1835
1855
|
{
|
|
1836
|
-
"nth": 31,
|
|
1837
|
-
"isVLEncoded": true,
|
|
1838
1856
|
"isSerialized": true,
|
|
1839
1857
|
"isSigningField": true,
|
|
1858
|
+
"isVLEncoded": true,
|
|
1859
|
+
"nth": 31,
|
|
1840
1860
|
"type": "Blob"
|
|
1841
1861
|
}
|
|
1842
1862
|
],
|
|
@@ -2013,13 +2033,23 @@
|
|
|
2013
2033
|
[
|
|
2014
2034
|
"Subject",
|
|
2015
2035
|
{
|
|
2016
|
-
"nth": 24,
|
|
2017
|
-
"isVLEncoded": true,
|
|
2018
2036
|
"isSerialized": true,
|
|
2019
2037
|
"isSigningField": true,
|
|
2038
|
+
"isVLEncoded": true,
|
|
2039
|
+
"nth": 24,
|
|
2020
2040
|
"type": "AccountID"
|
|
2021
2041
|
}
|
|
2022
2042
|
],
|
|
2043
|
+
[
|
|
2044
|
+
"Number",
|
|
2045
|
+
{
|
|
2046
|
+
"isSerialized": true,
|
|
2047
|
+
"isSigningField": true,
|
|
2048
|
+
"isVLEncoded": false,
|
|
2049
|
+
"nth": 1,
|
|
2050
|
+
"type": "Number"
|
|
2051
|
+
}
|
|
2052
|
+
],
|
|
2023
2053
|
[
|
|
2024
2054
|
"TransactionMetaData",
|
|
2025
2055
|
{
|
|
@@ -2313,10 +2343,30 @@
|
|
|
2313
2343
|
[
|
|
2314
2344
|
"Credential",
|
|
2315
2345
|
{
|
|
2346
|
+
"isSerialized": true,
|
|
2347
|
+
"isSigningField": true,
|
|
2348
|
+
"isVLEncoded": false,
|
|
2316
2349
|
"nth": 33,
|
|
2350
|
+
"type": "STObject"
|
|
2351
|
+
}
|
|
2352
|
+
],
|
|
2353
|
+
[
|
|
2354
|
+
"RawTransaction",
|
|
2355
|
+
{
|
|
2356
|
+
"isSerialized": true,
|
|
2357
|
+
"isSigningField": true,
|
|
2317
2358
|
"isVLEncoded": false,
|
|
2359
|
+
"nth": 34,
|
|
2360
|
+
"type": "STObject"
|
|
2361
|
+
}
|
|
2362
|
+
],
|
|
2363
|
+
[
|
|
2364
|
+
"BatchSigner",
|
|
2365
|
+
{
|
|
2318
2366
|
"isSerialized": true,
|
|
2319
2367
|
"isSigningField": true,
|
|
2368
|
+
"isVLEncoded": false,
|
|
2369
|
+
"nth": 35,
|
|
2320
2370
|
"type": "STObject"
|
|
2321
2371
|
}
|
|
2322
2372
|
],
|
|
@@ -2513,20 +2563,50 @@
|
|
|
2513
2563
|
[
|
|
2514
2564
|
"AuthorizeCredentials",
|
|
2515
2565
|
{
|
|
2516
|
-
"nth": 26,
|
|
2517
|
-
"isVLEncoded": false,
|
|
2518
2566
|
"isSerialized": true,
|
|
2519
2567
|
"isSigningField": true,
|
|
2568
|
+
"isVLEncoded": false,
|
|
2569
|
+
"nth": 26,
|
|
2520
2570
|
"type": "STArray"
|
|
2521
2571
|
}
|
|
2522
2572
|
],
|
|
2523
2573
|
[
|
|
2524
2574
|
"UnauthorizeCredentials",
|
|
2525
2575
|
{
|
|
2576
|
+
"isSerialized": true,
|
|
2577
|
+
"isSigningField": true,
|
|
2578
|
+
"isVLEncoded": false,
|
|
2526
2579
|
"nth": 27,
|
|
2580
|
+
"type": "STArray"
|
|
2581
|
+
}
|
|
2582
|
+
],
|
|
2583
|
+
[
|
|
2584
|
+
"AcceptedCredentials",
|
|
2585
|
+
{
|
|
2586
|
+
"isSerialized": true,
|
|
2587
|
+
"isSigningField": true,
|
|
2527
2588
|
"isVLEncoded": false,
|
|
2589
|
+
"nth": 28,
|
|
2590
|
+
"type": "STArray"
|
|
2591
|
+
}
|
|
2592
|
+
],
|
|
2593
|
+
[
|
|
2594
|
+
"RawTransactions",
|
|
2595
|
+
{
|
|
2528
2596
|
"isSerialized": true,
|
|
2529
2597
|
"isSigningField": true,
|
|
2598
|
+
"isVLEncoded": false,
|
|
2599
|
+
"nth": 29,
|
|
2600
|
+
"type": "STArray"
|
|
2601
|
+
}
|
|
2602
|
+
],
|
|
2603
|
+
[
|
|
2604
|
+
"BatchSigners",
|
|
2605
|
+
{
|
|
2606
|
+
"isSerialized": true,
|
|
2607
|
+
"isSigningField": false,
|
|
2608
|
+
"isVLEncoded": false,
|
|
2609
|
+
"nth": 30,
|
|
2530
2610
|
"type": "STArray"
|
|
2531
2611
|
}
|
|
2532
2612
|
],
|
|
@@ -2713,10 +2793,10 @@
|
|
|
2713
2793
|
[
|
|
2714
2794
|
"CredentialIDs",
|
|
2715
2795
|
{
|
|
2716
|
-
"nth": 5,
|
|
2717
|
-
"isVLEncoded": true,
|
|
2718
2796
|
"isSerialized": true,
|
|
2719
2797
|
"isSigningField": true,
|
|
2798
|
+
"isVLEncoded": true,
|
|
2799
|
+
"nth": 5,
|
|
2720
2800
|
"type": "Vector256"
|
|
2721
2801
|
}
|
|
2722
2802
|
],
|
|
@@ -2847,6 +2927,7 @@
|
|
|
2847
2927
|
"Amendments": 102,
|
|
2848
2928
|
"Bridge": 105,
|
|
2849
2929
|
"Check": 67,
|
|
2930
|
+
"Credential": 129,
|
|
2850
2931
|
"DID": 73,
|
|
2851
2932
|
"DepositPreauth": 112,
|
|
2852
2933
|
"DirectoryNode": 100,
|
|
@@ -2861,8 +2942,8 @@
|
|
|
2861
2942
|
"NegativeUNL": 78,
|
|
2862
2943
|
"Offer": 111,
|
|
2863
2944
|
"Oracle": 128,
|
|
2864
|
-
"Credential": 129,
|
|
2865
2945
|
"PayChannel": 120,
|
|
2946
|
+
"PermissionedDomain": 130,
|
|
2866
2947
|
"RippleState": 114,
|
|
2867
2948
|
"SignerList": 83,
|
|
2868
2949
|
"Ticket": 84,
|
|
@@ -2890,6 +2971,7 @@
|
|
|
2890
2971
|
"tecFAILED_PROCESSING": 105,
|
|
2891
2972
|
"tecFROZEN": 137,
|
|
2892
2973
|
"tecHAS_OBLIGATIONS": 151,
|
|
2974
|
+
"tecHOOK_REJECTED": 153,
|
|
2893
2975
|
"tecINCOMPLETE": 169,
|
|
2894
2976
|
"tecINSUFFICIENT_FUNDS": 159,
|
|
2895
2977
|
"tecINSUFFICIENT_PAYMENT": 161,
|
|
@@ -2948,6 +3030,7 @@
|
|
|
2948
3030
|
"tecXCHAIN_SELF_COMMIT": 184,
|
|
2949
3031
|
"tecXCHAIN_SENDING_ACCOUNT_MISMATCH": 179,
|
|
2950
3032
|
"tecXCHAIN_WRONG_CHAIN": 176,
|
|
3033
|
+
|
|
2951
3034
|
"tefALREADY": -198,
|
|
2952
3035
|
"tefBAD_ADD_AUTH": -197,
|
|
2953
3036
|
"tefBAD_AUTH": -196,
|
|
@@ -2970,6 +3053,7 @@
|
|
|
2970
3053
|
"tefPAST_SEQ": -190,
|
|
2971
3054
|
"tefTOO_BIG": -181,
|
|
2972
3055
|
"tefWRONG_PRIOR": -189,
|
|
3056
|
+
|
|
2973
3057
|
"telBAD_DOMAIN": -398,
|
|
2974
3058
|
"telBAD_PATH_COUNT": -397,
|
|
2975
3059
|
"telBAD_PUBLIC_KEY": -396,
|
|
@@ -2987,6 +3071,7 @@
|
|
|
2987
3071
|
"telNO_DST_PARTIAL": -393,
|
|
2988
3072
|
"telREQUIRES_NETWORK_ID": -385,
|
|
2989
3073
|
"telWRONG_NETWORK": -386,
|
|
3074
|
+
|
|
2990
3075
|
"temARRAY_EMPTY": -253,
|
|
2991
3076
|
"temARRAY_TOO_LARGE": -252,
|
|
2992
3077
|
"temBAD_AMM_TOKENS": -261,
|
|
@@ -3024,6 +3109,7 @@
|
|
|
3024
3109
|
"temINVALID_ACCOUNT_ID": -268,
|
|
3025
3110
|
"temINVALID_COUNT": -266,
|
|
3026
3111
|
"temINVALID_FLAG": -276,
|
|
3112
|
+
"temINVALID_INNER_BATCH": -250,
|
|
3027
3113
|
"temMALFORMED": -299,
|
|
3028
3114
|
"temREDUNDANT": -275,
|
|
3029
3115
|
"temRIPPLE_EMPTY": -274,
|
|
@@ -3036,6 +3122,7 @@
|
|
|
3036
3122
|
"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255,
|
|
3037
3123
|
"temXCHAIN_BRIDGE_NONDOOR_OWNER": -257,
|
|
3038
3124
|
"temXCHAIN_EQUAL_DOOR_ACCOUNTS": -260,
|
|
3125
|
+
|
|
3039
3126
|
"terFUNDS_SPENT": -98,
|
|
3040
3127
|
"terINSUF_FEE_B": -97,
|
|
3041
3128
|
"terLAST": -91,
|
|
@@ -3049,10 +3136,12 @@
|
|
|
3049
3136
|
"terPRE_TICKET": -88,
|
|
3050
3137
|
"terQUEUED": -89,
|
|
3051
3138
|
"terRETRY": -99,
|
|
3139
|
+
|
|
3052
3140
|
"tesSUCCESS": 0
|
|
3053
3141
|
},
|
|
3054
3142
|
"TRANSACTION_TYPES": {
|
|
3055
3143
|
"AMMBid": 39,
|
|
3144
|
+
"AMMClawback": 31,
|
|
3056
3145
|
"AMMCreate": 35,
|
|
3057
3146
|
"AMMDelete": 40,
|
|
3058
3147
|
"AMMDeposit": 36,
|
|
@@ -3060,12 +3149,13 @@
|
|
|
3060
3149
|
"AMMWithdraw": 37,
|
|
3061
3150
|
"AccountDelete": 21,
|
|
3062
3151
|
"AccountSet": 3,
|
|
3152
|
+
"Batch": 64,
|
|
3063
3153
|
"CheckCancel": 18,
|
|
3064
3154
|
"CheckCash": 17,
|
|
3065
3155
|
"CheckCreate": 16,
|
|
3066
3156
|
"Clawback": 30,
|
|
3067
|
-
"CredentialCreate": 58,
|
|
3068
3157
|
"CredentialAccept": 59,
|
|
3158
|
+
"CredentialCreate": 58,
|
|
3069
3159
|
"CredentialDelete": 60,
|
|
3070
3160
|
"DIDDelete": 50,
|
|
3071
3161
|
"DIDSet": 49,
|
|
@@ -3085,6 +3175,7 @@
|
|
|
3085
3175
|
"NFTokenCancelOffer": 28,
|
|
3086
3176
|
"NFTokenCreateOffer": 27,
|
|
3087
3177
|
"NFTokenMint": 25,
|
|
3178
|
+
"NFTokenModify": 61,
|
|
3088
3179
|
"OfferCancel": 8,
|
|
3089
3180
|
"OfferCreate": 7,
|
|
3090
3181
|
"OracleDelete": 52,
|
|
@@ -3093,6 +3184,8 @@
|
|
|
3093
3184
|
"PaymentChannelClaim": 15,
|
|
3094
3185
|
"PaymentChannelCreate": 13,
|
|
3095
3186
|
"PaymentChannelFund": 14,
|
|
3187
|
+
"PermissionedDomainDelete": 63,
|
|
3188
|
+
"PermissionedDomainSet": 62,
|
|
3096
3189
|
"SetFee": 101,
|
|
3097
3190
|
"SetRegularKey": 5,
|
|
3098
3191
|
"SignerListSet": 12,
|
|
@@ -3122,6 +3215,7 @@
|
|
|
3122
3215
|
"LedgerEntry": 10002,
|
|
3123
3216
|
"Metadata": 10004,
|
|
3124
3217
|
"NotPresent": 0,
|
|
3218
|
+
"Number": 9,
|
|
3125
3219
|
"PathSet": 18,
|
|
3126
3220
|
"STArray": 15,
|
|
3127
3221
|
"STObject": 14,
|
package/src/hash-prefixes.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { quality, binary, HashPrefix } from './coretypes'
|
|
2
2
|
import { decodeLedgerData } from './ledger-hashes'
|
|
3
|
-
import { ClaimObject } from './binary'
|
|
3
|
+
import { ClaimObject, BatchObject } from './binary'
|
|
4
4
|
import { JsonObject } from './types/serialized-type'
|
|
5
5
|
import {
|
|
6
6
|
XrplDefinitionsBase,
|
|
@@ -15,6 +15,7 @@ const {
|
|
|
15
15
|
signingData,
|
|
16
16
|
signingClaimData,
|
|
17
17
|
multiSigningData,
|
|
18
|
+
signingBatchData,
|
|
18
19
|
binaryToJSON,
|
|
19
20
|
serializeObject,
|
|
20
21
|
} = binary
|
|
@@ -110,6 +111,13 @@ function encodeForMultisigning(
|
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
function encodeForSigningBatch(json: object): string {
|
|
115
|
+
if (typeof json !== 'object') {
|
|
116
|
+
throw new Error()
|
|
117
|
+
}
|
|
118
|
+
return bytesToHex(signingBatchData(json as BatchObject))
|
|
119
|
+
}
|
|
120
|
+
|
|
113
121
|
/**
|
|
114
122
|
* Encode a quality value
|
|
115
123
|
*
|
|
@@ -142,6 +150,7 @@ export {
|
|
|
142
150
|
encodeForSigning,
|
|
143
151
|
encodeForSigningClaim,
|
|
144
152
|
encodeForMultisigning,
|
|
153
|
+
encodeForSigningBatch,
|
|
145
154
|
encodeQuality,
|
|
146
155
|
decodeQuality,
|
|
147
156
|
decodeLedgerData,
|