@tonappchain/sdk 0.6.1 → 0.6.3
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.d.ts +1 -1
- package/dist/sdk/TacSdk.js +20 -12
- package/package.json +4 -4
package/dist/sdk/TacSdk.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare class TacSdk {
|
|
|
46
46
|
get getTrustedTONExecutors(): string[];
|
|
47
47
|
getEVMTokenAddress(tvmTokenAddress: string): Promise<string>;
|
|
48
48
|
getTVMTokenAddress(evmTokenAddress: string): Promise<string>;
|
|
49
|
-
getTVMNFTAddress(evmNFTAddress: string, tokenId?: bigint): Promise<string>;
|
|
49
|
+
getTVMNFTAddress(evmNFTAddress: string, tokenId?: number | bigint): Promise<string>;
|
|
50
50
|
getEVMNFTAddress(tvmNFTAddress: string, addressType: NFTAddressType): Promise<string>;
|
|
51
51
|
isContractDeployedOnTVM(address: string): Promise<boolean>;
|
|
52
52
|
simulateTACMessage(req: TACSimulationRequest): Promise<TACSimulationResult>;
|
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,14 @@ 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
|
+
return tokenId == undefined
|
|
691
|
+
? nftCollection.address.toString()
|
|
692
|
+
: (await nftCollection.getNFTAddressByIndex(tokenId)).toString();
|
|
690
693
|
}
|
|
691
694
|
else {
|
|
692
695
|
nftCollection = this.TONParams.contractOpener.open(wrappers_1.NFTCollection.createFromConfig({
|
|
@@ -695,10 +698,15 @@ class TacSdk {
|
|
|
695
698
|
nftItemCode: this.TONParams.nftItemCode,
|
|
696
699
|
originalAddress: evmNFTAddress,
|
|
697
700
|
}, this.TONParams.nftCollectionCode));
|
|
701
|
+
return tokenId == undefined
|
|
702
|
+
? nftCollection.address.toString()
|
|
703
|
+
: wrappers_1.NFTItem.createFromConfig({
|
|
704
|
+
collectionAddress: nftCollection.address,
|
|
705
|
+
cclAddress: (0, ton_1.address)(this.TONParams.crossChainLayerAddress),
|
|
706
|
+
// @ts-ignore // bigint can be used, wrapper is not typed properly
|
|
707
|
+
index: tokenId,
|
|
708
|
+
}, this.TONParams.nftItemCode).address.toString();
|
|
698
709
|
}
|
|
699
|
-
return tokenId == undefined
|
|
700
|
-
? nftCollection.address.toString()
|
|
701
|
-
: (await nftCollection.getNFTAddressByIndex(tokenId)).toString();
|
|
702
710
|
}
|
|
703
711
|
async getEVMNFTAddress(tvmNFTAddress, addressType) {
|
|
704
712
|
(0, Utils_1.validateTVMAddress)(tvmNFTAddress);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonappchain/sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"jest": "^29.7.0",
|
|
46
46
|
"prettier": "^3.5.3",
|
|
47
47
|
"ts-jest": "^29.2.6",
|
|
48
|
-
"ts-node": "^10.9.2",
|
|
49
|
-
"typescript": "^5.7.
|
|
48
|
+
"ts-node": "^10.9.2",
|
|
49
|
+
"typescript": "^5.7.3",
|
|
50
50
|
"typescript-eslint": "^8.17.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|