@tonappchain/sdk 0.6.1-v3.0.4 → 0.6.1

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.
@@ -114,14 +114,14 @@ export type WithAddressFT = {
114
114
  */
115
115
  address?: string;
116
116
  };
117
- export type WithAddressNFT_Item = {
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 WithAddressNFT_CollectionItem = {
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 = WithAddressNFT_Item | WithAddressNFT_CollectionItem;
135
+ export type WithAddressNFT = WithAddressNFTItem | WithAddressNFTCollectionItem;
136
136
  export type WithAddress = WithAddressFT | WithAddressNFT;
137
- export type RawAssetBridgingData<NFTFormatRequired extends WithAddressNFT = WithAddressNFT_Item> = {
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);
@@ -181,7 +181,6 @@ export type TACSimulationRequest = {
181
181
  };
182
182
  evmValidExecutors: string[];
183
183
  extraData: string;
184
- feeAssetAddress: string;
185
184
  shardsKey: string;
186
185
  tonAssets: {
187
186
  amount: string;
@@ -300,6 +299,10 @@ export type TACSimulationResult = {
300
299
  blockNumber: number;
301
300
  };
302
301
  };
302
+ export type SuggestedTONExecutorFee = {
303
+ inTAC: string;
304
+ inTON: string;
305
+ };
303
306
  export type FeeParams = {
304
307
  isRoundTrip: boolean;
305
308
  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 = HighloadQueryId_1.HighloadQueryId.fromQueryId(BigInt(createdAt) % 8388608n);
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.4",
3
+ "version": "0.6.1",
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.3",
23
+ "@tonappchain/artifacts": "0.0.17",
24
24
  "@tonappchain/ton-lite-client": "3.0.6",
25
25
  "@tonconnect/ui": "^2.0.11",
26
26
  "bn.js": "^5.2.1",