@nosana/kit 1.0.3 → 1.0.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/.gitlab-ci.yml +2 -2
- package/dist/config/defaultConfigs.js +2 -0
- package/dist/config/types.d.ts +1 -0
- package/dist/generated_clients/merkle_distributor/accounts/claimStatus.d.ts +53 -0
- package/dist/generated_clients/merkle_distributor/accounts/claimStatus.js +65 -0
- package/dist/generated_clients/merkle_distributor/accounts/index.d.ts +9 -0
- package/dist/generated_clients/merkle_distributor/accounts/index.js +9 -0
- package/dist/generated_clients/merkle_distributor/accounts/merkleDistributor.d.ts +109 -0
- package/dist/generated_clients/merkle_distributor/accounts/merkleDistributor.js +93 -0
- package/dist/generated_clients/merkle_distributor/errors/index.d.ts +8 -0
- package/dist/generated_clients/merkle_distributor/errors/index.js +8 -0
- package/dist/generated_clients/merkle_distributor/errors/merkleDistributor.d.ts +63 -0
- package/dist/generated_clients/merkle_distributor/errors/merkleDistributor.js +89 -0
- package/dist/generated_clients/merkle_distributor/index.d.ts +11 -0
- package/dist/generated_clients/merkle_distributor/index.js +11 -0
- package/dist/generated_clients/merkle_distributor/instructions/claimLocked.d.ts +69 -0
- package/dist/generated_clients/merkle_distributor/instructions/claimLocked.js +84 -0
- package/dist/generated_clients/merkle_distributor/instructions/clawback.d.ts +69 -0
- package/dist/generated_clients/merkle_distributor/instructions/clawback.js +88 -0
- package/dist/generated_clients/merkle_distributor/instructions/closeClaimStatus.d.ts +45 -0
- package/dist/generated_clients/merkle_distributor/instructions/closeClaimStatus.js +73 -0
- package/dist/generated_clients/merkle_distributor/instructions/closeDistributor.d.ts +64 -0
- package/dist/generated_clients/merkle_distributor/instructions/closeDistributor.js +84 -0
- package/dist/generated_clients/merkle_distributor/instructions/index.d.ts +16 -0
- package/dist/generated_clients/merkle_distributor/instructions/index.js +16 -0
- package/dist/generated_clients/merkle_distributor/instructions/newClaim.d.ts +78 -0
- package/dist/generated_clients/merkle_distributor/instructions/newClaim.js +101 -0
- package/dist/generated_clients/merkle_distributor/instructions/newDistributor.d.ts +113 -0
- package/dist/generated_clients/merkle_distributor/instructions/newDistributor.js +122 -0
- package/dist/generated_clients/merkle_distributor/instructions/setAdmin.d.ts +48 -0
- package/dist/generated_clients/merkle_distributor/instructions/setAdmin.js +70 -0
- package/dist/generated_clients/merkle_distributor/instructions/setClawbackReceiver.d.ts +48 -0
- package/dist/generated_clients/merkle_distributor/instructions/setClawbackReceiver.js +76 -0
- package/dist/generated_clients/merkle_distributor/instructions/setEnableSlot.d.ts +47 -0
- package/dist/generated_clients/merkle_distributor/instructions/setEnableSlot.js +73 -0
- package/dist/generated_clients/merkle_distributor/programs/index.d.ts +8 -0
- package/dist/generated_clients/merkle_distributor/programs/index.js +8 -0
- package/dist/generated_clients/merkle_distributor/programs/merkleDistributor.d.ts +50 -0
- package/dist/generated_clients/merkle_distributor/programs/merkleDistributor.js +67 -0
- package/dist/generated_clients/merkle_distributor/shared/index.d.ts +49 -0
- package/dist/generated_clients/merkle_distributor/shared/index.js +86 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/programs/MerkleDistributorProgram.d.ts +101 -0
- package/dist/programs/MerkleDistributorProgram.js +296 -0
- package/package.json +13 -12
- package/scripts/generate-clients.ts +11 -0
package/.gitlab-ci.yml
CHANGED
|
@@ -9,11 +9,11 @@ include:
|
|
|
9
9
|
- project: nosana-ci/tools/cicd/gitlab-ci
|
|
10
10
|
file: templates/semver.yml
|
|
11
11
|
|
|
12
|
-
npm
|
|
12
|
+
npm format:
|
|
13
13
|
stage: test
|
|
14
14
|
script:
|
|
15
15
|
- npm ci
|
|
16
|
-
- npm run
|
|
16
|
+
- npm run format
|
|
17
17
|
rules:
|
|
18
18
|
- if: $CI_MERGE_REQUEST_ID
|
|
19
19
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
@@ -18,6 +18,7 @@ export const DEFAULT_CONFIGS = {
|
|
|
18
18
|
rewardsAddress: address('nosRB8DUV67oLNrL45bo2pFLrmsWPiewe2Lk2DRNYCp'),
|
|
19
19
|
stakeAddress: address('nosScmHY2uR24Zh751PmGj9ww9QRNHewh9H59AfrTJE'),
|
|
20
20
|
poolsAddress: address('nosPdZrfDzND1LAR28FLMDEATUPK53K8xbRBXAirevD'),
|
|
21
|
+
merkleDistributorAddress: address('merkp8F8f5EgYSYKadk3YiuQQdo3JPdnJWKviaaF425'),
|
|
21
22
|
},
|
|
22
23
|
logLevel: NosanaLogLevel.ERROR,
|
|
23
24
|
},
|
|
@@ -38,6 +39,7 @@ export const DEFAULT_CONFIGS = {
|
|
|
38
39
|
rewardsAddress: address('nosRB8DUV67oLNrL45bo2pFLrmsWPiewe2Lk2DRNYCp'),
|
|
39
40
|
stakeAddress: address('nosScmHY2uR24Zh751PmGj9ww9QRNHewh9H59AfrTJE'),
|
|
40
41
|
poolsAddress: address('nosPdZrfDzND1LAR28FLMDEATUPK53K8xbRBXAirevD'),
|
|
42
|
+
merkleDistributorAddress: address('merkp8F8f5EgYSYKadk3YiuQQdo3JPdnJWKviaaF425'),
|
|
41
43
|
},
|
|
42
44
|
logLevel: NosanaLogLevel.DEBUG,
|
|
43
45
|
},
|
package/dist/config/types.d.ts
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
export declare const CLAIM_STATUS_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
10
|
+
export declare function getClaimStatusDiscriminatorBytes(): ReadonlyUint8Array;
|
|
11
|
+
export type ClaimStatus = {
|
|
12
|
+
discriminator: ReadonlyUint8Array;
|
|
13
|
+
/** Authority that claimed the tokens. */
|
|
14
|
+
claimant: Address;
|
|
15
|
+
/** Locked amount */
|
|
16
|
+
lockedAmount: bigint;
|
|
17
|
+
/** Locked amount withdrawn */
|
|
18
|
+
lockedAmountWithdrawn: bigint;
|
|
19
|
+
/** Unlocked amount */
|
|
20
|
+
unlockedAmount: bigint;
|
|
21
|
+
/** Unlocked amount claimed */
|
|
22
|
+
unlockedAmountClaimed: bigint;
|
|
23
|
+
/** indicate that whether admin can close this account, for testing purpose */
|
|
24
|
+
closable: boolean;
|
|
25
|
+
/** admin of merkle tree, store for for testing purpose */
|
|
26
|
+
distributor: Address;
|
|
27
|
+
};
|
|
28
|
+
export type ClaimStatusArgs = {
|
|
29
|
+
/** Authority that claimed the tokens. */
|
|
30
|
+
claimant: Address;
|
|
31
|
+
/** Locked amount */
|
|
32
|
+
lockedAmount: number | bigint;
|
|
33
|
+
/** Locked amount withdrawn */
|
|
34
|
+
lockedAmountWithdrawn: number | bigint;
|
|
35
|
+
/** Unlocked amount */
|
|
36
|
+
unlockedAmount: number | bigint;
|
|
37
|
+
/** Unlocked amount claimed */
|
|
38
|
+
unlockedAmountClaimed: number | bigint;
|
|
39
|
+
/** indicate that whether admin can close this account, for testing purpose */
|
|
40
|
+
closable: boolean;
|
|
41
|
+
/** admin of merkle tree, store for for testing purpose */
|
|
42
|
+
distributor: Address;
|
|
43
|
+
};
|
|
44
|
+
export declare function getClaimStatusEncoder(): Encoder<ClaimStatusArgs>;
|
|
45
|
+
export declare function getClaimStatusDecoder(): Decoder<ClaimStatus>;
|
|
46
|
+
export declare function getClaimStatusCodec(): Codec<ClaimStatusArgs, ClaimStatus>;
|
|
47
|
+
export declare function decodeClaimStatus<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<ClaimStatus, TAddress>;
|
|
48
|
+
export declare function decodeClaimStatus<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<ClaimStatus, TAddress>;
|
|
49
|
+
export declare function fetchClaimStatus<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<ClaimStatus, TAddress>>;
|
|
50
|
+
export declare function fetchMaybeClaimStatus<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<ClaimStatus, TAddress>>;
|
|
51
|
+
export declare function fetchAllClaimStatus(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<ClaimStatus>[]>;
|
|
52
|
+
export declare function fetchAllMaybeClaimStatus(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<ClaimStatus>[]>;
|
|
53
|
+
export declare function getClaimStatusSize(): number;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
export const CLAIM_STATUS_DISCRIMINATOR = new Uint8Array([
|
|
10
|
+
22, 183, 249, 157, 247, 95, 150, 96,
|
|
11
|
+
]);
|
|
12
|
+
export function getClaimStatusDiscriminatorBytes() {
|
|
13
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_STATUS_DISCRIMINATOR);
|
|
14
|
+
}
|
|
15
|
+
export function getClaimStatusEncoder() {
|
|
16
|
+
return transformEncoder(getStructEncoder([
|
|
17
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
18
|
+
['claimant', getAddressEncoder()],
|
|
19
|
+
['lockedAmount', getU64Encoder()],
|
|
20
|
+
['lockedAmountWithdrawn', getU64Encoder()],
|
|
21
|
+
['unlockedAmount', getU64Encoder()],
|
|
22
|
+
['unlockedAmountClaimed', getU64Encoder()],
|
|
23
|
+
['closable', getBooleanEncoder()],
|
|
24
|
+
['distributor', getAddressEncoder()],
|
|
25
|
+
]), (value) => ({ ...value, discriminator: CLAIM_STATUS_DISCRIMINATOR }));
|
|
26
|
+
}
|
|
27
|
+
export function getClaimStatusDecoder() {
|
|
28
|
+
return getStructDecoder([
|
|
29
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
30
|
+
['claimant', getAddressDecoder()],
|
|
31
|
+
['lockedAmount', getU64Decoder()],
|
|
32
|
+
['lockedAmountWithdrawn', getU64Decoder()],
|
|
33
|
+
['unlockedAmount', getU64Decoder()],
|
|
34
|
+
['unlockedAmountClaimed', getU64Decoder()],
|
|
35
|
+
['closable', getBooleanDecoder()],
|
|
36
|
+
['distributor', getAddressDecoder()],
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
export function getClaimStatusCodec() {
|
|
40
|
+
return combineCodec(getClaimStatusEncoder(), getClaimStatusDecoder());
|
|
41
|
+
}
|
|
42
|
+
export function decodeClaimStatus(encodedAccount) {
|
|
43
|
+
return decodeAccount(encodedAccount, getClaimStatusDecoder());
|
|
44
|
+
}
|
|
45
|
+
export async function fetchClaimStatus(rpc, address, config) {
|
|
46
|
+
const maybeAccount = await fetchMaybeClaimStatus(rpc, address, config);
|
|
47
|
+
assertAccountExists(maybeAccount);
|
|
48
|
+
return maybeAccount;
|
|
49
|
+
}
|
|
50
|
+
export async function fetchMaybeClaimStatus(rpc, address, config) {
|
|
51
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
52
|
+
return decodeClaimStatus(maybeAccount);
|
|
53
|
+
}
|
|
54
|
+
export async function fetchAllClaimStatus(rpc, addresses, config) {
|
|
55
|
+
const maybeAccounts = await fetchAllMaybeClaimStatus(rpc, addresses, config);
|
|
56
|
+
assertAccountsExist(maybeAccounts);
|
|
57
|
+
return maybeAccounts;
|
|
58
|
+
}
|
|
59
|
+
export async function fetchAllMaybeClaimStatus(rpc, addresses, config) {
|
|
60
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
61
|
+
return maybeAccounts.map((maybeAccount) => decodeClaimStatus(maybeAccount));
|
|
62
|
+
}
|
|
63
|
+
export function getClaimStatusSize() {
|
|
64
|
+
return 105;
|
|
65
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './claimStatus';
|
|
9
|
+
export * from './merkleDistributor';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './claimStatus';
|
|
9
|
+
export * from './merkleDistributor';
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from '@solana/kit';
|
|
9
|
+
export declare const MERKLE_DISTRIBUTOR_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
10
|
+
export declare function getMerkleDistributorDiscriminatorBytes(): ReadonlyUint8Array;
|
|
11
|
+
export type MerkleDistributor = {
|
|
12
|
+
discriminator: ReadonlyUint8Array;
|
|
13
|
+
/** Bump seed. */
|
|
14
|
+
bump: number;
|
|
15
|
+
/** Version of the airdrop */
|
|
16
|
+
version: bigint;
|
|
17
|
+
/** The 256-bit merkle root. */
|
|
18
|
+
root: ReadonlyUint8Array;
|
|
19
|
+
/** [Mint] of the token to be distributed. */
|
|
20
|
+
mint: Address;
|
|
21
|
+
/** Token Address of the vault */
|
|
22
|
+
tokenVault: Address;
|
|
23
|
+
/** Maximum number of tokens that can ever be claimed from this [MerkleDistributor]. */
|
|
24
|
+
maxTotalClaim: bigint;
|
|
25
|
+
/** Maximum number of nodes in [MerkleDistributor]. */
|
|
26
|
+
maxNumNodes: bigint;
|
|
27
|
+
/** Total amount of tokens that have been claimed. */
|
|
28
|
+
totalAmountClaimed: bigint;
|
|
29
|
+
/** Total amount of tokens that have been forgone. */
|
|
30
|
+
totalAmountForgone: bigint;
|
|
31
|
+
/** Number of nodes that have been claimed. */
|
|
32
|
+
numNodesClaimed: bigint;
|
|
33
|
+
/** Lockup time start (Unix Timestamp) */
|
|
34
|
+
startTs: bigint;
|
|
35
|
+
/** Lockup time end (Unix Timestamp) */
|
|
36
|
+
endTs: bigint;
|
|
37
|
+
/** Clawback start (Unix Timestamp) */
|
|
38
|
+
clawbackStartTs: bigint;
|
|
39
|
+
/** Clawback receiver */
|
|
40
|
+
clawbackReceiver: Address;
|
|
41
|
+
/** Admin wallet */
|
|
42
|
+
admin: Address;
|
|
43
|
+
/** Whether or not the distributor has been clawed back */
|
|
44
|
+
clawedBack: boolean;
|
|
45
|
+
/** this merkle tree is enable from this slot */
|
|
46
|
+
enableSlot: bigint;
|
|
47
|
+
/** indicate that whether admin can close this pool, for testing purpose */
|
|
48
|
+
closable: boolean;
|
|
49
|
+
/** Buffer 0 */
|
|
50
|
+
buffer0: ReadonlyUint8Array;
|
|
51
|
+
/** Buffer 1 */
|
|
52
|
+
buffer1: ReadonlyUint8Array;
|
|
53
|
+
/** Buffer 2 */
|
|
54
|
+
buffer2: ReadonlyUint8Array;
|
|
55
|
+
};
|
|
56
|
+
export type MerkleDistributorArgs = {
|
|
57
|
+
/** Bump seed. */
|
|
58
|
+
bump: number;
|
|
59
|
+
/** Version of the airdrop */
|
|
60
|
+
version: number | bigint;
|
|
61
|
+
/** The 256-bit merkle root. */
|
|
62
|
+
root: ReadonlyUint8Array;
|
|
63
|
+
/** [Mint] of the token to be distributed. */
|
|
64
|
+
mint: Address;
|
|
65
|
+
/** Token Address of the vault */
|
|
66
|
+
tokenVault: Address;
|
|
67
|
+
/** Maximum number of tokens that can ever be claimed from this [MerkleDistributor]. */
|
|
68
|
+
maxTotalClaim: number | bigint;
|
|
69
|
+
/** Maximum number of nodes in [MerkleDistributor]. */
|
|
70
|
+
maxNumNodes: number | bigint;
|
|
71
|
+
/** Total amount of tokens that have been claimed. */
|
|
72
|
+
totalAmountClaimed: number | bigint;
|
|
73
|
+
/** Total amount of tokens that have been forgone. */
|
|
74
|
+
totalAmountForgone: number | bigint;
|
|
75
|
+
/** Number of nodes that have been claimed. */
|
|
76
|
+
numNodesClaimed: number | bigint;
|
|
77
|
+
/** Lockup time start (Unix Timestamp) */
|
|
78
|
+
startTs: number | bigint;
|
|
79
|
+
/** Lockup time end (Unix Timestamp) */
|
|
80
|
+
endTs: number | bigint;
|
|
81
|
+
/** Clawback start (Unix Timestamp) */
|
|
82
|
+
clawbackStartTs: number | bigint;
|
|
83
|
+
/** Clawback receiver */
|
|
84
|
+
clawbackReceiver: Address;
|
|
85
|
+
/** Admin wallet */
|
|
86
|
+
admin: Address;
|
|
87
|
+
/** Whether or not the distributor has been clawed back */
|
|
88
|
+
clawedBack: boolean;
|
|
89
|
+
/** this merkle tree is enable from this slot */
|
|
90
|
+
enableSlot: number | bigint;
|
|
91
|
+
/** indicate that whether admin can close this pool, for testing purpose */
|
|
92
|
+
closable: boolean;
|
|
93
|
+
/** Buffer 0 */
|
|
94
|
+
buffer0: ReadonlyUint8Array;
|
|
95
|
+
/** Buffer 1 */
|
|
96
|
+
buffer1: ReadonlyUint8Array;
|
|
97
|
+
/** Buffer 2 */
|
|
98
|
+
buffer2: ReadonlyUint8Array;
|
|
99
|
+
};
|
|
100
|
+
export declare function getMerkleDistributorEncoder(): Encoder<MerkleDistributorArgs>;
|
|
101
|
+
export declare function getMerkleDistributorDecoder(): Decoder<MerkleDistributor>;
|
|
102
|
+
export declare function getMerkleDistributorCodec(): Codec<MerkleDistributorArgs, MerkleDistributor>;
|
|
103
|
+
export declare function decodeMerkleDistributor<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<MerkleDistributor, TAddress>;
|
|
104
|
+
export declare function decodeMerkleDistributor<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<MerkleDistributor, TAddress>;
|
|
105
|
+
export declare function fetchMerkleDistributor<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<MerkleDistributor, TAddress>>;
|
|
106
|
+
export declare function fetchMaybeMerkleDistributor<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<MerkleDistributor, TAddress>>;
|
|
107
|
+
export declare function fetchAllMerkleDistributor(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<MerkleDistributor>[]>;
|
|
108
|
+
export declare function fetchAllMaybeMerkleDistributor(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<MerkleDistributor>[]>;
|
|
109
|
+
export declare function getMerkleDistributorSize(): number;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { assertAccountExists, assertAccountsExist, combineCodec, decodeAccount, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getI64Decoder, getI64Encoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, transformEncoder, } from '@solana/kit';
|
|
9
|
+
export const MERKLE_DISTRIBUTOR_DISCRIMINATOR = new Uint8Array([
|
|
10
|
+
77, 119, 139, 70, 84, 247, 12, 26,
|
|
11
|
+
]);
|
|
12
|
+
export function getMerkleDistributorDiscriminatorBytes() {
|
|
13
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(MERKLE_DISTRIBUTOR_DISCRIMINATOR);
|
|
14
|
+
}
|
|
15
|
+
export function getMerkleDistributorEncoder() {
|
|
16
|
+
return transformEncoder(getStructEncoder([
|
|
17
|
+
['discriminator', fixEncoderSize(getBytesEncoder(), 8)],
|
|
18
|
+
['bump', getU8Encoder()],
|
|
19
|
+
['version', getU64Encoder()],
|
|
20
|
+
['root', fixEncoderSize(getBytesEncoder(), 32)],
|
|
21
|
+
['mint', getAddressEncoder()],
|
|
22
|
+
['tokenVault', getAddressEncoder()],
|
|
23
|
+
['maxTotalClaim', getU64Encoder()],
|
|
24
|
+
['maxNumNodes', getU64Encoder()],
|
|
25
|
+
['totalAmountClaimed', getU64Encoder()],
|
|
26
|
+
['totalAmountForgone', getU64Encoder()],
|
|
27
|
+
['numNodesClaimed', getU64Encoder()],
|
|
28
|
+
['startTs', getI64Encoder()],
|
|
29
|
+
['endTs', getI64Encoder()],
|
|
30
|
+
['clawbackStartTs', getI64Encoder()],
|
|
31
|
+
['clawbackReceiver', getAddressEncoder()],
|
|
32
|
+
['admin', getAddressEncoder()],
|
|
33
|
+
['clawedBack', getBooleanEncoder()],
|
|
34
|
+
['enableSlot', getU64Encoder()],
|
|
35
|
+
['closable', getBooleanEncoder()],
|
|
36
|
+
['buffer0', fixEncoderSize(getBytesEncoder(), 32)],
|
|
37
|
+
['buffer1', fixEncoderSize(getBytesEncoder(), 32)],
|
|
38
|
+
['buffer2', fixEncoderSize(getBytesEncoder(), 32)],
|
|
39
|
+
]), (value) => ({ ...value, discriminator: MERKLE_DISTRIBUTOR_DISCRIMINATOR }));
|
|
40
|
+
}
|
|
41
|
+
export function getMerkleDistributorDecoder() {
|
|
42
|
+
return getStructDecoder([
|
|
43
|
+
['discriminator', fixDecoderSize(getBytesDecoder(), 8)],
|
|
44
|
+
['bump', getU8Decoder()],
|
|
45
|
+
['version', getU64Decoder()],
|
|
46
|
+
['root', fixDecoderSize(getBytesDecoder(), 32)],
|
|
47
|
+
['mint', getAddressDecoder()],
|
|
48
|
+
['tokenVault', getAddressDecoder()],
|
|
49
|
+
['maxTotalClaim', getU64Decoder()],
|
|
50
|
+
['maxNumNodes', getU64Decoder()],
|
|
51
|
+
['totalAmountClaimed', getU64Decoder()],
|
|
52
|
+
['totalAmountForgone', getU64Decoder()],
|
|
53
|
+
['numNodesClaimed', getU64Decoder()],
|
|
54
|
+
['startTs', getI64Decoder()],
|
|
55
|
+
['endTs', getI64Decoder()],
|
|
56
|
+
['clawbackStartTs', getI64Decoder()],
|
|
57
|
+
['clawbackReceiver', getAddressDecoder()],
|
|
58
|
+
['admin', getAddressDecoder()],
|
|
59
|
+
['clawedBack', getBooleanDecoder()],
|
|
60
|
+
['enableSlot', getU64Decoder()],
|
|
61
|
+
['closable', getBooleanDecoder()],
|
|
62
|
+
['buffer0', fixDecoderSize(getBytesDecoder(), 32)],
|
|
63
|
+
['buffer1', fixDecoderSize(getBytesDecoder(), 32)],
|
|
64
|
+
['buffer2', fixDecoderSize(getBytesDecoder(), 32)],
|
|
65
|
+
]);
|
|
66
|
+
}
|
|
67
|
+
export function getMerkleDistributorCodec() {
|
|
68
|
+
return combineCodec(getMerkleDistributorEncoder(), getMerkleDistributorDecoder());
|
|
69
|
+
}
|
|
70
|
+
export function decodeMerkleDistributor(encodedAccount) {
|
|
71
|
+
return decodeAccount(encodedAccount, getMerkleDistributorDecoder());
|
|
72
|
+
}
|
|
73
|
+
export async function fetchMerkleDistributor(rpc, address, config) {
|
|
74
|
+
const maybeAccount = await fetchMaybeMerkleDistributor(rpc, address, config);
|
|
75
|
+
assertAccountExists(maybeAccount);
|
|
76
|
+
return maybeAccount;
|
|
77
|
+
}
|
|
78
|
+
export async function fetchMaybeMerkleDistributor(rpc, address, config) {
|
|
79
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
80
|
+
return decodeMerkleDistributor(maybeAccount);
|
|
81
|
+
}
|
|
82
|
+
export async function fetchAllMerkleDistributor(rpc, addresses, config) {
|
|
83
|
+
const maybeAccounts = await fetchAllMaybeMerkleDistributor(rpc, addresses, config);
|
|
84
|
+
assertAccountsExist(maybeAccounts);
|
|
85
|
+
return maybeAccounts;
|
|
86
|
+
}
|
|
87
|
+
export async function fetchAllMaybeMerkleDistributor(rpc, addresses, config) {
|
|
88
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
89
|
+
return maybeAccounts.map((maybeAccount) => decodeMerkleDistributor(maybeAccount));
|
|
90
|
+
}
|
|
91
|
+
export function getMerkleDistributorSize() {
|
|
92
|
+
return 347;
|
|
93
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';
|
|
9
|
+
/** InsufficientUnlockedTokens: Insufficient unlocked tokens */
|
|
10
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_UNLOCKED_TOKENS = 6000;
|
|
11
|
+
/** StartTooFarInFuture: Deposit Start too far in future */
|
|
12
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__START_TOO_FAR_IN_FUTURE = 6001;
|
|
13
|
+
/** InvalidProof: Invalid Merkle proof. */
|
|
14
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__INVALID_PROOF = 6002;
|
|
15
|
+
/** ExceededMaxClaim: Exceeded maximum claim amount */
|
|
16
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__EXCEEDED_MAX_CLAIM = 6003;
|
|
17
|
+
/** MaxNodesExceeded: Exceeded maximum node count */
|
|
18
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__MAX_NODES_EXCEEDED = 6004;
|
|
19
|
+
/** Unauthorized: Account is not authorized to execute this instruction */
|
|
20
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__UNAUTHORIZED = 6005;
|
|
21
|
+
/** OwnerMismatch: Token account owner did not match intended owner */
|
|
22
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__OWNER_MISMATCH = 6006;
|
|
23
|
+
/** ClawbackDuringVesting: Clawback cannot be before vesting ends */
|
|
24
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_DURING_VESTING = 6007;
|
|
25
|
+
/** ClawbackBeforeStart: Attempted clawback before start */
|
|
26
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_BEFORE_START = 6008;
|
|
27
|
+
/** ClawbackAlreadyClaimed: Clawback already claimed */
|
|
28
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_ALREADY_CLAIMED = 6009;
|
|
29
|
+
/** InsufficientClawbackDelay: Clawback start must be at least one day after vesting end */
|
|
30
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_CLAWBACK_DELAY = 6010;
|
|
31
|
+
/** SameClawbackReceiver: New and old Clawback receivers are identical */
|
|
32
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__SAME_CLAWBACK_RECEIVER = 6011;
|
|
33
|
+
/** SameAdmin: New and old admin are identical */
|
|
34
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__SAME_ADMIN = 6012;
|
|
35
|
+
/** ClaimExpired: Claim window expired */
|
|
36
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CLAIM_EXPIRED = 6013;
|
|
37
|
+
/** ArithmeticError: Arithmetic Error (overflow/underflow) */
|
|
38
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__ARITHMETIC_ERROR = 6014;
|
|
39
|
+
/** StartTimestampAfterEnd: Start Timestamp cannot be after end Timestamp */
|
|
40
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__START_TIMESTAMP_AFTER_END = 6015;
|
|
41
|
+
/** TimestampsNotInFuture: Timestamps cannot be in the past */
|
|
42
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__TIMESTAMPS_NOT_IN_FUTURE = 6016;
|
|
43
|
+
/** InvalidVersion: Airdrop Version Mismatch */
|
|
44
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__INVALID_VERSION = 6017;
|
|
45
|
+
/** ClaimingIsNotStarted: Claiming is not started */
|
|
46
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CLAIMING_IS_NOT_STARTED = 6018;
|
|
47
|
+
/** CannotCloseDistributor: Cannot close distributor */
|
|
48
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_DISTRIBUTOR = 6019;
|
|
49
|
+
/** CannotCloseClaimStatus: Cannot close claim status */
|
|
50
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_CLAIM_STATUS = 6020;
|
|
51
|
+
/** InvalidVote: Can only claim to vote address */
|
|
52
|
+
export declare const MERKLE_DISTRIBUTOR_ERROR__INVALID_VOTE = 6021;
|
|
53
|
+
export type MerkleDistributorError = typeof MERKLE_DISTRIBUTOR_ERROR__ARITHMETIC_ERROR | typeof MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_CLAIM_STATUS | typeof MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_DISTRIBUTOR | typeof MERKLE_DISTRIBUTOR_ERROR__CLAIM_EXPIRED | typeof MERKLE_DISTRIBUTOR_ERROR__CLAIMING_IS_NOT_STARTED | typeof MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_ALREADY_CLAIMED | typeof MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_BEFORE_START | typeof MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_DURING_VESTING | typeof MERKLE_DISTRIBUTOR_ERROR__EXCEEDED_MAX_CLAIM | typeof MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_CLAWBACK_DELAY | typeof MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_UNLOCKED_TOKENS | typeof MERKLE_DISTRIBUTOR_ERROR__INVALID_PROOF | typeof MERKLE_DISTRIBUTOR_ERROR__INVALID_VERSION | typeof MERKLE_DISTRIBUTOR_ERROR__INVALID_VOTE | typeof MERKLE_DISTRIBUTOR_ERROR__MAX_NODES_EXCEEDED | typeof MERKLE_DISTRIBUTOR_ERROR__OWNER_MISMATCH | typeof MERKLE_DISTRIBUTOR_ERROR__SAME_ADMIN | typeof MERKLE_DISTRIBUTOR_ERROR__SAME_CLAWBACK_RECEIVER | typeof MERKLE_DISTRIBUTOR_ERROR__START_TIMESTAMP_AFTER_END | typeof MERKLE_DISTRIBUTOR_ERROR__START_TOO_FAR_IN_FUTURE | typeof MERKLE_DISTRIBUTOR_ERROR__TIMESTAMPS_NOT_IN_FUTURE | typeof MERKLE_DISTRIBUTOR_ERROR__UNAUTHORIZED;
|
|
54
|
+
export declare function getMerkleDistributorErrorMessage(code: MerkleDistributorError): string;
|
|
55
|
+
export declare function isMerkleDistributorError<TProgramErrorCode extends MerkleDistributorError>(error: unknown, transactionMessage: {
|
|
56
|
+
instructions: Record<number, {
|
|
57
|
+
programAddress: Address;
|
|
58
|
+
}>;
|
|
59
|
+
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
|
|
60
|
+
context: Readonly<{
|
|
61
|
+
code: TProgramErrorCode;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { isProgramError, } from '@solana/kit';
|
|
9
|
+
import { MERKLE_DISTRIBUTOR_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
+
/** InsufficientUnlockedTokens: Insufficient unlocked tokens */
|
|
11
|
+
export const MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_UNLOCKED_TOKENS = 0x1770; // 6000
|
|
12
|
+
/** StartTooFarInFuture: Deposit Start too far in future */
|
|
13
|
+
export const MERKLE_DISTRIBUTOR_ERROR__START_TOO_FAR_IN_FUTURE = 0x1771; // 6001
|
|
14
|
+
/** InvalidProof: Invalid Merkle proof. */
|
|
15
|
+
export const MERKLE_DISTRIBUTOR_ERROR__INVALID_PROOF = 0x1772; // 6002
|
|
16
|
+
/** ExceededMaxClaim: Exceeded maximum claim amount */
|
|
17
|
+
export const MERKLE_DISTRIBUTOR_ERROR__EXCEEDED_MAX_CLAIM = 0x1773; // 6003
|
|
18
|
+
/** MaxNodesExceeded: Exceeded maximum node count */
|
|
19
|
+
export const MERKLE_DISTRIBUTOR_ERROR__MAX_NODES_EXCEEDED = 0x1774; // 6004
|
|
20
|
+
/** Unauthorized: Account is not authorized to execute this instruction */
|
|
21
|
+
export const MERKLE_DISTRIBUTOR_ERROR__UNAUTHORIZED = 0x1775; // 6005
|
|
22
|
+
/** OwnerMismatch: Token account owner did not match intended owner */
|
|
23
|
+
export const MERKLE_DISTRIBUTOR_ERROR__OWNER_MISMATCH = 0x1776; // 6006
|
|
24
|
+
/** ClawbackDuringVesting: Clawback cannot be before vesting ends */
|
|
25
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_DURING_VESTING = 0x1777; // 6007
|
|
26
|
+
/** ClawbackBeforeStart: Attempted clawback before start */
|
|
27
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_BEFORE_START = 0x1778; // 6008
|
|
28
|
+
/** ClawbackAlreadyClaimed: Clawback already claimed */
|
|
29
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_ALREADY_CLAIMED = 0x1779; // 6009
|
|
30
|
+
/** InsufficientClawbackDelay: Clawback start must be at least one day after vesting end */
|
|
31
|
+
export const MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_CLAWBACK_DELAY = 0x177a; // 6010
|
|
32
|
+
/** SameClawbackReceiver: New and old Clawback receivers are identical */
|
|
33
|
+
export const MERKLE_DISTRIBUTOR_ERROR__SAME_CLAWBACK_RECEIVER = 0x177b; // 6011
|
|
34
|
+
/** SameAdmin: New and old admin are identical */
|
|
35
|
+
export const MERKLE_DISTRIBUTOR_ERROR__SAME_ADMIN = 0x177c; // 6012
|
|
36
|
+
/** ClaimExpired: Claim window expired */
|
|
37
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CLAIM_EXPIRED = 0x177d; // 6013
|
|
38
|
+
/** ArithmeticError: Arithmetic Error (overflow/underflow) */
|
|
39
|
+
export const MERKLE_DISTRIBUTOR_ERROR__ARITHMETIC_ERROR = 0x177e; // 6014
|
|
40
|
+
/** StartTimestampAfterEnd: Start Timestamp cannot be after end Timestamp */
|
|
41
|
+
export const MERKLE_DISTRIBUTOR_ERROR__START_TIMESTAMP_AFTER_END = 0x177f; // 6015
|
|
42
|
+
/** TimestampsNotInFuture: Timestamps cannot be in the past */
|
|
43
|
+
export const MERKLE_DISTRIBUTOR_ERROR__TIMESTAMPS_NOT_IN_FUTURE = 0x1780; // 6016
|
|
44
|
+
/** InvalidVersion: Airdrop Version Mismatch */
|
|
45
|
+
export const MERKLE_DISTRIBUTOR_ERROR__INVALID_VERSION = 0x1781; // 6017
|
|
46
|
+
/** ClaimingIsNotStarted: Claiming is not started */
|
|
47
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CLAIMING_IS_NOT_STARTED = 0x1782; // 6018
|
|
48
|
+
/** CannotCloseDistributor: Cannot close distributor */
|
|
49
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_DISTRIBUTOR = 0x1783; // 6019
|
|
50
|
+
/** CannotCloseClaimStatus: Cannot close claim status */
|
|
51
|
+
export const MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_CLAIM_STATUS = 0x1784; // 6020
|
|
52
|
+
/** InvalidVote: Can only claim to vote address */
|
|
53
|
+
export const MERKLE_DISTRIBUTOR_ERROR__INVALID_VOTE = 0x1785; // 6021
|
|
54
|
+
let merkleDistributorErrorMessages;
|
|
55
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
56
|
+
merkleDistributorErrorMessages = {
|
|
57
|
+
[MERKLE_DISTRIBUTOR_ERROR__ARITHMETIC_ERROR]: `Arithmetic Error (overflow/underflow)`,
|
|
58
|
+
[MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_CLAIM_STATUS]: `Cannot close claim status`,
|
|
59
|
+
[MERKLE_DISTRIBUTOR_ERROR__CANNOT_CLOSE_DISTRIBUTOR]: `Cannot close distributor`,
|
|
60
|
+
[MERKLE_DISTRIBUTOR_ERROR__CLAIM_EXPIRED]: `Claim window expired`,
|
|
61
|
+
[MERKLE_DISTRIBUTOR_ERROR__CLAIMING_IS_NOT_STARTED]: `Claiming is not started`,
|
|
62
|
+
[MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_ALREADY_CLAIMED]: `Clawback already claimed`,
|
|
63
|
+
[MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_BEFORE_START]: `Attempted clawback before start`,
|
|
64
|
+
[MERKLE_DISTRIBUTOR_ERROR__CLAWBACK_DURING_VESTING]: `Clawback cannot be before vesting ends`,
|
|
65
|
+
[MERKLE_DISTRIBUTOR_ERROR__EXCEEDED_MAX_CLAIM]: `Exceeded maximum claim amount`,
|
|
66
|
+
[MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_CLAWBACK_DELAY]: `Clawback start must be at least one day after vesting end`,
|
|
67
|
+
[MERKLE_DISTRIBUTOR_ERROR__INSUFFICIENT_UNLOCKED_TOKENS]: `Insufficient unlocked tokens`,
|
|
68
|
+
[MERKLE_DISTRIBUTOR_ERROR__INVALID_PROOF]: `Invalid Merkle proof.`,
|
|
69
|
+
[MERKLE_DISTRIBUTOR_ERROR__INVALID_VERSION]: `Airdrop Version Mismatch`,
|
|
70
|
+
[MERKLE_DISTRIBUTOR_ERROR__INVALID_VOTE]: `Can only claim to vote address`,
|
|
71
|
+
[MERKLE_DISTRIBUTOR_ERROR__MAX_NODES_EXCEEDED]: `Exceeded maximum node count`,
|
|
72
|
+
[MERKLE_DISTRIBUTOR_ERROR__OWNER_MISMATCH]: `Token account owner did not match intended owner`,
|
|
73
|
+
[MERKLE_DISTRIBUTOR_ERROR__SAME_ADMIN]: `New and old admin are identical`,
|
|
74
|
+
[MERKLE_DISTRIBUTOR_ERROR__SAME_CLAWBACK_RECEIVER]: `New and old Clawback receivers are identical`,
|
|
75
|
+
[MERKLE_DISTRIBUTOR_ERROR__START_TIMESTAMP_AFTER_END]: `Start Timestamp cannot be after end Timestamp`,
|
|
76
|
+
[MERKLE_DISTRIBUTOR_ERROR__START_TOO_FAR_IN_FUTURE]: `Deposit Start too far in future`,
|
|
77
|
+
[MERKLE_DISTRIBUTOR_ERROR__TIMESTAMPS_NOT_IN_FUTURE]: `Timestamps cannot be in the past`,
|
|
78
|
+
[MERKLE_DISTRIBUTOR_ERROR__UNAUTHORIZED]: `Account is not authorized to execute this instruction`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function getMerkleDistributorErrorMessage(code) {
|
|
82
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
83
|
+
return merkleDistributorErrorMessages[code];
|
|
84
|
+
}
|
|
85
|
+
return 'Error message not available in production bundles.';
|
|
86
|
+
}
|
|
87
|
+
export function isMerkleDistributorError(error, transactionMessage, code) {
|
|
88
|
+
return isProgramError(error, transactionMessage, MERKLE_DISTRIBUTOR_PROGRAM_ADDRESS, code);
|
|
89
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './accounts';
|
|
9
|
+
export * from './errors';
|
|
10
|
+
export * from './instructions';
|
|
11
|
+
export * from './programs';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from './accounts';
|
|
9
|
+
export * from './errors';
|
|
10
|
+
export * from './instructions';
|
|
11
|
+
export * from './programs';
|