@tonappchain/sdk 0.7.0-rc26 → 0.7.0-rc28
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/LICENSE +20 -20
- package/README.md +198 -196
- package/dist/src/agnosticSdk/DebugHelpers.js +1 -1
- package/dist/src/errors/instances.d.ts +1 -0
- package/dist/src/errors/instances.js +3 -1
- package/dist/src/interfaces/ITONTransactionManager.d.ts +4 -5
- package/dist/src/interfaces/ITacSDK.d.ts +3 -3
- package/dist/src/sdk/LiteSequencerClient.js +12 -4
- package/dist/src/sdk/TONTransactionManager.d.ts +3 -3
- package/dist/src/sdk/TONTransactionManager.js +18 -7
- package/dist/src/sdk/TacSdk.d.ts +3 -3
- package/dist/src/sdk/TacSdk.js +4 -4
- package/dist/src/structs/InternalStruct.d.ts +5 -0
- package/dist/src/structs/Struct.d.ts +13 -1
- package/package.json +118 -118
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 TAC
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 TAC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,197 +1,199 @@
|
|
|
1
|
-
# TacSdk
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@tonappchain/sdk)
|
|
4
|
-
[](https://www.npmjs.com/package/@tonappchain/sdk)
|
|
5
|
-
[](https://runkit.com/npm/@tonappchain/sdk)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
The TAC SDK makes it possible to create hybrid dApps that let TON users interact directly with EVM smart contracts without needing to manage multiple wallets or understand the complexities of cross-chain messaging.
|
|
9
|
-
|
|
10
|
-
### Documentation
|
|
11
|
-
|
|
12
|
-
For full documentation and examples, please visit [TAC SDK Documentation](https://docs.tac.build/build/sdk/introduction).
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- [`
|
|
46
|
-
- [`
|
|
47
|
-
- [`
|
|
48
|
-
- [`
|
|
49
|
-
- [`
|
|
50
|
-
- [`
|
|
51
|
-
- [`
|
|
52
|
-
- [`
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- [`
|
|
59
|
-
- [`
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
- **[`
|
|
72
|
-
|
|
73
|
-
- **[`
|
|
74
|
-
|
|
75
|
-
- **[`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- [`
|
|
83
|
-
- [`
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- [`
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
- **`
|
|
109
|
-
- **`
|
|
110
|
-
- **`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
import {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
tacSdk.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
1
|
+
# TacSdk
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@tonappchain/sdk)
|
|
4
|
+
[](https://www.npmjs.com/package/@tonappchain/sdk)
|
|
5
|
+
[](https://runkit.com/npm/@tonappchain/sdk)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
The TAC SDK makes it possible to create hybrid dApps that let TON users interact directly with EVM smart contracts without needing to manage multiple wallets or understand the complexities of cross-chain messaging.
|
|
9
|
+
|
|
10
|
+
### Documentation
|
|
11
|
+
|
|
12
|
+
For full documentation and examples, please visit [TAC SDK Documentation](https://docs.tac.build/build/sdk/introduction).
|
|
13
|
+
|
|
14
|
+
For practical examples and usage patterns, see [Examples Documentation](./docs/examples/examples.md).
|
|
15
|
+
|
|
16
|
+
### Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @tonappchain/sdk
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
or
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn add @tonappchain/sdk
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
The TAC SDK enables you to create frontends that:
|
|
32
|
+
|
|
33
|
+
- Connect to TON wallets like Tonkeeper or Tonhub
|
|
34
|
+
- Send transactions from TON to your EVM contracts
|
|
35
|
+
- Track cross-chain transaction status in real-time
|
|
36
|
+
- Handle tokens across both chains
|
|
37
|
+
- Create a seamless user experience for TON users
|
|
38
|
+
|
|
39
|
+
## Available Resources
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### SDK Components
|
|
43
|
+
|
|
44
|
+
- **[`TacSdk`](./docs/sdks/tac_sdk.md)**: The main class for interacting with the TAC protocol.
|
|
45
|
+
- [`create`](./docs/sdks/tac_sdk.md#creating-an-instance-of-tacsdk): Initializes the SDK instance.
|
|
46
|
+
- [`sendCrossChainTransaction`](./docs/sdks/tac_sdk.md#sendcrosschaintransaction): Sends a cross-chain transaction from TON to TAC.
|
|
47
|
+
- [`getEVMTokenAddress`](./docs/sdks/tac_sdk.md#getevmtokenaddress): Gets the TAC address for a TON token.
|
|
48
|
+
- [`getTVMTokenAddress`](./docs/sdks/tac_sdk.md#gettvmtokenaddress): Gets the TON address for a TAC token.
|
|
49
|
+
- [`getSimulationInfo`](./docs/sdks/tac_sdk.md#getsimulationinfo): Performs a complete simulation of a crosschain transaction to estimate fees and gather execution-related metadata.
|
|
50
|
+
- [`getUserJettonBalance`](./docs/sdks/tac_sdk.md#getuserjettonbalance): Gets a user's Jetton balance (raw).
|
|
51
|
+
- [`getUserJettonBalanceExtended`](./docs/sdks/tac_sdk.md#getuserjettonbalanceextended): Gets extended Jetton balance info (including decimals).
|
|
52
|
+
- [`getUserJettonWalletAddress`](./docs/sdks/tac_sdk.md#getuserjettonwalletaddress): Calculates a user's Jetton wallet address.
|
|
53
|
+
- [`nativeTONAddress (getter)`](./docs/sdks/tac_sdk.md#nativetonaddress): Placeholder address for native TON.
|
|
54
|
+
- [`nativeTACAddress (method)`](./docs/sdks/tac_sdk.md#nativetacaddress): Gets the native asset address on the TAC chain.
|
|
55
|
+
- *(See file for more...)*
|
|
56
|
+
|
|
57
|
+
- **[`OperationTracker`](./docs/sdks/operation_tracker.md)**: Tools for monitoring cross-chain operation status.
|
|
58
|
+
- [`constructor`](./docs/sdks/operation_tracker.md#constructor): Creates a tracker instance.
|
|
59
|
+
- [`getOperationId`](./docs/sdks/operation_tracker.md#getoperationid): Retrieves the Operation ID from a `TransactionLinker`.
|
|
60
|
+
- [`getStageProfiling`](./docs/sdks/operation_tracker.md#getstageprofiling): Gets detailed timing and status for all stages of an operation.
|
|
61
|
+
- [`getSimplifiedOperationStatus`](./docs/sdks/operation_tracker.md#getsimplifiedoperationstatus): Gets a simplified overall status (Pending, Successful, Failed, Not Found).
|
|
62
|
+
- *(See file for more...)*
|
|
63
|
+
|
|
64
|
+
- **[`Senders`](./docs/sdks/sender.md)**: Handles signing and sending TON transactions.
|
|
65
|
+
- [`TonConnectSender`](./docs/sdks/sender.md#tonconnectsender): Implements sending via TonConnect UI.
|
|
66
|
+
- [`RawSender`](./docs/sdks/sender.md#rawsender): Implements sending using a raw private key.
|
|
67
|
+
|
|
68
|
+
- **[`Utilities`](./docs/sdks/utilities.md)**: Helper functions and interfaces.
|
|
69
|
+
- [`startTracking`](./docs/sdks/utilities.md#starttracking): Utility function to poll and log operation status to the console.
|
|
70
|
+
|
|
71
|
+
- **[`AgnosticSdk`](./docs/sdks/agnostic_proxy_sdk.md)**: Agnostic SDK for cross-chain interactions.
|
|
72
|
+
|
|
73
|
+
- **[`Simulator`](./docs/sdks/simulator.md)**: Transaction simulation capabilities.
|
|
74
|
+
|
|
75
|
+
- **[`TACTransactionManager`](./docs/sdks/tac_transaction_manager.md)**: Manages TAC-side transactions.
|
|
76
|
+
|
|
77
|
+
- **[`TONTransactionManager`](./docs/sdks/ton_transaction_manager.md)**: Manages TON-side transactions.
|
|
78
|
+
|
|
79
|
+
### Data Models
|
|
80
|
+
|
|
81
|
+
- **[`Enums`](./docs/models/enums.md)**: Key enumerations used by the SDK.
|
|
82
|
+
- [`Network`](./docs/models/enums.md#network): `TESTNET` or `MAINNET`.
|
|
83
|
+
- [`SimplifiedStatuses`](./docs/models/enums.md#simplifiedstatuses): `PENDING`, `FAILED`, `SUCCESSFUL`, `OPERATION_ID_NOT_FOUND`.
|
|
84
|
+
- [`OperationType`](./docs/models/enums.md#operationtype): Detailed operation types (`PENDING`, `TON_TAC_TON`, `ROLLBACK`, etc.).
|
|
85
|
+
- [`StageName`](./docs/models/enums.md#stagename): Identifiers for tracking stages (`COLLECTED_IN_TAC`, `EXECUTED_IN_TAC`, etc.).
|
|
86
|
+
|
|
87
|
+
- **[`Structs`](./docs/models/structs.md)**: Core data structures.
|
|
88
|
+
- [`AssetLike`](./docs/models/structs.md#assetlike): Flexible asset specification for cross-chain operations.
|
|
89
|
+
- [`EvmProxyMsg`](./docs/models/structs.md#evmproxymsg-type): Defines the target EVM call details.
|
|
90
|
+
- [`TransactionLinker`](./docs/models/structs.md#transactionlinker-type): Identifies a cross-chain operation.
|
|
91
|
+
- *(See file for more...)*
|
|
92
|
+
|
|
93
|
+
Navigate through the linked files for full details on parameters, return types, examples, and more.
|
|
94
|
+
|
|
95
|
+
### TACHeader
|
|
96
|
+
> **Note:** The TAC protocol only knows how to send data to contracts that inherit from a TacProxy (TacProxyV1) contract. Such a contract must have a strictly defined signature of its methods. It is specified below:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
function myProxyFunction(bytes calldata tacHeader, bytes calldata arguments) external onlyTacCCL {
|
|
100
|
+
// Function implementation
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> **Note:** methodName in `evmProxyMsg` must be either a simple method name or a signature of the form MethodName(bytes,bytes)
|
|
105
|
+
|
|
106
|
+
The first argument of methods must always be TACHeader. It is sent by protocol, augmented with data from executor.
|
|
107
|
+
- **`bytes tacHeader`**: Encoded structure TacHeaderV1, containing:
|
|
108
|
+
- **`uint64 shardsKey`**: ID you can specify for yourself an inside message to the TVM contract on the TON network.
|
|
109
|
+
- **`uint256 timestamp`**: The block timestamp on TON where the user's message was created.
|
|
110
|
+
- **`bytes32 operationId`**: Unique identifier for the message created by the TAC infrastructure.
|
|
111
|
+
- **`string tvmCaller`**: The TON user's wallet address that sent the message.
|
|
112
|
+
- **`bytes extraData`**: Untrusted extra data, provided by executor with the current message if needed. Otherwise, it's an empty bytes array.
|
|
113
|
+
|
|
114
|
+
You need to specify all the remaining data you need in tuple (bytes) in arguments. For example this is how arguments for addLiquidity method in UniswapV2 (a special proxy contract for it) will look like:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
const abi = new ethers.AbiCoder();
|
|
118
|
+
const encodedParameters = abi.encode(
|
|
119
|
+
['tuple(address,address,uint256,uint256,uint256,uint256,address,uint256)'],
|
|
120
|
+
[
|
|
121
|
+
[
|
|
122
|
+
EVM_TOKEN_A_ADDRESS,
|
|
123
|
+
EVM_TOKEN_B_ADDRESS,
|
|
124
|
+
amountA,
|
|
125
|
+
amountB,
|
|
126
|
+
amountAMin,
|
|
127
|
+
amountBMin,
|
|
128
|
+
UNISWAPV2_PROXY_ADDRESS,
|
|
129
|
+
deadline
|
|
130
|
+
]
|
|
131
|
+
]
|
|
132
|
+
);
|
|
133
|
+
```
|
|
134
|
+
More details in [sendAddLiquidity.ts](tests/uniswap_v2/sendAddLiquidity.ts) and in other tests.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Usage
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
import { TacSdk, AssetLike, EvmProxyMsg, SDKParams, Network, SenderFactory } from '@tonappchain/sdk';
|
|
142
|
+
import { TonConnectUI } from '@tonconnect/ui';
|
|
143
|
+
import { ethers } from 'ethers';
|
|
144
|
+
|
|
145
|
+
// Create EVM payload for DappProxy
|
|
146
|
+
const abi = new ethers.AbiCoder();
|
|
147
|
+
const encodedParameters = abi.encode(
|
|
148
|
+
['tuple(uint256,uint256,address[],address)'],
|
|
149
|
+
[
|
|
150
|
+
[
|
|
151
|
+
tokenAAmount,
|
|
152
|
+
tokenBAmount,
|
|
153
|
+
[EVMtokenAAddress, EVMtokenBAddress],
|
|
154
|
+
proxyDapp
|
|
155
|
+
]
|
|
156
|
+
]
|
|
157
|
+
);
|
|
158
|
+
const evmProxyMsg: EvmProxyMsg = {
|
|
159
|
+
evmTargetAddress: DappProxyAddress,
|
|
160
|
+
methodName: 'addLiquidity',
|
|
161
|
+
encodedParameters
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// Create jetton transfer messages corresponding to EVM tokens, e.g., two tokens for adding liquidity to a pool
|
|
165
|
+
const assets: AssetLike[] = [
|
|
166
|
+
{
|
|
167
|
+
address: TVMtokenAAddress,
|
|
168
|
+
amount: tokenAAmount,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
address: TVMtokenBAddress,
|
|
172
|
+
amount: tokenBAmount,
|
|
173
|
+
}
|
|
174
|
+
];
|
|
175
|
+
|
|
176
|
+
const sdkParams: SDKParams = {
|
|
177
|
+
network: Network.TESTNET
|
|
178
|
+
};
|
|
179
|
+
const tacSdk = await TacSdk.create(sdkParams);
|
|
180
|
+
|
|
181
|
+
//Send transaction via tonConnect or mnemonic
|
|
182
|
+
const tonConnectUI = new TonConnectUI({
|
|
183
|
+
manifestUrl: config.tonconnectManifestUrl as string
|
|
184
|
+
});
|
|
185
|
+
const sender = await SenderFactory.getSender({
|
|
186
|
+
tonConnect: tonConnectUI
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
await tacSdk.sendCrossChainTransaction(evmProxyMsg, sender, assets);
|
|
190
|
+
|
|
191
|
+
tacSdk.closeConnections();
|
|
192
|
+
```
|
|
193
|
+
For a detailed example, see `tests/uniswap_v2/sendSwap.ts` or `tests/uniswap_v2/sendRemoveLiquidity.ts`, which demonstrates swapping tokens and removing liquidity on Uniswap and tracking the transaction status.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
197
199
|
MIT
|
|
@@ -170,7 +170,7 @@ class DebugHelpers {
|
|
|
170
170
|
const perspective = isFromSA ? 'Smart Account' : 'Proxy Contract';
|
|
171
171
|
const valueStr = value > 0n ? ` (sending ${ethers_1.ethers.formatEther(value)} ETH)` : '';
|
|
172
172
|
const replacementStr = hasReplacements ? ' 🔄 [with dynamic value replacement]' : '';
|
|
173
|
-
return `📞 Custom call to ${this._formatAddress(contractAddress)} from ${perspective}${valueStr}
|
|
173
|
+
return `📞 Custom call to ${this._formatAddress(contractAddress)} from ${perspective}${valueStr}
|
|
174
174
|
Function: ${functionDescription}${replacementStr}`;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
@@ -30,3 +30,4 @@ export declare const missingGasLimitError: FormatError;
|
|
|
30
30
|
export declare const missingDecimals: MetadataError;
|
|
31
31
|
export declare const missingJettonDataError: MetadataError;
|
|
32
32
|
export declare const zeroRawAmountError: (assetAddress: string) => TokenError;
|
|
33
|
+
export declare const sendCrossChainTransactionFailedError: (msg: string) => WalletError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zeroRawAmountError = exports.missingJettonDataError = exports.missingDecimals = exports.missingGasLimitError = exports.missingTvmExecutorFeeError = exports.missingFeeParamsError = exports.getTONFeeInfoFetchError = exports.simulationFetchError = exports.convertCurrencyFetchError = exports.indexRequiredError = exports.unknownTokenTypeError = exports.insufficientBalanceError = exports.allContractOpenerFailedError = exports.allEndpointsFailedError = exports.noValidGroupFoundError = exports.prepareMessageGroupError = exports.invalidAssetType = exports.emptyArrayError = exports.profilingFetchError = exports.invalidMethodNameError = exports.emptySettingError = exports.prefixError = exports.notMultiplyOf8Error = exports.unsupportedFormatError = exports.unsupportedKeyError = exports.unknownWalletError = exports.evmAddressError = exports.tvmAddressError = exports.statusFetchError = exports.operationFetchError = exports.emptyContractError = void 0;
|
|
3
|
+
exports.sendCrossChainTransactionFailedError = exports.zeroRawAmountError = exports.missingJettonDataError = exports.missingDecimals = exports.missingGasLimitError = exports.missingTvmExecutorFeeError = exports.missingFeeParamsError = exports.getTONFeeInfoFetchError = exports.simulationFetchError = exports.convertCurrencyFetchError = exports.indexRequiredError = exports.unknownTokenTypeError = exports.insufficientBalanceError = exports.allContractOpenerFailedError = exports.allEndpointsFailedError = exports.noValidGroupFoundError = exports.prepareMessageGroupError = exports.invalidAssetType = exports.emptyArrayError = exports.profilingFetchError = exports.invalidMethodNameError = exports.emptySettingError = exports.prefixError = exports.notMultiplyOf8Error = exports.unsupportedFormatError = exports.unsupportedKeyError = exports.unknownWalletError = exports.evmAddressError = exports.tvmAddressError = exports.statusFetchError = exports.operationFetchError = exports.emptyContractError = void 0;
|
|
4
4
|
const errors_1 = require("./errors");
|
|
5
5
|
exports.emptyContractError = new errors_1.ContractError('unexpected empty contract code of given jetton.', 100);
|
|
6
6
|
const operationFetchError = (msg, inner) => new errors_1.FetchError(`failed to fetch OperationId: ${msg}`, 101, inner);
|
|
@@ -53,3 +53,5 @@ exports.missingDecimals = new errors_1.MetadataError('Missing decimals in jetton
|
|
|
53
53
|
exports.missingJettonDataError = new errors_1.MetadataError('Jetton data should be available for TON origin', 129);
|
|
54
54
|
const zeroRawAmountError = (assetAddress) => new errors_1.TokenError(`FT asset with zero rawAmount/amount is not allowed: ${assetAddress}`, 130);
|
|
55
55
|
exports.zeroRawAmountError = zeroRawAmountError;
|
|
56
|
+
const sendCrossChainTransactionFailedError = (msg) => new errors_1.WalletError(`failed to send cross chain transaction: ${msg}`, 131);
|
|
57
|
+
exports.sendCrossChainTransactionFailedError = sendCrossChainTransactionFailedError;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import type { SenderAbstraction } from '../sender';
|
|
2
|
-
import {
|
|
2
|
+
import { BatchCrossChainTx, CrossChainTransactionsOptions, CrosschainTx, EvmProxyMsg, TransactionLinkerWithOperationId } from '../structs/Struct';
|
|
3
3
|
export interface ITONTransactionManager {
|
|
4
4
|
/**
|
|
5
5
|
* Sends a single cross-chain transaction.
|
|
6
6
|
* @param evmProxyMsg Encoded EVM proxy message to bridge.
|
|
7
7
|
* @param sender Sender abstraction for TVM message sending.
|
|
8
8
|
* @param tx cross-chain transaction to bridge.
|
|
9
|
-
* @param waitOptions Optional policy to wait for operation id resolution.
|
|
10
9
|
* @returns Transaction linker with operation id for tracking.
|
|
11
10
|
*/
|
|
12
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, tx: CrosschainTx
|
|
11
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, tx: CrosschainTx): Promise<TransactionLinkerWithOperationId>;
|
|
13
12
|
/**
|
|
14
13
|
* Sends multiple cross-chain transactions in a batch.
|
|
15
14
|
* @param sender Sender abstraction for TVM message sending.
|
|
16
15
|
* @param txs List of cross-chain transactions to bridge.
|
|
17
|
-
* @param
|
|
16
|
+
* @param options Optional options controlling waiting behavior for operation ids.
|
|
18
17
|
* @returns Array of transaction linkers, one per submitted transaction.
|
|
19
18
|
*/
|
|
20
|
-
sendCrossChainTransactions(sender: SenderAbstraction, txs:
|
|
19
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: BatchCrossChainTx[], options?: CrossChainTransactionsOptions): Promise<TransactionLinkerWithOperationId[]>;
|
|
21
20
|
}
|
|
@@ -2,7 +2,7 @@ import { Wallet } from 'ethers';
|
|
|
2
2
|
import { JettonMinterData, NFTItemData } from '../../artifacts/tonTypes';
|
|
3
3
|
import { FT, NFT } from '../assets';
|
|
4
4
|
import type { SenderAbstraction } from '../sender';
|
|
5
|
-
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, AssetLike, CrossChainTransactionOptions,
|
|
5
|
+
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, AssetLike, BatchCrossChainTxWithAssetLike, CrossChainTransactionOptions, CrossChainTransactionsOptions, CrosschainTx, EVMAddress, EvmProxyMsg, ExecutionFeeEstimationResult, NFTAddressType, SuggestedTVMExecutorFee, TACSimulationParams, TACSimulationResult, TransactionLinkerWithOperationId, TVMAddress, UserWalletBalanceExtended, WaitOptions } from '../structs/Struct';
|
|
6
6
|
import { Asset } from './Asset';
|
|
7
7
|
import { IConfiguration } from './IConfiguration';
|
|
8
8
|
import { IOperationTracker } from './IOperationTracker';
|
|
@@ -98,10 +98,10 @@ export interface ITacSDK {
|
|
|
98
98
|
* Sends multiple cross-chain transactions in one batch and optionally waits for tracking info.
|
|
99
99
|
* @param sender Sender abstraction for signing/sending TVM messages.
|
|
100
100
|
* @param txs Array of cross-chain transactions to broadcast.
|
|
101
|
-
* @param
|
|
101
|
+
* @param options Optional options controlling waiting behavior for operation ids.
|
|
102
102
|
* @returns Promise with an array of TransactionLinkerWithOperationId for each submitted transaction.
|
|
103
103
|
*/
|
|
104
|
-
sendCrossChainTransactions(sender: SenderAbstraction, txs:
|
|
104
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: BatchCrossChainTxWithAssetLike[], options?: CrossChainTransactionsOptions): Promise<TransactionLinkerWithOperationId[]>;
|
|
105
105
|
/**
|
|
106
106
|
* Bridges tokens/value from EVM to TON chain via the executor.
|
|
107
107
|
* @param signer Ethers Wallet used to sign the EVM-side transaction.
|
|
@@ -15,10 +15,18 @@ class LiteSequencerClient {
|
|
|
15
15
|
const isEthHash = /^0x[a-fA-F0-9]{64}$/.test(transactionHash);
|
|
16
16
|
const path = isEthHash ? 'tac/operation-id' : 'ton/operation-id';
|
|
17
17
|
try {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
if (isEthHash) {
|
|
19
|
+
const response = await this.httpClient.get(new URL(path, this.endpoint).toString(), {
|
|
20
|
+
params: { transactionHash },
|
|
21
|
+
});
|
|
22
|
+
return response.data.response?.operationId || '';
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const response = await this.httpClient.get(new URL(path, this.endpoint).toString(), {
|
|
26
|
+
params: { transactionHash },
|
|
27
|
+
});
|
|
28
|
+
return response.data.response || '';
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
31
|
catch (error) {
|
|
24
32
|
if (error?.response?.status === 404) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IConfiguration, ILogger, IOperationTracker, ISimulator, ITONTransactionManager } from '../interfaces';
|
|
2
2
|
import type { SenderAbstraction } from '../sender';
|
|
3
|
-
import {
|
|
3
|
+
import { BatchCrossChainTx, CrossChainTransactionsOptions, CrosschainTx, EvmProxyMsg, TransactionLinkerWithOperationId } from '../structs/Struct';
|
|
4
4
|
export declare class TONTransactionManager implements ITONTransactionManager {
|
|
5
5
|
private readonly config;
|
|
6
6
|
private readonly simulator;
|
|
@@ -10,8 +10,8 @@ export declare class TONTransactionManager implements ITONTransactionManager {
|
|
|
10
10
|
private buildFeeParams;
|
|
11
11
|
private prepareCrossChainTransaction;
|
|
12
12
|
private generateCrossChainMessages;
|
|
13
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, tx: CrosschainTx
|
|
14
|
-
sendCrossChainTransactions(sender: SenderAbstraction, txs:
|
|
13
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, tx: CrosschainTx): Promise<TransactionLinkerWithOperationId>;
|
|
14
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: BatchCrossChainTx[], options?: CrossChainTransactionsOptions): Promise<TransactionLinkerWithOperationId[]>;
|
|
15
15
|
private prepareBatchTransactions;
|
|
16
16
|
private waitForOperationIds;
|
|
17
17
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TONTransactionManager = void 0;
|
|
4
4
|
const assets_1 = require("../assets");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const instances_1 = require("../errors/instances");
|
|
6
7
|
const Consts_1 = require("./Consts");
|
|
7
8
|
const Logger_1 = require("./Logger");
|
|
8
9
|
const Utils_1 = require("./Utils");
|
|
@@ -136,17 +137,21 @@ class TONTransactionManager {
|
|
|
136
137
|
this.logger.debug('Cross-chain messages generated successfully');
|
|
137
138
|
return messages;
|
|
138
139
|
}
|
|
139
|
-
async sendCrossChainTransaction(evmProxyMsg, sender, tx
|
|
140
|
+
async sendCrossChainTransaction(evmProxyMsg, sender, tx) {
|
|
140
141
|
const { transaction, transactionLinker } = await this.prepareCrossChainTransaction(evmProxyMsg, sender, tx.assets, tx.options);
|
|
141
142
|
await assets_1.TON.checkBalance(sender, this.config, [transaction]);
|
|
142
143
|
this.logger.debug(`Sending transaction: ${(0, Utils_1.formatObjectForLogging)(transactionLinker)}`);
|
|
143
144
|
const sendTransactionResult = await sender.sendShardTransaction(transaction, this.config.network, this.config.TONParams.contractOpener);
|
|
144
|
-
if (!
|
|
145
|
+
if (!sendTransactionResult.success || sendTransactionResult.error) {
|
|
146
|
+
throw (0, instances_1.sendCrossChainTransactionFailedError)(sendTransactionResult.error?.message ?? 'Transaction failed to send');
|
|
147
|
+
}
|
|
148
|
+
const shouldWaitForOperationId = tx.options?.waitOperationId ?? true;
|
|
149
|
+
if (!shouldWaitForOperationId) {
|
|
145
150
|
return { sendTransactionResult, ...transactionLinker };
|
|
146
151
|
}
|
|
147
152
|
const operationId = await this.operationTracker
|
|
148
153
|
.getOperationId(transactionLinker, {
|
|
149
|
-
...waitOptions,
|
|
154
|
+
...(tx.options?.waitOptions ?? {}),
|
|
150
155
|
successCheck: (id) => !!id,
|
|
151
156
|
logger: this.logger,
|
|
152
157
|
})
|
|
@@ -156,15 +161,21 @@ class TONTransactionManager {
|
|
|
156
161
|
});
|
|
157
162
|
return { sendTransactionResult, operationId, ...transactionLinker };
|
|
158
163
|
}
|
|
159
|
-
async sendCrossChainTransactions(sender, txs,
|
|
164
|
+
async sendCrossChainTransactions(sender, txs, options) {
|
|
160
165
|
const caller = sender.getSenderAddress();
|
|
161
166
|
this.logger.debug(`Preparing ${txs.length} cross-chain transactions for ${caller}`);
|
|
162
167
|
const { transactions, transactionLinkers } = await this.prepareBatchTransactions(txs, sender);
|
|
163
168
|
await assets_1.TON.checkBalance(sender, this.config, transactions);
|
|
164
169
|
this.logger.debug(`Sending transactions: ${(0, Utils_1.formatObjectForLogging)(transactionLinkers)}`);
|
|
165
|
-
await sender.sendShardTransactions(transactions, this.config.network, this.config.TONParams.contractOpener);
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
const results = await sender.sendShardTransactions(transactions, this.config.network, this.config.TONParams.contractOpener);
|
|
171
|
+
for (const result of results) {
|
|
172
|
+
if (!result.success || result.error) {
|
|
173
|
+
throw (0, instances_1.sendCrossChainTransactionFailedError)(result.error?.message ?? 'Transaction failed to send');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const shouldWaitForOperationIds = options?.waitOperationIds ?? true;
|
|
177
|
+
return shouldWaitForOperationIds
|
|
178
|
+
? await this.waitForOperationIds(transactionLinkers, caller, options?.waitOptions ?? {})
|
|
168
179
|
: transactionLinkers;
|
|
169
180
|
}
|
|
170
181
|
async prepareBatchTransactions(txs, sender) {
|
package/dist/src/sdk/TacSdk.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { JettonMinterData, NFTItemData } from '../../artifacts/tonTypes';
|
|
|
3
3
|
import { FT, NFT } from '../assets';
|
|
4
4
|
import { IConfiguration, ILogger, IOperationTracker, ITacSDK } from '../interfaces';
|
|
5
5
|
import type { SenderAbstraction } from '../sender';
|
|
6
|
-
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, AssetLike, CrossChainTransactionOptions,
|
|
6
|
+
import { AssetFromFTArg, AssetFromNFTCollectionArg, AssetFromNFTItemArg, AssetLike, BatchCrossChainTxWithAssetLike, CrossChainTransactionOptions, CrossChainTransactionsOptions, CrosschainTx, EVMAddress, EvmProxyMsg, ExecutionFeeEstimationResult, NFTAddressType, SDKParams, SuggestedTVMExecutorFee, TACSimulationParams, TACSimulationResult, TransactionLinkerWithOperationId, TVMAddress, UserWalletBalanceExtended } from '../structs/Struct';
|
|
7
7
|
export declare class TacSdk implements ITacSDK {
|
|
8
8
|
readonly config: IConfiguration;
|
|
9
9
|
readonly operationTracker: IOperationTracker;
|
|
@@ -20,8 +20,8 @@ export declare class TacSdk implements ITacSDK {
|
|
|
20
20
|
get getTrustedTONExecutors(): string[];
|
|
21
21
|
getSimulationInfo(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: AssetLike[], options?: CrossChainTransactionOptions): Promise<ExecutionFeeEstimationResult>;
|
|
22
22
|
getTVMExecutorFeeInfo(assets: AssetLike[], feeSymbol: string, tvmValidExecutors?: string[]): Promise<SuggestedTVMExecutorFee>;
|
|
23
|
-
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: AssetLike[], options?: CrossChainTransactionOptions
|
|
24
|
-
sendCrossChainTransactions(sender: SenderAbstraction, txs:
|
|
23
|
+
sendCrossChainTransaction(evmProxyMsg: EvmProxyMsg, sender: SenderAbstraction, assets?: AssetLike[], options?: CrossChainTransactionOptions): Promise<TransactionLinkerWithOperationId>;
|
|
24
|
+
sendCrossChainTransactions(sender: SenderAbstraction, txs: BatchCrossChainTxWithAssetLike[], options?: CrossChainTransactionsOptions): Promise<TransactionLinkerWithOperationId[]>;
|
|
25
25
|
bridgeTokensToTON(signer: Wallet, value: bigint, tonTarget: string, assets?: AssetLike[], tvmExecutorFee?: bigint, tvmValidExecutors?: string[]): Promise<string>;
|
|
26
26
|
isContractDeployedOnTVM(address: string): Promise<boolean>;
|
|
27
27
|
simulateTACMessage(req: TACSimulationParams): Promise<TACSimulationResult>;
|
package/dist/src/sdk/TacSdk.js
CHANGED
|
@@ -77,18 +77,18 @@ class TacSdk {
|
|
|
77
77
|
};
|
|
78
78
|
return this.operationTracker.getTVMExecutorFee(params);
|
|
79
79
|
}
|
|
80
|
-
async sendCrossChainTransaction(evmProxyMsg, sender, assets = [], options
|
|
80
|
+
async sendCrossChainTransaction(evmProxyMsg, sender, assets = [], options) {
|
|
81
81
|
const normalizedAssets = await (0, Utils_1.normalizeAssets)(this.config, assets);
|
|
82
82
|
const tx = { evmProxyMsg, assets: normalizedAssets, options };
|
|
83
|
-
return this.tonTransactionManager.sendCrossChainTransaction(evmProxyMsg, sender, tx
|
|
83
|
+
return this.tonTransactionManager.sendCrossChainTransaction(evmProxyMsg, sender, tx);
|
|
84
84
|
}
|
|
85
|
-
async sendCrossChainTransactions(sender, txs,
|
|
85
|
+
async sendCrossChainTransactions(sender, txs, options) {
|
|
86
86
|
const normalizedTxs = await Promise.all(txs.map(async (tx) => ({
|
|
87
87
|
evmProxyMsg: tx.evmProxyMsg,
|
|
88
88
|
options: tx.options,
|
|
89
89
|
assets: await (0, Utils_1.normalizeAssets)(this.config, tx.assets),
|
|
90
90
|
})));
|
|
91
|
-
return this.tonTransactionManager.sendCrossChainTransactions(sender, normalizedTxs,
|
|
91
|
+
return this.tonTransactionManager.sendCrossChainTransactions(sender, normalizedTxs, options);
|
|
92
92
|
}
|
|
93
93
|
async bridgeTokensToTON(signer, value, tonTarget, assets, tvmExecutorFee, tvmValidExecutors) {
|
|
94
94
|
const normalizedAssets = await (0, Utils_1.normalizeAssets)(this.config, assets);
|
|
@@ -54,6 +54,11 @@ export type StageProfilingResponse = ResponseBase<ExecutionStagesByOperationId>;
|
|
|
54
54
|
export type TACSimulationResponse = ResponseBase<TACSimulationResult>;
|
|
55
55
|
export type SuggestedTVMExecutorFeeResponse = ResponseBase<SuggestedTVMExecutorFee>;
|
|
56
56
|
export type ConvertCurrencyResponse = ResponseBase<ConvertedCurrencyRawResult>;
|
|
57
|
+
export type OperationIdWithLogIndex = {
|
|
58
|
+
operationId: string;
|
|
59
|
+
logIndex: number;
|
|
60
|
+
};
|
|
61
|
+
export type OperationIdWithLogIndexResponse = ResponseBase<OperationIdWithLogIndex>;
|
|
57
62
|
export interface SendResult {
|
|
58
63
|
success: boolean;
|
|
59
64
|
result?: unknown;
|
|
@@ -287,6 +287,13 @@ export type CrossChainTransactionOptions = {
|
|
|
287
287
|
calculateRollbackFee?: boolean;
|
|
288
288
|
withoutSimulation?: boolean;
|
|
289
289
|
validateAssetsBalance?: boolean;
|
|
290
|
+
waitOperationId?: boolean;
|
|
291
|
+
waitOptions?: WaitOptions<string>;
|
|
292
|
+
};
|
|
293
|
+
export type BatchCrossChainTransactionOptions = Omit<CrossChainTransactionOptions, 'waitOperationId' | 'waitOptions'>;
|
|
294
|
+
export type CrossChainTransactionsOptions = {
|
|
295
|
+
waitOperationIds?: boolean;
|
|
296
|
+
waitOptions?: WaitOptions<OperationIdsByShardsKey>;
|
|
290
297
|
};
|
|
291
298
|
export type ExecutionFeeEstimationResult = {
|
|
292
299
|
feeParams: FeeParams;
|
|
@@ -297,6 +304,11 @@ export type CrosschainTx = {
|
|
|
297
304
|
assets?: Asset[];
|
|
298
305
|
options?: CrossChainTransactionOptions;
|
|
299
306
|
};
|
|
307
|
+
export type BatchCrossChainTx = {
|
|
308
|
+
evmProxyMsg: EvmProxyMsg;
|
|
309
|
+
assets?: Asset[];
|
|
310
|
+
options?: BatchCrossChainTransactionOptions;
|
|
311
|
+
};
|
|
300
312
|
export type AssetLike = Asset | FT | NFT | {
|
|
301
313
|
rawAmount: bigint;
|
|
302
314
|
} | {
|
|
@@ -313,7 +325,7 @@ export type AssetLike = Asset | FT | NFT | {
|
|
|
313
325
|
address: TVMAddress | EVMAddress;
|
|
314
326
|
itemIndex: bigint;
|
|
315
327
|
};
|
|
316
|
-
export type
|
|
328
|
+
export type BatchCrossChainTxWithAssetLike = Omit<BatchCrossChainTx, 'assets'> & {
|
|
317
329
|
assets?: AssetLike[];
|
|
318
330
|
};
|
|
319
331
|
export interface WaitOptions<T = unknown, TContext = unknown> {
|
package/package.json
CHANGED
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tonappchain/sdk",
|
|
3
|
-
"version": "0.7.0-
|
|
4
|
-
"repository": "https://github.com/TacBuild/tac-sdk.git",
|
|
5
|
-
"author": "TAC. <developers@tac>",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "dist/src/index.js",
|
|
8
|
-
"types": "dist/src/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"node": {
|
|
12
|
-
"types": "./dist/src/index.d.ts",
|
|
13
|
-
"require": "./dist/src/index.js",
|
|
14
|
-
"import": "./dist/src/index.js"
|
|
15
|
-
},
|
|
16
|
-
"browser": {
|
|
17
|
-
"types": "./dist/src/index.d.ts",
|
|
18
|
-
"import": "./dist/src/index.js"
|
|
19
|
-
},
|
|
20
|
-
"types": "./dist/src/index.d.ts",
|
|
21
|
-
"require": "./dist/src/index.js",
|
|
22
|
-
"import": "./dist/src/index.js",
|
|
23
|
-
"default": "./dist/src/index.js"
|
|
24
|
-
},
|
|
25
|
-
"./package.json": "./package.json",
|
|
26
|
-
"./dist": null,
|
|
27
|
-
"./dist/*": null,
|
|
28
|
-
"./src": null,
|
|
29
|
-
"./src/*": null,
|
|
30
|
-
"./artifacts": {
|
|
31
|
-
"types": "./dist/artifacts/index.d.ts",
|
|
32
|
-
"import": "./dist/artifacts/index.js",
|
|
33
|
-
"require": "./dist/artifacts/index.js"
|
|
34
|
-
},
|
|
35
|
-
"./artifacts/types/ton": {
|
|
36
|
-
"types": "./dist/artifacts/tonTypes.d.ts",
|
|
37
|
-
"import": "./dist/artifacts/tonTypes.js",
|
|
38
|
-
"require": "./dist/artifacts/tonTypes.js"
|
|
39
|
-
},
|
|
40
|
-
"./artifacts/types/tac": {
|
|
41
|
-
"types": "./dist/artifacts/tacTypes.d.ts",
|
|
42
|
-
"import": "./dist/artifacts/tacTypes.js",
|
|
43
|
-
"require": "./dist/artifacts/tacTypes.js"
|
|
44
|
-
},
|
|
45
|
-
"./artifacts/*": null,
|
|
46
|
-
"./*": null
|
|
47
|
-
},
|
|
48
|
-
"files": [
|
|
49
|
-
"dist"
|
|
50
|
-
],
|
|
51
|
-
"scripts": {
|
|
52
|
-
"prebuild": "git submodule update --init --recursive --remote",
|
|
53
|
-
"litebuild": "rm -rf dist && tsc --declaration",
|
|
54
|
-
"build": "rm -rf dist && npm run build:artifacts && tsc --declaration",
|
|
55
|
-
"build:artifacts:tac:dev": "cd artifacts/dev/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
56
|
-
"build:artifacts:ton:dev": "cd artifacts/dev/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
57
|
-
"build:artifacts:tac:testnet": "cd artifacts/testnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
58
|
-
"build:artifacts:ton:testnet": "cd artifacts/testnet/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
59
|
-
"build:artifacts:tac:mainnet": "cd artifacts/mainnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
60
|
-
"build:artifacts:ton:mainnet": "cd artifacts/mainnet/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
61
|
-
"build:artifacts:ton:all": "npm run build:artifacts:ton:dev && npm run build:artifacts:ton:testnet && npm run build:artifacts:ton:mainnet",
|
|
62
|
-
"build:artifacts:tac:all": "npm run build:artifacts:tac:dev && npm run build:artifacts:tac:testnet && npm run build:artifacts:tac:mainnet",
|
|
63
|
-
"build:artifacts": "npm run prebuild && npm run build:artifacts:ton:all && npm run build:artifacts:tac:all",
|
|
64
|
-
"test": "jest --verbose --runInBand",
|
|
65
|
-
"release": "yarn build && yarn release-it --npm.yarn1",
|
|
66
|
-
"lint": "eslint .",
|
|
67
|
-
"lint:fix": "eslint . --fix",
|
|
68
|
-
"prettier": "prettier --ignore-path .gitignore --write \"./src/**/*.+(js|ts|json)\""
|
|
69
|
-
},
|
|
70
|
-
"dependencies": {
|
|
71
|
-
"@aws-crypto/sha256-js": "^5.2.0",
|
|
72
|
-
"@orbs-network/ton-access": "^2.3.3",
|
|
73
|
-
"@ton/ton": "15.1.0",
|
|
74
|
-
"@tonappchain/ton-lite-client": "3.0.6",
|
|
75
|
-
"@tonconnect/ui": "^2.0.11",
|
|
76
|
-
"bn.js": "^5.2.1",
|
|
77
|
-
"cli-table3": "^0.6.5",
|
|
78
|
-
"dotenv": "^16.4.7",
|
|
79
|
-
"ethers": "^6.13.5",
|
|
80
|
-
"ton-crypto": "^3.2.0"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@
|
|
89
|
-
"@ton/
|
|
90
|
-
"@
|
|
91
|
-
"@types/
|
|
92
|
-
"
|
|
93
|
-
"eslint": "^
|
|
94
|
-
"eslint-
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"ts-
|
|
99
|
-
"
|
|
100
|
-
"typescript": "^
|
|
101
|
-
"
|
|
102
|
-
},
|
|
103
|
-
"publishConfig": {
|
|
104
|
-
"access": "public",
|
|
105
|
-
"registry": "https://registry.npmjs.org/"
|
|
106
|
-
},
|
|
107
|
-
"release-it": {
|
|
108
|
-
"plugins": {
|
|
109
|
-
"@release-it/keep-a-changelog": {
|
|
110
|
-
"filename": "CHANGELOG.md"
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"npm": {
|
|
114
|
-
"publish": false
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
118
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tonappchain/sdk",
|
|
3
|
+
"version": "0.7.0-rc28",
|
|
4
|
+
"repository": "https://github.com/TacBuild/tac-sdk.git",
|
|
5
|
+
"author": "TAC. <developers@tac>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/src/index.js",
|
|
8
|
+
"types": "dist/src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"node": {
|
|
12
|
+
"types": "./dist/src/index.d.ts",
|
|
13
|
+
"require": "./dist/src/index.js",
|
|
14
|
+
"import": "./dist/src/index.js"
|
|
15
|
+
},
|
|
16
|
+
"browser": {
|
|
17
|
+
"types": "./dist/src/index.d.ts",
|
|
18
|
+
"import": "./dist/src/index.js"
|
|
19
|
+
},
|
|
20
|
+
"types": "./dist/src/index.d.ts",
|
|
21
|
+
"require": "./dist/src/index.js",
|
|
22
|
+
"import": "./dist/src/index.js",
|
|
23
|
+
"default": "./dist/src/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
"./dist": null,
|
|
27
|
+
"./dist/*": null,
|
|
28
|
+
"./src": null,
|
|
29
|
+
"./src/*": null,
|
|
30
|
+
"./artifacts": {
|
|
31
|
+
"types": "./dist/artifacts/index.d.ts",
|
|
32
|
+
"import": "./dist/artifacts/index.js",
|
|
33
|
+
"require": "./dist/artifacts/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./artifacts/types/ton": {
|
|
36
|
+
"types": "./dist/artifacts/tonTypes.d.ts",
|
|
37
|
+
"import": "./dist/artifacts/tonTypes.js",
|
|
38
|
+
"require": "./dist/artifacts/tonTypes.js"
|
|
39
|
+
},
|
|
40
|
+
"./artifacts/types/tac": {
|
|
41
|
+
"types": "./dist/artifacts/tacTypes.d.ts",
|
|
42
|
+
"import": "./dist/artifacts/tacTypes.js",
|
|
43
|
+
"require": "./dist/artifacts/tacTypes.js"
|
|
44
|
+
},
|
|
45
|
+
"./artifacts/*": null,
|
|
46
|
+
"./*": null
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"prebuild": "git submodule update --init --recursive --remote",
|
|
53
|
+
"litebuild": "rm -rf dist && tsc --declaration",
|
|
54
|
+
"build": "rm -rf dist && npm run build:artifacts && tsc --declaration",
|
|
55
|
+
"build:artifacts:tac:dev": "cd artifacts/dev/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
56
|
+
"build:artifacts:ton:dev": "cd artifacts/dev/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
57
|
+
"build:artifacts:tac:testnet": "cd artifacts/testnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
58
|
+
"build:artifacts:ton:testnet": "cd artifacts/testnet/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
59
|
+
"build:artifacts:tac:mainnet": "cd artifacts/mainnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
60
|
+
"build:artifacts:ton:mainnet": "cd artifacts/mainnet/l1_tvm_ton && npm i && npm run compile:ts && npm run build:all && rsync -avh --delete ./build ./wrappers ../ton/internal/",
|
|
61
|
+
"build:artifacts:ton:all": "npm run build:artifacts:ton:dev && npm run build:artifacts:ton:testnet && npm run build:artifacts:ton:mainnet",
|
|
62
|
+
"build:artifacts:tac:all": "npm run build:artifacts:tac:dev && npm run build:artifacts:tac:testnet && npm run build:artifacts:tac:mainnet",
|
|
63
|
+
"build:artifacts": "npm run prebuild && npm run build:artifacts:ton:all && npm run build:artifacts:tac:all",
|
|
64
|
+
"test": "jest --verbose --runInBand",
|
|
65
|
+
"release": "yarn build && yarn release-it --npm.yarn1",
|
|
66
|
+
"lint": "eslint .",
|
|
67
|
+
"lint:fix": "eslint . --fix",
|
|
68
|
+
"prettier": "prettier --ignore-path .gitignore --write \"./src/**/*.+(js|ts|json)\""
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@aws-crypto/sha256-js": "^5.2.0",
|
|
72
|
+
"@orbs-network/ton-access": "^2.3.3",
|
|
73
|
+
"@ton/ton": "15.1.0",
|
|
74
|
+
"@tonappchain/ton-lite-client": "3.0.6",
|
|
75
|
+
"@tonconnect/ui": "^2.0.11",
|
|
76
|
+
"bn.js": "^5.2.1",
|
|
77
|
+
"cli-table3": "^0.6.5",
|
|
78
|
+
"dotenv": "^16.4.7",
|
|
79
|
+
"ethers": "^6.13.5",
|
|
80
|
+
"ton-crypto": "^3.2.0"
|
|
81
|
+
},
|
|
82
|
+
"keywords": [],
|
|
83
|
+
"description": "",
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@eslint/js": "^9.21.0",
|
|
86
|
+
"@jest/globals": "^29.7.0",
|
|
87
|
+
"@release-it/keep-a-changelog": "^6.0.0",
|
|
88
|
+
"@ton/sandbox": "^0.27.1",
|
|
89
|
+
"@ton/test-utils": "^0.5.0",
|
|
90
|
+
"@types/bn.js": "^5.1.6",
|
|
91
|
+
"@types/jest": "^29.5.14",
|
|
92
|
+
"eslint": "^9.21.0",
|
|
93
|
+
"eslint-config-prettier": "^10.0.2",
|
|
94
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
95
|
+
"jest": "^29.7.0",
|
|
96
|
+
"prettier": "^3.5.3",
|
|
97
|
+
"ts-jest": "^29.2.6",
|
|
98
|
+
"ts-node": "^10.9.2",
|
|
99
|
+
"typescript": "^5.7.3",
|
|
100
|
+
"typescript-eslint": "^8.17.0",
|
|
101
|
+
"yarn": "^1.22.22"
|
|
102
|
+
},
|
|
103
|
+
"publishConfig": {
|
|
104
|
+
"access": "public",
|
|
105
|
+
"registry": "https://registry.npmjs.org/"
|
|
106
|
+
},
|
|
107
|
+
"release-it": {
|
|
108
|
+
"plugins": {
|
|
109
|
+
"@release-it/keep-a-changelog": {
|
|
110
|
+
"filename": "CHANGELOG.md"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"npm": {
|
|
114
|
+
"publish": false
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
118
|
+
}
|