@sign-global/tokentable 0.4.0-beta.4 → 0.4.0-beta.6
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/SignatureAirdropClient.d.ts +13 -6
- package/dist/cjs/airdrop/SignatureAirdropClient.js +43 -23
- package/dist/cjs/airdrop/SignatureAirdropClient.js.map +1 -1
- package/dist/cjs/airdrop/core/evm/SignatureAirdropService.d.ts +4 -3
- package/dist/cjs/airdrop/core/evm/SignatureAirdropService.js +4 -1
- package/dist/cjs/airdrop/core/evm/SignatureAirdropService.js.map +1 -1
- package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.d.ts +5 -4
- package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.js +6 -2
- package/dist/cjs/airdrop/core/evm/contracts/AirdropSignatureClient.js.map +1 -1
- package/dist/cjs/airdrop/services/index.d.ts +19 -12
- package/dist/cjs/airdrop/services/index.js +20 -12
- package/dist/cjs/airdrop/services/index.js.map +1 -1
- package/dist/cjs/airdrop/types/index.d.ts +20 -0
- package/dist/cjs/airdrop/types/index.js.map +1 -1
- package/dist/esm/airdrop/SignatureAirdropClient.d.ts +13 -6
- package/dist/esm/airdrop/SignatureAirdropClient.js +44 -24
- package/dist/esm/airdrop/SignatureAirdropClient.js.map +1 -1
- package/dist/esm/airdrop/core/evm/SignatureAirdropService.d.ts +4 -3
- package/dist/esm/airdrop/core/evm/SignatureAirdropService.js +4 -1
- package/dist/esm/airdrop/core/evm/SignatureAirdropService.js.map +1 -1
- package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.d.ts +5 -4
- package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.js +6 -2
- package/dist/esm/airdrop/core/evm/contracts/AirdropSignatureClient.js.map +1 -1
- package/dist/esm/airdrop/services/index.d.ts +19 -12
- package/dist/esm/airdrop/services/index.js +18 -11
- package/dist/esm/airdrop/services/index.js.map +1 -1
- package/dist/esm/airdrop/types/index.d.ts +20 -0
- package/dist/esm/airdrop/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/airdrop/SignatureAirdropClient.ts +73 -25
- package/src/airdrop/core/evm/SignatureAirdropService.ts +7 -3
- package/src/airdrop/core/evm/contracts/AirdropSignatureClient.ts +10 -5
- package/src/airdrop/services/index.ts +53 -28
- package/src/airdrop/types/index.ts +23 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { getAddress } from 'viem';
|
|
1
2
|
import { CONST } from './constants';
|
|
2
3
|
import { SignatureAirdropService } from './core/evm/SignatureAirdropService';
|
|
3
4
|
import { WalletFactory } from './core/useWeb3ConnectWallet';
|
|
4
5
|
import { ChainType } from './core/useWeb3ConnectWallet/types';
|
|
5
|
-
import { bindWallet, checkEligibility, connectTwitter, getAirdropProject } from './services';
|
|
6
|
+
import { bindWallet, checkEligibility, connectTwitter, disconnectRecipient, getAirdropProject } from './services';
|
|
6
7
|
import { AirdropSigIdentityTypeEnum } from './types';
|
|
7
8
|
export class SignatureAirdropClient {
|
|
8
9
|
projectId;
|
|
@@ -10,12 +11,7 @@ export class SignatureAirdropClient {
|
|
|
10
11
|
project;
|
|
11
12
|
claims;
|
|
12
13
|
projectPromise;
|
|
13
|
-
claimHook;
|
|
14
|
-
// private contractConfig: IContractConfig | null = null;
|
|
15
14
|
constructor(params) {
|
|
16
|
-
// if ('slug' in params) {
|
|
17
|
-
// this.slug = params.slug;
|
|
18
|
-
// }
|
|
19
15
|
this.projectId = params.projectId;
|
|
20
16
|
this.endpoint = params.endpoint;
|
|
21
17
|
if (this.project) {
|
|
@@ -25,6 +21,10 @@ export class SignatureAirdropClient {
|
|
|
25
21
|
this.projectPromise = this.initializeProjects();
|
|
26
22
|
}
|
|
27
23
|
}
|
|
24
|
+
LOCAL_STORAGE_SID_PREFIX = 'sid_';
|
|
25
|
+
setSid(projectId, sid) {
|
|
26
|
+
window.localStorage.setItem(`${this.LOCAL_STORAGE_SID_PREFIX}${projectId}`, sid);
|
|
27
|
+
}
|
|
28
28
|
async fetchProjectDetails(projectId) {
|
|
29
29
|
this.project = await getAirdropProject(projectId, this.endpoint);
|
|
30
30
|
}
|
|
@@ -55,8 +55,9 @@ export class SignatureAirdropClient {
|
|
|
55
55
|
const { code } = message.data.data || {};
|
|
56
56
|
try {
|
|
57
57
|
const res = await connectTwitter({ code, projectId: project.id }, this.endpoint);
|
|
58
|
-
if (res?.sid)
|
|
59
|
-
|
|
58
|
+
if (res?.sid) {
|
|
59
|
+
this.setSid(project.id, res?.sid);
|
|
60
|
+
}
|
|
60
61
|
onSuccess();
|
|
61
62
|
}
|
|
62
63
|
catch (error) {
|
|
@@ -82,7 +83,7 @@ export class SignatureAirdropClient {
|
|
|
82
83
|
[ChainType.Ton]: ''
|
|
83
84
|
};
|
|
84
85
|
const msg = [project.id, recipientTypeMap[chainType], timestamp].join(',');
|
|
85
|
-
const signResult = await wallet.signin(msg);
|
|
86
|
+
const signResult = await wallet.signin(msg, false);
|
|
86
87
|
const { message, signature } = signResult || {};
|
|
87
88
|
const payload = {
|
|
88
89
|
signature: signature,
|
|
@@ -93,8 +94,9 @@ export class SignatureAirdropClient {
|
|
|
93
94
|
recipientType: recipientTypeMap[chainType]
|
|
94
95
|
};
|
|
95
96
|
const res = await bindWallet(payload, this.endpoint);
|
|
96
|
-
if (res?.sid)
|
|
97
|
-
|
|
97
|
+
if (res?.sid) {
|
|
98
|
+
this.setSid(project.id, res?.sid);
|
|
99
|
+
}
|
|
98
100
|
onSuccess?.();
|
|
99
101
|
}
|
|
100
102
|
catch (error) {
|
|
@@ -107,7 +109,15 @@ export class SignatureAirdropClient {
|
|
|
107
109
|
projectId: project.id
|
|
108
110
|
}, this.endpoint);
|
|
109
111
|
this.claims = res.claims;
|
|
110
|
-
return
|
|
112
|
+
return res;
|
|
113
|
+
}
|
|
114
|
+
async disconnectIdentity({ recipientType, recipient }) {
|
|
115
|
+
const project = await this.getProjectInfo();
|
|
116
|
+
await disconnectRecipient({
|
|
117
|
+
projectId: project.id,
|
|
118
|
+
recipientType,
|
|
119
|
+
recipient
|
|
120
|
+
});
|
|
111
121
|
}
|
|
112
122
|
async getStrategy(walletClient) {
|
|
113
123
|
const project = await this.getProjectInfo();
|
|
@@ -117,34 +127,44 @@ export class SignatureAirdropClient {
|
|
|
117
127
|
walletClient: walletClient
|
|
118
128
|
});
|
|
119
129
|
}
|
|
130
|
+
async getVersion() {
|
|
131
|
+
const strategy = await this.getStrategy();
|
|
132
|
+
return strategy.getVersion();
|
|
133
|
+
}
|
|
120
134
|
async getClaimFee(amount) {
|
|
121
135
|
const strategy = await this.getStrategy();
|
|
122
136
|
if (!strategy.getClaimFee) {
|
|
123
137
|
throw new Error('getClaimFee is not supported for this chain');
|
|
124
138
|
}
|
|
125
|
-
return strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(
|
|
139
|
+
return await strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(1));
|
|
126
140
|
}
|
|
127
|
-
async claimAirdrop({ claimIds, walletClient }) {
|
|
141
|
+
async claimAirdrop({ claimIds, walletClient, recipient }) {
|
|
142
|
+
if (!claimIds.length) {
|
|
143
|
+
throw new Error('Claim IDs cannot be empty');
|
|
144
|
+
}
|
|
145
|
+
if (!walletClient) {
|
|
146
|
+
throw new Error('Wallet client is required');
|
|
147
|
+
}
|
|
128
148
|
const service = await this.getStrategy(walletClient);
|
|
129
|
-
const claimData = this.claims
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const feeData = await this.getClaimFee(1n);
|
|
149
|
+
const claimData = this.claims
|
|
150
|
+
?.filter((it) => claimIds.includes(it.claimId))
|
|
151
|
+
.map((it) => ({
|
|
152
|
+
...it,
|
|
153
|
+
recipient: recipient ? recipient : walletClient.account?.address
|
|
154
|
+
})) || [];
|
|
155
|
+
const delegateMode = recipient ? getAddress(recipient) !== walletClient.account?.address : false;
|
|
156
|
+
const feeData = (await this.getClaimFee(1n)) || 0n;
|
|
137
157
|
const hash = (await service.claim(claimData, delegateMode ? feeData * BigInt(claimData.length) : feeData));
|
|
138
158
|
return hash;
|
|
139
159
|
}
|
|
140
160
|
async batchCheckClaimed() {
|
|
161
|
+
if (!this.claims?.length)
|
|
162
|
+
return [];
|
|
141
163
|
const strategy = await this.getStrategy();
|
|
142
164
|
if (!strategy.batchFetchClaimed) {
|
|
143
165
|
throw new Error('batchCheckClaimed is not supported for this chain');
|
|
144
166
|
}
|
|
145
167
|
const claimIds = this.claims?.map((it) => it.claimId);
|
|
146
|
-
if (!claimIds)
|
|
147
|
-
return [];
|
|
148
168
|
return strategy.batchFetchClaimed(claimIds);
|
|
149
169
|
}
|
|
150
170
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureAirdropClient.js","sourceRoot":"","sources":["../../../src/airdrop/SignatureAirdropClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"SignatureAirdropClient.js","sourceRoot":"","sources":["../../../src/airdrop/SignatureAirdropClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D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,IAAI,EAAE,CAAC;QACd,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QACjG,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,MAAM,IAAI,GAAG,CAAC,MAAM,OAAQ,CAAC,KAAK,CAChC,SAAS,EACT,YAAY,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAC5D,CAAkB,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM;YAAE,OAAO,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -6,7 +6,8 @@ export declare class SignatureAirdropService {
|
|
|
6
6
|
private get airdropClient();
|
|
7
7
|
getDeployerClient(): Promise<DeployerClient>;
|
|
8
8
|
private getFeeClient;
|
|
9
|
-
getDeployer(): Promise<
|
|
9
|
+
getDeployer(): Promise<string>;
|
|
10
|
+
getVersion(): Promise<any>;
|
|
10
11
|
feeCollectors: (address: string) => Promise<unknown>;
|
|
11
12
|
feeTokens: (address: string) => Promise<unknown>;
|
|
12
13
|
getFeelessThreshold(): Promise<void>;
|
|
@@ -14,9 +15,9 @@ export declare class SignatureAirdropService {
|
|
|
14
15
|
batchFetchClaimed(userClaimIds: string[]): Promise<boolean[]>;
|
|
15
16
|
claim(data: {
|
|
16
17
|
recipient: string;
|
|
17
|
-
|
|
18
|
+
claimId: string;
|
|
18
19
|
data: string;
|
|
19
20
|
signature: string;
|
|
20
|
-
extraData
|
|
21
|
+
extraData?: string;
|
|
21
22
|
}[], value?: bigint): Promise<`0x${string}`>;
|
|
22
23
|
}
|
|
@@ -33,6 +33,9 @@ export class SignatureAirdropService {
|
|
|
33
33
|
async getDeployer() {
|
|
34
34
|
return this.airdropClient.getDeployer();
|
|
35
35
|
}
|
|
36
|
+
async getVersion() {
|
|
37
|
+
return this.airdropClient.getVersion();
|
|
38
|
+
}
|
|
36
39
|
feeCollectors = async (address) => {
|
|
37
40
|
const deployerClient = await this.getDeployerClient();
|
|
38
41
|
return await deployerClient.feeCollectors(address);
|
|
@@ -50,7 +53,7 @@ export class SignatureAirdropService {
|
|
|
50
53
|
return undefined;
|
|
51
54
|
}
|
|
52
55
|
const feeClient = this.getFeeClient(feeCollector);
|
|
53
|
-
const fee = await feeClient.getFee(address, amount);
|
|
56
|
+
const fee = (await feeClient.getFee(address, amount));
|
|
54
57
|
return fee;
|
|
55
58
|
}
|
|
56
59
|
async batchFetchClaimed(userClaimIds) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureAirdropService.js","sourceRoot":"","sources":["../../../../../src/airdrop/core/evm/SignatureAirdropService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,OAAO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C,OAAO,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,KAAK,CAAC,mBAAmB;QACvB,mDAAmD;IACrD,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,MAAc;QAC/C,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,eAAyB,CAAC,CAAC;QACtF,IAAI,CAAC,YAAY,IAAI,YAAY,KAAK,YAAY,EAAE,CAAC;YACnD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,YAAsB,CAAC,CAAC;QAC5D,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SignatureAirdropService.js","sourceRoot":"","sources":["../../../../../src/airdrop/core/evm/SignatureAirdropService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,OAAO,uBAAuB;IAClC,OAAO,CAA0B;IACjC,YAAY,OAAgC;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAY,aAAa;QACvB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,IAAI,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,OAAO,IAAI,cA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B,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,YAAsB,CAAC,CAAC;QAC5D,MAAM,GAAG,GAAG,CAAC,MAAM,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAW,CAAC;QAChE,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,YAAsB;QAC5C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QACrE,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,KAAK,CACT,IAMG,EACH,KAAc;QAEd,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -5,11 +5,12 @@ export declare class AirdropSignatureClient extends ContractBaseClient {
|
|
|
5
5
|
getClaimStatus(userClaimId: string): Promise<unknown>;
|
|
6
6
|
claim(data: {
|
|
7
7
|
recipient: string;
|
|
8
|
-
group: string;
|
|
9
8
|
data: string;
|
|
9
|
+
claimId: string;
|
|
10
10
|
signature: string;
|
|
11
|
-
extraData
|
|
11
|
+
extraData?: string;
|
|
12
12
|
}[], value?: bigint): Promise<`0x${string}`>;
|
|
13
|
-
batchFetchClaimed(userClaimIds: string[]): Promise<
|
|
14
|
-
getDeployer(): Promise<
|
|
13
|
+
batchFetchClaimed(userClaimIds: string[]): Promise<boolean[]>;
|
|
14
|
+
getDeployer(): Promise<string>;
|
|
15
|
+
getVersion(): Promise<any>;
|
|
15
16
|
}
|
|
@@ -25,12 +25,16 @@ export class AirdropSignatureClient extends ContractBaseClient {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
async batchFetchClaimed(userClaimIds) {
|
|
28
|
-
const res = await this.readContract({ functionName: 'getClaimStatus', args: [userClaimIds] });
|
|
28
|
+
const res = (await this.readContract({ functionName: 'getClaimStatus', args: [userClaimIds] }));
|
|
29
29
|
return res;
|
|
30
30
|
}
|
|
31
31
|
async getDeployer() {
|
|
32
|
-
const res = await this.readContract({ functionName: 'getStorage' });
|
|
32
|
+
const res = (await this.readContract({ functionName: 'getStorage' }));
|
|
33
33
|
return res?.[3];
|
|
34
34
|
}
|
|
35
|
+
async getVersion() {
|
|
36
|
+
const res = (await this.readContract({ functionName: 'getStorage' }));
|
|
37
|
+
return res?.[0];
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
//# sourceMappingURL=AirdropSignatureClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirdropSignatureClient.js","sourceRoot":"","sources":["../../../../../../src/airdrop/core/evm/contracts/AirdropSignatureClient.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,2CAA2C,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,YAAY,OAAgC;QAC1C,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,GAAG,EAAE,GAAG;SACT,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,WAAmB;QACtC,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,KAAK,CACT,IAMG,EACH,KAAc;QAEd,MAAM,CAAC,UAAU,GAAG,EAAE,EAAE,YAAY,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,CAAC,GAAG;YACzF,WAAW;YACX,SAAS;YACT,MAAM;YACN,WAAW;YACX,WAAW;SACZ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAA6B,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAE9E,OAAO,IAAI,CAAC,aAAa,CAAC;YACxB,YAAY,EAAE,OAAO;YACrB,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC;YAC/D,KAAK,EAAE,KAAK,IAAI,EAAE;SACnB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,YAAsB;QAC5C,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"AirdropSignatureClient.js","sourceRoot":"","sources":["../../../../../../src/airdrop/core/evm/contracts/AirdropSignatureClient.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,2CAA2C,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB;IAC5D,YAAY,OAAgC;QAC1C,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,GAAG,EAAE,GAAG;SACT,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,WAAmB;QACtC,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,KAAK,CAAC,KAAK,CACT,IAMG,EACH,KAAc;QAEd,MAAM,CAAC,UAAU,GAAG,EAAE,EAAE,YAAY,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,CAAC,GAAG;YACzF,WAAW;YACX,SAAS;YACT,MAAM;YACN,WAAW;YACX,WAAW;SACZ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAA6B,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAE9E,OAAO,IAAI,CAAC,aAAa,CAAC;YACxB,YAAY,EAAE,OAAO;YACrB,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC;YAC/D,KAAK,EAAE,KAAK,IAAI,EAAE;SACnB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,YAAsB;QAC5C,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAc,CAAC;QAC7G,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAU,CAAC;QAC/E,OAAO,GAAG,EAAE,CAAC,CAAC,CAAW,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAU,CAAC;QAC/E,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAirdropData, IContractConfig, IProject } from '../types';
|
|
1
|
+
import { AirdropSigIdentityTypeEnum, IAirdropData, IAirdropSignatureData, IContractConfig, IProject } from '../types';
|
|
2
2
|
export { TonWalletService } from './wallet-service/ton';
|
|
3
3
|
export declare const getAirdropProject: (projectId: string, baseURL?: string) => Promise<IProject>;
|
|
4
4
|
export declare const getAirdropProjectId: (data: {
|
|
@@ -26,22 +26,29 @@ export declare const getJettonInfo: (data: {
|
|
|
26
26
|
address: string;
|
|
27
27
|
isTestnet: "true" | "false";
|
|
28
28
|
}, baseURL?: string) => Promise<any>;
|
|
29
|
-
|
|
30
|
-
code: string;
|
|
31
|
-
projectId: string;
|
|
32
|
-
}, baseURL?: string) => Promise<{
|
|
29
|
+
interface SidResponse {
|
|
33
30
|
sid: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
31
|
+
}
|
|
32
|
+
interface TwitterConnectParams {
|
|
33
|
+
code: string;
|
|
36
34
|
projectId: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
35
|
+
}
|
|
36
|
+
interface WalletBindParams {
|
|
39
37
|
projectId: string;
|
|
40
38
|
key: string;
|
|
41
39
|
signature: string;
|
|
42
40
|
message: string;
|
|
43
41
|
timestamp: number;
|
|
44
42
|
recipientType: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
}
|
|
44
|
+
export declare const connectTwitter: (data: TwitterConnectParams, baseURL?: string) => Promise<SidResponse>;
|
|
45
|
+
export declare const checkEligibility: (data: {
|
|
46
|
+
projectId: string;
|
|
47
|
+
}, baseURL?: string) => Promise<IAirdropSignatureData>;
|
|
48
|
+
export declare const bindWallet: (data: WalletBindParams, baseURL?: string) => Promise<SidResponse>;
|
|
49
|
+
interface DisconnectParams {
|
|
50
|
+
projectId: string;
|
|
51
|
+
recipientType: AirdropSigIdentityTypeEnum;
|
|
52
|
+
recipient?: string;
|
|
53
|
+
}
|
|
54
|
+
export declare const disconnectRecipient: (data: DisconnectParams, baseURL?: string) => Promise<void>;
|
|
@@ -8,7 +8,7 @@ export const getAirdropProject = async (projectId, baseURL) => {
|
|
|
8
8
|
const client = createApiClient(baseURL);
|
|
9
9
|
const res = await client.get(`/airdrop-open/projects/${projectId}`);
|
|
10
10
|
if (!res)
|
|
11
|
-
return res; // res
|
|
11
|
+
return res; // res is null
|
|
12
12
|
const projectConfig = res?.themeConf;
|
|
13
13
|
const blockCountries = safeParseJSON(projectConfig?.blockCountries);
|
|
14
14
|
return {
|
|
@@ -36,29 +36,36 @@ export const getJettonInfo = async (data, baseURL) => {
|
|
|
36
36
|
const client = createApiClient(baseURL);
|
|
37
37
|
return client.get(`/airdrop-open/jetton/${data.address}?isTestnet=${data.isTestnet}`);
|
|
38
38
|
};
|
|
39
|
+
const getSidHeader = (projectId) => ({
|
|
40
|
+
sid: window.localStorage.getItem(`sid_${projectId}`) || ''
|
|
41
|
+
});
|
|
39
42
|
export const connectTwitter = async (data, baseURL) => {
|
|
40
43
|
const client = createApiClient(baseURL);
|
|
41
44
|
return client.post('/airdrop-open/connect-twitter', data, {
|
|
42
|
-
headers:
|
|
43
|
-
sid: window.localStorage.getItem('sid_' + data.projectId) || ''
|
|
44
|
-
}
|
|
45
|
+
headers: getSidHeader(data.projectId)
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
|
-
//{{ttApi}}/airdrop-open/check-eligibility
|
|
48
48
|
export const checkEligibility = async (data, baseURL) => {
|
|
49
|
+
const headers = getSidHeader(data.projectId);
|
|
50
|
+
if (!headers.sid)
|
|
51
|
+
return {
|
|
52
|
+
claims: []
|
|
53
|
+
};
|
|
49
54
|
const client = createApiClient(baseURL);
|
|
50
55
|
return client.post('/airdrop-open/check-eligibility', data, {
|
|
51
|
-
headers:
|
|
52
|
-
sid: window.localStorage.getItem('sid_' + data.projectId) || ''
|
|
53
|
-
}
|
|
56
|
+
headers: headers
|
|
54
57
|
});
|
|
55
58
|
};
|
|
56
59
|
export const bindWallet = async (data, baseURL) => {
|
|
57
60
|
const client = createApiClient(baseURL);
|
|
58
61
|
return client.post('/airdrop-open/connect-wallet', data, {
|
|
59
|
-
headers:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
headers: getSidHeader(data.projectId)
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export const disconnectRecipient = async (data, baseURL) => {
|
|
66
|
+
const client = createApiClient(baseURL);
|
|
67
|
+
return client.post('/airdrop-open/disconnect', data, {
|
|
68
|
+
headers: getSidHeader(data.projectId)
|
|
62
69
|
});
|
|
63
70
|
};
|
|
64
71
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC3C,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,SAAiB,EAAE,OAAgB,EAAqB,EAAE;IAChG,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAM,0BAA0B,SAAS,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC3C,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,SAAiB,EAAE,OAAgB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EAAE,OAAgB,EAAwB,EAAE;IACjG,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,8BAA8B,EAAE,IAAI,EAAE;QACvD,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;KACtC,CAAC,CAAC;AACL,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,IAAsB,EAAE,OAAgB,EAAiB,EAAE;IACnG,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,IAAI,EAAE;QACnD,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;KACtC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -99,8 +99,28 @@ export type IAirdropClaim = {
|
|
|
99
99
|
expired?: boolean;
|
|
100
100
|
project: IProject;
|
|
101
101
|
};
|
|
102
|
+
export type IAirdropSignatureClaim = {
|
|
103
|
+
percent: number;
|
|
104
|
+
unlockingAt: number;
|
|
105
|
+
claimDeadline: number;
|
|
106
|
+
value: string;
|
|
107
|
+
recipient: string;
|
|
108
|
+
recipientType: string;
|
|
109
|
+
claimId: string;
|
|
110
|
+
data: string;
|
|
111
|
+
signature: string;
|
|
112
|
+
claimed?: boolean;
|
|
113
|
+
};
|
|
114
|
+
export interface IAirdropSignatureIdentity {
|
|
115
|
+
type: AirdropSigIdentityTypeEnum;
|
|
116
|
+
value: string;
|
|
117
|
+
}
|
|
102
118
|
export interface IAirdropData {
|
|
103
119
|
claims: IAirdropClaim[];
|
|
120
|
+
identities: IAirdropSignatureIdentity[];
|
|
121
|
+
}
|
|
122
|
+
export interface IAirdropSignatureData {
|
|
123
|
+
claims: IAirdropSignatureClaim[];
|
|
104
124
|
}
|
|
105
125
|
export declare enum TonAirdropVersionEnum {
|
|
106
126
|
V1 = "1.0.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/airdrop/types/index.ts"],"names":[],"mappings":"AAeA,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,wBAAW,CAAA;AACb,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAsDD,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,mDAAqB,CAAA;IACrB,4DAA8B,CAAA;IAC9B,sDAAwB,CAAA;AAC1B,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAUD,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,qCAAuB,CAAA;IACvB,4BAAc,CAAA;AAChB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB;AAoDD,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,qCAAY,CAAA;IACZ,qCAAY,CAAA;IACZ,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;AACrB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAN,IAAY,qBAIX;AAJD,WAAY,qBAAqB;IAC/B,qCAAY,CAAA;IACZ,qCAAY,CAAA;IACZ,qCAAY,CAAA,CAAC,yBAAyB;AACxC,CAAC,EAJW,qBAAqB,KAArB,qBAAqB,QAIhC"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
+
import { getAddress } from 'viem';
|
|
1
2
|
import { CONST } from './constants';
|
|
2
3
|
import { SignatureAirdropService } from './core/evm/SignatureAirdropService';
|
|
3
4
|
import { WalletFactory } from './core/useWeb3ConnectWallet';
|
|
4
5
|
import { ChainType } from './core/useWeb3ConnectWallet/types';
|
|
5
|
-
import { bindWallet, checkEligibility, connectTwitter, getAirdropProject } from './services';
|
|
6
|
-
import {
|
|
6
|
+
import { bindWallet, checkEligibility, connectTwitter, disconnectRecipient, getAirdropProject } from './services';
|
|
7
|
+
import {
|
|
8
|
+
AirdropSigIdentityTypeEnum,
|
|
9
|
+
ChainId,
|
|
10
|
+
IAirdropOptions,
|
|
11
|
+
IAirdropSignatureClaim,
|
|
12
|
+
IProject,
|
|
13
|
+
IWalletClient
|
|
14
|
+
} from './types';
|
|
7
15
|
|
|
8
16
|
export class SignatureAirdropClient {
|
|
9
17
|
private projectId?: string;
|
|
10
18
|
private endpoint?: string;
|
|
11
19
|
private project: IProject | undefined;
|
|
12
|
-
protected claims?:
|
|
20
|
+
protected claims?: IAirdropSignatureClaim[];
|
|
13
21
|
private projectPromise: Promise<void> | undefined;
|
|
14
|
-
private claimHook: ((v: any) => any) | undefined;
|
|
15
|
-
// private contractConfig: IContractConfig | null = null;
|
|
16
22
|
constructor(params: IAirdropOptions) {
|
|
17
|
-
// if ('slug' in params) {
|
|
18
|
-
// this.slug = params.slug;
|
|
19
|
-
// }
|
|
20
23
|
this.projectId = params.projectId;
|
|
21
24
|
this.endpoint = params.endpoint;
|
|
22
25
|
if (this.project) {
|
|
@@ -26,6 +29,12 @@ export class SignatureAirdropClient {
|
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
private readonly LOCAL_STORAGE_SID_PREFIX = 'sid_';
|
|
33
|
+
|
|
34
|
+
private setSid(projectId: string, sid: string): void {
|
|
35
|
+
window.localStorage.setItem(`${this.LOCAL_STORAGE_SID_PREFIX}${projectId}`, sid);
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
private async fetchProjectDetails(projectId: string): Promise<void> {
|
|
30
39
|
this.project = await getAirdropProject(projectId, this.endpoint);
|
|
31
40
|
}
|
|
@@ -60,7 +69,9 @@ export class SignatureAirdropClient {
|
|
|
60
69
|
try {
|
|
61
70
|
const res = await connectTwitter({ code, projectId: project.id }, this.endpoint);
|
|
62
71
|
|
|
63
|
-
if (res?.sid)
|
|
72
|
+
if (res?.sid) {
|
|
73
|
+
this.setSid(project.id, res?.sid);
|
|
74
|
+
}
|
|
64
75
|
onSuccess();
|
|
65
76
|
} catch (error) {
|
|
66
77
|
onError();
|
|
@@ -96,7 +107,7 @@ export class SignatureAirdropClient {
|
|
|
96
107
|
[ChainType.Ton]: ''
|
|
97
108
|
};
|
|
98
109
|
const msg = [project.id, recipientTypeMap[chainType], timestamp].join(',');
|
|
99
|
-
const signResult = await wallet.signin(msg);
|
|
110
|
+
const signResult = await wallet.signin(msg, false);
|
|
100
111
|
|
|
101
112
|
const { message, signature } = signResult || {};
|
|
102
113
|
|
|
@@ -110,7 +121,9 @@ export class SignatureAirdropClient {
|
|
|
110
121
|
};
|
|
111
122
|
|
|
112
123
|
const res = await bindWallet(payload, this.endpoint);
|
|
113
|
-
if (res?.sid)
|
|
124
|
+
if (res?.sid) {
|
|
125
|
+
this.setSid(project.id, res?.sid);
|
|
126
|
+
}
|
|
114
127
|
onSuccess?.();
|
|
115
128
|
} catch (error) {
|
|
116
129
|
onError?.(error);
|
|
@@ -126,7 +139,22 @@ export class SignatureAirdropClient {
|
|
|
126
139
|
this.endpoint
|
|
127
140
|
);
|
|
128
141
|
this.claims = res.claims;
|
|
129
|
-
return
|
|
142
|
+
return res;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
public async disconnectIdentity({
|
|
146
|
+
recipientType,
|
|
147
|
+
recipient
|
|
148
|
+
}: {
|
|
149
|
+
recipientType: AirdropSigIdentityTypeEnum;
|
|
150
|
+
recipient?: string;
|
|
151
|
+
}) {
|
|
152
|
+
const project = await this.getProjectInfo();
|
|
153
|
+
await disconnectRecipient({
|
|
154
|
+
projectId: project.id,
|
|
155
|
+
recipientType,
|
|
156
|
+
recipient
|
|
157
|
+
});
|
|
130
158
|
}
|
|
131
159
|
|
|
132
160
|
public async getStrategy(walletClient?: IWalletClient): Promise<SignatureAirdropService> {
|
|
@@ -139,38 +167,58 @@ export class SignatureAirdropClient {
|
|
|
139
167
|
});
|
|
140
168
|
}
|
|
141
169
|
|
|
142
|
-
async
|
|
170
|
+
async getVersion(): Promise<string> {
|
|
171
|
+
const strategy = await this.getStrategy();
|
|
172
|
+
return strategy.getVersion();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async getClaimFee(amount?: bigint): Promise<undefined | bigint> {
|
|
143
176
|
const strategy = await this.getStrategy();
|
|
144
177
|
if (!strategy.getClaimFee) {
|
|
145
178
|
throw new Error('getClaimFee is not supported for this chain');
|
|
146
179
|
}
|
|
147
|
-
return strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(
|
|
180
|
+
return await strategy.getClaimFee(this.project?.contractAddress || '', amount || BigInt(1));
|
|
148
181
|
}
|
|
149
182
|
|
|
150
|
-
async claimAirdrop({
|
|
183
|
+
async claimAirdrop({
|
|
184
|
+
claimIds,
|
|
185
|
+
walletClient,
|
|
186
|
+
recipient
|
|
187
|
+
}: {
|
|
188
|
+
claimIds: string[];
|
|
189
|
+
walletClient: IWalletClient;
|
|
190
|
+
recipient?: string;
|
|
191
|
+
}) {
|
|
192
|
+
if (!claimIds.length) {
|
|
193
|
+
throw new Error('Claim IDs cannot be empty');
|
|
194
|
+
}
|
|
195
|
+
if (!walletClient) {
|
|
196
|
+
throw new Error('Wallet client is required');
|
|
197
|
+
}
|
|
151
198
|
const service = await this.getStrategy(walletClient);
|
|
152
|
-
const claimData =
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
const
|
|
199
|
+
const claimData =
|
|
200
|
+
this.claims
|
|
201
|
+
?.filter((it) => claimIds.includes(it.claimId))
|
|
202
|
+
.map((it) => ({
|
|
203
|
+
...it,
|
|
204
|
+
recipient: recipient ? recipient : walletClient.account?.address!
|
|
205
|
+
})) || [];
|
|
206
|
+
const delegateMode = recipient ? getAddress(recipient) !== walletClient.account?.address : false;
|
|
207
|
+
const feeData = (await this.getClaimFee(1n)) || 0n;
|
|
160
208
|
const hash = (await service!.claim(
|
|
161
209
|
claimData,
|
|
162
210
|
delegateMode ? feeData * BigInt(claimData.length) : feeData
|
|
163
|
-
)) as
|
|
211
|
+
)) as `0x${string}`;
|
|
164
212
|
return hash;
|
|
165
213
|
}
|
|
166
214
|
|
|
167
215
|
async batchCheckClaimed(): Promise<boolean[]> {
|
|
216
|
+
if (!this.claims?.length) return [];
|
|
168
217
|
const strategy = await this.getStrategy();
|
|
169
218
|
if (!strategy.batchFetchClaimed) {
|
|
170
219
|
throw new Error('batchCheckClaimed is not supported for this chain');
|
|
171
220
|
}
|
|
172
221
|
const claimIds = this.claims?.map((it) => it.claimId);
|
|
173
|
-
if (!claimIds) return [];
|
|
174
222
|
return strategy.batchFetchClaimed(claimIds);
|
|
175
223
|
}
|
|
176
224
|
}
|
|
@@ -42,6 +42,10 @@ export class SignatureAirdropService {
|
|
|
42
42
|
return this.airdropClient.getDeployer();
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
async getVersion() {
|
|
46
|
+
return this.airdropClient.getVersion();
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
feeCollectors = async (address: string) => {
|
|
46
50
|
const deployerClient = await this.getDeployerClient();
|
|
47
51
|
return await deployerClient.feeCollectors(address);
|
|
@@ -62,7 +66,7 @@ export class SignatureAirdropService {
|
|
|
62
66
|
return undefined;
|
|
63
67
|
}
|
|
64
68
|
const feeClient = this.getFeeClient(feeCollector as string);
|
|
65
|
-
const fee = await feeClient.getFee(address, amount);
|
|
69
|
+
const fee = (await feeClient.getFee(address, amount)) as bigint;
|
|
66
70
|
return fee;
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -74,10 +78,10 @@ export class SignatureAirdropService {
|
|
|
74
78
|
async claim(
|
|
75
79
|
data: {
|
|
76
80
|
recipient: string;
|
|
77
|
-
|
|
81
|
+
claimId: string;
|
|
78
82
|
data: string;
|
|
79
83
|
signature: string;
|
|
80
|
-
extraData
|
|
84
|
+
extraData?: string;
|
|
81
85
|
}[],
|
|
82
86
|
value?: bigint
|
|
83
87
|
) {
|