@tonappchain/sdk 0.7.2 → 0.7.3-rc2
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 +203 -199
- package/dist/artifacts/dev/index.d.ts +2 -2
- package/dist/artifacts/dev/index.js +2 -1
- package/dist/artifacts/dev/ton/endpoints.d.ts +1 -0
- package/dist/artifacts/dev/ton/endpoints.js +2 -1
- package/dist/artifacts/mainnet/index.d.ts +2 -2
- package/dist/artifacts/mainnet/index.js +2 -1
- package/dist/artifacts/mainnet/ton/endpoints.d.ts +1 -0
- package/dist/artifacts/mainnet/ton/endpoints.js +2 -1
- package/dist/artifacts/testnet/index.d.ts +2 -2
- package/dist/artifacts/testnet/index.js +2 -1
- package/dist/artifacts/testnet/ton/endpoints.d.ts +1 -0
- package/dist/artifacts/testnet/ton/endpoints.js +2 -1
- package/dist/src/adapters/BaseContractOpener.js +8 -5
- package/dist/src/adapters/RetryableContractOpener.d.ts +6 -1
- package/dist/src/adapters/RetryableContractOpener.js +35 -8
- package/dist/src/adapters/ToncenterV3Indexer.d.ts +34 -0
- package/dist/src/adapters/ToncenterV3Indexer.js +123 -0
- package/dist/src/adapters/index.d.ts +1 -0
- package/dist/src/adapters/index.js +1 -0
- package/dist/src/assets/AssetFactory.d.ts +4 -1
- package/dist/src/assets/AssetFactory.js +4 -0
- package/dist/src/assets/FT.d.ts +3 -3
- package/dist/src/assets/FT.js +28 -15
- package/dist/src/assets/NFT.d.ts +3 -3
- package/dist/src/assets/NFT.js +10 -4
- package/dist/src/assets/TAC.d.ts +24 -0
- package/dist/src/assets/TAC.js +74 -0
- package/dist/src/assets/TON.d.ts +3 -3
- package/dist/src/assets/TON.js +12 -5
- package/dist/src/assets/index.d.ts +1 -0
- package/dist/src/assets/index.js +3 -1
- package/dist/src/errors/index.d.ts +1 -1
- package/dist/src/errors/index.js +8 -1
- package/dist/src/errors/instances.d.ts +6 -0
- package/dist/src/errors/instances.js +11 -1
- package/dist/src/interfaces/Asset.d.ts +11 -6
- package/dist/src/interfaces/ContractOpener.d.ts +1 -1
- package/dist/src/interfaces/IConfiguration.d.ts +1 -3
- package/dist/src/interfaces/ILiteSequencerClient.d.ts +14 -2
- package/dist/src/interfaces/IOperationTracker.d.ts +26 -1
- package/dist/src/interfaces/ITACTransactionManager.d.ts +20 -1
- package/dist/src/interfaces/ITacSDK.d.ts +52 -10
- package/dist/src/interfaces/IToncenterV3Indexer.d.ts +35 -0
- package/dist/src/interfaces/IToncenterV3Indexer.js +2 -0
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -0
- package/dist/src/sdk/Consts.d.ts +6 -0
- package/dist/src/sdk/Consts.js +7 -1
- package/dist/src/sdk/LiteSequencerClient.d.ts +5 -2
- package/dist/src/sdk/LiteSequencerClient.js +59 -1
- package/dist/src/sdk/OperationTracker.d.ts +5 -1
- package/dist/src/sdk/OperationTracker.js +76 -0
- package/dist/src/sdk/TACTransactionManager.d.ts +4 -0
- package/dist/src/sdk/TACTransactionManager.js +181 -35
- package/dist/src/sdk/TONTransactionManager.js +28 -6
- package/dist/src/sdk/TacSdk.d.ts +8 -3
- package/dist/src/sdk/TacSdk.js +40 -2
- package/dist/src/sdk/Utils.d.ts +2 -1
- package/dist/src/sdk/Utils.js +5 -1
- package/dist/src/structs/InternalStruct.d.ts +41 -2
- package/dist/src/structs/Struct.d.ts +209 -6
- package/dist/src/structs/Struct.js +12 -1
- package/dist/src/wrappers/ContentUtils.d.ts +36 -13
- package/dist/src/wrappers/ContentUtils.js +197 -98
- package/package.json +121 -121
|
@@ -5,155 +5,254 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.OFFCHAIN_CONTENT_PREFIX = exports.ONCHAIN_CONTENT_PREFIX = void 0;
|
|
7
7
|
exports.buildJettonOffChainMetadata = buildJettonOffChainMetadata;
|
|
8
|
+
exports.buildNFTOffChainMetadata = buildNFTOffChainMetadata;
|
|
8
9
|
exports.buildJettonOnchainMetadata = buildJettonOnchainMetadata;
|
|
10
|
+
exports.buildNFTOnchainMetadata = buildNFTOnchainMetadata;
|
|
9
11
|
exports.readJettonMetadata = readJettonMetadata;
|
|
12
|
+
exports.readNFTMetadata = readNFTMetadata;
|
|
10
13
|
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
11
14
|
const ton_1 = require("@ton/ton");
|
|
12
15
|
const axios_1 = __importDefault(require("axios"));
|
|
13
|
-
const bn_js_1 = __importDefault(require("bn.js"));
|
|
14
16
|
const errors_1 = require("../errors");
|
|
15
17
|
exports.ONCHAIN_CONTENT_PREFIX = 0x00;
|
|
16
18
|
exports.OFFCHAIN_CONTENT_PREFIX = 0x01;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const jettonOnChainMetadataSpec = {
|
|
19
|
+
const SNAKE_CONTENT_PREFIX = 0x00;
|
|
20
|
+
const CHUNKED_CONTENT_PREFIX = 0x01;
|
|
21
|
+
const CELL_MAX_BITS = 1023;
|
|
22
|
+
const commonMetadataSpec = {
|
|
22
23
|
uri: 'ascii',
|
|
23
24
|
name: 'utf8',
|
|
24
25
|
description: 'utf8',
|
|
25
26
|
image: 'ascii',
|
|
26
27
|
image_data: 'ascii',
|
|
28
|
+
};
|
|
29
|
+
const jettonOnChainMetadataSpec = {
|
|
30
|
+
...commonMetadataSpec,
|
|
27
31
|
symbol: 'utf8',
|
|
28
32
|
decimals: 'utf8',
|
|
33
|
+
amount_style: 'utf8',
|
|
34
|
+
render_type: 'utf8',
|
|
29
35
|
};
|
|
30
|
-
const
|
|
36
|
+
const nftOnChainMetadataSpec = {
|
|
37
|
+
...commonMetadataSpec,
|
|
38
|
+
};
|
|
39
|
+
const sha256 = (value) => {
|
|
31
40
|
const sha = new sha256_js_1.Sha256();
|
|
32
|
-
sha.update(
|
|
41
|
+
sha.update(value);
|
|
33
42
|
return Buffer.from(sha.digestSync());
|
|
34
43
|
};
|
|
35
|
-
function
|
|
36
|
-
|
|
44
|
+
function getAvailableBytes(withPrefix) {
|
|
45
|
+
return Math.floor((CELL_MAX_BITS - (withPrefix ? 8 : 0)) / 8);
|
|
46
|
+
}
|
|
47
|
+
function buildSnakeCell(content, withPrefix) {
|
|
37
48
|
const cell = new ton_1.Builder();
|
|
38
|
-
if (
|
|
39
|
-
cell.storeUint(
|
|
49
|
+
if (withPrefix) {
|
|
50
|
+
cell.storeUint(SNAKE_CONTENT_PREFIX, 8);
|
|
40
51
|
}
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
const bytesToStore = getAvailableBytes(withPrefix);
|
|
53
|
+
cell.storeBuffer(content.subarray(0, bytesToStore));
|
|
54
|
+
const remainingContent = content.subarray(bytesToStore);
|
|
43
55
|
if (remainingContent.length > 0) {
|
|
44
|
-
cell.storeRef(
|
|
56
|
+
cell.storeRef(buildSnakeCell(remainingContent, false));
|
|
45
57
|
}
|
|
46
58
|
return cell.endCell();
|
|
47
59
|
}
|
|
48
|
-
function
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
function buildOffchainContent(contentUri) {
|
|
61
|
+
const content = Buffer.from(contentUri, 'ascii');
|
|
62
|
+
const root = (0, ton_1.beginCell)().storeUint(exports.OFFCHAIN_CONTENT_PREFIX, 8);
|
|
63
|
+
const bytesToStore = getAvailableBytes(true);
|
|
64
|
+
root.storeBuffer(content.subarray(0, bytesToStore));
|
|
65
|
+
const remainingContent = content.subarray(bytesToStore);
|
|
66
|
+
if (remainingContent.length > 0) {
|
|
67
|
+
root.storeRef(buildSnakeCell(remainingContent, false));
|
|
68
|
+
}
|
|
69
|
+
return root.endCell();
|
|
70
|
+
}
|
|
71
|
+
function ensureByteAligned(slice) {
|
|
72
|
+
if (slice.remainingBits % 8 !== 0) {
|
|
73
|
+
throw errors_1.notMultiplyOf8Error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function readSnakeData(slice, withPrefix) {
|
|
77
|
+
if (withPrefix) {
|
|
78
|
+
if (slice.loadUint(8) !== SNAKE_CONTENT_PREFIX) {
|
|
79
|
+
throw errors_1.unsupportedFormatError;
|
|
53
80
|
}
|
|
54
|
-
|
|
55
|
-
|
|
81
|
+
}
|
|
82
|
+
ensureByteAligned(slice);
|
|
83
|
+
const current = slice.remainingBits > 0 ? slice.loadBuffer(slice.remainingBits / 8) : Buffer.alloc(0);
|
|
84
|
+
if (slice.remainingRefs === 0) {
|
|
85
|
+
return current;
|
|
86
|
+
}
|
|
87
|
+
if (slice.remainingRefs > 1) {
|
|
88
|
+
throw errors_1.unsupportedFormatError;
|
|
89
|
+
}
|
|
90
|
+
return Buffer.concat([current, readSnakeData(slice.loadRef().beginParse(), false)]);
|
|
91
|
+
}
|
|
92
|
+
function readChunkedData(slice) {
|
|
93
|
+
const dict = slice.loadDict(ton_1.Dictionary.Keys.Uint(32), ton_1.Dictionary.Values.Cell());
|
|
94
|
+
const chunks = dict.keys().sort((a, b) => a - b);
|
|
95
|
+
return Buffer.concat(chunks.map((chunkIndex) => {
|
|
96
|
+
const chunk = dict.get(chunkIndex);
|
|
97
|
+
if (!chunk) {
|
|
98
|
+
return Buffer.alloc(0);
|
|
56
99
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
return (0, ton_1.beginCell)()
|
|
61
|
-
.storeInt(exports.ONCHAIN_CONTENT_PREFIX, 8)
|
|
62
|
-
.storeDict(dict, ton_1.Dictionary.Keys.Buffer(32), ton_1.Dictionary.Values.Cell())
|
|
63
|
-
.endCell();
|
|
100
|
+
return readSnakeData(chunk.beginParse(), true);
|
|
101
|
+
}));
|
|
64
102
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
103
|
+
function readContentData(cell) {
|
|
104
|
+
const slice = cell.beginParse();
|
|
105
|
+
const prefix = slice.loadUint(8);
|
|
106
|
+
if (prefix === SNAKE_CONTENT_PREFIX) {
|
|
107
|
+
return readSnakeData(slice, false);
|
|
68
108
|
}
|
|
69
|
-
if (
|
|
70
|
-
|
|
109
|
+
if (prefix === CHUNKED_CONTENT_PREFIX) {
|
|
110
|
+
return readChunkedData(slice);
|
|
71
111
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// and upon parsing, it reads it back to a BN(base10)
|
|
86
|
-
// tl;dr if we want to read the map back to a JSON with string keys, we have to convert BN(10) back to hex
|
|
87
|
-
const toKey = (str) => BigInt(new bn_js_1.default(str, 'hex').toString(10));
|
|
88
|
-
const isJettonDeployerFaultyOnChainData = false;
|
|
89
|
-
const cellDict = contentSlice.loadDict(ton_1.Dictionary.Keys.BigUint(256), ton_1.Dictionary.Values.Cell());
|
|
90
|
-
const dict = new Map();
|
|
91
|
-
cellDict.values().forEach((item, index) => {
|
|
92
|
-
dict.set(cellDict.keys()[index], readSnakeContent(item.beginParse(), true));
|
|
93
|
-
});
|
|
94
|
-
const res = {};
|
|
95
|
-
Object.keys(jettonOnChainMetadataSpec).forEach((k) => {
|
|
96
|
-
const val = dict
|
|
97
|
-
.get(toKey(sha256(k).toString('hex')))
|
|
98
|
-
?.toString(jettonOnChainMetadataSpec[k]);
|
|
99
|
-
if (val) {
|
|
100
|
-
res[k] = val;
|
|
112
|
+
throw errors_1.unsupportedFormatError;
|
|
113
|
+
}
|
|
114
|
+
function parseOnchainMetadata(contentSlice, metadataSpec) {
|
|
115
|
+
const dict = contentSlice.loadDict(ton_1.Dictionary.Keys.Buffer(32), ton_1.Dictionary.Values.Cell());
|
|
116
|
+
const metadata = {};
|
|
117
|
+
for (const key of Object.keys(metadataSpec)) {
|
|
118
|
+
const encoding = metadataSpec[key];
|
|
119
|
+
if (!encoding) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const cell = dict.get(sha256(key));
|
|
123
|
+
if (!cell) {
|
|
124
|
+
continue;
|
|
101
125
|
}
|
|
102
|
-
|
|
126
|
+
const value = readContentData(cell).toString(encoding);
|
|
127
|
+
if (value) {
|
|
128
|
+
metadata[key] = value;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
103
131
|
return {
|
|
104
|
-
metadata
|
|
105
|
-
isJettonDeployerFaultyOnChainData,
|
|
132
|
+
metadata,
|
|
133
|
+
isJettonDeployerFaultyOnChainData: false,
|
|
106
134
|
};
|
|
107
135
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
136
|
+
function normalizeContentUri(contentUri) {
|
|
137
|
+
if (contentUri.startsWith('ipfs://')) {
|
|
138
|
+
const ipfsPath = contentUri.slice('ipfs://'.length).replace(/^ipfs\//, '');
|
|
139
|
+
return {
|
|
140
|
+
contentUri: `https://ipfs.io/ipfs/${ipfsPath}`,
|
|
141
|
+
isIpfs: true,
|
|
142
|
+
};
|
|
112
143
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
144
|
+
return {
|
|
145
|
+
contentUri,
|
|
146
|
+
isIpfs: /(^|\/)ipfs[.:/]/i.test(contentUri),
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async function fetchOffchainMetadata(contentUri) {
|
|
150
|
+
const normalized = normalizeContentUri(contentUri);
|
|
119
151
|
try {
|
|
120
|
-
|
|
121
|
-
|
|
152
|
+
const response = await axios_1.default.get(normalized.contentUri);
|
|
153
|
+
const metadata = response.data && typeof response.data === 'object' && !Array.isArray(response.data)
|
|
154
|
+
? response.data
|
|
155
|
+
: null;
|
|
156
|
+
return {
|
|
157
|
+
metadata,
|
|
158
|
+
isIpfs: normalized.isIpfs,
|
|
159
|
+
contentUri: normalized.contentUri,
|
|
160
|
+
};
|
|
122
161
|
}
|
|
123
162
|
catch {
|
|
124
|
-
|
|
163
|
+
return {
|
|
164
|
+
metadata: null,
|
|
165
|
+
isIpfs: normalized.isIpfs,
|
|
166
|
+
contentUri: normalized.contentUri,
|
|
167
|
+
};
|
|
125
168
|
}
|
|
126
|
-
return {
|
|
127
|
-
metadata,
|
|
128
|
-
isIpfs,
|
|
129
|
-
contentUri: jsonURI,
|
|
130
|
-
};
|
|
131
169
|
}
|
|
132
|
-
async function
|
|
170
|
+
async function parseOffchainMetadata(contentSlice) {
|
|
171
|
+
const contentUri = readSnakeData(contentSlice, false).toString('ascii');
|
|
172
|
+
return fetchOffchainMetadata(contentUri);
|
|
173
|
+
}
|
|
174
|
+
async function readMetadata(contentCell, metadataSpec) {
|
|
133
175
|
if (contentCell.bits.length <= 0) {
|
|
134
176
|
return {
|
|
135
177
|
contentUri: undefined,
|
|
136
|
-
isJettonDeployerFaultyOnChainData: false,
|
|
137
178
|
metadata: {},
|
|
138
179
|
persistenceType: 'none',
|
|
139
180
|
};
|
|
140
181
|
}
|
|
141
182
|
const contentSlice = contentCell.beginParse();
|
|
142
|
-
|
|
143
|
-
|
|
183
|
+
const prefix = contentSlice.loadUint(8);
|
|
184
|
+
if (prefix === exports.ONCHAIN_CONTENT_PREFIX) {
|
|
185
|
+
const { metadata: onchainMetadata, isJettonDeployerFaultyOnChainData } = parseOnchainMetadata(contentSlice, metadataSpec);
|
|
186
|
+
const uri = onchainMetadata.uri;
|
|
187
|
+
if (typeof uri === 'string' && uri.length > 0) {
|
|
188
|
+
const { metadata: offchainMetadata, isIpfs, contentUri } = await fetchOffchainMetadata(uri);
|
|
144
189
|
return {
|
|
145
|
-
persistenceType: 'onchain',
|
|
146
|
-
...parseJettonOnchainMetadata(contentSlice),
|
|
147
|
-
};
|
|
148
|
-
case exports.OFFCHAIN_CONTENT_PREFIX: {
|
|
149
|
-
const { metadata, isIpfs, contentUri } = await parseJettonOffchainMetadata(contentSlice);
|
|
150
|
-
return {
|
|
151
|
-
persistenceType: isIpfs ? 'offchain_ipfs' : 'offchain_private_domain',
|
|
152
190
|
contentUri,
|
|
153
|
-
|
|
191
|
+
isJettonDeployerFaultyOnChainData,
|
|
192
|
+
metadata: {
|
|
193
|
+
...(offchainMetadata ?? {}),
|
|
194
|
+
...onchainMetadata,
|
|
195
|
+
},
|
|
196
|
+
persistenceType: isIpfs ? 'semichain_ipfs' : 'semichain_private_domain',
|
|
154
197
|
};
|
|
155
198
|
}
|
|
156
|
-
|
|
157
|
-
|
|
199
|
+
return {
|
|
200
|
+
isJettonDeployerFaultyOnChainData,
|
|
201
|
+
metadata: onchainMetadata,
|
|
202
|
+
persistenceType: 'onchain',
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
if (prefix === exports.OFFCHAIN_CONTENT_PREFIX) {
|
|
206
|
+
const { metadata, isIpfs, contentUri } = await parseOffchainMetadata(contentSlice);
|
|
207
|
+
return {
|
|
208
|
+
contentUri,
|
|
209
|
+
metadata,
|
|
210
|
+
persistenceType: isIpfs ? 'offchain_ipfs' : 'offchain_private_domain',
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
throw errors_1.prefixError;
|
|
214
|
+
}
|
|
215
|
+
function buildOnchainMetadata(data, metadataSpec) {
|
|
216
|
+
const dict = ton_1.Dictionary.empty(ton_1.Dictionary.Keys.Buffer(32), ton_1.Dictionary.Values.Cell());
|
|
217
|
+
for (const [key, value] of Object.entries(data)) {
|
|
218
|
+
const encoding = metadataSpec[key];
|
|
219
|
+
if (!encoding) {
|
|
220
|
+
throw (0, errors_1.unsupportedKeyError)(key);
|
|
221
|
+
}
|
|
222
|
+
if (value === '' || value == null) {
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
dict.set(sha256(key), buildSnakeCell(Buffer.from(String(value), encoding), true));
|
|
158
226
|
}
|
|
227
|
+
return (0, ton_1.beginCell)()
|
|
228
|
+
.storeUint(exports.ONCHAIN_CONTENT_PREFIX, 8)
|
|
229
|
+
.storeDict(dict, ton_1.Dictionary.Keys.Buffer(32), ton_1.Dictionary.Values.Cell())
|
|
230
|
+
.endCell();
|
|
231
|
+
}
|
|
232
|
+
function buildJettonOffChainMetadata(contentUri) {
|
|
233
|
+
return buildOffchainContent(contentUri);
|
|
234
|
+
}
|
|
235
|
+
function buildNFTOffChainMetadata(contentUri) {
|
|
236
|
+
return buildOffchainContent(contentUri);
|
|
237
|
+
}
|
|
238
|
+
function buildJettonOnchainMetadata(data) {
|
|
239
|
+
return buildOnchainMetadata(data, jettonOnChainMetadataSpec);
|
|
240
|
+
}
|
|
241
|
+
function buildNFTOnchainMetadata(data) {
|
|
242
|
+
return buildOnchainMetadata(data, nftOnChainMetadataSpec);
|
|
243
|
+
}
|
|
244
|
+
async function readJettonMetadata(contentCell) {
|
|
245
|
+
const metadata = await readMetadata(contentCell, jettonOnChainMetadataSpec);
|
|
246
|
+
return {
|
|
247
|
+
...metadata,
|
|
248
|
+
isJettonDeployerFaultyOnChainData: metadata.isJettonDeployerFaultyOnChainData ?? false,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
async function readNFTMetadata(contentCell) {
|
|
252
|
+
const metadata = await readMetadata(contentCell, nftOnChainMetadataSpec);
|
|
253
|
+
return {
|
|
254
|
+
contentUri: metadata.contentUri,
|
|
255
|
+
metadata: metadata.metadata,
|
|
256
|
+
persistenceType: metadata.persistenceType,
|
|
257
|
+
};
|
|
159
258
|
}
|
package/package.json
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tonappchain/sdk",
|
|
3
|
-
"version": "0.7.
|
|
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
|
-
"litebuild": "rm -rf dist && tsc --declaration",
|
|
53
|
-
"build": "bash build.sh",
|
|
54
|
-
"build:artifacts:tac:dev": "cd artifacts/dev/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
55
|
-
"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/",
|
|
56
|
-
"build:artifacts:tac:testnet": "cd artifacts/testnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
57
|
-
"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/",
|
|
58
|
-
"build:artifacts:tac:mainnet": "cd artifacts/mainnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
59
|
-
"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/",
|
|
60
|
-
"build:artifacts:ton:all": "npm run build:artifacts:ton:dev && npm run build:artifacts:ton:testnet && npm run build:artifacts:ton:mainnet",
|
|
61
|
-
"build:artifacts:tac:all": "npm run build:artifacts:tac:dev && npm run build:artifacts:tac:testnet && npm run build:artifacts:tac:mainnet",
|
|
62
|
-
"build:artifacts": "npm run build:artifacts:ton:all && npm run build:artifacts:tac:all",
|
|
63
|
-
"test": "jest --verbose --runInBand",
|
|
64
|
-
"release": "npm run build && npx release-it",
|
|
65
|
-
"lint": "eslint .",
|
|
66
|
-
"lint:fix": "eslint . --fix",
|
|
67
|
-
"prettier": "prettier --ignore-path .gitignore --write \"./src/**/*.+(js|ts|json)\""
|
|
68
|
-
},
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"@aws-crypto/sha256-js": "^5.2.0",
|
|
71
|
-
"@orbs-network/ton-access": "^2.3.3",
|
|
72
|
-
"@tonappchain/ton-lite-client": "3.0.6",
|
|
73
|
-
"bn.js": "^5.2.3",
|
|
74
|
-
"cli-table3": "^0.6.5",
|
|
75
|
-
"dotenv": "^16.4.7"
|
|
76
|
-
},
|
|
77
|
-
"peerDependencies": {
|
|
78
|
-
"@ton/ton": ">=15",
|
|
79
|
-
"@tonconnect/ui": ">=2",
|
|
80
|
-
"ethers": ">=6",
|
|
81
|
-
"ton-crypto": ">=3"
|
|
82
|
-
},
|
|
83
|
-
"keywords": [],
|
|
84
|
-
"description": "",
|
|
85
|
-
"devDependencies": {
|
|
86
|
-
"@eslint/js": "^9.21.0",
|
|
87
|
-
"@jest/globals": "^29.7.0",
|
|
88
|
-
"@release-it/keep-a-changelog": "^7.0.0",
|
|
89
|
-
"@ton/sandbox": "^0.27.1",
|
|
90
|
-
"@ton/test-utils": "^0.5.0",
|
|
91
|
-
"@ton/ton": "16.2.2",
|
|
92
|
-
"@tonconnect/ui": "^2.0.11",
|
|
93
|
-
"@types/bn.js": "^5.1.6",
|
|
94
|
-
"@types/jest": "^29.5.14",
|
|
95
|
-
"eslint": "^9.26.0",
|
|
96
|
-
"eslint-config-prettier": "^10.0.2",
|
|
97
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
98
|
-
"ethers": "^6.13.5",
|
|
99
|
-
"jest": "^29.7.0",
|
|
100
|
-
"prettier": "^3.5.3",
|
|
101
|
-
"ton-crypto": "3.2.0",
|
|
102
|
-
"ts-jest": "^29.2.6",
|
|
103
|
-
"ts-node": "^10.9.2",
|
|
104
|
-
"typescript": "^5.7.3",
|
|
105
|
-
"typescript-eslint": "^8.17.0"
|
|
106
|
-
},
|
|
107
|
-
"publishConfig": {
|
|
108
|
-
"access": "public",
|
|
109
|
-
"registry": "https://registry.npmjs.org/"
|
|
110
|
-
},
|
|
111
|
-
"release-it": {
|
|
112
|
-
"plugins": {
|
|
113
|
-
"@release-it/keep-a-changelog": {
|
|
114
|
-
"filename": "CHANGELOG.md"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"npm": {
|
|
118
|
-
"publish": false
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tonappchain/sdk",
|
|
3
|
+
"version": "0.7.3-rc2",
|
|
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
|
+
"litebuild": "rm -rf dist && tsc --declaration",
|
|
53
|
+
"build": "bash build.sh",
|
|
54
|
+
"build:artifacts:tac:dev": "cd artifacts/dev/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
55
|
+
"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/",
|
|
56
|
+
"build:artifacts:tac:testnet": "cd artifacts/testnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
57
|
+
"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/",
|
|
58
|
+
"build:artifacts:tac:mainnet": "cd artifacts/mainnet/l2-evm && npm i && npx hardhat compile && rsync -avh --delete ./artifacts ./scripts ./typechain-types ../tac/internal/",
|
|
59
|
+
"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/",
|
|
60
|
+
"build:artifacts:ton:all": "npm run build:artifacts:ton:dev && npm run build:artifacts:ton:testnet && npm run build:artifacts:ton:mainnet",
|
|
61
|
+
"build:artifacts:tac:all": "npm run build:artifacts:tac:dev && npm run build:artifacts:tac:testnet && npm run build:artifacts:tac:mainnet",
|
|
62
|
+
"build:artifacts": "npm run build:artifacts:ton:all && npm run build:artifacts:tac:all",
|
|
63
|
+
"test": "jest --verbose --runInBand",
|
|
64
|
+
"release": "npm run build && npx release-it",
|
|
65
|
+
"lint": "eslint .",
|
|
66
|
+
"lint:fix": "eslint . --fix",
|
|
67
|
+
"prettier": "prettier --ignore-path .gitignore --write \"./src/**/*.+(js|ts|json)\""
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"@aws-crypto/sha256-js": "^5.2.0",
|
|
71
|
+
"@orbs-network/ton-access": "^2.3.3",
|
|
72
|
+
"@tonappchain/ton-lite-client": "3.0.6",
|
|
73
|
+
"bn.js": "^5.2.3",
|
|
74
|
+
"cli-table3": "^0.6.5",
|
|
75
|
+
"dotenv": "^16.4.7"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@ton/ton": ">=15",
|
|
79
|
+
"@tonconnect/ui": ">=2",
|
|
80
|
+
"ethers": ">=6",
|
|
81
|
+
"ton-crypto": ">=3"
|
|
82
|
+
},
|
|
83
|
+
"keywords": [],
|
|
84
|
+
"description": "",
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@eslint/js": "^9.21.0",
|
|
87
|
+
"@jest/globals": "^29.7.0",
|
|
88
|
+
"@release-it/keep-a-changelog": "^7.0.0",
|
|
89
|
+
"@ton/sandbox": "^0.27.1",
|
|
90
|
+
"@ton/test-utils": "^0.5.0",
|
|
91
|
+
"@ton/ton": "16.2.2",
|
|
92
|
+
"@tonconnect/ui": "^2.0.11",
|
|
93
|
+
"@types/bn.js": "^5.1.6",
|
|
94
|
+
"@types/jest": "^29.5.14",
|
|
95
|
+
"eslint": "^9.26.0",
|
|
96
|
+
"eslint-config-prettier": "^10.0.2",
|
|
97
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
98
|
+
"ethers": "^6.13.5",
|
|
99
|
+
"jest": "^29.7.0",
|
|
100
|
+
"prettier": "^3.5.3",
|
|
101
|
+
"ton-crypto": "3.2.0",
|
|
102
|
+
"ts-jest": "^29.2.6",
|
|
103
|
+
"ts-node": "^10.9.2",
|
|
104
|
+
"typescript": "^5.7.3",
|
|
105
|
+
"typescript-eslint": "^8.17.0"
|
|
106
|
+
},
|
|
107
|
+
"publishConfig": {
|
|
108
|
+
"access": "public",
|
|
109
|
+
"registry": "https://registry.npmjs.org/"
|
|
110
|
+
},
|
|
111
|
+
"release-it": {
|
|
112
|
+
"plugins": {
|
|
113
|
+
"@release-it/keep-a-changelog": {
|
|
114
|
+
"filename": "CHANGELOG.md"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"npm": {
|
|
118
|
+
"publish": false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|