@tonappchain/sdk 0.6.1-v3.0.3 → 0.6.1-v3.0.5
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/errors/errors.d.ts +6 -0
- package/dist/errors/errors.js +15 -1
- package/dist/errors/instances.d.ts +3 -1
- package/dist/errors/instances.js +4 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -1
- package/dist/sdk/Consts.d.ts +5 -0
- package/dist/sdk/Consts.js +6 -1
- package/dist/sdk/LiteSequencerClient.d.ts +12 -0
- package/dist/sdk/LiteSequencerClient.js +127 -0
- package/dist/sdk/OperationTracker.d.ts +5 -6
- package/dist/sdk/OperationTracker.js +55 -89
- package/dist/sdk/TacSdk.d.ts +3 -3
- package/dist/sdk/TacSdk.js +63 -38
- package/dist/sdk/Utils.d.ts +2 -1
- package/dist/sdk/Utils.js +17 -1
- package/dist/sender/BatchSender.d.ts +15 -0
- package/dist/sender/BatchSender.js +116 -0
- package/dist/sender/RawSender.d.ts +3 -5
- package/dist/sender/RawSender.js +25 -29
- package/dist/sender/SenderAbstraction.d.ts +3 -3
- package/dist/sender/SenderFactory.js +4 -0
- package/dist/sender/TonConnectSender.d.ts +4 -4
- package/dist/sender/TonConnectSender.js +43 -15
- package/dist/sender/index.d.ts +1 -0
- package/dist/sender/index.js +1 -0
- package/dist/structs/InternalStruct.d.ts +8 -1
- package/dist/structs/Struct.d.ts +8 -4
- package/dist/wrappers/HighloadWalletV3.d.ts +3 -0
- package/dist/wrappers/HighloadWalletV3.js +12 -2
- package/package.json +3 -3
package/dist/structs/Struct.d.ts
CHANGED
|
@@ -114,14 +114,14 @@ export type WithAddressFT = {
|
|
|
114
114
|
*/
|
|
115
115
|
address?: string;
|
|
116
116
|
};
|
|
117
|
-
export type
|
|
117
|
+
export type WithAddressNFTItem = {
|
|
118
118
|
type: AssetType.NFT;
|
|
119
119
|
/**
|
|
120
120
|
* Address NFT item token.
|
|
121
121
|
*/
|
|
122
122
|
address: string;
|
|
123
123
|
};
|
|
124
|
-
export type
|
|
124
|
+
export type WithAddressNFTCollectionItem = {
|
|
125
125
|
type: AssetType.NFT;
|
|
126
126
|
/**
|
|
127
127
|
* Address NFT collection.
|
|
@@ -132,9 +132,9 @@ export type WithAddressNFT_CollectionItem = {
|
|
|
132
132
|
*/
|
|
133
133
|
itemIndex: bigint;
|
|
134
134
|
};
|
|
135
|
-
export type WithAddressNFT =
|
|
135
|
+
export type WithAddressNFT = WithAddressNFTItem | WithAddressNFTCollectionItem;
|
|
136
136
|
export type WithAddress = WithAddressFT | WithAddressNFT;
|
|
137
|
-
export type RawAssetBridgingData<NFTFormatRequired extends WithAddressNFT =
|
|
137
|
+
export type RawAssetBridgingData<NFTFormatRequired extends WithAddressNFT = WithAddressNFTItem> = {
|
|
138
138
|
/** Raw format, e.g. 12340000000 (=12.34 tokens if decimals is 9) */
|
|
139
139
|
rawAmount: bigint;
|
|
140
140
|
} & (WithAddressFT | NFTFormatRequired);
|
|
@@ -300,6 +300,10 @@ export type TACSimulationResult = {
|
|
|
300
300
|
blockNumber: number;
|
|
301
301
|
};
|
|
302
302
|
};
|
|
303
|
+
export type SuggestedTONExecutorFee = {
|
|
304
|
+
inTAC: string;
|
|
305
|
+
inTON: string;
|
|
306
|
+
};
|
|
303
307
|
export type FeeParams = {
|
|
304
308
|
isRoundTrip: boolean;
|
|
305
309
|
gasLimit: bigint;
|
|
@@ -32,6 +32,7 @@ export declare class HighloadWalletV3 implements WalletInstance {
|
|
|
32
32
|
sendMode: SendMode;
|
|
33
33
|
timeout?: number;
|
|
34
34
|
subwalletId?: number;
|
|
35
|
+
createdAt?: number;
|
|
35
36
|
}): Promise<void>;
|
|
36
37
|
static create(config: HighloadWalletV3Config, code?: Cell, workchain?: number): HighloadWalletV3;
|
|
37
38
|
sendExternalMessage(provider: ContractProvider, secretKey: Buffer, opts: {
|
|
@@ -43,6 +44,8 @@ export declare class HighloadWalletV3 implements WalletInstance {
|
|
|
43
44
|
timeout: number;
|
|
44
45
|
}): Promise<void>;
|
|
45
46
|
sendBatch(provider: ContractProvider, secretKey: Buffer, messages: OutActionSendMsg[], subwallet: number, timeout: number, createdAt?: number, value?: bigint): Promise<void>;
|
|
47
|
+
getQueryIdFromCreatedAt(createdAt: number): HighloadQueryId;
|
|
48
|
+
getExternalMessage(messages: MessageRelaxed[], sendMode: SendMode, value: bigint, queryId: HighloadQueryId): MessageRelaxed;
|
|
46
49
|
static createInternalTransferBody(opts: {
|
|
47
50
|
actions: OutAction[] | Cell;
|
|
48
51
|
queryId: HighloadQueryId;
|
|
@@ -43,7 +43,7 @@ class HighloadWalletV3 {
|
|
|
43
43
|
mode: args.sendMode,
|
|
44
44
|
outMsg: msg,
|
|
45
45
|
}));
|
|
46
|
-
await this.sendBatch(provider, args.secretKey, actions, subwalletId, timeout);
|
|
46
|
+
await this.sendBatch(provider, args.secretKey, actions, subwalletId, timeout, args.createdAt);
|
|
47
47
|
}
|
|
48
48
|
static create(config, code = HIGHLOAD_V3_CODE, workchain = 0) {
|
|
49
49
|
const data = highloadWalletV3ConfigToCell(config);
|
|
@@ -75,7 +75,7 @@ class HighloadWalletV3 {
|
|
|
75
75
|
if (createdAt == undefined) {
|
|
76
76
|
createdAt = Math.floor(Date.now() / 1000) - 40; // -40 is used to pass check created_at <= now() in smart contract for sure
|
|
77
77
|
}
|
|
78
|
-
const queryId =
|
|
78
|
+
const queryId = this.getQueryIdFromCreatedAt(createdAt);
|
|
79
79
|
return await this.sendExternalMessage(provider, secretKey, {
|
|
80
80
|
message: this.packActions(messages, value, queryId),
|
|
81
81
|
mode: value > 0n ? ton_1.SendMode.PAY_GAS_SEPARATELY : ton_1.SendMode.CARRY_ALL_REMAINING_BALANCE,
|
|
@@ -85,6 +85,16 @@ class HighloadWalletV3 {
|
|
|
85
85
|
timeout: timeout,
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
+
getQueryIdFromCreatedAt(createdAt) {
|
|
89
|
+
return HighloadQueryId_1.HighloadQueryId.fromQueryId(BigInt(createdAt) % 8388608n);
|
|
90
|
+
}
|
|
91
|
+
getExternalMessage(messages, sendMode, value, queryId) {
|
|
92
|
+
return this.packActions(messages.map((msg) => ({
|
|
93
|
+
type: 'sendMsg',
|
|
94
|
+
mode: sendMode,
|
|
95
|
+
outMsg: msg,
|
|
96
|
+
})), value, queryId);
|
|
97
|
+
}
|
|
88
98
|
static createInternalTransferBody(opts) {
|
|
89
99
|
let actionsCell;
|
|
90
100
|
if (opts.actions instanceof ton_1.Cell) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonappchain/sdk",
|
|
3
|
-
"version": "0.6.1-v3.0.
|
|
3
|
+
"version": "0.6.1-v3.0.5",
|
|
4
4
|
"repository": "https://github.com/TacBuild/tac-sdk.git",
|
|
5
5
|
"author": "TAC. <developers@tac>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@aws-crypto/sha256-js": "^5.2.0",
|
|
21
21
|
"@orbs-network/ton-access": "^2.3.3",
|
|
22
22
|
"@ton/ton": "15.1.0",
|
|
23
|
-
"@tonappchain/artifacts": "0.0.17-v3.0.
|
|
23
|
+
"@tonappchain/artifacts": "0.0.17-v3.0.5",
|
|
24
24
|
"@tonappchain/ton-lite-client": "3.0.6",
|
|
25
25
|
"@tonconnect/ui": "^2.0.11",
|
|
26
26
|
"bn.js": "^5.2.1",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"jest": "^29.7.0",
|
|
46
46
|
"prettier": "^3.5.3",
|
|
47
47
|
"ts-jest": "^29.2.6",
|
|
48
|
-
"ts-node": "^10.9.2",
|
|
48
|
+
"ts-node": "^10.9.2",
|
|
49
49
|
"typescript": "^5.7.2",
|
|
50
50
|
"typescript-eslint": "^8.17.0"
|
|
51
51
|
},
|