@ton/ton 13.5.1 → 13.8.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/client/TonClient.d.ts +1 -19
- package/dist/client/TonClient.js +49 -24
- package/dist/client/TonClient4.d.ts +843 -0
- package/dist/client/TonClient4.js +138 -8
- package/dist/client/TonClient4.spec.js +7 -1
- package/dist/client/api/HttpApi.d.ts +17 -0
- package/dist/client/api/HttpApi.js +5 -2
- package/dist/config/ConfigParser.d.ts +622 -0
- package/dist/config/ConfigParser.js +711 -0
- package/dist/config/ConfigParser.spec.d.ts +8 -0
- package/dist/config/ConfigParser.spec.js +97 -0
- package/dist/elector/ElectorContract.d.ts +51 -0
- package/dist/elector/ElectorContract.js +192 -0
- package/dist/elector/ElectorContract.spec.d.ts +8 -0
- package/dist/elector/ElectorContract.spec.js +104 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +44 -1
- package/dist/multisig/MultisigWallet.d.ts +1 -0
- package/dist/multisig/MultisigWallet.js +14 -0
- package/dist/multisig/MultisigWallet.spec.js +18 -0
- package/dist/utils/fees.d.ts +25 -0
- package/dist/utils/fees.js +105 -0
- package/dist/utils/fees.spec.d.ts +1 -0
- package/dist/utils/fees.spec.js +83 -0
- package/dist/wallets/WalletContractV5.d.ts +111 -0
- package/dist/wallets/WalletContractV5.js +197 -0
- package/dist/wallets/WalletContractV5.spec.d.ts +8 -0
- package/dist/wallets/WalletContractV5.spec.js +151 -0
- package/dist/wallets/WalletV5Utils.d.ts +31 -0
- package/dist/wallets/WalletV5Utils.js +115 -0
- package/dist/wallets/WalletV5Utils.spec.d.ts +1 -0
- package/dist/wallets/WalletV5Utils.spec.js +192 -0
- package/dist/wallets/signing/createWalletTransfer.d.ts +7 -1
- package/dist/wallets/signing/createWalletTransfer.js +33 -1
- package/package.json +4 -4
- package/CHANGELOG.md +0 -133
|
@@ -101,25 +101,7 @@ export declare class TonClient {
|
|
|
101
101
|
* @param hash transaction hash
|
|
102
102
|
* @returns transaction or null if not exist
|
|
103
103
|
*/
|
|
104
|
-
getTransaction(address: Address, lt: string, hash: string): Promise<
|
|
105
|
-
address: bigint;
|
|
106
|
-
lt: bigint;
|
|
107
|
-
prevTransactionHash: bigint;
|
|
108
|
-
prevTransactionLt: bigint;
|
|
109
|
-
now: number;
|
|
110
|
-
outMessagesCount: number;
|
|
111
|
-
oldStatus: import("@ton/core").AccountStatus; /**
|
|
112
|
-
* Get Address Balance
|
|
113
|
-
* @param address address for balance check
|
|
114
|
-
* @returns balance
|
|
115
|
-
*/
|
|
116
|
-
endStatus: import("@ton/core").AccountStatus;
|
|
117
|
-
inMessage: Message | undefined;
|
|
118
|
-
outMessages: import("@ton/core").Dictionary<number, Message>;
|
|
119
|
-
totalFees: import("@ton/core").CurrencyCollection;
|
|
120
|
-
stateUpdate: import("@ton/core").HashUpdate;
|
|
121
|
-
description: import("@ton/core").TransactionDescription;
|
|
122
|
-
} | null>;
|
|
104
|
+
getTransaction(address: Address, lt: string, hash: string): Promise<Transaction | null>;
|
|
123
105
|
/**
|
|
124
106
|
* Fetch latest masterchain info
|
|
125
107
|
* @returns masterchain info
|
package/dist/client/TonClient.js
CHANGED
|
@@ -261,33 +261,58 @@ class TonClient {
|
|
|
261
261
|
}
|
|
262
262
|
exports.TonClient = TonClient;
|
|
263
263
|
_TonClient_api = new WeakMap();
|
|
264
|
-
function
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
else if (s[0] === 'slice') {
|
|
283
|
-
stack.push({ type: 'slice', cell: core_1.Cell.fromBoc(Buffer.from(s[1].bytes, 'base64'))[0] });
|
|
284
|
-
}
|
|
285
|
-
else if (s[0] === 'builder') {
|
|
286
|
-
stack.push({ type: 'builder', cell: core_1.Cell.fromBoc(Buffer.from(s[1].bytes, 'base64'))[0] });
|
|
264
|
+
function parseStackEntry(s) {
|
|
265
|
+
switch (s["@type"]) {
|
|
266
|
+
case "tvm.stackEntryNumber":
|
|
267
|
+
return { type: 'int', value: BigInt(s.number.number) };
|
|
268
|
+
case "tvm.stackEntryCell":
|
|
269
|
+
return { type: 'cell', cell: core_1.Cell.fromBase64(s.cell) };
|
|
270
|
+
case 'tvm.stackEntryTuple':
|
|
271
|
+
return { type: 'tuple', items: s.tuple.elements.map(parseStackEntry) };
|
|
272
|
+
default:
|
|
273
|
+
throw Error("Unsupported item type: " + s["@type"]);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function parseStackItem(s) {
|
|
277
|
+
if (s[0] === 'num') {
|
|
278
|
+
let val = s[1];
|
|
279
|
+
if (val.startsWith('-')) {
|
|
280
|
+
return { type: 'int', value: -BigInt(val.slice(1)) };
|
|
287
281
|
}
|
|
288
282
|
else {
|
|
289
|
-
|
|
283
|
+
return { type: 'int', value: BigInt(val) };
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
else if (s[0] === 'null') {
|
|
287
|
+
return { type: 'null' };
|
|
288
|
+
}
|
|
289
|
+
else if (s[0] === 'cell') {
|
|
290
|
+
return { type: 'cell', cell: core_1.Cell.fromBoc(Buffer.from(s[1].bytes, 'base64'))[0] };
|
|
291
|
+
}
|
|
292
|
+
else if (s[0] === 'slice') {
|
|
293
|
+
return { type: 'slice', cell: core_1.Cell.fromBoc(Buffer.from(s[1].bytes, 'base64'))[0] };
|
|
294
|
+
}
|
|
295
|
+
else if (s[0] === 'builder') {
|
|
296
|
+
return { type: 'builder', cell: core_1.Cell.fromBoc(Buffer.from(s[1].bytes, 'base64'))[0] };
|
|
297
|
+
}
|
|
298
|
+
else if (s[0] === 'tuple' || s[0] === 'list') {
|
|
299
|
+
// toncenter.com missbehaviour
|
|
300
|
+
if (s[1].elements.length === 0) {
|
|
301
|
+
return { type: 'null' };
|
|
290
302
|
}
|
|
303
|
+
return {
|
|
304
|
+
type: s[0],
|
|
305
|
+
items: s[1].elements.map(parseStackEntry)
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
throw Error('Unsupported stack item type: ' + s[0]);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
function parseStack(src) {
|
|
313
|
+
let stack = [];
|
|
314
|
+
for (let s of src) {
|
|
315
|
+
stack.push(parseStackItem(s));
|
|
291
316
|
}
|
|
292
317
|
return new core_1.TupleReader(stack);
|
|
293
318
|
}
|