@sign-global/tokentable 0.4.3-beta.0 → 0.4.3-beta.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/cjs/airdrop/AirdropClient.d.ts +1 -1
- package/dist/cjs/airdrop/AirdropClient.js +4 -3
- package/dist/cjs/airdrop/AirdropClient.js.map +1 -1
- package/dist/cjs/airdrop/SignatureAirdropClient.d.ts +10 -1
- package/dist/cjs/airdrop/SignatureAirdropClient.js +48 -11
- package/dist/cjs/airdrop/SignatureAirdropClient.js.map +1 -1
- package/dist/cjs/airdrop/common/index.d.ts +1 -1
- package/dist/cjs/airdrop/constants/chain-config.d.ts +1 -1
- package/dist/cjs/airdrop/constants/chain-config.js +1 -1
- package/dist/cjs/airdrop/constants/chain-config.js.map +1 -1
- package/dist/cjs/airdrop/constants/index.d.ts +1 -0
- package/dist/cjs/airdrop/constants/index.js +1 -0
- package/dist/cjs/airdrop/constants/index.js.map +1 -1
- package/dist/cjs/airdrop/contracts/evm/contracts/AirdropSignatureClient.js +0 -1
- package/dist/cjs/airdrop/contracts/evm/contracts/AirdropSignatureClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/index.d.ts +1 -0
- package/dist/cjs/airdrop/contracts/index.js +3 -1
- package/dist/cjs/airdrop/contracts/index.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/AirdropService.d.ts +16 -0
- package/dist/cjs/airdrop/contracts/solana/AirdropService.js +38 -0
- package/dist/cjs/airdrop/contracts/solana/AirdropService.js.map +1 -0
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.d.ts +3 -2
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.js +12 -11
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/FeeCollectorClient.d.ts +3 -2
- package/dist/cjs/airdrop/contracts/solana/FeeCollectorClient.js +7 -3
- package/dist/cjs/airdrop/contracts/solana/FeeCollectorClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/MerkleDistributorClient.d.ts +49 -0
- package/dist/cjs/airdrop/contracts/solana/MerkleDistributorClient.js +242 -0
- package/dist/cjs/airdrop/contracts/solana/MerkleDistributorClient.js.map +1 -0
- package/dist/cjs/airdrop/contracts/solana/SignatureAirdropService.d.ts +1 -0
- package/dist/cjs/airdrop/contracts/solana/SignatureAirdropService.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/SolanaContractClient.d.ts +1 -0
- package/dist/cjs/airdrop/contracts/solana/SolanaContractClient.js +3 -0
- package/dist/cjs/airdrop/contracts/solana/SolanaContractClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/eddsa_token_with_fees_distributor_solana.d.ts +1668 -0
- package/dist/cjs/airdrop/contracts/solana/eddsa_token_with_fees_distributor_solana.js +3 -0
- package/dist/cjs/airdrop/contracts/solana/eddsa_token_with_fees_distributor_solana.js.map +1 -0
- package/dist/cjs/airdrop/contracts/solana/{fungible_token_distributor_solana.json → eddsa_token_with_fees_distributor_solana.json} +127 -38
- package/dist/cjs/airdrop/contracts/solana/fee_collector.d.ts +198 -1
- package/dist/cjs/airdrop/contracts/solana/fee_collector.json +200 -3
- package/dist/cjs/airdrop/contracts/solana/merkle_token_distributor_solana.d.ts +1695 -0
- package/dist/cjs/airdrop/contracts/solana/merkle_token_distributor_solana.js +3 -0
- package/dist/cjs/airdrop/contracts/solana/merkle_token_distributor_solana.js.map +1 -0
- package/dist/cjs/airdrop/contracts/solana/merkle_token_distributor_solana.json +1689 -0
- package/dist/cjs/airdrop/services/index.d.ts +3 -2
- package/dist/cjs/airdrop/services/index.js +8 -1
- package/dist/cjs/airdrop/services/index.js.map +1 -1
- package/dist/cjs/airdrop/strategies/AirdropStrategyFactory.d.ts +1 -0
- package/dist/cjs/airdrop/strategies/AirdropStrategyFactory.js +2 -1
- package/dist/cjs/airdrop/strategies/AirdropStrategyFactory.js.map +1 -1
- package/dist/cjs/airdrop/strategies/IAirdropStrategy.d.ts +1 -0
- package/dist/cjs/airdrop/strategies/SolanaAirdropStrategy.d.ts +25 -0
- package/dist/cjs/airdrop/strategies/SolanaAirdropStrategy.js +62 -0
- package/dist/cjs/airdrop/strategies/SolanaAirdropStrategy.js.map +1 -0
- package/dist/cjs/airdrop/types/index.d.ts +8 -1
- package/dist/cjs/airdrop/types/index.js +1 -0
- package/dist/cjs/airdrop/types/index.js.map +1 -1
- package/dist/esm/airdrop/AirdropClient.d.ts +1 -1
- package/dist/esm/airdrop/AirdropClient.js +4 -3
- package/dist/esm/airdrop/AirdropClient.js.map +1 -1
- package/dist/esm/airdrop/SignatureAirdropClient.d.ts +10 -1
- package/dist/esm/airdrop/SignatureAirdropClient.js +49 -12
- package/dist/esm/airdrop/SignatureAirdropClient.js.map +1 -1
- package/dist/esm/airdrop/common/index.d.ts +1 -1
- package/dist/esm/airdrop/constants/chain-config.d.ts +1 -1
- package/dist/esm/airdrop/constants/chain-config.js +1 -1
- package/dist/esm/airdrop/constants/chain-config.js.map +1 -1
- package/dist/esm/airdrop/constants/index.d.ts +1 -0
- package/dist/esm/airdrop/constants/index.js +1 -0
- package/dist/esm/airdrop/constants/index.js.map +1 -1
- package/dist/esm/airdrop/contracts/evm/contracts/AirdropSignatureClient.js +0 -1
- package/dist/esm/airdrop/contracts/evm/contracts/AirdropSignatureClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/index.d.ts +1 -0
- package/dist/esm/airdrop/contracts/index.js +1 -0
- package/dist/esm/airdrop/contracts/index.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/AirdropService.d.ts +16 -0
- package/dist/esm/airdrop/contracts/solana/AirdropService.js +34 -0
- package/dist/esm/airdrop/contracts/solana/AirdropService.js.map +1 -0
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.d.ts +3 -2
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.js +11 -10
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/FeeCollectorClient.d.ts +3 -2
- package/dist/esm/airdrop/contracts/solana/FeeCollectorClient.js +7 -3
- package/dist/esm/airdrop/contracts/solana/FeeCollectorClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/MerkleDistributorClient.d.ts +49 -0
- package/dist/esm/airdrop/contracts/solana/MerkleDistributorClient.js +212 -0
- package/dist/esm/airdrop/contracts/solana/MerkleDistributorClient.js.map +1 -0
- package/dist/esm/airdrop/contracts/solana/SignatureAirdropService.d.ts +1 -0
- package/dist/esm/airdrop/contracts/solana/SignatureAirdropService.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/SolanaContractClient.d.ts +1 -0
- package/dist/esm/airdrop/contracts/solana/SolanaContractClient.js +3 -0
- package/dist/esm/airdrop/contracts/solana/SolanaContractClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/eddsa_token_with_fees_distributor_solana.d.ts +1668 -0
- package/dist/esm/airdrop/contracts/solana/eddsa_token_with_fees_distributor_solana.js +2 -0
- package/dist/esm/airdrop/contracts/solana/eddsa_token_with_fees_distributor_solana.js.map +1 -0
- package/dist/esm/airdrop/contracts/solana/{fungible_token_distributor_solana.json → eddsa_token_with_fees_distributor_solana.json} +127 -38
- package/dist/esm/airdrop/contracts/solana/fee_collector.d.ts +198 -1
- package/dist/esm/airdrop/contracts/solana/fee_collector.json +200 -3
- package/dist/esm/airdrop/contracts/solana/merkle_token_distributor_solana.d.ts +1695 -0
- package/dist/esm/airdrop/contracts/solana/merkle_token_distributor_solana.js +2 -0
- package/dist/esm/airdrop/contracts/solana/merkle_token_distributor_solana.js.map +1 -0
- package/dist/esm/airdrop/contracts/solana/merkle_token_distributor_solana.json +1689 -0
- package/dist/esm/airdrop/services/index.d.ts +3 -2
- package/dist/esm/airdrop/services/index.js +6 -0
- package/dist/esm/airdrop/services/index.js.map +1 -1
- package/dist/esm/airdrop/strategies/AirdropStrategyFactory.d.ts +1 -0
- package/dist/esm/airdrop/strategies/AirdropStrategyFactory.js +2 -1
- package/dist/esm/airdrop/strategies/AirdropStrategyFactory.js.map +1 -1
- package/dist/esm/airdrop/strategies/IAirdropStrategy.d.ts +1 -0
- package/dist/esm/airdrop/strategies/SolanaAirdropStrategy.d.ts +25 -0
- package/dist/esm/airdrop/strategies/SolanaAirdropStrategy.js +58 -0
- package/dist/esm/airdrop/strategies/SolanaAirdropStrategy.js.map +1 -0
- package/dist/esm/airdrop/types/index.d.ts +8 -1
- package/dist/esm/airdrop/types/index.js +1 -0
- package/dist/esm/airdrop/types/index.js.map +1 -1
- package/package.json +2 -9
- package/src/airdrop/AirdropClient.ts +0 -307
- package/src/airdrop/SignatureAirdropClient.ts +0 -337
- package/src/airdrop/common/index.ts +0 -54
- package/src/airdrop/common/projectDataForTon.ts +0 -79
- package/src/airdrop/constants/chain-config.ts +0 -107
- package/src/airdrop/constants/index.ts +0 -8
- package/src/airdrop/constants/network.ts +0 -78
- package/src/airdrop/contracts/evm/AirdropService.ts +0 -181
- package/src/airdrop/contracts/evm/SignatureAirdropService.ts +0 -114
- package/src/airdrop/contracts/evm/contracts/AirdropSignatureClient.ts +0 -63
- package/src/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.ts +0 -61
- package/src/airdrop/contracts/evm/contracts/AirdropV2Client.ts +0 -37
- package/src/airdrop/contracts/evm/contracts/AirdropV3Client.ts +0 -49
- package/src/airdrop/contracts/evm/contracts/AirdropV3FeeClient.ts +0 -16
- package/src/airdrop/contracts/evm/contracts/AirdropV4Client.ts +0 -36
- package/src/airdrop/contracts/evm/contracts/ContractBaseClient.ts +0 -85
- package/src/airdrop/contracts/evm/contracts/DeployClient.ts +0 -35
- package/src/airdrop/contracts/evm/contracts/FeeCollectorClient.ts +0 -21
- package/src/airdrop/contracts/evm/contracts/KycClient.ts +0 -21
- package/src/airdrop/contracts/evm/contracts/abis/Airdrop.json +0 -674
- package/src/airdrop/contracts/evm/contracts/abis/AirdropV2.json +0 -676
- package/src/airdrop/contracts/evm/contracts/abis/AirdropV3.json +0 -740
- package/src/airdrop/contracts/evm/contracts/abis/AirdropV3_Fee.json +0 -678
- package/src/airdrop/contracts/evm/contracts/abis/CustomFeeNativeAirdropV4.json +0 -701
- package/src/airdrop/contracts/evm/contracts/abis/Deployer.json +0 -271
- package/src/airdrop/contracts/evm/contracts/abis/ERC721.json +0 -737
- package/src/airdrop/contracts/evm/contracts/abis/FeeCollector.json +0 -322
- package/src/airdrop/contracts/evm/contracts/abis/FungibleTokenECDSADistributor.json +0 -564
- package/src/airdrop/contracts/evm/contracts/abis/FungibleTokenWithFeesECDSADistributor.json +0 -260
- package/src/airdrop/contracts/evm/contracts/abis/KycHook.json +0 -312
- package/src/airdrop/contracts/index.ts +0 -4
- package/src/airdrop/contracts/solana/AirdropSignatureClient.ts +0 -242
- package/src/airdrop/contracts/solana/FeeCollectorClient.ts +0 -43
- package/src/airdrop/contracts/solana/SignatureAirdropService.ts +0 -51
- package/src/airdrop/contracts/solana/SolanaContractClient.ts +0 -126
- package/src/airdrop/contracts/solana/fee_collector.json +0 -1063
- package/src/airdrop/contracts/solana/fee_collector.ts +0 -1069
- package/src/airdrop/contracts/solana/fungible_token_distributor_solana.json +0 -1573
- package/src/airdrop/contracts/solana/fungible_token_distributor_solana.ts +0 -1579
- package/src/airdrop/contracts/ton/AirdropClientV1.ts +0 -122
- package/src/airdrop/contracts/ton/AirdropClientV2.ts +0 -118
- package/src/airdrop/contracts/ton/AirdropClientV21.ts +0 -131
- package/src/airdrop/contracts/ton/AirdropClientV3.ts +0 -127
- package/src/airdrop/contracts/ton/AirdropService.ts +0 -150
- package/src/airdrop/contracts/ton/TonContractBaseClient.ts +0 -236
- package/src/airdrop/contracts/ton/v1/build/Leaf.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v1/build/MerkleTokenDistributor.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v1/utils/constants.ts +0 -42
- package/src/airdrop/contracts/ton/v1/utils/date.utils.ts +0 -11
- package/src/airdrop/contracts/ton/v1/utils/index.ts +0 -3
- package/src/airdrop/contracts/ton/v1/utils/ton.utils.ts +0 -84
- package/src/airdrop/contracts/ton/v1/wrappers/JettonMinter.ts +0 -81
- package/src/airdrop/contracts/ton/v1/wrappers/JettonWallet.ts +0 -73
- package/src/airdrop/contracts/ton/v1/wrappers/Leaf.ts +0 -88
- package/src/airdrop/contracts/ton/v1/wrappers/MerkleTokenDistributor.ts +0 -317
- package/src/airdrop/contracts/ton/v1/wrappers/index.ts +0 -2
- package/src/airdrop/contracts/ton/v2/build/Leaf.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v2/build/MerkleTokenDistributor.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v2/utils/constants.ts +0 -43
- package/src/airdrop/contracts/ton/v2/utils/date.utils.ts +0 -11
- package/src/airdrop/contracts/ton/v2/utils/index.ts +0 -3
- package/src/airdrop/contracts/ton/v2/utils/ton.utils.ts +0 -102
- package/src/airdrop/contracts/ton/v2/wrappers/Leaf.ts +0 -69
- package/src/airdrop/contracts/ton/v2/wrappers/MerkleTokenDistributor.ts +0 -340
- package/src/airdrop/contracts/ton/v2/wrappers/index.ts +0 -2
- package/src/airdrop/contracts/ton/v21/build/Leaf.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v21/build/MerkleTokenDistributor.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v21/utils/constants.ts +0 -48
- package/src/airdrop/contracts/ton/v21/utils/date.utils.ts +0 -11
- package/src/airdrop/contracts/ton/v21/utils/index.ts +0 -3
- package/src/airdrop/contracts/ton/v21/utils/ton.utils.ts +0 -84
- package/src/airdrop/contracts/ton/v21/wrappers/Leaf.ts +0 -69
- package/src/airdrop/contracts/ton/v21/wrappers/MerkleTokenDistributor.ts +0 -346
- package/src/airdrop/contracts/ton/v21/wrappers/index.ts +0 -2
- package/src/airdrop/contracts/ton/v3/build/Leaf.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v3/build/MerkleTokenDistributor.compiled.json +0 -1
- package/src/airdrop/contracts/ton/v3/utils/constants.ts +0 -43
- package/src/airdrop/contracts/ton/v3/utils/date.utils.ts +0 -11
- package/src/airdrop/contracts/ton/v3/utils/index.ts +0 -3
- package/src/airdrop/contracts/ton/v3/utils/ton.utils.ts +0 -84
- package/src/airdrop/contracts/ton/v3/wrappers/Leaf.ts +0 -68
- package/src/airdrop/contracts/ton/v3/wrappers/MerkleTokenDistributor.ts +0 -316
- package/src/airdrop/contracts/ton/v3/wrappers/index.ts +0 -2
- package/src/airdrop/index.ts +0 -10
- package/src/airdrop/services/index.ts +0 -159
- package/src/airdrop/services/wallet-service/ton/WalletService.ts +0 -226
- package/src/airdrop/services/wallet-service/ton/index.ts +0 -1
- package/src/airdrop/strategies/AirdropStrategyFactory.ts +0 -31
- package/src/airdrop/strategies/EvmAirdropStrategy.ts +0 -81
- package/src/airdrop/strategies/IAirdropStrategy.ts +0 -26
- package/src/airdrop/strategies/StrategyCache.ts +0 -34
- package/src/airdrop/strategies/TonAirdropStrategy.ts +0 -77
- package/src/airdrop/tests/index.test.ts +0 -387
- package/src/airdrop/types/index.ts +0 -199
- package/src/index.ts +0 -3
- package/src/utils/api-client.ts +0 -69
- package/src/utils/index.ts +0 -3
- package/src/utils/utils.ts +0 -45
- package/src/utils/web3.ts +0 -172
- package/src/wallets/WalletBase.ts +0 -92
- package/src/wallets/WalletFactory.tsx +0 -35
- package/src/wallets/index.ts +0 -3
- package/src/wallets/providers/evm/EvmWallet.ts +0 -101
- package/src/wallets/providers/evm/index.tsx +0 -56
- package/src/wallets/providers/index.ts +0 -4
- package/src/wallets/providers/solana/index.tsx +0 -133
- package/src/wallets/providers/ton/TonWallet.ts +0 -153
- package/src/wallets/providers/ton/index.tsx +0 -41
- package/src/wallets/types.ts +0 -45
- package/src/wallets/utils/index.ts +0 -61
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import { CONST } from './constants';
|
|
2
|
-
import { EvmSignatureAirdropService, SolanaSignatureAirdropService } from './contracts';
|
|
3
|
-
import { WalletFactory } from '../wallets';
|
|
4
|
-
import { ChainType } from '../wallets/types';
|
|
5
|
-
import {
|
|
6
|
-
bindWallet,
|
|
7
|
-
checkEligibility,
|
|
8
|
-
checkGetSignatures,
|
|
9
|
-
connectTwitter,
|
|
10
|
-
disconnectRecipient,
|
|
11
|
-
getAirdropProject
|
|
12
|
-
} from './services';
|
|
13
|
-
import {
|
|
14
|
-
AirdropSigIdentityTypeEnum,
|
|
15
|
-
ChainId,
|
|
16
|
-
ErrorCode,
|
|
17
|
-
IAirdropOptions,
|
|
18
|
-
IAirdropSignatureClaim,
|
|
19
|
-
IAirdropSignatureIdentity,
|
|
20
|
-
IClaimSignature,
|
|
21
|
-
IProject,
|
|
22
|
-
IWalletClient,
|
|
23
|
-
SolanaWalletState,
|
|
24
|
-
ViemWalletClient
|
|
25
|
-
} from './types';
|
|
26
|
-
import { cleanUrlParams, isMobile } from '../utils';
|
|
27
|
-
|
|
28
|
-
export class SignatureAirdropClient {
|
|
29
|
-
private projectId?: string;
|
|
30
|
-
private endpoint?: string;
|
|
31
|
-
private project: IProject | undefined;
|
|
32
|
-
protected claims?: IAirdropSignatureClaim[];
|
|
33
|
-
protected identities?: IAirdropSignatureIdentity[];
|
|
34
|
-
private projectPromise: Promise<void> | undefined;
|
|
35
|
-
private twitterPromise: Promise<void> | undefined;
|
|
36
|
-
private strategyCache: Map<string, EvmSignatureAirdropService | SolanaSignatureAirdropService> = new Map();
|
|
37
|
-
constructor(params: IAirdropOptions) {
|
|
38
|
-
this.projectId = params.projectId;
|
|
39
|
-
this.endpoint = params.endpoint;
|
|
40
|
-
if (this.project) {
|
|
41
|
-
this.project = params.project;
|
|
42
|
-
} else {
|
|
43
|
-
this.projectPromise = this.initializeProjects();
|
|
44
|
-
}
|
|
45
|
-
if (isMobile()) {
|
|
46
|
-
this.twitterPromise = this.checkAndHandleTwitterCode();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
private readonly LOCAL_STORAGE_SID_PREFIX = 'sid_';
|
|
51
|
-
|
|
52
|
-
private async checkAndHandleTwitterCode() {
|
|
53
|
-
try {
|
|
54
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
55
|
-
const code = urlParams.get('code');
|
|
56
|
-
const type = urlParams.get('type');
|
|
57
|
-
|
|
58
|
-
if (type === 'twitter' && code && this.projectId) {
|
|
59
|
-
const res = await connectTwitter({ code, projectId: this.projectId }, this.endpoint);
|
|
60
|
-
if (res?.sid) {
|
|
61
|
-
this.setSid(this.projectId!, res.sid);
|
|
62
|
-
}
|
|
63
|
-
cleanUrlParams(['code', 'type']);
|
|
64
|
-
}
|
|
65
|
-
} catch (error) {
|
|
66
|
-
console.error(error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
private setSid(projectId: string, sid: string): void {
|
|
71
|
-
window.localStorage.setItem(`${this.LOCAL_STORAGE_SID_PREFIX}${projectId}`, sid);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
private async fetchProjectDetails(projectId: string): Promise<void> {
|
|
75
|
-
this.project = await getAirdropProject(projectId, this.endpoint);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
protected async initializeProjects() {
|
|
79
|
-
try {
|
|
80
|
-
let projectId = this.projectId;
|
|
81
|
-
if (!projectId) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
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 connectX({ onSuccess, onError }: { onSuccess: () => void; onError: (error: Error) => void }) {
|
|
99
|
-
const project = await this.getProjectInfo();
|
|
100
|
-
const authorizeUrl = project.identities.find(
|
|
101
|
-
(item: any) => item.identityType === AirdropSigIdentityTypeEnum.Twitter
|
|
102
|
-
)?.authorizeUrl;
|
|
103
|
-
if (isMobile()) {
|
|
104
|
-
const state = encodeURIComponent(window.location.href);
|
|
105
|
-
window.location.href = `${authorizeUrl}&state=${state}`;
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const onWindowMessage = async (message: any) => {
|
|
109
|
-
if (message.data.name && message.data.name === CONST.TWITTER_AUTH_SUCCESS) {
|
|
110
|
-
const { code } = message.data.data || {};
|
|
111
|
-
try {
|
|
112
|
-
const res = await connectTwitter({ code, projectId: project.id }, this.endpoint);
|
|
113
|
-
|
|
114
|
-
if (res?.sid) {
|
|
115
|
-
this.setSid(project.id, res?.sid);
|
|
116
|
-
}
|
|
117
|
-
onSuccess();
|
|
118
|
-
} catch (error) {
|
|
119
|
-
onError(error as Error);
|
|
120
|
-
} finally {
|
|
121
|
-
window.removeEventListener('message', onWindowMessage);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
window.addEventListener('message', onWindowMessage);
|
|
127
|
-
window.open(`${authorizeUrl}&state=state`, `twitter_auth_${project.id}`, 'width=600,height=800');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
async connectWallet({
|
|
131
|
-
chainType,
|
|
132
|
-
onSuccess,
|
|
133
|
-
onError
|
|
134
|
-
}: {
|
|
135
|
-
chainType: ChainType;
|
|
136
|
-
onSuccess?: (address: string) => void;
|
|
137
|
-
onError?: (error: any) => void;
|
|
138
|
-
}) {
|
|
139
|
-
try {
|
|
140
|
-
const project = await this.getProjectInfo();
|
|
141
|
-
const wallet = WalletFactory.getWallet(chainType);
|
|
142
|
-
const timestamp = Date.now();
|
|
143
|
-
const recipientTypeMap = {
|
|
144
|
-
[ChainType.Evm]: AirdropSigIdentityTypeEnum.EVMWallet,
|
|
145
|
-
[ChainType.Solana]: AirdropSigIdentityTypeEnum.SolanaWallet,
|
|
146
|
-
[ChainType.Ton]: AirdropSigIdentityTypeEnum.TONWallet
|
|
147
|
-
};
|
|
148
|
-
const msg = [project.id, recipientTypeMap[chainType], timestamp].join(',');
|
|
149
|
-
const signResult = await wallet.signin(msg, false);
|
|
150
|
-
await wallet.disconnect();
|
|
151
|
-
const { message, signature } = signResult || {};
|
|
152
|
-
|
|
153
|
-
if (this.identities?.find((it) => it.value?.toLowerCase() === wallet.address?.toLowerCase())) {
|
|
154
|
-
onError?.(ErrorCode.WALLET_ALREADY_CONNECTED);
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const payload = {
|
|
159
|
-
signature: signature as string,
|
|
160
|
-
message: message as string,
|
|
161
|
-
key: wallet.publicKey || wallet.address!,
|
|
162
|
-
address: wallet.address!,
|
|
163
|
-
projectId: project.id,
|
|
164
|
-
timestamp: timestamp,
|
|
165
|
-
recipientType: recipientTypeMap[chainType]
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const res = await bindWallet(payload, this.endpoint);
|
|
169
|
-
if (res?.sid) {
|
|
170
|
-
this.setSid(project.id, res?.sid);
|
|
171
|
-
}
|
|
172
|
-
onSuccess?.(wallet.address!);
|
|
173
|
-
} catch (error) {
|
|
174
|
-
onError?.(error);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
async getClaims() {
|
|
179
|
-
const project = await this.getProjectInfo();
|
|
180
|
-
if (this.twitterPromise) {
|
|
181
|
-
await this.twitterPromise;
|
|
182
|
-
}
|
|
183
|
-
const res = await checkEligibility(
|
|
184
|
-
{
|
|
185
|
-
projectId: project.id
|
|
186
|
-
},
|
|
187
|
-
this.endpoint
|
|
188
|
-
);
|
|
189
|
-
this.claims = res.claims;
|
|
190
|
-
this.identities = res.identities;
|
|
191
|
-
return res;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
public async disconnectIdentity({
|
|
195
|
-
recipientType,
|
|
196
|
-
recipient
|
|
197
|
-
}: {
|
|
198
|
-
recipientType: AirdropSigIdentityTypeEnum;
|
|
199
|
-
recipient?: string;
|
|
200
|
-
}) {
|
|
201
|
-
const project = await this.getProjectInfo();
|
|
202
|
-
return await disconnectRecipient(
|
|
203
|
-
{
|
|
204
|
-
projectId: project.id,
|
|
205
|
-
recipientType,
|
|
206
|
-
recipient
|
|
207
|
-
},
|
|
208
|
-
this.endpoint
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
public async getStrategy(
|
|
213
|
-
walletClient?: IWalletClient
|
|
214
|
-
): Promise<EvmSignatureAirdropService | SolanaSignatureAirdropService> {
|
|
215
|
-
const project = await this.getProjectInfo();
|
|
216
|
-
|
|
217
|
-
const cacheKey = walletClient
|
|
218
|
-
? project.chainType === ChainType.Evm
|
|
219
|
-
? (walletClient as ViemWalletClient).account?.address!
|
|
220
|
-
: project.chainType === ChainType.Solana
|
|
221
|
-
? (walletClient as SolanaWalletState).publicKey!.toString()
|
|
222
|
-
: 'walletClient'
|
|
223
|
-
: 'default';
|
|
224
|
-
if (this.strategyCache.has(cacheKey)) {
|
|
225
|
-
return this.strategyCache.get(cacheKey)!;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const strategy =
|
|
229
|
-
project.chainType === ChainType.Solana
|
|
230
|
-
? new SolanaSignatureAirdropService({
|
|
231
|
-
chainId: project.chainId,
|
|
232
|
-
projectId: project.id,
|
|
233
|
-
token: project.tokenAddress,
|
|
234
|
-
walletClient: walletClient as any
|
|
235
|
-
})
|
|
236
|
-
: new EvmSignatureAirdropService({
|
|
237
|
-
chainId: Number(project.chainId) as ChainId,
|
|
238
|
-
contractAddress: project.contractAddress,
|
|
239
|
-
walletClient: walletClient as any
|
|
240
|
-
});
|
|
241
|
-
this.strategyCache.set(cacheKey, strategy);
|
|
242
|
-
return strategy;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
async getVersion(): Promise<string> {
|
|
246
|
-
const strategy = await this.getStrategy();
|
|
247
|
-
return strategy.getVersion();
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// solana prams need to wallet
|
|
251
|
-
async getClaimFee(amount?: bigint, walletClient?: IWalletClient): Promise<undefined | bigint> {
|
|
252
|
-
const strategy = await this.getStrategy(walletClient);
|
|
253
|
-
if (!strategy.getClaimFee) {
|
|
254
|
-
throw new Error('getClaimFee is not supported for this chain');
|
|
255
|
-
}
|
|
256
|
-
return await strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(1));
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
async claimAirdrop({
|
|
260
|
-
claimIds,
|
|
261
|
-
walletClient,
|
|
262
|
-
recipient
|
|
263
|
-
}: {
|
|
264
|
-
claimIds: string[];
|
|
265
|
-
walletClient: IWalletClient;
|
|
266
|
-
recipient: string;
|
|
267
|
-
}) {
|
|
268
|
-
if (!claimIds.length) {
|
|
269
|
-
throw new Error('Claim IDs cannot be empty');
|
|
270
|
-
}
|
|
271
|
-
if (!walletClient) {
|
|
272
|
-
throw new Error('Wallet client is required');
|
|
273
|
-
}
|
|
274
|
-
if (!this.claims?.length) {
|
|
275
|
-
throw new Error('No claims available');
|
|
276
|
-
}
|
|
277
|
-
const service = await this.getStrategy(walletClient);
|
|
278
|
-
const project = await this.getProjectInfo();
|
|
279
|
-
const res = await checkGetSignatures(
|
|
280
|
-
{
|
|
281
|
-
claimIds,
|
|
282
|
-
projectId: this.projectId!,
|
|
283
|
-
recipient
|
|
284
|
-
},
|
|
285
|
-
this.endpoint
|
|
286
|
-
);
|
|
287
|
-
if (!res?.signatures?.length) {
|
|
288
|
-
throw new Error('Failed to get signatures');
|
|
289
|
-
}
|
|
290
|
-
const signatureMap = res?.signatures?.reduce((map, item) => {
|
|
291
|
-
map[item.claimId] = item;
|
|
292
|
-
return map;
|
|
293
|
-
}, {} as Record<string, IClaimSignature>);
|
|
294
|
-
const filteredClaims = this.claims.filter((it) => claimIds.includes(it.claimId));
|
|
295
|
-
if (!filteredClaims.length) {
|
|
296
|
-
throw new Error('No matching claims found');
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// only evm use
|
|
300
|
-
const defaultRecipient =
|
|
301
|
-
project.chainType === ChainType.Evm ? (walletClient as ViemWalletClient).account?.address! : '';
|
|
302
|
-
|
|
303
|
-
const claimData = filteredClaims.map((it) => {
|
|
304
|
-
const signature = signatureMap[it.claimId];
|
|
305
|
-
if (!signature) {
|
|
306
|
-
throw new Error(`Signature not found for claim ID: ${it.claimId}`);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
return {
|
|
310
|
-
...it,
|
|
311
|
-
recipient: recipient ? recipient : defaultRecipient,
|
|
312
|
-
...signature
|
|
313
|
-
};
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
const hash = (await service!.claim(claimData, recipient)) as `0x${string}`;
|
|
317
|
-
return hash;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
async batchCheckClaimed(): Promise<boolean[]> {
|
|
321
|
-
if (!this.claims?.length) return [];
|
|
322
|
-
const strategy = await this.getStrategy();
|
|
323
|
-
if (!strategy.batchFetchClaimed) {
|
|
324
|
-
throw new Error('batchCheckClaimed is not supported for this chain');
|
|
325
|
-
}
|
|
326
|
-
const claimIds = this.claims?.map((it) => it.claimId);
|
|
327
|
-
return strategy.batchFetchClaimed(claimIds);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
async getPaused(): Promise<boolean> {
|
|
331
|
-
const strategy = await this.getStrategy();
|
|
332
|
-
if (!strategy.getPaused) {
|
|
333
|
-
throw new Error('getPaused is not supported for this chain');
|
|
334
|
-
}
|
|
335
|
-
return strategy.getPaused();
|
|
336
|
-
}
|
|
337
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ChainConfig, SupportedChains } from '../constants';
|
|
2
|
-
import { ChainId } from '../types';
|
|
3
|
-
import { projectDataForTon } from './projectDataForTon';
|
|
4
|
-
|
|
5
|
-
export function getChainById(chainId: ChainId) {
|
|
6
|
-
const chain = SupportedChains.find((chain) => chain.id === chainId);
|
|
7
|
-
|
|
8
|
-
if (!chain) {
|
|
9
|
-
throw new Error(`ChainId ${chainId} not supported.`);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return chain;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function getChainConfig(chainId: ChainId) {
|
|
16
|
-
return ChainConfig[chainId];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function getChainRpc(chainId: ChainId): string {
|
|
20
|
-
const config = getChainConfig(chainId as any);
|
|
21
|
-
|
|
22
|
-
if (!config) {
|
|
23
|
-
throw new Error(`ChainId ${chainId} not supported.`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return config?.rpcUrl;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const getTonProjectIdByAddress = ({
|
|
30
|
-
address,
|
|
31
|
-
slug,
|
|
32
|
-
data
|
|
33
|
-
}: {
|
|
34
|
-
address?: string;
|
|
35
|
-
slug: string;
|
|
36
|
-
data: Record<string, string>;
|
|
37
|
-
}): string | undefined => {
|
|
38
|
-
let project: Record<string, string> = projectDataForTon[slug as keyof typeof projectDataForTon];
|
|
39
|
-
if (!project) {
|
|
40
|
-
project = data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!address) {
|
|
44
|
-
const firstProject = Object.values(project)[0];
|
|
45
|
-
return firstProject;
|
|
46
|
-
}
|
|
47
|
-
const lastText = address[address.length - 1];
|
|
48
|
-
|
|
49
|
-
const group = Object.keys(project || {}).find((key) => key.includes(lastText));
|
|
50
|
-
|
|
51
|
-
const projectId = group ? project[group as keyof typeof project] : undefined;
|
|
52
|
-
|
|
53
|
-
return projectId;
|
|
54
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export const projectDataForTon = {
|
|
2
|
-
ava: {
|
|
3
|
-
'12345': 'AD_18uwEPKbTXZo',
|
|
4
|
-
'67890': 'AD_XOPhRRGggtjK',
|
|
5
|
-
abcABC: 'AD_qKwG21hnimAB',
|
|
6
|
-
defDEF: 'AD_CfAV1GNekDAQ',
|
|
7
|
-
ghiGHI: 'AD_uwipChWywF4V',
|
|
8
|
-
jklJKL: 'AD_d3tai5RtikM2',
|
|
9
|
-
mnoMNO: 'AD_dMEF8ToRIqzY',
|
|
10
|
-
pqrPQR: 'AD_vdx6P5QHc1ES',
|
|
11
|
-
stuSTU: 'AD_2k77RlCRD1ds',
|
|
12
|
-
vwxVWX: 'AD_hiXx1hLsIkBM',
|
|
13
|
-
'yz-_YZ': 'AD_cj99f5rdUU8C'
|
|
14
|
-
},
|
|
15
|
-
dogs: {
|
|
16
|
-
'12': 'AD_P2ipWbDVrtSE',
|
|
17
|
-
'34': 'AD_cXW3IFfYHfa5',
|
|
18
|
-
'56': 'AD_NG5bNpQOHuqI',
|
|
19
|
-
'78': 'AD_KvnQeG76AgYs',
|
|
20
|
-
'90': 'AD_xlv2JO3PQdtR',
|
|
21
|
-
aA: 'AD_kc0CJE8RPvJy',
|
|
22
|
-
bB: 'AD_yRFzJyPoAOY4',
|
|
23
|
-
cC: 'AD_yN14YHi4F29p',
|
|
24
|
-
dD: 'AD_jWsTmtfnbzVn',
|
|
25
|
-
eE: 'AD_ZfFnjr06dhp7',
|
|
26
|
-
fF: 'AD_s58jwEK3EggA',
|
|
27
|
-
gG: 'AD_qKszLFxv5PDy',
|
|
28
|
-
hH: 'AD_RzefaG1fi44A',
|
|
29
|
-
iI: 'AD_LItldBE09QRn',
|
|
30
|
-
jJ: 'AD_SzKbQmVOz0S1',
|
|
31
|
-
kK: 'AD_rNrYIzCzye0W',
|
|
32
|
-
lL: 'AD_IbtlhoM0M6SZ',
|
|
33
|
-
mM: 'AD_m2NUNiwCgFES',
|
|
34
|
-
nN: 'AD_3mb6NTcYPw5y',
|
|
35
|
-
oO: 'AD_kVrO6qmmZDUK',
|
|
36
|
-
pP: 'AD_cV9g8YMQZ0iB',
|
|
37
|
-
qQ: 'AD_esdFer2shKO3',
|
|
38
|
-
rR: 'AD_BqZmJzFKapu0',
|
|
39
|
-
sS: 'AD_iOU6Rnltj3sx',
|
|
40
|
-
tT: 'AD_M8J1QU64Yuzi',
|
|
41
|
-
uU: 'AD_es9ceiuC8TXq',
|
|
42
|
-
vV: 'AD_7DXSpRcGivjO',
|
|
43
|
-
wW: 'AD_0uI9R6Sc6jY4',
|
|
44
|
-
xX: 'AD_FyrRNdtrgqKj',
|
|
45
|
-
yY: 'AD_JR0ktPVqVriT',
|
|
46
|
-
zZ: 'AD_bb9I2XdIqM6W',
|
|
47
|
-
'_-': 'AD_qaLi6r8K9BAv'
|
|
48
|
-
},
|
|
49
|
-
ava2: {
|
|
50
|
-
'1234567890_': 'AD_EZFWfhs641YQ',
|
|
51
|
-
'aAbBcCdDeE-': 'AD_jCVjsDT9g6h3',
|
|
52
|
-
fFgGhHiIjJ: 'AD_7nF9gncQeVW3',
|
|
53
|
-
kKlLmMnNoO: 'AD_RmoPsyKeIah0',
|
|
54
|
-
pPqQrRsStTZ: 'AD_zrK1RVGQ2Ogl',
|
|
55
|
-
uUvVwWxXyYz: 'AD_fKN6IcxEIdIA'
|
|
56
|
-
},
|
|
57
|
-
wat: {
|
|
58
|
-
'1234': 'AD_sMtwhyrqUFiZ',
|
|
59
|
-
'5678': 'AD_CMZVOHQjeVBp',
|
|
60
|
-
aAbB: 'AD_sdmcLLcDS59f',
|
|
61
|
-
cCdD: 'AD_M9Zyy7VaLuR1',
|
|
62
|
-
eEfF: 'AD_K4WWeUvk7aMj',
|
|
63
|
-
gGhH: 'AD_AmCnivdzxToB',
|
|
64
|
-
iIjJ: 'AD_2NgsKs5nyJhe',
|
|
65
|
-
kKlL: 'AD_IOPluo9KRSM9',
|
|
66
|
-
mMnN: 'AD_FMOlFAIOycQw',
|
|
67
|
-
oOpP: 'AD_NCW9yZdOTPQ9',
|
|
68
|
-
qQrR: 'AD_JjOkeBs0Jfsb',
|
|
69
|
-
sStT: 'AD_hUkWbwWMWUvp',
|
|
70
|
-
uUvV: 'AD_w9UAKxCxU84P',
|
|
71
|
-
wWxX: 'AD_Vwa41VRRXjpP',
|
|
72
|
-
yYzZ: 'AD_XQbS0ksJGDrB',
|
|
73
|
-
'90_-': 'AD_LhssByVDm8Q1'
|
|
74
|
-
},
|
|
75
|
-
roolz: {
|
|
76
|
-
abcdefghijklmnopqrstuvwxyz12345_: 'AD_3ZoF8wq7leAI',
|
|
77
|
-
'ABCDEFGHIJKLMNOPQRSTUVWXYZ67890-': 'AD_HMFs2ubSrC1K'
|
|
78
|
-
}
|
|
79
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { CHAIN } from '@tonconnect/ui-react';
|
|
2
|
-
import {
|
|
3
|
-
base,
|
|
4
|
-
baseSepolia,
|
|
5
|
-
cyber,
|
|
6
|
-
mainnet,
|
|
7
|
-
polygonMumbai,
|
|
8
|
-
polygonAmoy,
|
|
9
|
-
sepolia,
|
|
10
|
-
zetachain,
|
|
11
|
-
zetachainAthensTestnet,
|
|
12
|
-
zkSync,
|
|
13
|
-
bsc,
|
|
14
|
-
berachainTestnet,
|
|
15
|
-
arbitrum
|
|
16
|
-
} from 'viem/chains';
|
|
17
|
-
import { mevmDevNet, tonMainNet, tonTestNet } from './network';
|
|
18
|
-
|
|
19
|
-
export const ChainConfig = {
|
|
20
|
-
[mainnet.id]: {
|
|
21
|
-
contractAddress: '0x0993Dd5384BcD116A3543889BC6ffA6C98948631',
|
|
22
|
-
rpcUrl: 'https://eth-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
|
|
23
|
-
},
|
|
24
|
-
[bsc.id]: {
|
|
25
|
-
contractAddress: '0x6c241FF6d5c3f074b49aC10872770529d9e27BA4',
|
|
26
|
-
rpcUrl: 'https://bnb-mainnet.g.alchemy.com/v2/udrqNPSB6i5n5L6QSM31Ng72h_hFOrVT'
|
|
27
|
-
},
|
|
28
|
-
[base.id]: {
|
|
29
|
-
contractAddress: '0x3d1abcD56d53f7C8b04A753C6AF397903DC0f0F2',
|
|
30
|
-
rpcUrl: base.rpcUrls.default.http[0]
|
|
31
|
-
},
|
|
32
|
-
[cyber.id]: {
|
|
33
|
-
contractAddress: '0x7915dA247674E430b2a4Dcf01e4471f709428Bc0',
|
|
34
|
-
rpcUrl: cyber.rpcUrls.default.http[0]
|
|
35
|
-
},
|
|
36
|
-
[sepolia.id]: {
|
|
37
|
-
contractAddress: '0xf3f5243B35376c6dea04169983A8c853c8BE6d69',
|
|
38
|
-
rpcUrl: 'https://eth-sepolia.public.blastapi.io'
|
|
39
|
-
},
|
|
40
|
-
[baseSepolia.id]: {
|
|
41
|
-
contractAddress: '0x66c9fe5c76672B06Bf497eFfdaAfDf897D1e68d8',
|
|
42
|
-
rpcUrl: baseSepolia.rpcUrls.default.http[0]
|
|
43
|
-
},
|
|
44
|
-
[zetachainAthensTestnet.id]: {
|
|
45
|
-
contractAddress: '0x63aE2f2260DEfc11932d22410B976Ec29F54498B',
|
|
46
|
-
rpcUrl: zetachainAthensTestnet.rpcUrls.default.http[0]
|
|
47
|
-
},
|
|
48
|
-
[zetachain.id]: {
|
|
49
|
-
contractAddress: '0x00aFD4466E4Afa4F43cCd414b1BC65e574ACA2f5',
|
|
50
|
-
rpcUrl: 'https://zetachain-mainnet.g.alchemy.com/v2/1tmk0FrhwTJHXh0XIyae7_SXw1lDCjgs'
|
|
51
|
-
},
|
|
52
|
-
[arbitrum.id]: {
|
|
53
|
-
contractAddress: '0x759ac3CA33FeeAfB8C41aEbC8687A7Bd849Fc87a',
|
|
54
|
-
rpcUrl: arbitrum.rpcUrls.default.http[0]
|
|
55
|
-
},
|
|
56
|
-
[berachainTestnet.id]: {
|
|
57
|
-
contractAddress: '',
|
|
58
|
-
rpcUrl: '',
|
|
59
|
-
availableSolutions: []
|
|
60
|
-
},
|
|
61
|
-
[polygonMumbai.id]: {
|
|
62
|
-
contractAddress: '',
|
|
63
|
-
rpcUrl: '',
|
|
64
|
-
availableSolutions: []
|
|
65
|
-
},
|
|
66
|
-
[polygonAmoy.id]: {
|
|
67
|
-
contractAddress: '',
|
|
68
|
-
rpcUrl: '',
|
|
69
|
-
availableSolutions: []
|
|
70
|
-
},
|
|
71
|
-
[mevmDevNet.id]: {
|
|
72
|
-
contractAddress: '0x8D92827CdB67A503e9FB21B28a58F9dAb36B4973',
|
|
73
|
-
rpcUrl: mevmDevNet.rpcUrls.default.http[0]
|
|
74
|
-
},
|
|
75
|
-
[CHAIN.TESTNET]: {
|
|
76
|
-
name: 'TestNet',
|
|
77
|
-
contractAddress: '',
|
|
78
|
-
rpcUrl: 'https://testnet.toncenter.com/api/v2/jsonRPC', //https://toncenter.com/api/v2/jsonRPC
|
|
79
|
-
tonApiPrefix: 'https://testnet.tonapi.io',
|
|
80
|
-
blockExplorer: 'https://testnet.tonviewer.com'
|
|
81
|
-
},
|
|
82
|
-
[CHAIN.MAINNET]: {
|
|
83
|
-
name: 'MainNet',
|
|
84
|
-
contractAddress: '',
|
|
85
|
-
rpcUrl: 'https://toncenter.com/api/v2/jsonRPC',
|
|
86
|
-
tonApiPrefix: 'https://tonapi.io',
|
|
87
|
-
blockExplorer: 'https://tonviewer.com'
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
export const SupportedChains = [
|
|
92
|
-
mainnet,
|
|
93
|
-
bsc,
|
|
94
|
-
base,
|
|
95
|
-
cyber,
|
|
96
|
-
sepolia,
|
|
97
|
-
baseSepolia,
|
|
98
|
-
zetachain,
|
|
99
|
-
zetachainAthensTestnet,
|
|
100
|
-
berachainTestnet,
|
|
101
|
-
polygonMumbai,
|
|
102
|
-
polygonAmoy,
|
|
103
|
-
mevmDevNet,
|
|
104
|
-
arbitrum,
|
|
105
|
-
tonTestNet,
|
|
106
|
-
tonMainNet
|
|
107
|
-
];
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { CHAIN } from '@tonconnect/ui-react';
|
|
2
|
-
import { defineChain } from 'viem';
|
|
3
|
-
|
|
4
|
-
export const mevmDevNet = defineChain({
|
|
5
|
-
id: 30732,
|
|
6
|
-
name: 'Movement M1 Devnet',
|
|
7
|
-
network: 'mevm',
|
|
8
|
-
nativeCurrency: { name: 'Move', symbol: 'MOVE', decimals: 18 },
|
|
9
|
-
rpcUrls: {
|
|
10
|
-
default: {
|
|
11
|
-
http: ['https://mevm.devnet.imola.movementlabs.xyz']
|
|
12
|
-
},
|
|
13
|
-
public: {
|
|
14
|
-
http: ['https://mevm.devnet.imola.movementlabs.xyz']
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
blockExplorers: {
|
|
18
|
-
etherscan: { name: 'Arbiscan', url: 'https://explorer.devnet.imola.movementlabs.xyz/' },
|
|
19
|
-
default: { name: 'Arbiscan', url: 'https://explorer.devnet.imola.movementlabs.xyz/' }
|
|
20
|
-
},
|
|
21
|
-
contracts: {
|
|
22
|
-
multicall3: {
|
|
23
|
-
address: '0xD67Eca381AAbd0c049554f5714E7d8C21864c560',
|
|
24
|
-
blockCreated: 500
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const tonTestNet = {
|
|
30
|
-
id: CHAIN.TESTNET,
|
|
31
|
-
name: 'TON Testnet',
|
|
32
|
-
network: 'TON_TESTNET',
|
|
33
|
-
nativeCurrency: {
|
|
34
|
-
decimals: 9,
|
|
35
|
-
name: 'TON',
|
|
36
|
-
symbol: 'TON'
|
|
37
|
-
},
|
|
38
|
-
rpcUrls: {
|
|
39
|
-
public: {
|
|
40
|
-
http: []
|
|
41
|
-
},
|
|
42
|
-
default: {
|
|
43
|
-
http: []
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
blockExplorers: {
|
|
47
|
-
default: {
|
|
48
|
-
name: 'tonviewer',
|
|
49
|
-
url: 'https://testnet.tonviewer.com'
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
testnet: true
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const tonMainNet = {
|
|
56
|
-
id: CHAIN.MAINNET,
|
|
57
|
-
name: 'TON Mainnet',
|
|
58
|
-
network: 'TON_MAINNET',
|
|
59
|
-
nativeCurrency: {
|
|
60
|
-
decimals: 9,
|
|
61
|
-
name: 'TON',
|
|
62
|
-
symbol: 'TON'
|
|
63
|
-
},
|
|
64
|
-
rpcUrls: {
|
|
65
|
-
public: {
|
|
66
|
-
http: []
|
|
67
|
-
},
|
|
68
|
-
default: {
|
|
69
|
-
http: []
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
blockExplorers: {
|
|
73
|
-
default: {
|
|
74
|
-
name: 'tonviwer',
|
|
75
|
-
url: 'https://tonviewer.com'
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
};
|