@tonappchain/sdk 0.7.2-alpha-1 → 0.7.2-alpha-2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Blockchain } from '@ton/sandbox';
|
|
2
|
-
import { Address, Transaction } from '@ton/ton';
|
|
2
|
+
import { Address, TonClient, Transaction } from '@ton/ton';
|
|
3
3
|
import { ContractOpener } from '../interfaces';
|
|
4
4
|
import { GetTransactionsOptions } from '../structs/InternalStruct';
|
|
5
5
|
import { Network } from '../structs/Struct';
|
|
@@ -20,5 +20,5 @@ export declare function liteClientOpener(options: {
|
|
|
20
20
|
export declare function sandboxOpener(blockchain: Blockchain): ContractOpener;
|
|
21
21
|
export declare function orbsOpener(network: Network): Promise<ContractOpener>;
|
|
22
22
|
export declare function orbsOpener4(network: Network, timeout?: number): Promise<ContractOpener>;
|
|
23
|
-
export declare function tonClientOpener(
|
|
23
|
+
export declare function tonClientOpener(client: TonClient): ContractOpener;
|
|
24
24
|
export {};
|
|
@@ -265,10 +265,7 @@ async function orbsOpener4(network, timeout = 10000) {
|
|
|
265
265
|
},
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function tonClientOpener(
|
|
269
|
-
const client = new ton_1.TonClient({
|
|
270
|
-
endpoint,
|
|
271
|
-
});
|
|
268
|
+
function tonClientOpener(client) {
|
|
272
269
|
return {
|
|
273
270
|
open: client.open.bind(client),
|
|
274
271
|
getContractState: client.getContractState.bind(client),
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RetryableContractOpener = void 0;
|
|
4
4
|
exports.createDefaultRetryableOpener = createDefaultRetryableOpener;
|
|
5
|
+
const ton_1 = require("@ton/ton");
|
|
5
6
|
const instances_1 = require("../errors/instances");
|
|
6
7
|
const Struct_1 = require("../structs/Struct");
|
|
7
8
|
const contractOpener_1 = require("./contractOpener");
|
|
@@ -107,8 +108,9 @@ class RetryableContractOpener {
|
|
|
107
108
|
exports.RetryableContractOpener = RetryableContractOpener;
|
|
108
109
|
async function createDefaultRetryableOpener(tonRpcEndpoint, networkType, maxRetries = 5, retryDelay = 1000) {
|
|
109
110
|
const openers = [];
|
|
110
|
-
const tonClient =
|
|
111
|
-
|
|
111
|
+
const tonClient = new ton_1.TonClient({ endpoint: new URL('api/v2/jsonRPC', tonRpcEndpoint).toString() });
|
|
112
|
+
const opener = (0, contractOpener_1.tonClientOpener)(tonClient);
|
|
113
|
+
openers.push({ opener, retries: maxRetries, retryDelay });
|
|
112
114
|
if (networkType !== Struct_1.Network.DEV) {
|
|
113
115
|
try {
|
|
114
116
|
const opener4 = await (0, contractOpener_1.orbsOpener4)(networkType);
|