@sign-global/tokentable 0.4.1-beta.5 → 0.4.1-beta.7
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 +1 -1
- package/dist/cjs/airdrop/SignatureAirdropClient.js +3 -2
- package/dist/cjs/airdrop/SignatureAirdropClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.d.ts +8 -3
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.js +32 -13
- package/dist/cjs/airdrop/contracts/solana/AirdropSignatureClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/FeeCollectorClient.d.ts +2 -2
- package/dist/cjs/airdrop/contracts/solana/FeeCollectorClient.js +11 -7
- package/dist/cjs/airdrop/contracts/solana/FeeCollectorClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/SignatureAirdropService.d.ts +2 -2
- package/dist/cjs/airdrop/contracts/solana/SignatureAirdropService.js +1 -1
- package/dist/cjs/airdrop/contracts/solana/SignatureAirdropService.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/SolanaContractClient.d.ts +2 -1
- package/dist/cjs/airdrop/contracts/solana/SolanaContractClient.js +10 -4
- package/dist/cjs/airdrop/contracts/solana/SolanaContractClient.js.map +1 -1
- package/dist/cjs/airdrop/contracts/solana/fee_collector.d.ts +78 -11
- package/dist/cjs/airdrop/contracts/solana/fee_collector.json +78 -11
- package/dist/cjs/airdrop/contracts/solana/fungible_token_distributor_solana.d.ts +56 -1
- package/dist/cjs/airdrop/contracts/solana/fungible_token_distributor_solana.json +56 -1
- package/dist/cjs/utils/web3.d.ts +15 -1
- package/dist/cjs/utils/web3.js +43 -0
- package/dist/cjs/utils/web3.js.map +1 -1
- package/dist/cjs/wallets/providers/evm/EvmWallet.js +27 -17
- package/dist/cjs/wallets/providers/evm/EvmWallet.js.map +1 -1
- package/dist/esm/airdrop/SignatureAirdropClient.d.ts +1 -1
- package/dist/esm/airdrop/SignatureAirdropClient.js +3 -2
- package/dist/esm/airdrop/SignatureAirdropClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.d.ts +8 -3
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.js +33 -14
- package/dist/esm/airdrop/contracts/solana/AirdropSignatureClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/FeeCollectorClient.d.ts +2 -2
- package/dist/esm/airdrop/contracts/solana/FeeCollectorClient.js +11 -7
- package/dist/esm/airdrop/contracts/solana/FeeCollectorClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/SignatureAirdropService.d.ts +2 -2
- package/dist/esm/airdrop/contracts/solana/SignatureAirdropService.js +1 -1
- package/dist/esm/airdrop/contracts/solana/SignatureAirdropService.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/SolanaContractClient.d.ts +2 -1
- package/dist/esm/airdrop/contracts/solana/SolanaContractClient.js +10 -4
- package/dist/esm/airdrop/contracts/solana/SolanaContractClient.js.map +1 -1
- package/dist/esm/airdrop/contracts/solana/fee_collector.d.ts +78 -11
- package/dist/esm/airdrop/contracts/solana/fee_collector.json +78 -11
- package/dist/esm/airdrop/contracts/solana/fungible_token_distributor_solana.d.ts +56 -1
- package/dist/esm/airdrop/contracts/solana/fungible_token_distributor_solana.json +56 -1
- package/dist/esm/utils/web3.d.ts +15 -1
- package/dist/esm/utils/web3.js +43 -2
- package/dist/esm/utils/web3.js.map +1 -1
- package/dist/esm/wallets/providers/evm/EvmWallet.js +27 -17
- package/dist/esm/wallets/providers/evm/EvmWallet.js.map +1 -1
- package/package.json +1 -1
- package/src/airdrop/SignatureAirdropClient.ts +3 -2
- package/src/airdrop/contracts/solana/AirdropSignatureClient.ts +38 -15
- package/src/airdrop/contracts/solana/FeeCollectorClient.ts +10 -7
- package/src/airdrop/contracts/solana/SignatureAirdropService.ts +2 -2
- package/src/airdrop/contracts/solana/SolanaContractClient.ts +19 -11
- package/src/airdrop/contracts/solana/fee_collector.json +78 -11
- package/src/airdrop/contracts/solana/fee_collector.ts +78 -11
- package/src/airdrop/contracts/solana/fungible_token_distributor_solana.json +56 -1
- package/src/airdrop/contracts/solana/fungible_token_distributor_solana.ts +56 -1
- package/src/utils/web3.ts +62 -2
- package/src/wallets/providers/evm/EvmWallet.ts +27 -19
package/dist/esm/utils/web3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TonWeb from 'tonweb';
|
|
2
|
-
import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddress, getAccount, createAssociatedTokenAccountInstruction, TokenAccountNotFoundError, TokenInvalidAccountOwnerError, TokenInvalidMintError, TokenInvalidOwnerError, TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
|
3
|
-
import { Transaction } from '@solana/web3.js';
|
|
2
|
+
import { ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddress, getAccount, createAssociatedTokenAccountInstruction, TokenAccountNotFoundError, TokenInvalidAccountOwnerError, TokenInvalidMintError, TokenInvalidOwnerError, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
|
|
3
|
+
import { clusterApiUrl, Connection, PublicKey, Transaction } from '@solana/web3.js';
|
|
4
4
|
export function flipAddressType(address) {
|
|
5
5
|
if (!address)
|
|
6
6
|
return '';
|
|
@@ -63,4 +63,45 @@ export async function getOrCreateAssociatedTokenAccount({ connection, payer, min
|
|
|
63
63
|
throw new TokenInvalidOwnerError();
|
|
64
64
|
return account;
|
|
65
65
|
}
|
|
66
|
+
export var SplTokenVersion;
|
|
67
|
+
(function (SplTokenVersion) {
|
|
68
|
+
SplTokenVersion["SplToken"] = "spl-token";
|
|
69
|
+
SplTokenVersion["SplToken2022"] = "spl-token-2022";
|
|
70
|
+
})(SplTokenVersion || (SplTokenVersion = {}));
|
|
71
|
+
async function _getTokenProgramAndParsedAccountData(conn, tokenAddress) {
|
|
72
|
+
const tokenMintAddress = new PublicKey(tokenAddress);
|
|
73
|
+
const parsedMintAccountInfo = await conn.getParsedAccountInfo(tokenMintAddress);
|
|
74
|
+
const parsedMintAccountData = parsedMintAccountInfo.value?.data;
|
|
75
|
+
if (parsedMintAccountData?.program === SplTokenVersion.SplToken) {
|
|
76
|
+
return {
|
|
77
|
+
name: SplTokenVersion.SplToken,
|
|
78
|
+
programId: TOKEN_PROGRAM_ID,
|
|
79
|
+
parsedMintAccountData
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
else if (parsedMintAccountData?.program === SplTokenVersion.SplToken2022) {
|
|
83
|
+
return {
|
|
84
|
+
name: SplTokenVersion.SplToken2022,
|
|
85
|
+
programId: TOKEN_2022_PROGRAM_ID,
|
|
86
|
+
parsedMintAccountData
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
function _getConnection(clusterOrEndpoint) {
|
|
92
|
+
let endpoint;
|
|
93
|
+
try {
|
|
94
|
+
endpoint = clusterApiUrl(clusterOrEndpoint ?? 'mainnet-beta');
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
endpoint = clusterOrEndpoint;
|
|
98
|
+
}
|
|
99
|
+
const conn = new Connection(endpoint);
|
|
100
|
+
return conn;
|
|
101
|
+
}
|
|
102
|
+
export async function fetchTokenVersion(tokenAddress, options) {
|
|
103
|
+
const conn = _getConnection(options.clusterOrEndpoint);
|
|
104
|
+
const data = await _getTokenProgramAndParsedAccountData(conn, tokenAddress);
|
|
105
|
+
return data ? { name: data.name, programId: data.programId } : null;
|
|
106
|
+
}
|
|
66
107
|
//# sourceMappingURL=web3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web3.js","sourceRoot":"","sources":["../../../src/utils/web3.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,UAAU,EACV,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+
try {
|
|
29
|
+
const sign = await signMessage(evmStore.config, {
|
|
30
|
+
message: _message
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
message: _message,
|
|
34
|
+
signature: sign
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
35
40
|
}
|
|
36
41
|
async signin(statement, prepare = true) {
|
|
37
|
-
return new Promise((resolve) => {
|
|
38
|
-
const signCallback = (data) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
43
|
+
const signCallback = async (data) => {
|
|
44
|
+
try {
|
|
45
|
+
this.address = data.address;
|
|
46
|
+
this.chainId = data.chainId;
|
|
47
|
+
let fullMessage = statement;
|
|
48
|
+
if (prepare) {
|
|
49
|
+
const msg = prepareSignMessage({ statement, chainId: data.chainId, address: data.address });
|
|
50
|
+
fullMessage = get4361Message(msg);
|
|
51
|
+
}
|
|
52
|
+
const res = await this.sign(fullMessage);
|
|
53
|
+
resolve(res);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
reject(error);
|
|
45
57
|
}
|
|
46
|
-
const res = this.sign(fullMessage);
|
|
47
|
-
resolve(res);
|
|
48
58
|
};
|
|
49
59
|
const account = getAccount(evmStore.config);
|
|
50
60
|
this.provider = evmStore.walletClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmWallet.js","sourceRoot":"","sources":["../../../../../src/wallets/providers/evm/EvmWallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,kBAAkB,E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,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -247,8 +247,9 @@ export class SignatureAirdropClient {
|
|
|
247
247
|
return strategy.getVersion();
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
// solana prams need to wallet
|
|
251
|
+
async getClaimFee(amount?: bigint, walletClient?: IWalletClient): Promise<undefined | bigint> {
|
|
252
|
+
const strategy = await this.getStrategy(walletClient);
|
|
252
253
|
if (!strategy.getClaimFee) {
|
|
253
254
|
throw new Error('getClaimFee is not supported for this chain');
|
|
254
255
|
}
|
|
@@ -5,7 +5,7 @@ import * as anchor from '@coral-xyz/anchor';
|
|
|
5
5
|
import { FungibleTokenDistributorSolana } from './fungible_token_distributor_solana';
|
|
6
6
|
import { TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';
|
|
7
7
|
import { FeeCollectorClient } from './FeeCollectorClient';
|
|
8
|
-
import { getOrCreateAssociatedTokenAccount, hexStrToU8Array } from '../../../utils';
|
|
8
|
+
import { fetchTokenVersion, getOrCreateAssociatedTokenAccount, hexStrToU8Array } from '../../../utils';
|
|
9
9
|
|
|
10
10
|
export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTokenDistributorSolana> {
|
|
11
11
|
projectId: string;
|
|
@@ -17,8 +17,16 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
17
17
|
this.projectId = options.projectId;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
async getVersionPDA(): Promise<PublicKey> {
|
|
21
|
+
const [versionPDA] = await this.findProgramAddress([anchor.utils.bytes.utf8.encode('version')]);
|
|
22
|
+
|
|
23
|
+
return versionPDA;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async getVersion() {
|
|
27
|
+
const versionPDA = await this.getVersionPDA();
|
|
28
|
+
const versionData = await this.fetchAccountData('version', versionPDA);
|
|
29
|
+
return versionData.version;
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
get FeeCollector() {
|
|
@@ -29,8 +37,8 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
29
37
|
});
|
|
30
38
|
}
|
|
31
39
|
|
|
32
|
-
async getClaimFee() {
|
|
33
|
-
return this.FeeCollector.getClaimFee();
|
|
40
|
+
async getClaimFee(amount: bigint) {
|
|
41
|
+
return this.FeeCollector.getClaimFee(amount.toString());
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
async getStoragePDA(): Promise<PublicKey> {
|
|
@@ -137,6 +145,15 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
137
145
|
await this.invokeInstruction('togglePause', {}, [this.projectId]);
|
|
138
146
|
}
|
|
139
147
|
|
|
148
|
+
async getFeeInfo() {
|
|
149
|
+
const airdropPDA = await this.getAirdropPDA();
|
|
150
|
+
const config = await this.fetchAccountData('airdrop', airdropPDA);
|
|
151
|
+
return {
|
|
152
|
+
feeToken: config.feeToken.toString(),
|
|
153
|
+
feeCollector: config.feeCollector.toString()
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
140
157
|
async claim(
|
|
141
158
|
data: {
|
|
142
159
|
recipient: string;
|
|
@@ -152,9 +169,11 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
152
169
|
const config = await this.getContractInfo();
|
|
153
170
|
|
|
154
171
|
const feeCollectorStoragePDA = await this.FeeCollector.getStoragePDA();
|
|
155
|
-
const
|
|
172
|
+
const feePDA = await this.FeeCollector.getProjectFeePDA();
|
|
156
173
|
const airdropPDA = await this.getAirdropPDA();
|
|
157
|
-
const
|
|
174
|
+
const tokenVersion = await fetchTokenVersion(config.token, {
|
|
175
|
+
clusterOrEndpoint: this.chainId
|
|
176
|
+
});
|
|
158
177
|
|
|
159
178
|
const authorityATA = await getOrCreateAssociatedTokenAccount({
|
|
160
179
|
connection: this.connection,
|
|
@@ -162,12 +181,13 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
162
181
|
mint: new PublicKey(config.token),
|
|
163
182
|
owner: new PublicKey(this.wallet.publicKey),
|
|
164
183
|
signTransaction: (this.wallet as any).signTransaction,
|
|
165
|
-
programId: TOKEN_2022_PROGRAM_ID
|
|
184
|
+
programId: tokenVersion?.programId || TOKEN_2022_PROGRAM_ID
|
|
166
185
|
});
|
|
167
186
|
|
|
168
|
-
|
|
169
|
-
|
|
187
|
+
let lastHash = '';
|
|
188
|
+
// solana max transaction size of 1232
|
|
170
189
|
for (const claim of data) {
|
|
190
|
+
const tx = new anchor.web3.Transaction();
|
|
171
191
|
tx.add(
|
|
172
192
|
anchor.web3.Ed25519Program.createInstructionWithPublicKey({
|
|
173
193
|
publicKey: new PublicKey(config.signer).toBytes(),
|
|
@@ -196,20 +216,23 @@ export class AirdropSignatureClient extends SolanaContractClientBase<FungibleTok
|
|
|
196
216
|
authority: this.wallet.publicKey,
|
|
197
217
|
airdrop: airdropPDA,
|
|
198
218
|
claim: claimPDA,
|
|
199
|
-
vault: vaultPDA,
|
|
200
219
|
authorityAta: authorityATA.address,
|
|
201
220
|
tokenMint: new PublicKey(config.token),
|
|
202
221
|
feeCollectorStorage: feeCollectorStoragePDA,
|
|
203
222
|
feeCollectorVault: null,
|
|
204
|
-
|
|
223
|
+
fee: feePDA,
|
|
205
224
|
authorityFeeAta: null,
|
|
206
|
-
tokenProgram: TOKEN_2022_PROGRAM_ID
|
|
225
|
+
tokenProgram: tokenVersion?.programId || TOKEN_2022_PROGRAM_ID,
|
|
226
|
+
feeTokenMint: null
|
|
207
227
|
})
|
|
208
228
|
.transaction()
|
|
209
229
|
);
|
|
210
|
-
|
|
230
|
+
|
|
231
|
+
const hash = await this.program.provider.sendAndConfirm?.(tx);
|
|
232
|
+
|
|
233
|
+
lastHash = hash!;
|
|
211
234
|
}
|
|
212
235
|
|
|
213
|
-
return
|
|
236
|
+
return lastHash;
|
|
214
237
|
}
|
|
215
238
|
}
|
|
@@ -20,21 +20,24 @@ export class FeeCollectorClient extends SolanaContractClientBase<FeeCollector> {
|
|
|
20
20
|
return storagePDA;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
async
|
|
24
|
-
const [
|
|
23
|
+
async getProjectFeePDA(): Promise<PublicKey> {
|
|
24
|
+
const [projectFeePDA] = await this.findProgramAddress([
|
|
25
25
|
anchor.utils.bytes.utf8.encode('fee'),
|
|
26
26
|
anchor.utils.bytes.utf8.encode(this.projectId)
|
|
27
27
|
]);
|
|
28
|
-
return
|
|
28
|
+
return projectFeePDA;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
async setDefaultFee(fee: string) {
|
|
32
32
|
return this.invokeInstruction('setDefaultFee', {}, [new anchor.BN(fee)]);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
async getClaimFee(): Promise<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
async getClaimFee(tokenAmount: string): Promise<bigint> {
|
|
36
|
+
try {
|
|
37
|
+
const fee = await this.invokeView('getFee', [this.projectId, new anchor.BN(tokenAmount)]);
|
|
38
|
+
return BigInt(fee);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return BigInt(0);
|
|
41
|
+
}
|
|
39
42
|
}
|
|
40
43
|
}
|
|
@@ -39,8 +39,8 @@ export class SignatureAirdropService {
|
|
|
39
39
|
return '';
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
async getClaimFee(address: string, amount: bigint): Promise<
|
|
43
|
-
const fee = this.airdropClient.getClaimFee();
|
|
42
|
+
async getClaimFee(address: string, amount: bigint): Promise<bigint> {
|
|
43
|
+
const fee = await this.airdropClient.getClaimFee(amount);
|
|
44
44
|
return fee;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Program, AnchorProvider, setProvider, Wallet, Idl
|
|
1
|
+
import { Program, AnchorProvider, setProvider, Wallet, Idl } from '@coral-xyz/anchor';
|
|
2
2
|
import {
|
|
3
3
|
AllAccountsMap,
|
|
4
4
|
AllInstructions,
|
|
@@ -70,7 +70,7 @@ export abstract class SolanaContractClientBase<T extends Idl = Idl> {
|
|
|
70
70
|
async invokeView<M extends keyof MakeMethodsNamespace<T, AllInstructions<T>>>(
|
|
71
71
|
methodName: M,
|
|
72
72
|
args: Parameters<MakeMethodsNamespace<T, AllInstructions<T>>[M]>
|
|
73
|
-
): Promise<
|
|
73
|
+
): Promise<any> {
|
|
74
74
|
try {
|
|
75
75
|
if (!this.program.methods[methodName]) {
|
|
76
76
|
throw new Error(`Method ${methodName} not found in program`);
|
|
@@ -91,27 +91,35 @@ export abstract class SolanaContractClientBase<T extends Idl = Idl> {
|
|
|
91
91
|
args: any,
|
|
92
92
|
options?: { signers?: Signer[] }
|
|
93
93
|
): Promise<string> {
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
if (!this.program.methods[methodName]) {
|
|
95
|
+
throw new Error(`Method ${methodName} not found in program`);
|
|
96
|
+
}
|
|
96
97
|
let instruction = this.program.methods[methodName](...args).accounts(accounts);
|
|
97
98
|
|
|
98
99
|
if (options?.signers?.length) {
|
|
99
100
|
instruction = instruction.signers(options.signers);
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
console.log(instruction, 'in');
|
|
103
|
-
|
|
104
103
|
const tx = await instruction.rpc();
|
|
105
104
|
|
|
106
|
-
await this.
|
|
107
|
-
signature: tx,
|
|
108
|
-
blockhash: latestBlockhash.blockhash,
|
|
109
|
-
lastValidBlockHeight: latestBlockhash.lastValidBlockHeight
|
|
110
|
-
});
|
|
105
|
+
await this.confirmTransaction(tx);
|
|
111
106
|
console.log(tx);
|
|
112
107
|
|
|
113
108
|
return tx;
|
|
114
109
|
}
|
|
110
|
+
|
|
111
|
+
async confirmTransaction(tx: string): Promise<string> {
|
|
112
|
+
const latestBlockhash = await this.connection.getLatestBlockhash();
|
|
113
|
+
await this.connection.confirmTransaction(
|
|
114
|
+
{
|
|
115
|
+
signature: tx,
|
|
116
|
+
blockhash: latestBlockhash.blockhash,
|
|
117
|
+
lastValidBlockHeight: latestBlockhash.lastValidBlockHeight
|
|
118
|
+
},
|
|
119
|
+
'confirmed'
|
|
120
|
+
);
|
|
121
|
+
return tx;
|
|
122
|
+
}
|
|
115
123
|
// protected abstract getProgramAccount(accountName: string, address: PublicKey): Promise<any>;
|
|
116
124
|
|
|
117
125
|
// protected abstract getEventLogs(signature: string, eventName: string): Promise<any[]>;
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
"name": "fee_token_mint",
|
|
45
|
+
"writable": true,
|
|
46
|
+
"optional": true
|
|
47
|
+
},
|
|
43
48
|
{
|
|
44
49
|
"name": "vault",
|
|
45
50
|
"writable": true,
|
|
@@ -65,7 +70,6 @@
|
|
|
65
70
|
},
|
|
66
71
|
{
|
|
67
72
|
"name": "fee",
|
|
68
|
-
"writable": true,
|
|
69
73
|
"pda": {
|
|
70
74
|
"seeds": [
|
|
71
75
|
{
|
|
@@ -241,7 +245,6 @@
|
|
|
241
245
|
},
|
|
242
246
|
{
|
|
243
247
|
"name": "fee",
|
|
244
|
-
"writable": true,
|
|
245
248
|
"pda": {
|
|
246
249
|
"seeds": [
|
|
247
250
|
{
|
|
@@ -258,15 +261,6 @@
|
|
|
258
261
|
}
|
|
259
262
|
]
|
|
260
263
|
}
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"name": "authority",
|
|
264
|
-
"writable": true,
|
|
265
|
-
"signer": true
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
"name": "system_program",
|
|
269
|
-
"address": "11111111111111111111111111111111"
|
|
270
264
|
}
|
|
271
265
|
],
|
|
272
266
|
"args": [
|
|
@@ -360,6 +354,75 @@
|
|
|
360
354
|
}
|
|
361
355
|
]
|
|
362
356
|
},
|
|
357
|
+
{
|
|
358
|
+
"name": "init_project_fee",
|
|
359
|
+
"discriminator": [
|
|
360
|
+
21,
|
|
361
|
+
68,
|
|
362
|
+
31,
|
|
363
|
+
251,
|
|
364
|
+
143,
|
|
365
|
+
139,
|
|
366
|
+
107,
|
|
367
|
+
64
|
|
368
|
+
],
|
|
369
|
+
"accounts": [
|
|
370
|
+
{
|
|
371
|
+
"name": "storage",
|
|
372
|
+
"pda": {
|
|
373
|
+
"seeds": [
|
|
374
|
+
{
|
|
375
|
+
"kind": "const",
|
|
376
|
+
"value": [
|
|
377
|
+
115,
|
|
378
|
+
116,
|
|
379
|
+
111,
|
|
380
|
+
114,
|
|
381
|
+
97,
|
|
382
|
+
103,
|
|
383
|
+
101
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"name": "fee",
|
|
391
|
+
"writable": true,
|
|
392
|
+
"pda": {
|
|
393
|
+
"seeds": [
|
|
394
|
+
{
|
|
395
|
+
"kind": "const",
|
|
396
|
+
"value": [
|
|
397
|
+
102,
|
|
398
|
+
101,
|
|
399
|
+
101
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"kind": "arg",
|
|
404
|
+
"path": "_project_id"
|
|
405
|
+
}
|
|
406
|
+
]
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"name": "authority",
|
|
411
|
+
"writable": true,
|
|
412
|
+
"signer": true
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"name": "system_program",
|
|
416
|
+
"address": "11111111111111111111111111111111"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"args": [
|
|
420
|
+
{
|
|
421
|
+
"name": "project_id",
|
|
422
|
+
"type": "string"
|
|
423
|
+
}
|
|
424
|
+
]
|
|
425
|
+
},
|
|
363
426
|
{
|
|
364
427
|
"name": "initialize",
|
|
365
428
|
"discriminator": [
|
|
@@ -1015,6 +1078,10 @@
|
|
|
1015
1078
|
"type": {
|
|
1016
1079
|
"kind": "struct",
|
|
1017
1080
|
"fields": [
|
|
1081
|
+
{
|
|
1082
|
+
"name": "default",
|
|
1083
|
+
"type": "bool"
|
|
1084
|
+
},
|
|
1018
1085
|
{
|
|
1019
1086
|
"name": "bips",
|
|
1020
1087
|
"type": "u64"
|
|
@@ -46,6 +46,11 @@ export type FeeCollector = {
|
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
"name": "feeTokenMint",
|
|
51
|
+
"writable": true,
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
49
54
|
{
|
|
50
55
|
"name": "vault",
|
|
51
56
|
"writable": true,
|
|
@@ -71,7 +76,6 @@ export type FeeCollector = {
|
|
|
71
76
|
},
|
|
72
77
|
{
|
|
73
78
|
"name": "fee",
|
|
74
|
-
"writable": true,
|
|
75
79
|
"pda": {
|
|
76
80
|
"seeds": [
|
|
77
81
|
{
|
|
@@ -247,7 +251,6 @@ export type FeeCollector = {
|
|
|
247
251
|
},
|
|
248
252
|
{
|
|
249
253
|
"name": "fee",
|
|
250
|
-
"writable": true,
|
|
251
254
|
"pda": {
|
|
252
255
|
"seeds": [
|
|
253
256
|
{
|
|
@@ -264,15 +267,6 @@ export type FeeCollector = {
|
|
|
264
267
|
}
|
|
265
268
|
]
|
|
266
269
|
}
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"name": "authority",
|
|
270
|
-
"writable": true,
|
|
271
|
-
"signer": true
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"name": "systemProgram",
|
|
275
|
-
"address": "11111111111111111111111111111111"
|
|
276
270
|
}
|
|
277
271
|
],
|
|
278
272
|
"args": [
|
|
@@ -366,6 +360,75 @@ export type FeeCollector = {
|
|
|
366
360
|
}
|
|
367
361
|
]
|
|
368
362
|
},
|
|
363
|
+
{
|
|
364
|
+
"name": "initProjectFee",
|
|
365
|
+
"discriminator": [
|
|
366
|
+
21,
|
|
367
|
+
68,
|
|
368
|
+
31,
|
|
369
|
+
251,
|
|
370
|
+
143,
|
|
371
|
+
139,
|
|
372
|
+
107,
|
|
373
|
+
64
|
|
374
|
+
],
|
|
375
|
+
"accounts": [
|
|
376
|
+
{
|
|
377
|
+
"name": "storage",
|
|
378
|
+
"pda": {
|
|
379
|
+
"seeds": [
|
|
380
|
+
{
|
|
381
|
+
"kind": "const",
|
|
382
|
+
"value": [
|
|
383
|
+
115,
|
|
384
|
+
116,
|
|
385
|
+
111,
|
|
386
|
+
114,
|
|
387
|
+
97,
|
|
388
|
+
103,
|
|
389
|
+
101
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "fee",
|
|
397
|
+
"writable": true,
|
|
398
|
+
"pda": {
|
|
399
|
+
"seeds": [
|
|
400
|
+
{
|
|
401
|
+
"kind": "const",
|
|
402
|
+
"value": [
|
|
403
|
+
102,
|
|
404
|
+
101,
|
|
405
|
+
101
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"kind": "arg",
|
|
410
|
+
"path": "projectId"
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "authority",
|
|
417
|
+
"writable": true,
|
|
418
|
+
"signer": true
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"name": "systemProgram",
|
|
422
|
+
"address": "11111111111111111111111111111111"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"args": [
|
|
426
|
+
{
|
|
427
|
+
"name": "projectId",
|
|
428
|
+
"type": "string"
|
|
429
|
+
}
|
|
430
|
+
]
|
|
431
|
+
},
|
|
369
432
|
{
|
|
370
433
|
"name": "initialize",
|
|
371
434
|
"discriminator": [
|
|
@@ -1021,6 +1084,10 @@ export type FeeCollector = {
|
|
|
1021
1084
|
"type": {
|
|
1022
1085
|
"kind": "struct",
|
|
1023
1086
|
"fields": [
|
|
1087
|
+
{
|
|
1088
|
+
"name": "default",
|
|
1089
|
+
"type": "bool"
|
|
1090
|
+
},
|
|
1024
1091
|
{
|
|
1025
1092
|
"name": "bips",
|
|
1026
1093
|
"type": "u64"
|