@tonappchain/sdk 0.6.1 → 0.6.2
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/dist/sdk/TacSdk.js +9 -9
- package/package.json +2 -2
package/dist/sdk/TacSdk.js
CHANGED
|
@@ -665,10 +665,10 @@ class TacSdk {
|
|
|
665
665
|
}
|
|
666
666
|
async getTVMTokenAddress(evmTokenAddress) {
|
|
667
667
|
(0, Utils_1.validateEVMAddress)(evmTokenAddress);
|
|
668
|
-
const
|
|
669
|
-
if (
|
|
670
|
-
const
|
|
671
|
-
const info = await
|
|
668
|
+
const exists = await this.TACParams.tokenUtils['exists(address)'](evmTokenAddress);
|
|
669
|
+
if (exists) {
|
|
670
|
+
const erc721Token = this.artifacts.tac.wrappers.CrossChainLayerERC20FactoryTAC.connect(evmTokenAddress, this.TACParams.provider);
|
|
671
|
+
const info = await erc721Token.getInfo();
|
|
672
672
|
return info.tvmAddress;
|
|
673
673
|
}
|
|
674
674
|
const jettonMaster = JettonMaster_1.JettonMaster.createFromConfig({
|
|
@@ -682,11 +682,11 @@ class TacSdk {
|
|
|
682
682
|
async getTVMNFTAddress(evmNFTAddress, tokenId) {
|
|
683
683
|
(0, Utils_1.validateEVMAddress)(evmNFTAddress);
|
|
684
684
|
let nftCollection;
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
const
|
|
688
|
-
const info = await
|
|
689
|
-
nftCollection = this.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromAddress(info.tvmAddress));
|
|
685
|
+
const exists = await this.TACParams.tokenUtils['exists(address)'](evmNFTAddress);
|
|
686
|
+
if (exists) {
|
|
687
|
+
const erc721Token = this.artifacts.tac.wrappers.CrossChainLayerERC721FactoryTAC.connect(evmNFTAddress, this.TACParams.provider);
|
|
688
|
+
const info = await erc721Token.getInfo();
|
|
689
|
+
nftCollection = this.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromAddress((0, ton_1.address)(info.tvmAddress)));
|
|
690
690
|
}
|
|
691
691
|
else {
|
|
692
692
|
nftCollection = this.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromConfig({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonappchain/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"repository": "https://github.com/TacBuild/tac-sdk.git",
|
|
5
5
|
"author": "TAC. <developers@tac>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@aws-crypto/sha256-js": "^5.2.0",
|
|
21
21
|
"@orbs-network/ton-access": "^2.3.3",
|
|
22
22
|
"@ton/ton": "15.1.0",
|
|
23
|
-
"@tonappchain/artifacts": "0.0.17",
|
|
23
|
+
"@tonappchain/artifacts": "0.0.17-test",
|
|
24
24
|
"@tonappchain/ton-lite-client": "3.0.6",
|
|
25
25
|
"@tonconnect/ui": "^2.0.11",
|
|
26
26
|
"bn.js": "^5.2.1",
|