koilib 2.7.0 → 3.1.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/README.md +75 -12
- package/dist/koinos.js +8556 -269
- package/dist/koinos.min.js +1 -1
- package/lib/Contract.d.ts +66 -18
- package/lib/Contract.js +103 -40
- package/lib/Contract.js.map +1 -1
- package/lib/Provider.d.ts +22 -7
- package/lib/Provider.js +60 -21
- package/lib/Provider.js.map +1 -1
- package/lib/Serializer.d.ts +9 -3
- package/lib/Serializer.js +111 -85
- package/lib/Serializer.js.map +1 -1
- package/lib/Signer.d.ts +58 -38
- package/lib/Signer.js +318 -97
- package/lib/Signer.js.map +1 -1
- package/lib/browser/Contract.d.ts +66 -18
- package/lib/browser/Contract.js +103 -40
- package/lib/browser/Contract.js.map +1 -1
- package/lib/browser/Provider.d.ts +22 -7
- package/lib/browser/Provider.js +60 -21
- package/lib/browser/Provider.js.map +1 -1
- package/lib/browser/Serializer.d.ts +9 -3
- package/lib/browser/Serializer.js +111 -85
- package/lib/browser/Serializer.js.map +1 -1
- package/lib/browser/Signer.d.ts +58 -38
- package/lib/browser/Signer.js +318 -97
- package/lib/browser/Signer.js.map +1 -1
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/indexUtils.d.ts +2 -0
- package/lib/browser/indexUtils.js +15 -0
- package/lib/browser/indexUtils.js.map +1 -0
- package/lib/browser/interface.d.ts +242 -46
- package/lib/browser/jsonDescriptors/chain-proto.json +676 -0
- package/lib/browser/jsonDescriptors/{krc20-proto.json → token-proto.json} +47 -4
- package/lib/browser/protoModules/protocol-proto.d.ts +2 -0
- package/lib/browser/protoModules/protocol-proto.js +6336 -0
- package/lib/browser/protoModules/protocol-proto.js.map +1 -0
- package/lib/browser/utils.d.ts +19 -255
- package/lib/browser/utils.js +170 -15
- package/lib/browser/utils.js.map +1 -1
- package/lib/browser/utilsNode.d.ts +1021 -0
- package/lib/browser/utilsNode.js +346 -0
- package/lib/browser/utilsNode.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/indexUtils.d.ts +2 -0
- package/lib/indexUtils.js +15 -0
- package/lib/indexUtils.js.map +1 -0
- package/lib/interface.d.ts +242 -46
- package/lib/jsonDescriptors/chain-proto.json +676 -0
- package/lib/jsonDescriptors/{krc20-proto.json → token-proto.json} +47 -4
- package/lib/protoModules/protocol-proto.d.ts +2 -0
- package/lib/protoModules/protocol-proto.js +6336 -0
- package/lib/protoModules/protocol-proto.js.map +1 -0
- package/lib/utils.d.ts +19 -255
- package/lib/utils.js +170 -15
- package/lib/utils.js.map +1 -1
- package/lib/utilsNode.d.ts +1021 -0
- package/lib/utilsNode.js +346 -0
- package/lib/utilsNode.js.map +1 -0
- package/package.json +1 -1
- package/lib/browser/jsonDescriptors/protocol-proto.json +0 -246
- package/lib/jsonDescriptors/protocol-proto.json +0 -246
package/lib/browser/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Abi } from "./interface";
|
|
1
|
+
import { Abi, TypeField } from "./interface";
|
|
2
2
|
/**
|
|
3
3
|
* Converts an hex string to Uint8Array
|
|
4
4
|
*/
|
|
@@ -15,14 +15,27 @@ export declare function encodeBase58(buffer: Uint8Array): string;
|
|
|
15
15
|
* Decodes a buffer formatted in base58
|
|
16
16
|
*/
|
|
17
17
|
export declare function decodeBase58(bs58: string): Uint8Array;
|
|
18
|
+
/**
|
|
19
|
+
* Encodes an Uint8Array in base64url
|
|
20
|
+
*/
|
|
21
|
+
export declare function encodeBase64url(buffer: Uint8Array): string;
|
|
22
|
+
/**
|
|
23
|
+
* Decodes a buffer formatted in base64url
|
|
24
|
+
*/
|
|
25
|
+
export declare function decodeBase64url(bs64url: string): Uint8Array;
|
|
18
26
|
/**
|
|
19
27
|
* Encodes an Uint8Array in base64
|
|
20
28
|
*/
|
|
21
29
|
export declare function encodeBase64(buffer: Uint8Array): string;
|
|
30
|
+
export declare function multihash(buffer: Uint8Array, code?: string): Uint8Array;
|
|
22
31
|
/**
|
|
23
32
|
* Decodes a buffer formatted in base64
|
|
24
33
|
*/
|
|
25
34
|
export declare function decodeBase64(bs64: string): Uint8Array;
|
|
35
|
+
/**
|
|
36
|
+
* Calculates the merkle root of sha256 hashes
|
|
37
|
+
*/
|
|
38
|
+
export declare function calculateMerkleRoot(hashes: Uint8Array[]): Uint8Array;
|
|
26
39
|
/**
|
|
27
40
|
* Encodes a public or private key in base58 using
|
|
28
41
|
* the bitcoin format (see [Bitcoin Base58Check encoding](https://en.bitcoin.it/wiki/Base58Check_encoding)
|
|
@@ -67,260 +80,11 @@ export declare function formatUnits(value: string | number | bigint, decimals: n
|
|
|
67
80
|
* ```
|
|
68
81
|
*/
|
|
69
82
|
export declare function parseUnits(value: string, decimals: number): string;
|
|
83
|
+
export declare function btypeDecodeValue(valueEncoded: unknown, typeField: TypeField): unknown;
|
|
84
|
+
export declare function btypeEncodeValue(valueDecoded: unknown, typeField: TypeField): unknown;
|
|
85
|
+
export declare function btypeDecode(valueEncoded: Record<string, unknown> | unknown[], fields: Record<string, TypeField>): Record<string, unknown>;
|
|
86
|
+
export declare function btypeEncode(valueDecoded: Record<string, unknown> | unknown[], fields: Record<string, TypeField>): Record<string, unknown>;
|
|
70
87
|
/**
|
|
71
88
|
* ABI for tokens
|
|
72
89
|
*/
|
|
73
|
-
export declare const
|
|
74
|
-
export declare const ProtocolTypes: {
|
|
75
|
-
nested: {
|
|
76
|
-
koinos: {
|
|
77
|
-
nested: {
|
|
78
|
-
protocol: {
|
|
79
|
-
options: {
|
|
80
|
-
go_package: string;
|
|
81
|
-
};
|
|
82
|
-
nested: {
|
|
83
|
-
contract_call_bundle: {
|
|
84
|
-
fields: {
|
|
85
|
-
contract_id: {
|
|
86
|
-
type: string;
|
|
87
|
-
id: number;
|
|
88
|
-
options: {
|
|
89
|
-
"(koinos_bytes_type)": string;
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
entry_point: {
|
|
93
|
-
type: string;
|
|
94
|
-
id: number;
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
system_call_target: {
|
|
99
|
-
oneofs: {
|
|
100
|
-
target: {
|
|
101
|
-
oneof: string[];
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
fields: {
|
|
105
|
-
thunk_id: {
|
|
106
|
-
type: string;
|
|
107
|
-
id: number;
|
|
108
|
-
};
|
|
109
|
-
system_call_bundle: {
|
|
110
|
-
type: string;
|
|
111
|
-
id: number;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
upload_contract_operation: {
|
|
116
|
-
fields: {
|
|
117
|
-
contract_id: {
|
|
118
|
-
type: string;
|
|
119
|
-
id: number;
|
|
120
|
-
options: {
|
|
121
|
-
"(koinos_bytes_type)": string;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
bytecode: {
|
|
125
|
-
/**
|
|
126
|
-
* Encodes a public or private key in base58 using
|
|
127
|
-
* the bitcoin format (see [Bitcoin Base58Check encoding](https://en.bitcoin.it/wiki/Base58Check_encoding)
|
|
128
|
-
* and [Bitcoin WIF](https://en.bitcoin.it/wiki/Wallet_import_format)).
|
|
129
|
-
*
|
|
130
|
-
* For private keys this encode is also known as
|
|
131
|
-
* wallet import format (WIF).
|
|
132
|
-
*/
|
|
133
|
-
type: string;
|
|
134
|
-
id: number;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
call_contract_operation: {
|
|
139
|
-
fields: {
|
|
140
|
-
contract_id: {
|
|
141
|
-
type: string;
|
|
142
|
-
id: number;
|
|
143
|
-
options: {
|
|
144
|
-
"(koinos_bytes_type)": string;
|
|
145
|
-
};
|
|
146
|
-
};
|
|
147
|
-
entry_point: {
|
|
148
|
-
type: string;
|
|
149
|
-
id: number;
|
|
150
|
-
};
|
|
151
|
-
args: {
|
|
152
|
-
type: string;
|
|
153
|
-
id: number;
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
set_system_call_operation: {
|
|
158
|
-
fields: {
|
|
159
|
-
call_id: {
|
|
160
|
-
type: string;
|
|
161
|
-
id: number;
|
|
162
|
-
};
|
|
163
|
-
target: {
|
|
164
|
-
type: string;
|
|
165
|
-
id: number;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
operation: {
|
|
170
|
-
oneofs: {
|
|
171
|
-
op: {
|
|
172
|
-
oneof: string[];
|
|
173
|
-
};
|
|
174
|
-
};
|
|
175
|
-
fields: {
|
|
176
|
-
upload_contract: {
|
|
177
|
-
type: string;
|
|
178
|
-
id: number;
|
|
179
|
-
};
|
|
180
|
-
call_contract: {
|
|
181
|
-
type: string;
|
|
182
|
-
id: number;
|
|
183
|
-
};
|
|
184
|
-
set_system_call: {
|
|
185
|
-
type: string;
|
|
186
|
-
id: number;
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
active_transaction_data: {
|
|
191
|
-
fields: {
|
|
192
|
-
rc_limit: {
|
|
193
|
-
type: string;
|
|
194
|
-
id: number;
|
|
195
|
-
options: {
|
|
196
|
-
jstype: string;
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
nonce: {
|
|
200
|
-
type: string;
|
|
201
|
-
id: number;
|
|
202
|
-
options: {
|
|
203
|
-
jstype: string;
|
|
204
|
-
};
|
|
205
|
-
};
|
|
206
|
-
operations: {
|
|
207
|
-
rule: string;
|
|
208
|
-
type: string;
|
|
209
|
-
id: number;
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
passive_transaction_data: {
|
|
214
|
-
fields: {};
|
|
215
|
-
};
|
|
216
|
-
transaction: {
|
|
217
|
-
fields: {
|
|
218
|
-
id: {
|
|
219
|
-
type: string;
|
|
220
|
-
id: number;
|
|
221
|
-
options: {
|
|
222
|
-
"(koinos_bytes_type)": string;
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
|
-
active: {
|
|
226
|
-
type: string;
|
|
227
|
-
id: number;
|
|
228
|
-
};
|
|
229
|
-
passive: {
|
|
230
|
-
type: string;
|
|
231
|
-
id: number;
|
|
232
|
-
};
|
|
233
|
-
signature_data: {
|
|
234
|
-
type: string;
|
|
235
|
-
id: number;
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
};
|
|
239
|
-
active_block_data: {
|
|
240
|
-
fields: {
|
|
241
|
-
transaction_merkle_root: {
|
|
242
|
-
type: string;
|
|
243
|
-
id: number;
|
|
244
|
-
};
|
|
245
|
-
passive_data_merkle_root: {
|
|
246
|
-
type: string;
|
|
247
|
-
id: number;
|
|
248
|
-
};
|
|
249
|
-
signer: {
|
|
250
|
-
type: string;
|
|
251
|
-
id: number;
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
passive_block_data: {
|
|
256
|
-
fields: {};
|
|
257
|
-
};
|
|
258
|
-
block_header: {
|
|
259
|
-
fields: {
|
|
260
|
-
previous: {
|
|
261
|
-
type: string;
|
|
262
|
-
/**
|
|
263
|
-
* ABI for tokens
|
|
264
|
-
*/
|
|
265
|
-
id: number;
|
|
266
|
-
options: {
|
|
267
|
-
"(koinos_bytes_type)": string;
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
height: {
|
|
271
|
-
type: string;
|
|
272
|
-
id: number;
|
|
273
|
-
options: {
|
|
274
|
-
jstype: string;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
timestamp: {
|
|
278
|
-
type: string;
|
|
279
|
-
id: number;
|
|
280
|
-
options: {
|
|
281
|
-
jstype: string;
|
|
282
|
-
};
|
|
283
|
-
};
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
block: {
|
|
287
|
-
fields: {
|
|
288
|
-
id: {
|
|
289
|
-
type: string;
|
|
290
|
-
id: number;
|
|
291
|
-
options: {
|
|
292
|
-
"(koinos_bytes_type)": string;
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
header: {
|
|
296
|
-
type: string;
|
|
297
|
-
id: number;
|
|
298
|
-
};
|
|
299
|
-
active: {
|
|
300
|
-
type: string;
|
|
301
|
-
id: number;
|
|
302
|
-
};
|
|
303
|
-
passive: {
|
|
304
|
-
type: string;
|
|
305
|
-
id: number;
|
|
306
|
-
};
|
|
307
|
-
signature_data: {
|
|
308
|
-
type: string;
|
|
309
|
-
id: number;
|
|
310
|
-
};
|
|
311
|
-
transactions: {
|
|
312
|
-
rule: string;
|
|
313
|
-
type: string;
|
|
314
|
-
id: number;
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
block_receipt: {
|
|
319
|
-
fields: {};
|
|
320
|
-
};
|
|
321
|
-
};
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
};
|
|
90
|
+
export declare const tokenAbi: Abi;
|
package/lib/browser/utils.js
CHANGED
|
@@ -22,12 +22,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.
|
|
25
|
+
exports.tokenAbi = exports.btypeEncode = exports.btypeDecode = exports.btypeEncodeValue = exports.btypeDecodeValue = exports.parseUnits = exports.formatUnits = exports.bitcoinAddress = exports.bitcoinDecode = exports.bitcoinEncode = exports.calculateMerkleRoot = exports.decodeBase64 = exports.multihash = exports.encodeBase64 = exports.decodeBase64url = exports.encodeBase64url = exports.decodeBase58 = exports.encodeBase58 = exports.toHexString = exports.toUint8Array = void 0;
|
|
26
26
|
const multibase = __importStar(require("multibase"));
|
|
27
27
|
const sha256_1 = require("@noble/hashes/sha256");
|
|
28
28
|
const ripemd160_1 = require("@noble/hashes/ripemd160");
|
|
29
|
-
const
|
|
30
|
-
const protocol_proto_json_1 = __importDefault(require("./jsonDescriptors/protocol-proto.json"));
|
|
29
|
+
const token_proto_json_1 = __importDefault(require("./jsonDescriptors/token-proto.json"));
|
|
31
30
|
/**
|
|
32
31
|
* Converts an hex string to Uint8Array
|
|
33
32
|
*/
|
|
@@ -62,20 +61,67 @@ function decodeBase58(bs58) {
|
|
|
62
61
|
return multibase.decode(`z${bs58}`);
|
|
63
62
|
}
|
|
64
63
|
exports.decodeBase58 = decodeBase58;
|
|
64
|
+
/**
|
|
65
|
+
* Encodes an Uint8Array in base64url
|
|
66
|
+
*/
|
|
67
|
+
function encodeBase64url(buffer) {
|
|
68
|
+
return new TextDecoder().decode(multibase.encode("U", buffer)).slice(1);
|
|
69
|
+
}
|
|
70
|
+
exports.encodeBase64url = encodeBase64url;
|
|
71
|
+
/**
|
|
72
|
+
* Decodes a buffer formatted in base64url
|
|
73
|
+
*/
|
|
74
|
+
function decodeBase64url(bs64url) {
|
|
75
|
+
return multibase.decode(`U${bs64url}`);
|
|
76
|
+
}
|
|
77
|
+
exports.decodeBase64url = decodeBase64url;
|
|
65
78
|
/**
|
|
66
79
|
* Encodes an Uint8Array in base64
|
|
67
80
|
*/
|
|
68
81
|
function encodeBase64(buffer) {
|
|
69
|
-
return new TextDecoder().decode(multibase.encode("
|
|
82
|
+
return new TextDecoder().decode(multibase.encode("M", buffer)).slice(1);
|
|
70
83
|
}
|
|
71
84
|
exports.encodeBase64 = encodeBase64;
|
|
85
|
+
function multihash(buffer, code = "sha2-256") {
|
|
86
|
+
switch (code) {
|
|
87
|
+
case "sha2-256": {
|
|
88
|
+
return new Uint8Array([18, buffer.length, ...buffer]);
|
|
89
|
+
}
|
|
90
|
+
default:
|
|
91
|
+
throw new Error(`multihash code ${code} not supported`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.multihash = multihash;
|
|
72
95
|
/**
|
|
73
96
|
* Decodes a buffer formatted in base64
|
|
74
97
|
*/
|
|
75
98
|
function decodeBase64(bs64) {
|
|
76
|
-
return multibase.decode(`
|
|
99
|
+
return multibase.decode(`M${bs64}`);
|
|
77
100
|
}
|
|
78
101
|
exports.decodeBase64 = decodeBase64;
|
|
102
|
+
/**
|
|
103
|
+
* Calculates the merkle root of sha256 hashes
|
|
104
|
+
*/
|
|
105
|
+
function calculateMerkleRoot(hashes) {
|
|
106
|
+
if (!hashes.length)
|
|
107
|
+
return (0, sha256_1.sha256)(new Uint8Array());
|
|
108
|
+
while (hashes.length > 1) {
|
|
109
|
+
for (let i = 0; i < hashes.length; i += 2) {
|
|
110
|
+
if (i + 1 < hashes.length) {
|
|
111
|
+
const leftHash = hashes[i];
|
|
112
|
+
const rightHash = hashes[i + 1];
|
|
113
|
+
const sumHash = (0, sha256_1.sha256)(new Uint8Array([...leftHash, ...rightHash]));
|
|
114
|
+
hashes[i / 2] = new Uint8Array(sumHash);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
hashes[i / 2] = hashes[i];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
hashes = hashes.slice(0, Math.ceil(hashes.length / 2));
|
|
121
|
+
}
|
|
122
|
+
return hashes[0];
|
|
123
|
+
}
|
|
124
|
+
exports.calculateMerkleRoot = calculateMerkleRoot;
|
|
79
125
|
/**
|
|
80
126
|
* Encodes a public or private key in base58 using
|
|
81
127
|
* the bitcoin format (see [Bitcoin Base58Check encoding](https://en.bitcoin.it/wiki/Base58Check_encoding)
|
|
@@ -199,54 +245,163 @@ function parseUnits(value, decimals) {
|
|
|
199
245
|
return `${sign}${`${integerPart}${decimalPart}`.replace(/^0+(?=\d)/, "")}`;
|
|
200
246
|
}
|
|
201
247
|
exports.parseUnits = parseUnits;
|
|
248
|
+
/**
|
|
249
|
+
* Makes a copy of a value. The returned value can be modified
|
|
250
|
+
* without altering the original one. Although this is not needed
|
|
251
|
+
* for strings or numbers and only needed for objects and arrays,
|
|
252
|
+
* all these options are covered in a single function
|
|
253
|
+
*
|
|
254
|
+
* It is assumed that the argument is number, string, or contructions
|
|
255
|
+
* of these types inside objects or arrays.
|
|
256
|
+
*/
|
|
257
|
+
function copyValue(value) {
|
|
258
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
259
|
+
return value;
|
|
260
|
+
}
|
|
261
|
+
return JSON.parse(JSON.stringify(value));
|
|
262
|
+
}
|
|
263
|
+
function btypeDecodeValue(valueEncoded, typeField) {
|
|
264
|
+
// No byte conversion
|
|
265
|
+
if (typeField.type !== "bytes")
|
|
266
|
+
return copyValue(valueEncoded);
|
|
267
|
+
const value = valueEncoded;
|
|
268
|
+
// Default byte conversion
|
|
269
|
+
if (!typeField.btype) {
|
|
270
|
+
return decodeBase64url(value);
|
|
271
|
+
}
|
|
272
|
+
// Specific byte conversion
|
|
273
|
+
switch (typeField.btype) {
|
|
274
|
+
case "BASE58":
|
|
275
|
+
case "CONTRACT_ID":
|
|
276
|
+
case "ADDRESS":
|
|
277
|
+
return decodeBase58(value);
|
|
278
|
+
case "BASE64":
|
|
279
|
+
return decodeBase64url(value);
|
|
280
|
+
case "HEX":
|
|
281
|
+
case "BLOCK_ID":
|
|
282
|
+
case "TRANSACTION_ID":
|
|
283
|
+
return toUint8Array(value.slice(2));
|
|
284
|
+
default:
|
|
285
|
+
throw new Error(`unknown btype ${typeField.btype}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
exports.btypeDecodeValue = btypeDecodeValue;
|
|
289
|
+
function btypeEncodeValue(valueDecoded, typeField) {
|
|
290
|
+
// No byte conversion
|
|
291
|
+
if (typeField.type !== "bytes")
|
|
292
|
+
return copyValue(valueDecoded);
|
|
293
|
+
const value = valueDecoded;
|
|
294
|
+
// Default byte conversion
|
|
295
|
+
if (!typeField.btype) {
|
|
296
|
+
return encodeBase64url(value);
|
|
297
|
+
}
|
|
298
|
+
// Specific byte conversion
|
|
299
|
+
switch (typeField.btype) {
|
|
300
|
+
case "BASE58":
|
|
301
|
+
case "CONTRACT_ID":
|
|
302
|
+
case "ADDRESS":
|
|
303
|
+
return encodeBase58(value);
|
|
304
|
+
case "BASE64":
|
|
305
|
+
return encodeBase64url(value);
|
|
306
|
+
case "HEX":
|
|
307
|
+
case "BLOCK_ID":
|
|
308
|
+
case "TRANSACTION_ID":
|
|
309
|
+
return `0x${toHexString(value)}`;
|
|
310
|
+
default:
|
|
311
|
+
throw new Error(`unknown btype ${typeField.btype}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
exports.btypeEncodeValue = btypeEncodeValue;
|
|
315
|
+
function btypeDecode(valueEncoded, fields) {
|
|
316
|
+
if (typeof valueEncoded !== "object")
|
|
317
|
+
return valueEncoded;
|
|
318
|
+
const valueDecoded = {};
|
|
319
|
+
Object.keys(fields).forEach((name) => {
|
|
320
|
+
if (!valueEncoded[name])
|
|
321
|
+
return;
|
|
322
|
+
if (fields[name].rule === "repeated")
|
|
323
|
+
valueDecoded[name] = valueEncoded[name].map((itemEncoded) => {
|
|
324
|
+
if (fields[name].subtypes)
|
|
325
|
+
return btypeDecode(itemEncoded, fields[name].subtypes);
|
|
326
|
+
return btypeDecodeValue(itemEncoded, fields[name]);
|
|
327
|
+
});
|
|
328
|
+
else if (fields[name].subtypes)
|
|
329
|
+
valueDecoded[name] = btypeDecode(valueEncoded[name], fields[name].subtypes);
|
|
330
|
+
else
|
|
331
|
+
valueDecoded[name] = btypeDecodeValue(valueEncoded[name], fields[name]);
|
|
332
|
+
});
|
|
333
|
+
return valueDecoded;
|
|
334
|
+
}
|
|
335
|
+
exports.btypeDecode = btypeDecode;
|
|
336
|
+
function btypeEncode(valueDecoded, fields) {
|
|
337
|
+
if (typeof valueDecoded !== "object")
|
|
338
|
+
return valueDecoded;
|
|
339
|
+
const valueEncoded = {};
|
|
340
|
+
Object.keys(fields).forEach((name) => {
|
|
341
|
+
if (!valueDecoded[name])
|
|
342
|
+
return;
|
|
343
|
+
if (fields[name].rule === "repeated")
|
|
344
|
+
valueEncoded[name] = valueDecoded[name].map((itemDecoded) => {
|
|
345
|
+
if (fields[name].subtypes)
|
|
346
|
+
return btypeEncode(itemDecoded, fields[name].subtypes);
|
|
347
|
+
return btypeEncodeValue(itemDecoded, fields[name]);
|
|
348
|
+
});
|
|
349
|
+
else if (fields[name].subtypes)
|
|
350
|
+
valueEncoded[name] = btypeEncode(valueDecoded[name], fields[name].subtypes);
|
|
351
|
+
else
|
|
352
|
+
valueEncoded[name] = btypeEncodeValue(valueDecoded[name], fields[name]);
|
|
353
|
+
});
|
|
354
|
+
return valueEncoded;
|
|
355
|
+
}
|
|
356
|
+
exports.btypeEncode = btypeEncode;
|
|
202
357
|
/**
|
|
203
358
|
* ABI for tokens
|
|
204
359
|
*/
|
|
205
|
-
exports.
|
|
360
|
+
exports.tokenAbi = {
|
|
206
361
|
methods: {
|
|
207
362
|
name: {
|
|
208
|
-
entryPoint:
|
|
363
|
+
entryPoint: 0x82a3537f,
|
|
209
364
|
input: "name_arguments",
|
|
210
365
|
output: "name_result",
|
|
211
366
|
readOnly: true,
|
|
212
367
|
},
|
|
213
368
|
symbol: {
|
|
214
|
-
entryPoint:
|
|
369
|
+
entryPoint: 0xb76a7ca1,
|
|
215
370
|
input: "symbol_arguments",
|
|
216
371
|
output: "symbol_result",
|
|
217
372
|
readOnly: true,
|
|
218
373
|
},
|
|
219
374
|
decimals: {
|
|
220
|
-
entryPoint:
|
|
375
|
+
entryPoint: 0xee80fd2f,
|
|
221
376
|
input: "decimals_arguments",
|
|
222
377
|
output: "decimals_result",
|
|
223
378
|
readOnly: true,
|
|
224
379
|
},
|
|
225
380
|
totalSupply: {
|
|
226
|
-
entryPoint:
|
|
381
|
+
entryPoint: 0xb0da3934,
|
|
227
382
|
input: "total_supply_arguments",
|
|
228
383
|
output: "total_supply_result",
|
|
229
384
|
readOnly: true,
|
|
230
385
|
},
|
|
231
386
|
balanceOf: {
|
|
232
|
-
entryPoint:
|
|
387
|
+
entryPoint: 0x5c721497,
|
|
233
388
|
input: "balance_of_arguments",
|
|
234
389
|
output: "balance_of_result",
|
|
235
390
|
readOnly: true,
|
|
236
391
|
defaultOutput: { value: "0" },
|
|
237
392
|
},
|
|
238
393
|
transfer: {
|
|
239
|
-
entryPoint:
|
|
394
|
+
entryPoint: 0x27f576ca,
|
|
240
395
|
input: "transfer_arguments",
|
|
241
396
|
output: "transfer_result",
|
|
242
397
|
},
|
|
243
398
|
mint: {
|
|
244
|
-
entryPoint:
|
|
399
|
+
entryPoint: 0xdc6f17bb,
|
|
245
400
|
input: "mint_arguments",
|
|
246
401
|
output: "mint_result",
|
|
247
402
|
},
|
|
248
403
|
},
|
|
249
|
-
types:
|
|
404
|
+
types: token_proto_json_1.default,
|
|
250
405
|
};
|
|
251
|
-
|
|
406
|
+
//export const ProtocolTypes = protocolJson;
|
|
252
407
|
//# sourceMappingURL=utils.js.map
|
package/lib/browser/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,iDAA8C;AAC9C,uDAAoD;AACpD,0FAAgE;AAChE,gGAAiE;AAGjE;;GAEG;AACH,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IAC3C,OAAO,IAAI,UAAU,CACnB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB;KACzD,CAAC;AACJ,CAAC;AAND,oCAMC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,MAAkB;IAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;SACtB,GAAG,CAAC,CAAC,CAAC,EAAE,EA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