@tonappchain/sdk 0.7.0 → 0.7.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.
@@ -25,8 +25,9 @@ class AssetFactory {
25
25
  return asset;
26
26
  }
27
27
  static async createFTAsset(configuration, address) {
28
- if (address === configuration.nativeTONAddress || address === '') {
29
- return TON_1.TON.create(configuration);
28
+ const ton = TON_1.TON.create(configuration);
29
+ if (address === configuration.nativeTONAddress || address === '' || address === (await ton.getEVMAddress())) {
30
+ return ton;
30
31
  }
31
32
  return FT_1.FT.fromAddress(configuration, address);
32
33
  }
@@ -6,6 +6,7 @@ import { AssetType, FeeParams } from '../structs/Struct';
6
6
  export declare class TON implements Asset {
7
7
  readonly address: string;
8
8
  readonly type: AssetType;
9
+ private evmAddress;
9
10
  private _rawAmount;
10
11
  private _config;
11
12
  constructor(config: IConfiguration);
@@ -12,6 +12,7 @@ class TON {
12
12
  this.address = '';
13
13
  this._config = config;
14
14
  this._rawAmount = 0n;
15
+ this.evmAddress = '';
15
16
  }
16
17
  static create(config) {
17
18
  return new TON(config);
@@ -51,7 +52,10 @@ class TON {
51
52
  return this;
52
53
  }
53
54
  async getEVMAddress() {
54
- return this._config.TACParams.tokenUtils.computeAddress(this._config.nativeTONAddress);
55
+ if (this.evmAddress === '') {
56
+ this.evmAddress = await this._config.TACParams.tokenUtils.computeAddress(this._config.nativeTONAddress);
57
+ }
58
+ return this.evmAddress;
55
59
  }
56
60
  async getTVMAddress() {
57
61
  return '';
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",
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
- }
1
+ {
2
+ "name": "@tonappchain/sdk",
3
+ "version": "0.7.1",
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",
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
+ }