@tonappchain/sdk 0.7.0-rc24-test-14 → 0.7.0-rc26

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.
@@ -100,7 +100,14 @@ class AbiHandler {
100
100
  // Handle struct/tuple types
101
101
  if (param.components && Array.isArray(param.components)) {
102
102
  const componentTypes = param.components
103
- .map((component) => this._buildParameterType(component))
103
+ .map((component) => {
104
+ const baseType = this._buildParameterType(component);
105
+ // Include parameter name for struct components if available
106
+ if (component.name) {
107
+ return `${baseType} ${component.name}`;
108
+ }
109
+ return baseType;
110
+ })
104
111
  .join(',');
105
112
  return `(${componentTypes})`;
106
113
  }
@@ -110,7 +117,14 @@ class AbiHandler {
110
117
  // Handle array of structs
111
118
  if (param.components && Array.isArray(param.components)) {
112
119
  const componentTypes = param.components
113
- .map((component) => this._buildParameterType(component))
120
+ .map((component) => {
121
+ const baseType = this._buildParameterType(component);
122
+ // Include parameter name for struct components if available
123
+ if (component.name) {
124
+ return `${baseType} ${component.name}`;
125
+ }
126
+ return baseType;
127
+ })
114
128
  .join(',');
115
129
  return `(${componentTypes})[]`;
116
130
  }
@@ -1,2 +1,2 @@
1
1
  export { AddressError, BitError, ContractError, EVMCallError, FetchError, FormatError, KeyError, MetadataError, SettingError, TokenError, WalletError, } from './errors';
2
- export { allEndpointsFailedError, emptyArrayError, emptyContractError, emptySettingError, evmAddressError, indexRequiredError, insufficientBalanceError, invalidMethodNameError, missingDecimals, missingFeeParamsError, missingGasLimitError, missingJettonDataError, missingTvmExecutorFeeError, notMultiplyOf8Error, operationFetchError, prefixError, profilingFetchError, simulationFetchError, statusFetchError, tvmAddressError, unknownTokenTypeError, unknownWalletError, unsupportedFormatError, unsupportedKeyError, } from './instances';
2
+ export { allEndpointsFailedError, emptyArrayError, emptyContractError, emptySettingError, evmAddressError, indexRequiredError, insufficientBalanceError, invalidMethodNameError, missingDecimals, missingFeeParamsError, missingGasLimitError, missingJettonDataError, missingTvmExecutorFeeError, notMultiplyOf8Error, operationFetchError, prefixError, profilingFetchError, simulationFetchError, statusFetchError, tvmAddressError, unknownTokenTypeError, unknownWalletError, unsupportedFormatError, unsupportedKeyError, zeroRawAmountError, } from './instances';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unsupportedKeyError = exports.unsupportedFormatError = exports.unknownWalletError = exports.unknownTokenTypeError = exports.tvmAddressError = exports.statusFetchError = exports.simulationFetchError = exports.profilingFetchError = exports.prefixError = exports.operationFetchError = exports.notMultiplyOf8Error = exports.missingTvmExecutorFeeError = exports.missingJettonDataError = exports.missingGasLimitError = exports.missingFeeParamsError = exports.missingDecimals = exports.invalidMethodNameError = exports.insufficientBalanceError = exports.indexRequiredError = exports.evmAddressError = exports.emptySettingError = exports.emptyContractError = exports.emptyArrayError = exports.allEndpointsFailedError = exports.WalletError = exports.TokenError = exports.SettingError = exports.MetadataError = exports.KeyError = exports.FormatError = exports.FetchError = exports.EVMCallError = exports.ContractError = exports.BitError = exports.AddressError = void 0;
3
+ exports.zeroRawAmountError = exports.unsupportedKeyError = exports.unsupportedFormatError = exports.unknownWalletError = exports.unknownTokenTypeError = exports.tvmAddressError = exports.statusFetchError = exports.simulationFetchError = exports.profilingFetchError = exports.prefixError = exports.operationFetchError = exports.notMultiplyOf8Error = exports.missingTvmExecutorFeeError = exports.missingJettonDataError = exports.missingGasLimitError = exports.missingFeeParamsError = exports.missingDecimals = exports.invalidMethodNameError = exports.insufficientBalanceError = exports.indexRequiredError = exports.evmAddressError = exports.emptySettingError = exports.emptyContractError = exports.emptyArrayError = exports.allEndpointsFailedError = exports.WalletError = exports.TokenError = exports.SettingError = exports.MetadataError = exports.KeyError = exports.FormatError = exports.FetchError = exports.EVMCallError = exports.ContractError = exports.BitError = exports.AddressError = void 0;
4
4
  var errors_1 = require("./errors");
5
5
  Object.defineProperty(exports, "AddressError", { enumerable: true, get: function () { return errors_1.AddressError; } });
6
6
  Object.defineProperty(exports, "BitError", { enumerable: true, get: function () { return errors_1.BitError; } });
@@ -38,3 +38,4 @@ Object.defineProperty(exports, "unknownTokenTypeError", { enumerable: true, get:
38
38
  Object.defineProperty(exports, "unknownWalletError", { enumerable: true, get: function () { return instances_1.unknownWalletError; } });
39
39
  Object.defineProperty(exports, "unsupportedFormatError", { enumerable: true, get: function () { return instances_1.unsupportedFormatError; } });
40
40
  Object.defineProperty(exports, "unsupportedKeyError", { enumerable: true, get: function () { return instances_1.unsupportedKeyError; } });
41
+ Object.defineProperty(exports, "zeroRawAmountError", { enumerable: true, get: function () { return instances_1.zeroRawAmountError; } });
@@ -29,3 +29,4 @@ export declare const missingTvmExecutorFeeError: FormatError;
29
29
  export declare const missingGasLimitError: FormatError;
30
30
  export declare const missingDecimals: MetadataError;
31
31
  export declare const missingJettonDataError: MetadataError;
32
+ export declare const zeroRawAmountError: (assetAddress: string) => TokenError;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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);
@@ -51,3 +51,5 @@ exports.missingTvmExecutorFeeError = new errors_1.FormatError('When withoutSimul
51
51
  exports.missingGasLimitError = new errors_1.FormatError('When withoutSimulation is true, gasLimit must be provided in evmProxyMsg', 127);
52
52
  exports.missingDecimals = new errors_1.MetadataError('Missing decimals in jetton metadata', 128);
53
53
  exports.missingJettonDataError = new errors_1.MetadataError('Jetton data should be available for TON origin', 129);
54
+ const zeroRawAmountError = (assetAddress) => new errors_1.TokenError(`FT asset with zero rawAmount/amount is not allowed: ${assetAddress}`, 130);
55
+ exports.zeroRawAmountError = zeroRawAmountError;
@@ -203,10 +203,11 @@ async function aggregateTokens(assets) {
203
203
  const uniqueAssetsMap = new Map();
204
204
  let ton;
205
205
  for await (const asset of assets ?? []) {
206
- if (asset.rawAmount === 0n)
207
- continue;
208
206
  if (asset.type !== Struct_1.AssetType.FT)
209
207
  continue;
208
+ if (asset.rawAmount === 0n) {
209
+ throw (0, errors_1.zeroRawAmountError)(asset.address || 'NATIVE TON');
210
+ }
210
211
  if (!asset.address) {
211
212
  ton = ton ? ton.addRawAmount(asset.rawAmount) : asset.clone;
212
213
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonappchain/sdk",
3
- "version": "0.7.0-rc24-test-14",
3
+ "version": "0.7.0-rc26",
4
4
  "repository": "https://github.com/TacBuild/tac-sdk.git",
5
5
  "author": "TAC. <developers@tac>",
6
6
  "license": "MIT",
@@ -51,16 +51,16 @@
51
51
  "scripts": {
52
52
  "prebuild": "git submodule update --init --recursive --remote",
53
53
  "litebuild": "rm -rf dist && tsc --declaration",
54
- "build": "rm -rf dist && yarn build:artifacts && tsc --declaration",
54
+ "build": "rm -rf dist && npm run build:artifacts && tsc --declaration",
55
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
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
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
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
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
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": "yarn build:artifacts:ton:dev && yarn build:artifacts:ton:testnet && yarn build:artifacts:ton:mainnet",
62
- "build:artifacts:tac:all": "yarn build:artifacts:tac:dev && yarn build:artifacts:tac:testnet && yarn build:artifacts:tac:mainnet",
63
- "build:artifacts": "yarn prebuild && yarn build:artifacts:ton:all && yarn build:artifacts:tac:all",
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
64
  "test": "jest --verbose --runInBand",
65
65
  "release": "yarn build && yarn release-it --npm.yarn1",
66
66
  "lint": "eslint .",