@sign-global/tokentable 0.4.1-beta.8 → 0.4.2-beta.0
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/contracts/evm/SignatureAirdropService.d.ts +2 -0
- package/dist/cjs/airdrop/contracts/evm/SignatureAirdropService.js +12 -0
- package/dist/cjs/airdrop/contracts/evm/SignatureAirdropService.js.map +1 -1
- package/dist/cjs/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.d.ts +17 -0
- package/dist/cjs/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.js +51 -0
- package/dist/cjs/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.js.map +1 -0
- package/dist/cjs/airdrop/contracts/evm/contracts/abis/FungibleTokenWithFeesECDSADistributor.json +260 -0
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.js +6 -2
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/fee_collector.d.ts +11 -10
- package/dist/cjs/airdrop/contracts/solana/fee_collector.json +12 -11
- package/dist/cjs/airdrop/contracts/solana/fungible_token_distributor_solana.d.ts +8 -4
- package/dist/cjs/airdrop/contracts/solana/fungible_token_distributor_solana.json +8 -4
- package/dist/cjs/airdrop/index.d.ts +1 -0
- package/dist/cjs/airdrop/index.js +6 -1
- package/dist/cjs/airdrop/index.js.map +1 -1
- package/dist/esm/airdrop/contracts/evm/SignatureAirdropService.d.ts +2 -0
- package/dist/esm/airdrop/contracts/evm/SignatureAirdropService.js +12 -0
- package/dist/esm/airdrop/contracts/evm/SignatureAirdropService.js.map +1 -1
- package/dist/esm/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.d.ts +17 -0
- package/dist/esm/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.js +44 -0
- package/dist/esm/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.js.map +1 -0
- package/dist/esm/airdrop/contracts/evm/contracts/abis/FungibleTokenWithFeesECDSADistributor.json +260 -0
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.js +6 -2
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/fee_collector.d.ts +11 -10
- package/dist/esm/airdrop/contracts/solana/fee_collector.json +12 -11
- package/dist/esm/airdrop/contracts/solana/fungible_token_distributor_solana.d.ts +8 -4
- package/dist/esm/airdrop/contracts/solana/fungible_token_distributor_solana.json +8 -4
- package/dist/esm/airdrop/index.d.ts +1 -0
- package/dist/esm/airdrop/index.js +1 -0
- package/dist/esm/airdrop/index.js.map +1 -1
- package/package.json +1 -1
- package/src/airdrop/contracts/evm/SignatureAirdropService.ts +15 -0
- package/src/airdrop/contracts/evm/contracts/AirdropSignatureFeeClient.ts +61 -0
- package/src/airdrop/contracts/evm/contracts/abis/FungibleTokenWithFeesECDSADistributor.json +260 -0
- package/src/airdrop/contracts/solana/AirdropSignatureClient.ts +6 -2
- package/src/airdrop/contracts/solana/fee_collector.json +12 -11
- package/src/airdrop/contracts/solana/fee_collector.ts +12 -11
- package/src/airdrop/contracts/solana/fungible_token_distributor_solana.json +8 -4
- package/src/airdrop/contracts/solana/fungible_token_distributor_solana.ts +8 -4
- package/src/airdrop/index.ts +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "2fLgxHG1eCxQmfUMn8LYffxE7EQKWzeJhDpcAsyb1VKA",
|
|
3
3
|
"metadata": {
|
|
4
4
|
"name": "fungible_token_distributor_solana",
|
|
5
5
|
"version": "0.1.0",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
{
|
|
175
175
|
"name": "fee_collector",
|
|
176
176
|
"optional": true,
|
|
177
|
-
"address": "
|
|
177
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
"name": "fee_token_mint",
|
|
@@ -192,6 +192,10 @@
|
|
|
192
192
|
{
|
|
193
193
|
"name": "token_program"
|
|
194
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"name": "fee_token_program",
|
|
197
|
+
"optional": true
|
|
198
|
+
},
|
|
195
199
|
{
|
|
196
200
|
"name": "associated_token_program",
|
|
197
201
|
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
@@ -464,7 +468,7 @@
|
|
|
464
468
|
{
|
|
465
469
|
"name": "fee_collector",
|
|
466
470
|
"optional": true,
|
|
467
|
-
"address": "
|
|
471
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
468
472
|
},
|
|
469
473
|
{
|
|
470
474
|
"name": "fee_collector_storage",
|
|
@@ -685,7 +689,7 @@
|
|
|
685
689
|
{
|
|
686
690
|
"name": "fee_collector",
|
|
687
691
|
"optional": true,
|
|
688
|
-
"address": "
|
|
692
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
689
693
|
},
|
|
690
694
|
{
|
|
691
695
|
"name": "fee_collector_storage",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { AirdropClient } from './AirdropClient';
|
|
2
2
|
export { SignatureAirdropClient } from './SignatureAirdropClient';
|
|
3
|
+
export { EvmSignatureAirdropService, SolanaSignatureAirdropService, EvmAirdropService, TonAirdropService } from './contracts';
|
|
3
4
|
export { CONST } from './constants';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { AirdropClient } from './AirdropClient';
|
|
2
2
|
export { SignatureAirdropClient } from './SignatureAirdropClient';
|
|
3
|
+
export { EvmSignatureAirdropService, SolanaSignatureAirdropService, EvmAirdropService, TonAirdropService } from './contracts';
|
|
3
4
|
export { CONST } from './constants';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/airdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/airdrop/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { ChainId, EvmContractClientOption } from '../../types';
|
|
|
4
4
|
import { AirdropSignatureClient } from './contracts/AirdropSignatureClient';
|
|
5
5
|
import { DeployerClient } from './contracts/DeployClient';
|
|
6
6
|
import { FeeCollectorClient } from './contracts/FeeCollectorClient';
|
|
7
|
+
import { AirdropSignatureFeeClient } from './contracts/AirdropSignatureFeeClient';
|
|
7
8
|
|
|
8
9
|
export class SignatureAirdropService {
|
|
9
10
|
options: EvmContractClientOption;
|
|
@@ -18,6 +19,13 @@ export class SignatureAirdropService {
|
|
|
18
19
|
|
|
19
20
|
return new AirdropSignatureClient(this.options);
|
|
20
21
|
}
|
|
22
|
+
private get airdropWithFeeClient(): AirdropSignatureFeeClient {
|
|
23
|
+
if (!this.options) {
|
|
24
|
+
throw new Error('options is empty');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return new AirdropSignatureFeeClient(this.options);
|
|
28
|
+
}
|
|
21
29
|
|
|
22
30
|
async getDeployerClient(): Promise<DeployerClient> {
|
|
23
31
|
const deployer = await this.getDeployer();
|
|
@@ -86,10 +94,17 @@ export class SignatureAirdropService {
|
|
|
86
94
|
claimId: string;
|
|
87
95
|
data: string;
|
|
88
96
|
signature: string;
|
|
97
|
+
fees?: string;
|
|
89
98
|
extraData?: string;
|
|
90
99
|
}[],
|
|
91
100
|
recipient?: string
|
|
92
101
|
) {
|
|
102
|
+
const version = await this.getVersion();
|
|
103
|
+
|
|
104
|
+
if (version.includes('FungibleTokenWithFeesECDSADistributor')) {
|
|
105
|
+
const totalFees = data.map((item) => BigInt(item.fees || '0')).reduce((sum, fee) => sum + fee, BigInt(0));
|
|
106
|
+
return this.airdropWithFeeClient.claim(data, totalFees);
|
|
107
|
+
}
|
|
93
108
|
const defaultRecipient = this.options.walletClient?.account?.address;
|
|
94
109
|
const delegateMode = recipient ? getAddress(recipient) !== defaultRecipient : false;
|
|
95
110
|
const feeData = (await this.getClaimFee(this.options.contractAddress, 1n)) || 0n;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EvmContractClientOption } from '../../../types';
|
|
2
|
+
import ABI from './abis/FungibleTokenWithFeesECDSADistributor.json';
|
|
3
|
+
import { ContractBaseClient } from './ContractBaseClient';
|
|
4
|
+
|
|
5
|
+
export class AirdropSignatureFeeClient extends ContractBaseClient {
|
|
6
|
+
constructor(options: EvmContractClientOption) {
|
|
7
|
+
super({
|
|
8
|
+
...options,
|
|
9
|
+
abi: ABI
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async getClaimStatus(userClaimId: string) {
|
|
14
|
+
return this.readContract({ functionName: 'getClaimStatus', args: [userClaimId] });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async claim(
|
|
18
|
+
data: {
|
|
19
|
+
recipient: string;
|
|
20
|
+
data: string;
|
|
21
|
+
claimId: string;
|
|
22
|
+
signature: string;
|
|
23
|
+
extraData?: string;
|
|
24
|
+
}[],
|
|
25
|
+
value?: bigint
|
|
26
|
+
) {
|
|
27
|
+
const [recipients = [], userClaimIds = [], datas = [], signatures = [], extraDatas = []] = [
|
|
28
|
+
'recipient',
|
|
29
|
+
'claimId',
|
|
30
|
+
'data',
|
|
31
|
+
'signature',
|
|
32
|
+
'extraData'
|
|
33
|
+
].map((key) => data.map((item) => item[key as keyof (typeof data)[0]] || ''));
|
|
34
|
+
|
|
35
|
+
return this.writeContract({
|
|
36
|
+
functionName: 'claim',
|
|
37
|
+
args: [recipients, userClaimIds, datas, signatures, extraDatas],
|
|
38
|
+
value: value || 0n
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async batchFetchClaimed(userClaimIds: string[]) {
|
|
43
|
+
const res = (await this.readContract({ functionName: 'getClaimStatus', args: [userClaimIds] })) as boolean[];
|
|
44
|
+
return res;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async getDeployer() {
|
|
48
|
+
const res = (await this.readContract({ functionName: 'getStorage' })) as any[];
|
|
49
|
+
return res?.[3] as string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async getVersion() {
|
|
53
|
+
const res = (await this.readContract({ functionName: 'getStorage' })) as any[];
|
|
54
|
+
return res?.[0];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async getPaused() {
|
|
58
|
+
const res = (await this.readContract({ functionName: 'getStorage' })) as any[];
|
|
59
|
+
return res?.[2] as boolean;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [{ "internalType": "address", "name": "target", "type": "address" }],
|
|
4
|
+
"name": "AddressEmptyCode",
|
|
5
|
+
"type": "error"
|
|
6
|
+
},
|
|
7
|
+
{ "inputs": [], "name": "ClaimClaimed", "type": "error" },
|
|
8
|
+
{
|
|
9
|
+
"inputs": [{ "internalType": "address", "name": "implementation", "type": "address" }],
|
|
10
|
+
"name": "ERC1967InvalidImplementation",
|
|
11
|
+
"type": "error"
|
|
12
|
+
},
|
|
13
|
+
{ "inputs": [], "name": "ERC1967NonPayable", "type": "error" },
|
|
14
|
+
{ "inputs": [], "name": "EnforcedPause", "type": "error" },
|
|
15
|
+
{ "inputs": [], "name": "ExpectedPause", "type": "error" },
|
|
16
|
+
{ "inputs": [], "name": "FailedCall", "type": "error" },
|
|
17
|
+
{ "inputs": [], "name": "IncorrectFees", "type": "error" },
|
|
18
|
+
{ "inputs": [], "name": "InvalidInitialization", "type": "error" },
|
|
19
|
+
{ "inputs": [], "name": "InvalidSignature", "type": "error" },
|
|
20
|
+
{ "inputs": [], "name": "NotInitializing", "type": "error" },
|
|
21
|
+
{ "inputs": [], "name": "OutsideClaimableTimeRange", "type": "error" },
|
|
22
|
+
{
|
|
23
|
+
"inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
|
|
24
|
+
"name": "OwnableInvalidOwner",
|
|
25
|
+
"type": "error"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"inputs": [{ "internalType": "address", "name": "account", "type": "address" }],
|
|
29
|
+
"name": "OwnableUnauthorizedAccount",
|
|
30
|
+
"type": "error"
|
|
31
|
+
},
|
|
32
|
+
{ "inputs": [], "name": "ReentrancyGuardReentrantCall", "type": "error" },
|
|
33
|
+
{
|
|
34
|
+
"inputs": [{ "internalType": "address", "name": "token", "type": "address" }],
|
|
35
|
+
"name": "SafeERC20FailedOperation",
|
|
36
|
+
"type": "error"
|
|
37
|
+
},
|
|
38
|
+
{ "inputs": [], "name": "TimeInactive", "type": "error" },
|
|
39
|
+
{ "inputs": [], "name": "UUPSUnauthorizedCallContext", "type": "error" },
|
|
40
|
+
{
|
|
41
|
+
"inputs": [{ "internalType": "bytes32", "name": "slot", "type": "bytes32" }],
|
|
42
|
+
"name": "UUPSUnsupportedProxiableUUID",
|
|
43
|
+
"type": "error"
|
|
44
|
+
},
|
|
45
|
+
{ "inputs": [], "name": "UnsupportedOperation", "type": "error" },
|
|
46
|
+
{
|
|
47
|
+
"anonymous": false,
|
|
48
|
+
"inputs": [{ "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" }],
|
|
49
|
+
"name": "Initialized",
|
|
50
|
+
"type": "event"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"anonymous": false,
|
|
54
|
+
"inputs": [
|
|
55
|
+
{ "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
|
|
56
|
+
{ "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
|
|
57
|
+
],
|
|
58
|
+
"name": "OwnershipTransferred",
|
|
59
|
+
"type": "event"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"anonymous": false,
|
|
63
|
+
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
|
|
64
|
+
"name": "Paused",
|
|
65
|
+
"type": "event"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"anonymous": false,
|
|
69
|
+
"inputs": [{ "indexed": false, "internalType": "address", "name": "account", "type": "address" }],
|
|
70
|
+
"name": "Unpaused",
|
|
71
|
+
"type": "event"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"anonymous": false,
|
|
75
|
+
"inputs": [{ "indexed": true, "internalType": "address", "name": "implementation", "type": "address" }],
|
|
76
|
+
"name": "Upgraded",
|
|
77
|
+
"type": "event"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"inputs": [],
|
|
81
|
+
"name": "UPGRADE_INTERFACE_VERSION",
|
|
82
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
83
|
+
"stateMutability": "view",
|
|
84
|
+
"type": "function"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"inputs": [
|
|
88
|
+
{ "internalType": "address[]", "name": "recipients", "type": "address[]" },
|
|
89
|
+
{ "internalType": "bytes32[]", "name": "userClaimIds", "type": "bytes32[]" },
|
|
90
|
+
{ "internalType": "bytes[]", "name": "datas", "type": "bytes[]" },
|
|
91
|
+
{ "internalType": "bytes[]", "name": "signatures", "type": "bytes[]" },
|
|
92
|
+
{ "internalType": "bytes[]", "name": "extraDatas", "type": "bytes[]" }
|
|
93
|
+
],
|
|
94
|
+
"name": "claim",
|
|
95
|
+
"outputs": [],
|
|
96
|
+
"stateMutability": "payable",
|
|
97
|
+
"type": "function"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"inputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
|
|
101
|
+
"name": "decodeUserClaimData",
|
|
102
|
+
"outputs": [
|
|
103
|
+
{
|
|
104
|
+
"components": [
|
|
105
|
+
{ "internalType": "uint256", "name": "claimableTimestamp", "type": "uint256" },
|
|
106
|
+
{ "internalType": "uint256", "name": "claimableAmount", "type": "uint256" }
|
|
107
|
+
],
|
|
108
|
+
"internalType": "struct FungibleTokenECDSADistributorData",
|
|
109
|
+
"name": "",
|
|
110
|
+
"type": "tuple"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"stateMutability": "pure",
|
|
114
|
+
"type": "function"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"inputs": [{ "internalType": "bytes", "name": "userClaimData", "type": "bytes" }],
|
|
118
|
+
"name": "decodeUserClaimDataWithFees",
|
|
119
|
+
"outputs": [
|
|
120
|
+
{
|
|
121
|
+
"components": [
|
|
122
|
+
{ "internalType": "uint256", "name": "claimableTimestamp", "type": "uint256" },
|
|
123
|
+
{ "internalType": "uint256", "name": "claimableAmount", "type": "uint256" },
|
|
124
|
+
{ "internalType": "uint256", "name": "fees", "type": "uint256" }
|
|
125
|
+
],
|
|
126
|
+
"internalType": "struct FungibleTokenWithFeesECDSADistributorData",
|
|
127
|
+
"name": "",
|
|
128
|
+
"type": "tuple"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"stateMutability": "pure",
|
|
132
|
+
"type": "function"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"inputs": [
|
|
136
|
+
{ "internalType": "bytes32", "name": "userClaimId", "type": "bytes32" },
|
|
137
|
+
{ "internalType": "bytes", "name": "userClaimData", "type": "bytes" }
|
|
138
|
+
],
|
|
139
|
+
"name": "encodeHashToBeSigned",
|
|
140
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
141
|
+
"stateMutability": "view",
|
|
142
|
+
"type": "function"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"inputs": [{ "internalType": "bytes32[]", "name": "userClaimIds", "type": "bytes32[]" }],
|
|
146
|
+
"name": "getClaimStatus",
|
|
147
|
+
"outputs": [{ "internalType": "bool[]", "name": "", "type": "bool[]" }],
|
|
148
|
+
"stateMutability": "view",
|
|
149
|
+
"type": "function"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"inputs": [],
|
|
153
|
+
"name": "getStorage",
|
|
154
|
+
"outputs": [
|
|
155
|
+
{ "internalType": "string", "name": "version_", "type": "string" },
|
|
156
|
+
{ "internalType": "address", "name": "owner", "type": "address" },
|
|
157
|
+
{ "internalType": "bool", "name": "paused", "type": "bool" },
|
|
158
|
+
{ "internalType": "address", "name": "deployer", "type": "address" },
|
|
159
|
+
{ "internalType": "address", "name": "authorizedSigner", "type": "address" },
|
|
160
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
161
|
+
{ "internalType": "address", "name": "claimHook", "type": "address" },
|
|
162
|
+
{ "internalType": "uint256", "name": "startTime", "type": "uint256" },
|
|
163
|
+
{ "internalType": "uint256", "name": "endTime", "type": "uint256" }
|
|
164
|
+
],
|
|
165
|
+
"stateMutability": "view",
|
|
166
|
+
"type": "function"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"inputs": [{ "internalType": "address", "name": "owner_", "type": "address" }],
|
|
170
|
+
"name": "initialize",
|
|
171
|
+
"outputs": [],
|
|
172
|
+
"stateMutability": "nonpayable",
|
|
173
|
+
"type": "function"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"inputs": [],
|
|
177
|
+
"name": "owner",
|
|
178
|
+
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
|
179
|
+
"stateMutability": "view",
|
|
180
|
+
"type": "function"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"inputs": [],
|
|
184
|
+
"name": "paused",
|
|
185
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
|
186
|
+
"stateMutability": "view",
|
|
187
|
+
"type": "function"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"inputs": [],
|
|
191
|
+
"name": "proxiableUUID",
|
|
192
|
+
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
|
|
193
|
+
"stateMutability": "view",
|
|
194
|
+
"type": "function"
|
|
195
|
+
},
|
|
196
|
+
{ "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
|
197
|
+
{
|
|
198
|
+
"inputs": [
|
|
199
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
|
200
|
+
{ "internalType": "uint256", "name": "startTime", "type": "uint256" },
|
|
201
|
+
{ "internalType": "uint256", "name": "endTime", "type": "uint256" },
|
|
202
|
+
{ "internalType": "address", "name": "authorizedSigner", "type": "address" }
|
|
203
|
+
],
|
|
204
|
+
"name": "setBaseParams",
|
|
205
|
+
"outputs": [],
|
|
206
|
+
"stateMutability": "nonpayable",
|
|
207
|
+
"type": "function"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"inputs": [{ "internalType": "address", "name": "hook", "type": "address" }],
|
|
211
|
+
"name": "setClaimHook",
|
|
212
|
+
"outputs": [],
|
|
213
|
+
"stateMutability": "nonpayable",
|
|
214
|
+
"type": "function"
|
|
215
|
+
},
|
|
216
|
+
{ "inputs": [], "name": "togglePause", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
|
|
217
|
+
{
|
|
218
|
+
"inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
|
|
219
|
+
"name": "transferOwnership",
|
|
220
|
+
"outputs": [],
|
|
221
|
+
"stateMutability": "nonpayable",
|
|
222
|
+
"type": "function"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"inputs": [
|
|
226
|
+
{ "internalType": "address", "name": "newImplementation", "type": "address" },
|
|
227
|
+
{ "internalType": "bytes", "name": "data", "type": "bytes" }
|
|
228
|
+
],
|
|
229
|
+
"name": "upgradeToAndCall",
|
|
230
|
+
"outputs": [],
|
|
231
|
+
"stateMutability": "payable",
|
|
232
|
+
"type": "function"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"inputs": [
|
|
236
|
+
{ "internalType": "address", "name": "signer", "type": "address" },
|
|
237
|
+
{ "internalType": "bytes32", "name": "hash", "type": "bytes32" },
|
|
238
|
+
{ "internalType": "bytes", "name": "signature", "type": "bytes" }
|
|
239
|
+
],
|
|
240
|
+
"name": "verify",
|
|
241
|
+
"outputs": [],
|
|
242
|
+
"stateMutability": "view",
|
|
243
|
+
"type": "function"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"inputs": [],
|
|
247
|
+
"name": "version",
|
|
248
|
+
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
|
|
249
|
+
"stateMutability": "pure",
|
|
250
|
+
"type": "function"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"inputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
|
|
254
|
+
"name": "withdraw",
|
|
255
|
+
"outputs": [],
|
|
256
|
+
"stateMutability": "nonpayable",
|
|
257
|
+
"type": "function"
|
|
258
|
+
},
|
|
259
|
+
{ "stateMutability": "payable", "type": "receive" }
|
|
260
|
+
]
|
|
@@ -80,8 +80,9 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
80
80
|
const airdropPDA = await this.getAirdropPDA();
|
|
81
81
|
const config: any = await this.fetchAccountData('airdrop', airdropPDA);
|
|
82
82
|
|
|
83
|
+
const version = await this.getVersion();
|
|
83
84
|
return {
|
|
84
|
-
version:
|
|
85
|
+
version: version,
|
|
85
86
|
token: config.token.toString() as string,
|
|
86
87
|
startTime: Number(config.startTime),
|
|
87
88
|
endTime: Number(config.endTime),
|
|
@@ -223,12 +224,15 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
223
224
|
fee: feePDA,
|
|
224
225
|
authorityFeeAta: null,
|
|
225
226
|
tokenProgram: tokenVersion?.programId || TOKEN_2022_PROGRAM_ID,
|
|
227
|
+
feeTokenProgram: null,
|
|
226
228
|
feeTokenMint: null
|
|
227
229
|
})
|
|
228
230
|
.transaction()
|
|
229
231
|
);
|
|
230
232
|
|
|
231
|
-
const hash = await this.program.provider.sendAndConfirm?.(tx
|
|
233
|
+
const hash = await this.program.provider.sendAndConfirm?.(tx, [], {
|
|
234
|
+
commitment: 'finalized'
|
|
235
|
+
});
|
|
232
236
|
|
|
233
237
|
lastHash = hash!;
|
|
234
238
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8",
|
|
3
3
|
"metadata": {
|
|
4
4
|
"name": "fee_collector",
|
|
5
5
|
"version": "0.1.0",
|
|
@@ -155,7 +155,8 @@
|
|
|
155
155
|
"address": "11111111111111111111111111111111"
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
|
-
"name": "token_program"
|
|
158
|
+
"name": "token_program",
|
|
159
|
+
"optional": true
|
|
159
160
|
},
|
|
160
161
|
{
|
|
161
162
|
"name": "associated_token_program",
|
|
@@ -436,16 +437,16 @@
|
|
|
436
437
|
"args": []
|
|
437
438
|
},
|
|
438
439
|
{
|
|
439
|
-
"name": "
|
|
440
|
+
"name": "receive_ownership",
|
|
440
441
|
"discriminator": [
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
442
|
+
156,
|
|
443
|
+
163,
|
|
444
|
+
211,
|
|
445
|
+
191,
|
|
446
|
+
160,
|
|
447
|
+
158,
|
|
448
|
+
61,
|
|
449
|
+
55
|
|
449
450
|
],
|
|
450
451
|
"accounts": [
|
|
451
452
|
{
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* IDL can be found at `target/idl/fee_collector.json`.
|
|
6
6
|
*/
|
|
7
7
|
export type FeeCollector = {
|
|
8
|
-
"address": "
|
|
8
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8",
|
|
9
9
|
"metadata": {
|
|
10
10
|
"name": "feeCollector",
|
|
11
11
|
"version": "0.1.0",
|
|
@@ -161,7 +161,8 @@ export type FeeCollector = {
|
|
|
161
161
|
"address": "11111111111111111111111111111111"
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
"name": "tokenProgram"
|
|
164
|
+
"name": "tokenProgram",
|
|
165
|
+
"optional": true
|
|
165
166
|
},
|
|
166
167
|
{
|
|
167
168
|
"name": "associatedTokenProgram",
|
|
@@ -442,16 +443,16 @@ export type FeeCollector = {
|
|
|
442
443
|
"args": []
|
|
443
444
|
},
|
|
444
445
|
{
|
|
445
|
-
"name": "
|
|
446
|
+
"name": "receiveOwnership",
|
|
446
447
|
"discriminator": [
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
448
|
+
156,
|
|
449
|
+
163,
|
|
450
|
+
211,
|
|
451
|
+
191,
|
|
452
|
+
160,
|
|
453
|
+
158,
|
|
454
|
+
61,
|
|
455
|
+
55
|
|
455
456
|
],
|
|
456
457
|
"accounts": [
|
|
457
458
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "2fLgxHG1eCxQmfUMn8LYffxE7EQKWzeJhDpcAsyb1VKA",
|
|
3
3
|
"metadata": {
|
|
4
4
|
"name": "fungible_token_distributor_solana",
|
|
5
5
|
"version": "0.1.0",
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
{
|
|
175
175
|
"name": "fee_collector",
|
|
176
176
|
"optional": true,
|
|
177
|
-
"address": "
|
|
177
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
"name": "fee_token_mint",
|
|
@@ -192,6 +192,10 @@
|
|
|
192
192
|
{
|
|
193
193
|
"name": "token_program"
|
|
194
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"name": "fee_token_program",
|
|
197
|
+
"optional": true
|
|
198
|
+
},
|
|
195
199
|
{
|
|
196
200
|
"name": "associated_token_program",
|
|
197
201
|
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
@@ -464,7 +468,7 @@
|
|
|
464
468
|
{
|
|
465
469
|
"name": "fee_collector",
|
|
466
470
|
"optional": true,
|
|
467
|
-
"address": "
|
|
471
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
468
472
|
},
|
|
469
473
|
{
|
|
470
474
|
"name": "fee_collector_storage",
|
|
@@ -685,7 +689,7 @@
|
|
|
685
689
|
{
|
|
686
690
|
"name": "fee_collector",
|
|
687
691
|
"optional": true,
|
|
688
|
-
"address": "
|
|
692
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
689
693
|
},
|
|
690
694
|
{
|
|
691
695
|
"name": "fee_collector_storage",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* IDL can be found at `target/idl/fungible_token_distributor_solana.json`.
|
|
6
6
|
*/
|
|
7
7
|
export type FungibleTokenDistributorSolana = {
|
|
8
|
-
"address": "
|
|
8
|
+
"address": "2fLgxHG1eCxQmfUMn8LYffxE7EQKWzeJhDpcAsyb1VKA",
|
|
9
9
|
"metadata": {
|
|
10
10
|
"name": "fungibleTokenDistributorSolana",
|
|
11
11
|
"version": "0.1.0",
|
|
@@ -180,7 +180,7 @@ export type FungibleTokenDistributorSolana = {
|
|
|
180
180
|
{
|
|
181
181
|
"name": "feeCollector",
|
|
182
182
|
"optional": true,
|
|
183
|
-
"address": "
|
|
183
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
184
184
|
},
|
|
185
185
|
{
|
|
186
186
|
"name": "feeTokenMint",
|
|
@@ -198,6 +198,10 @@ export type FungibleTokenDistributorSolana = {
|
|
|
198
198
|
{
|
|
199
199
|
"name": "tokenProgram"
|
|
200
200
|
},
|
|
201
|
+
{
|
|
202
|
+
"name": "feeTokenProgram",
|
|
203
|
+
"optional": true
|
|
204
|
+
},
|
|
201
205
|
{
|
|
202
206
|
"name": "associatedTokenProgram",
|
|
203
207
|
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
@@ -470,7 +474,7 @@ export type FungibleTokenDistributorSolana = {
|
|
|
470
474
|
{
|
|
471
475
|
"name": "feeCollector",
|
|
472
476
|
"optional": true,
|
|
473
|
-
"address": "
|
|
477
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
474
478
|
},
|
|
475
479
|
{
|
|
476
480
|
"name": "feeCollectorStorage",
|
|
@@ -691,7 +695,7 @@ export type FungibleTokenDistributorSolana = {
|
|
|
691
695
|
{
|
|
692
696
|
"name": "feeCollector",
|
|
693
697
|
"optional": true,
|
|
694
|
-
"address": "
|
|
698
|
+
"address": "FCAaMMWdkNJnbFvz71rkXtsHPL1voheMHXdKucT3EUd8"
|
|
695
699
|
},
|
|
696
700
|
{
|
|
697
701
|
"name": "feeCollectorStorage",
|
package/src/airdrop/index.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export { AirdropClient } from './AirdropClient';
|
|
2
2
|
export { SignatureAirdropClient } from './SignatureAirdropClient';
|
|
3
|
+
export {
|
|
4
|
+
EvmSignatureAirdropService,
|
|
5
|
+
SolanaSignatureAirdropService,
|
|
6
|
+
EvmAirdropService,
|
|
7
|
+
TonAirdropService
|
|
8
|
+
} from './contracts';
|
|
3
9
|
|
|
4
10
|
export { CONST } from './constants';
|