@sign-global/tokentable 0.4.2-beta.2 → 0.4.2-beta.4

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.
Files changed (119) hide show
  1. package/dist/cjs/airdrop/common/index.d.ts +1 -1
  2. package/dist/cjs/airdrop/constants/chain-config.d.ts +1 -1
  3. package/dist/cjs/airdrop/constants/chain-config.js +1 -1
  4. package/dist/cjs/airdrop/constants/chain-config.js.map +1 -1
  5. package/dist/esm/airdrop/common/index.d.ts +1 -1
  6. package/dist/esm/airdrop/constants/chain-config.d.ts +1 -1
  7. package/dist/esm/airdrop/constants/chain-config.js +1 -1
  8. package/dist/esm/airdrop/constants/chain-config.js.map +1 -1
  9. package/package.json +2 -9
  10. package/src/airdrop/AirdropClient.ts +0 -307
  11. package/src/airdrop/SignatureAirdropClient.ts +0 -378
  12. package/src/airdrop/common/index.ts +0 -54
  13. package/src/airdrop/common/projectDataForTon.ts +0 -79
  14. package/src/airdrop/constants/chain-config.ts +0 -107
  15. package/src/airdrop/constants/index.ts +0 -9
  16. package/src/airdrop/constants/network.ts +0 -78
  17. package/src/airdrop/contracts/evm/AirdropService.ts +0 -181
  18. package/src/airdrop/contracts/evm/SignatureAirdropService.ts +0 -114
  19. package/src/airdrop/contracts/evm/contracts/AirdropSignatureClient.ts +0 -63
  20. package/src/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.ts +0 -61
  21. package/src/airdrop/contracts/evm/contracts/AirdropV2Client.ts +0 -37
  22. package/src/airdrop/contracts/evm/contracts/AirdropV3Client.ts +0 -49
  23. package/src/airdrop/contracts/evm/contracts/AirdropV3FeeClient.ts +0 -16
  24. package/src/airdrop/contracts/evm/contracts/AirdropV4Client.ts +0 -36
  25. package/src/airdrop/contracts/evm/contracts/ContractBaseClient.ts +0 -85
  26. package/src/airdrop/contracts/evm/contracts/DeployClient.ts +0 -35
  27. package/src/airdrop/contracts/evm/contracts/FeeCollectorClient.ts +0 -21
  28. package/src/airdrop/contracts/evm/contracts/KycClient.ts +0 -21
  29. package/src/airdrop/contracts/evm/contracts/abis/Airdrop.json +0 -674
  30. package/src/airdrop/contracts/evm/contracts/abis/AirdropV2.json +0 -676
  31. package/src/airdrop/contracts/evm/contracts/abis/AirdropV3.json +0 -740
  32. package/src/airdrop/contracts/evm/contracts/abis/AirdropV3_Fee.json +0 -678
  33. package/src/airdrop/contracts/evm/contracts/abis/CustomFeeNativeAirdropV4.json +0 -701
  34. package/src/airdrop/contracts/evm/contracts/abis/Deployer.json +0 -271
  35. package/src/airdrop/contracts/evm/contracts/abis/ERC721.json +0 -737
  36. package/src/airdrop/contracts/evm/contracts/abis/FeeCollector.json +0 -322
  37. package/src/airdrop/contracts/evm/contracts/abis/FungibleTokenECDSADistributor.json +0 -564
  38. package/src/airdrop/contracts/evm/contracts/abis/FungibleTokenWithFeesECDSADistributor.json +0 -260
  39. package/src/airdrop/contracts/evm/contracts/abis/KycHook.json +0 -312
  40. package/src/airdrop/contracts/index.ts +0 -4
  41. package/src/airdrop/contracts/solana/AirdropSignatureClient.ts +0 -242
  42. package/src/airdrop/contracts/solana/FeeCollectorClient.ts +0 -43
  43. package/src/airdrop/contracts/solana/SignatureAirdropService.ts +0 -51
  44. package/src/airdrop/contracts/solana/SolanaContractClient.ts +0 -126
  45. package/src/airdrop/contracts/solana/fee_collector.json +0 -1063
  46. package/src/airdrop/contracts/solana/fee_collector.ts +0 -1069
  47. package/src/airdrop/contracts/solana/fungible_token_distributor_solana.json +0 -1573
  48. package/src/airdrop/contracts/solana/fungible_token_distributor_solana.ts +0 -1579
  49. package/src/airdrop/contracts/ton/AirdropClientV1.ts +0 -122
  50. package/src/airdrop/contracts/ton/AirdropClientV2.ts +0 -118
  51. package/src/airdrop/contracts/ton/AirdropClientV21.ts +0 -131
  52. package/src/airdrop/contracts/ton/AirdropClientV3.ts +0 -127
  53. package/src/airdrop/contracts/ton/AirdropService.ts +0 -150
  54. package/src/airdrop/contracts/ton/TonContractBaseClient.ts +0 -236
  55. package/src/airdrop/contracts/ton/v1/build/Leaf.compiled.json +0 -1
  56. package/src/airdrop/contracts/ton/v1/build/MerkleTokenDistributor.compiled.json +0 -1
  57. package/src/airdrop/contracts/ton/v1/utils/constants.ts +0 -42
  58. package/src/airdrop/contracts/ton/v1/utils/date.utils.ts +0 -11
  59. package/src/airdrop/contracts/ton/v1/utils/index.ts +0 -3
  60. package/src/airdrop/contracts/ton/v1/utils/ton.utils.ts +0 -84
  61. package/src/airdrop/contracts/ton/v1/wrappers/JettonMinter.ts +0 -81
  62. package/src/airdrop/contracts/ton/v1/wrappers/JettonWallet.ts +0 -73
  63. package/src/airdrop/contracts/ton/v1/wrappers/Leaf.ts +0 -88
  64. package/src/airdrop/contracts/ton/v1/wrappers/MerkleTokenDistributor.ts +0 -317
  65. package/src/airdrop/contracts/ton/v1/wrappers/index.ts +0 -2
  66. package/src/airdrop/contracts/ton/v2/build/Leaf.compiled.json +0 -1
  67. package/src/airdrop/contracts/ton/v2/build/MerkleTokenDistributor.compiled.json +0 -1
  68. package/src/airdrop/contracts/ton/v2/utils/constants.ts +0 -43
  69. package/src/airdrop/contracts/ton/v2/utils/date.utils.ts +0 -11
  70. package/src/airdrop/contracts/ton/v2/utils/index.ts +0 -3
  71. package/src/airdrop/contracts/ton/v2/utils/ton.utils.ts +0 -102
  72. package/src/airdrop/contracts/ton/v2/wrappers/Leaf.ts +0 -69
  73. package/src/airdrop/contracts/ton/v2/wrappers/MerkleTokenDistributor.ts +0 -340
  74. package/src/airdrop/contracts/ton/v2/wrappers/index.ts +0 -2
  75. package/src/airdrop/contracts/ton/v21/build/Leaf.compiled.json +0 -1
  76. package/src/airdrop/contracts/ton/v21/build/MerkleTokenDistributor.compiled.json +0 -1
  77. package/src/airdrop/contracts/ton/v21/utils/constants.ts +0 -48
  78. package/src/airdrop/contracts/ton/v21/utils/date.utils.ts +0 -11
  79. package/src/airdrop/contracts/ton/v21/utils/index.ts +0 -3
  80. package/src/airdrop/contracts/ton/v21/utils/ton.utils.ts +0 -84
  81. package/src/airdrop/contracts/ton/v21/wrappers/Leaf.ts +0 -69
  82. package/src/airdrop/contracts/ton/v21/wrappers/MerkleTokenDistributor.ts +0 -346
  83. package/src/airdrop/contracts/ton/v21/wrappers/index.ts +0 -2
  84. package/src/airdrop/contracts/ton/v3/build/Leaf.compiled.json +0 -1
  85. package/src/airdrop/contracts/ton/v3/build/MerkleTokenDistributor.compiled.json +0 -1
  86. package/src/airdrop/contracts/ton/v3/utils/constants.ts +0 -43
  87. package/src/airdrop/contracts/ton/v3/utils/date.utils.ts +0 -11
  88. package/src/airdrop/contracts/ton/v3/utils/index.ts +0 -3
  89. package/src/airdrop/contracts/ton/v3/utils/ton.utils.ts +0 -84
  90. package/src/airdrop/contracts/ton/v3/wrappers/Leaf.ts +0 -68
  91. package/src/airdrop/contracts/ton/v3/wrappers/MerkleTokenDistributor.ts +0 -316
  92. package/src/airdrop/contracts/ton/v3/wrappers/index.ts +0 -2
  93. package/src/airdrop/index.ts +0 -10
  94. package/src/airdrop/services/index.ts +0 -166
  95. package/src/airdrop/services/wallet-service/ton/WalletService.ts +0 -226
  96. package/src/airdrop/services/wallet-service/ton/index.ts +0 -1
  97. package/src/airdrop/strategies/AirdropStrategyFactory.ts +0 -31
  98. package/src/airdrop/strategies/EvmAirdropStrategy.ts +0 -81
  99. package/src/airdrop/strategies/IAirdropStrategy.ts +0 -26
  100. package/src/airdrop/strategies/StrategyCache.ts +0 -34
  101. package/src/airdrop/strategies/TonAirdropStrategy.ts +0 -77
  102. package/src/airdrop/tests/index.test.ts +0 -387
  103. package/src/airdrop/types/index.ts +0 -200
  104. package/src/index.ts +0 -3
  105. package/src/utils/api-client.ts +0 -69
  106. package/src/utils/index.ts +0 -3
  107. package/src/utils/utils.ts +0 -45
  108. package/src/utils/web3.ts +0 -172
  109. package/src/wallets/WalletBase.ts +0 -92
  110. package/src/wallets/WalletFactory.tsx +0 -35
  111. package/src/wallets/index.ts +0 -3
  112. package/src/wallets/providers/evm/EvmWallet.ts +0 -101
  113. package/src/wallets/providers/evm/index.tsx +0 -56
  114. package/src/wallets/providers/index.ts +0 -4
  115. package/src/wallets/providers/solana/index.tsx +0 -133
  116. package/src/wallets/providers/ton/TonWallet.ts +0 -153
  117. package/src/wallets/providers/ton/index.tsx +0 -41
  118. package/src/wallets/types.ts +0 -45
  119. package/src/wallets/utils/index.ts +0 -61
@@ -1014,7 +1014,7 @@ export declare function getChainConfig(chainId: ChainId): {
1014
1014
  rpcUrl: string;
1015
1015
  } | {
1016
1016
  contractAddress: string;
1017
- rpcUrl: "https://mainnet.base.org";
1017
+ rpcUrl: string;
1018
1018
  } | {
1019
1019
  contractAddress: string;
1020
1020
  rpcUrl: "https://cyber.alt.technology";
@@ -10,7 +10,7 @@ export declare const ChainConfig: {
10
10
  };
11
11
  8453: {
12
12
  contractAddress: string;
13
- rpcUrl: "https://mainnet.base.org";
13
+ rpcUrl: string;
14
14
  };
15
15
  7560: {
16
16
  contractAddress: string;
@@ -15,7 +15,7 @@ exports.ChainConfig = {
15
15
  },
16
16
  [chains_1.base.id]: {
17
17
  contractAddress: '0x3d1abcD56d53f7C8b04A753C6AF397903DC0f0F2',
18
- rpcUrl: chains_1.base.rpcUrls.default.http[0]
18
+ rpcUrl: 'https://base-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
19
19
  },
20
20
  [chains_1.cyber.id]: {
21
21
  contractAddress: '0x7915dA247674E430b2a4Dcf01e4471f709428Bc0',
@@ -1 +1 @@
1
- {"version":3,"file":"chain-config.js","sourceRoot":"","sources":["../../../../src/airdrop/constants/chain-config.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,wCAcqB;AACrB,uCAA+D;AAElD,QAAA,WAAW,GAAG;IACzB,CAAC,gBAAO,CAAC,EAAE,CAAC,EAAE;QACZ,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,uEAAuE;KAChF;IACD,CAAC,YAAG,CAAC,E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AAE,EAAE;QACnB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,EAAE;KACvB;IACD,CAAC,oBAAW,CAAC,EAAE,CAAC,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,EAAE;KACvB;IACD,CAAC,oBAAU,CAAC,EAAE,CAAC,EAAE;QACf,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,oBAAU,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KAC3C;IACD,CAAC,gBAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,8CAA8C,EAAE,sCAAsC;QAC9F,YAAY,EAAE,2BAA2B;QACzC,aAAa,EAAE,+BAA+B;KAC/C;IACD,CAAC,gBAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,sCAAsC;QAC9C,YAAY,EAAE,mBAAmB;QACjC,aAAa,EAAE,uBAAuB;KACvC;CACF,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,gBAAO;IACP,YAAG;IACH,aAAI;IACJ,cAAK;IACL,gBAAO;IACP,oBAAW;IACX,kBAAS;IACT,+BAAsB;IACtB,yBAAgB;IAChB,sBAAa;IACb,oBAAW;IACX,oBAAU;IACV,iBAAQ;IACR,oBAAU;IACV,oBAAU;CACX,CAAC"}
1
+ {"version":3,"file":"chain-config.js","sourceRoot":"","sources":["../../../../src/airdrop/constants/chain-config.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,wCAcqB;AACrB,uCAA+D;AAElD,QAAA,WAAW,GAAG;IACzB,CAAC,gBAAO,CAAC,EAAE,CAAC,EAAE;QACZ,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,uEAAuE;KAChF;IACD,CAAC,YAAG,CAAC,EAAE,CAAC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ACvB;IACD,CAAC,oBAAW,CAAC,EAAE,CAAC,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,EAAE;KACvB;IACD,CAAC,oBAAU,CAAC,EAAE,CAAC,EAAE;QACf,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,oBAAU,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KAC3C;IACD,CAAC,gBAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,8CAA8C,EAAE,sCAAsC;QAC9F,YAAY,EAAE,2BAA2B;QACzC,aAAa,EAAE,+BAA+B;KAC/C;IACD,CAAC,gBAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,sCAAsC;QAC9C,YAAY,EAAE,mBAAmB;QACjC,aAAa,EAAE,uBAAuB;KACvC;CACF,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,gBAAO;IACP,YAAG;IACH,aAAI;IACJ,cAAK;IACL,gBAAO;IACP,oBAAW;IACX,kBAAS;IACT,+BAAsB;IACtB,yBAAgB;IAChB,sBAAa;IACb,oBAAW;IACX,oBAAU;IACV,iBAAQ;IACR,oBAAU;IACV,oBAAU;CACX,CAAC"}
@@ -1014,7 +1014,7 @@ export declare function getChainConfig(chainId: ChainId): {
1014
1014
  rpcUrl: string;
1015
1015
  } | {
1016
1016
  contractAddress: string;
1017
- rpcUrl: "https://mainnet.base.org";
1017
+ rpcUrl: string;
1018
1018
  } | {
1019
1019
  contractAddress: string;
1020
1020
  rpcUrl: "https://cyber.alt.technology";
@@ -10,7 +10,7 @@ export declare const ChainConfig: {
10
10
  };
11
11
  8453: {
12
12
  contractAddress: string;
13
- rpcUrl: "https://mainnet.base.org";
13
+ rpcUrl: string;
14
14
  };
15
15
  7560: {
16
16
  contractAddress: string;
@@ -12,7 +12,7 @@ export const ChainConfig = {
12
12
  },
13
13
  [base.id]: {
14
14
  contractAddress: '0x3d1abcD56d53f7C8b04A753C6AF397903DC0f0F2',
15
- rpcUrl: base.rpcUrls.default.http[0]
15
+ rpcUrl: 'https://base-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
16
16
  },
17
17
  [cyber.id]: {
18
18
  contractAddress: '0x7915dA247674E430b2a4Dcf01e4471f709428Bc0',
@@ -1 +1 @@
1
- {"version":3,"file":"chain-config.js","sourceRoot":"","sources":["../../../../src/airdrop/constants/chain-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EACL,IAAI,EACJ,WAAW,EACX,KAAK,EACL,OAAO,EACP,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,EACT,sBAAsB,EAEtB,GAAG,EACH,gBAAgB,EAChB,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACZ,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,uEAAuE;KAChF;IACD,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QACR,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,uEAAuE;KAChF;IACD,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;QACT,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KACrC;IACD,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;QACV,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,C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AO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,8CAA8C,EAAE,sCAAsC;QAC9F,YAAY,EAAE,2BAA2B;QACzC,aAAa,EAAE,+BAA+B;KAC/C;IACD,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,sCAAsC;QAC9C,YAAY,EAAE,mBAAmB;QACjC,aAAa,EAAE,uBAAuB;KACvC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO;IACP,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,WAAW;IACX,SAAS;IACT,sBAAsB;IACtB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;IACV,UAAU;CACX,CAAC"}
1
+ {"version":3,"file":"chain-config.js","sourceRoot":"","sources":["../../../../src/airdrop/constants/chain-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EACL,IAAI,EACJ,WAAW,EACX,KAAK,EACL,OAAO,EACP,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,EACT,sBAAsB,EAEtB,GAAG,EACH,gBAAgB,EAChB,QAAQ,EACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACZ,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,uEAAuE;KAChF;IACD,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE;QACR,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,uEAAuE;KAChF;IACD,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE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AAE;KACvB;IACD,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;QACf,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KAC3C;IACD,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,8CAA8C,EAAE,sCAAsC;QAC9F,YAAY,EAAE,2BAA2B;QACzC,aAAa,EAAE,+BAA+B;KAC/C;IACD,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;QACf,IAAI,EAAE,SAAS;QACf,eAAe,EAAE,EAAE;QACnB,MAAM,EAAE,sCAAsC;QAC9C,YAAY,EAAE,mBAAmB;QACjC,aAAa,EAAE,uBAAuB;KACvC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO;IACP,GAAG;IACH,IAAI;IACJ,KAAK;IACL,OAAO;IACP,WAAW;IACX,SAAS;IACT,sBAAsB;IACtB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;IACV,UAAU;CACX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sign-global/tokentable",
3
- "version": "0.4.2-beta.2",
3
+ "version": "0.4.2-beta.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,28 +21,21 @@
21
21
  "@solana/spl-token": "^0.4.12",
22
22
  "@ethsign/utils-web": "^0.8.9",
23
23
  "@orbs-network/ton-access": "^2.3.3",
24
- "@rainbow-me/rainbowkit": "^2.2.3",
25
- "@solana/wallet-adapter-react": "^0.15.35",
26
- "@solana/wallet-adapter-react-ui": "^0.9.35",
27
24
  "@solana/wallet-adapter-wallets": "^0.19.32",
28
25
  "@solana/web3.js": "^1.98.0",
29
26
  "@ton/core": "^0.59.0",
30
27
  "@ton/ton": "^15.1.0",
31
28
  "@tonconnect/ui": "^2.0.11",
32
- "@tonconnect/ui-react": "^2.0.11",
33
29
  "@types/jest": "^29.5.14",
34
30
  "bignumber.js": "^9.1.2",
35
31
  "bs58": "^6.0.0",
36
32
  "dayjs": "^1.11.13",
37
33
  "jest": "^29.7.0",
38
34
  "nanoid": "^5.0.9",
39
- "react": "^18.2.0",
40
35
  "ton-core": "^0.53.0",
41
36
  "tonapi-sdk-js": "^2.0.3",
42
37
  "tonweb": "^0.0.66",
43
- "ts-jest": "^29.2.5",
44
- "viem": "^2.21.49",
45
- "wagmi": "^2.13.0"
38
+ "ts-jest": "^29.2.5"
46
39
  },
47
40
  "peerDependencies": {
48
41
  "react": "^18.2.0",
@@ -1,307 +0,0 @@
1
- import { TonClient } from '@ton/ton';
2
- import { getAirdropPro, getAirdropProject, getAirdropQuery, getAirdropContractConfig } from './services';
3
- import {
4
- ChainType,
5
- ETokenType,
6
- EvmAirdropVersionEnum,
7
- IAirdropClaim,
8
- IAirdropOptions,
9
- IContractConfig,
10
- IProject,
11
- IWalletClient
12
- } from './types';
13
- import { getTonProjectIdByAddress } from './common';
14
- import { AirdropStrategyFactory } from './strategies/AirdropStrategyFactory';
15
- import { IAirdropStrategy } from './strategies/IAirdropStrategy';
16
- import { strategyCache } from './strategies/StrategyCache';
17
-
18
- export class AirdropClient {
19
- private tonClient?: TonClient;
20
- private slug?: string;
21
- private projectId?: string;
22
- private endpoint?: string;
23
- private project: IProject | undefined;
24
- protected claims?: IAirdropClaim[];
25
- private projectPromise: Promise<void> | undefined;
26
- private claimHook: ((v: any) => any) | undefined;
27
- private contractConfig: IContractConfig | null = null;
28
-
29
- constructor(params: IAirdropOptions) {
30
- if ('slug' in params) {
31
- this.slug = params.slug;
32
- }
33
- this.projectId = params.projectId;
34
- this.endpoint = params.endpoint;
35
- if (this.project) {
36
- this.project = params.project;
37
- } else {
38
- this.projectPromise = this.initializeProjects();
39
- }
40
- }
41
-
42
- setTonClient(tonClient: TonClient) {
43
- this.tonClient = tonClient;
44
- }
45
-
46
- private getTonClient(): TonClient | undefined {
47
- if (!this.tonClient) {
48
- return undefined;
49
- }
50
- return this.tonClient;
51
- }
52
-
53
- private async fetchProjectFromSlug(address?: string): Promise<string | undefined> {
54
- if (!this.slug) return undefined;
55
-
56
- const res = await getAirdropPro(this.slug, this.endpoint);
57
- const projectMap = res?.childProjectMapping || {};
58
-
59
- return getTonProjectIdByAddress({
60
- address,
61
- slug: this.slug,
62
- data: projectMap
63
- });
64
- }
65
-
66
- private async fetchProjectDetails(projectId: string): Promise<void> {
67
- this.project = await getAirdropProject(projectId, this.endpoint);
68
- }
69
-
70
- protected async initializeProjects(address?: string) {
71
- try {
72
- let projectId = this.projectId;
73
-
74
- // If slug is provided, try to fetch project ID from slug
75
- if (!projectId) {
76
- projectId = await this.fetchProjectFromSlug(address);
77
- }
78
-
79
- if (!projectId) {
80
- return;
81
- }
82
-
83
- // Fetch project details
84
- await this.fetchProjectDetails(projectId);
85
- } catch (error: any) {
86
- throw new Error(`Failed to initialize project: ${error.message}`);
87
- }
88
- }
89
-
90
- async getProjectInfo() {
91
- if (this.projectPromise) {
92
- await this.projectPromise;
93
- }
94
- if (!this.project) throw new Error('Project not found');
95
- return this.project;
96
- }
97
-
98
- async getAirdropClaims(data: { address: string }) {
99
- if (this.slug) {
100
- await this.initializeProjects(data.address); // Fetch project details by address & slug
101
- }
102
- const project = await this.getProjectInfo();
103
-
104
- const res = await getAirdropQuery(
105
- {
106
- recipient: data.address,
107
- projectId: project!.id,
108
- recipientType: project!.recipientType
109
- },
110
- this.endpoint
111
- );
112
- const claimsRes = res.claims?.map((it) => ({
113
- ...it,
114
- project: project!,
115
- claimId: project!.chainType === ChainType.Evm ? `${project!.id}:${it.leaf}` : `${project!.id}:${it.index}`
116
- }));
117
- this.claims = claimsRes;
118
- return this.claims;
119
- }
120
-
121
- public async getStrategy(walletClient?: IWalletClient): Promise<IAirdropStrategy> {
122
- const project = await this.getProjectInfo();
123
- const version = this.contractConfig?.version || undefined;
124
-
125
- const hasWallet = !!walletClient;
126
-
127
- // Try to get cached strategy
128
- let strategy = strategyCache.getStrategy(project.contractAddress, project.chainId, project.chainType, hasWallet);
129
-
130
- if (!strategy) {
131
- // Create new strategy if not cached
132
- strategy = AirdropStrategyFactory.createStrategy({
133
- chainType: project.chainType,
134
- contractAddress: project.contractAddress,
135
- chainId: project.chainId,
136
- walletClient,
137
- tonClient: this.getTonClient(),
138
- version
139
- });
140
-
141
- // Initialize the strategy
142
- await strategy.initialize(walletClient);
143
-
144
- // Cache the initialized strategy
145
- strategyCache.setStrategy(project.contractAddress, project.chainId, project.chainType, strategy, hasWallet);
146
- } else if (hasWallet) {
147
- // If we have a wallet and the strategy exists, just initialize with the new wallet
148
- await strategy.initialize(walletClient);
149
- }
150
-
151
- return strategy;
152
- }
153
-
154
- private getClaimDataById(claimId: string) {
155
- const claimData = this.claims?.find((it) => it.claimId === claimId);
156
- if (!claimData) throw new Error('Claim data not found');
157
- return claimData;
158
- }
159
-
160
- setClaimHook(fn: (v: any) => any) {
161
- this.claimHook = fn;
162
- }
163
-
164
- private getDefaultExtraData() {
165
- return {
166
- isLegacy: true,
167
- attestationId: BigInt(1)
168
- };
169
- }
170
-
171
- private async calculateClaimFee(project: IProject, claimAmount: string): Promise<string | bigint | undefined> {
172
- if (project.chainType === ChainType.Evm) {
173
- const version = await this.getVersion();
174
- const isNativeFreeVersion =
175
- project.tokenType === ETokenType.Native &&
176
- [EvmAirdropVersionEnum.V3, EvmAirdropVersionEnum.V4].includes(version as EvmAirdropVersionEnum);
177
- return isNativeFreeVersion ? undefined : await this.getClaimFee(BigInt(claimAmount));
178
- }
179
-
180
- if (project.chainType === ChainType.Ton) {
181
- return await this.getClaimFee(BigInt(claimAmount));
182
- }
183
-
184
- return undefined;
185
- }
186
-
187
- async claimAirdrop(
188
- { claimId, walletClient }: { claimId: string; walletClient: IWalletClient },
189
- options?: { onLoading?: () => void }
190
- ) {
191
- // Get claim data and initialize strategy
192
- const claimData = this.getClaimDataById(claimId);
193
- const strategy = await this.getStrategy(walletClient);
194
- const project = await this.getProjectInfo();
195
-
196
- // Process extra data
197
- const extraData =
198
- project.chainType === ChainType.Ton
199
- ? undefined
200
- : this.claimHook
201
- ? this.claimHook(claimData)
202
- : this.getDefaultExtraData();
203
-
204
- // Calculate claim value based on project type
205
- const value = await this.calculateClaimFee(project, claimData.amount);
206
-
207
- // Execute claim with processed data
208
- return strategy.claim(
209
- {
210
- ...claimData,
211
- extraData,
212
- value
213
- },
214
- options
215
- );
216
- }
217
-
218
- async checkClaimed(claimId: string): Promise<boolean> {
219
- const claimData = this.getClaimDataById(claimId);
220
- const strategy = await this.getStrategy();
221
- return strategy.checkClaimed(claimData);
222
- }
223
-
224
- private async getContractConfig(): Promise<IContractConfig | null> {
225
- try {
226
- const project = await this.getProjectInfo();
227
-
228
- if (!this.contractConfig) {
229
- this.contractConfig = await getAirdropContractConfig(
230
- {
231
- chainId: project.chainId,
232
- chainType: project.chainType,
233
- contractAddress: project.contractAddress
234
- },
235
- this.endpoint
236
- );
237
- }
238
- return this.contractConfig;
239
- } catch (error) {
240
- console.error('Error fetching contract config:', error);
241
- return null;
242
- }
243
- }
244
-
245
- async getVersion(): Promise<string> {
246
- const config = await this.getContractConfig();
247
- if (config?.version) {
248
- return config.version;
249
- }
250
-
251
- const strategy = await this.getStrategy();
252
- return strategy.getVersion();
253
- }
254
-
255
- async getPaused(): Promise<boolean> {
256
- const config = await this.getContractConfig();
257
- if (config && config?.paused !== null) {
258
- return config.paused;
259
- }
260
-
261
- const strategy = await this.getStrategy();
262
- if (!strategy.getPaused) {
263
- throw new Error('getPaused is not supported for this chain');
264
- }
265
- return strategy.getPaused();
266
- }
267
-
268
- async getClaimFee(amount?: bigint): Promise<string | bigint> {
269
- const config = await this.getContractConfig();
270
- if (config?.claimFee) {
271
- return config.claimFee;
272
- }
273
-
274
- const strategy = await this.getStrategy();
275
- if (!strategy.getClaimFee) {
276
- throw new Error('getClaimFee is not supported for this chain');
277
- }
278
- return strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(0));
279
- }
280
-
281
- // params claimId[]
282
- async batchCheckClaimed(): Promise<{ result: boolean; status: string }[]> {
283
- const strategy = await this.getStrategy();
284
- if (!strategy.batchCheckClaimed) {
285
- throw new Error('batchCheckClaimed is not supported for this chain');
286
- }
287
- const leafs = this.claims?.map((it) => it.leaf);
288
- if (!leafs) return [];
289
- return strategy.batchCheckClaimed(leafs);
290
- }
291
-
292
- async getNFT(): Promise<string> {
293
- const strategy = await this.getStrategy();
294
- if (!strategy.getNFT) {
295
- throw new Error('getNFT is not supported for this chain');
296
- }
297
- return strategy.getNFT();
298
- }
299
-
300
- async getKycThreshold(): Promise<bigint> {
301
- const strategy = await this.getStrategy();
302
- if (!strategy.getKycThreshold) {
303
- throw new Error('getKycThreshold is not supported for this chain');
304
- }
305
- return strategy.getKycThreshold();
306
- }
307
- }