@streamflow/distributor 7.5.3 → 8.0.0-alpha.p287.39c8818

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.
Files changed (98) hide show
  1. package/dist/cjs/index.cjs +3101 -0
  2. package/dist/cjs/index.cjs.map +1 -0
  3. package/dist/cjs/index.d.cts +10 -0
  4. package/dist/cjs/solana/descriptor/aligned_distributor.cjs +4 -0
  5. package/dist/cjs/solana/descriptor/aligned_distributor.cjs.map +1 -0
  6. package/dist/cjs/solana/descriptor/aligned_distributor.d.cts +932 -0
  7. package/dist/cjs/solana/descriptor/merkle_distributor.cjs +4 -0
  8. package/dist/cjs/solana/descriptor/merkle_distributor.cjs.map +1 -0
  9. package/dist/cjs/solana/descriptor/merkle_distributor.d.cts +1128 -0
  10. package/dist/cjs/solana/index.cjs +3095 -0
  11. package/dist/cjs/solana/index.cjs.map +1 -0
  12. package/dist/cjs/solana/index.d.cts +1486 -0
  13. package/dist/esm/index.d.ts +10 -1
  14. package/dist/esm/index.js +3075 -1
  15. package/dist/esm/index.js.map +1 -0
  16. package/dist/esm/solana/descriptor/aligned_distributor.d.ts +3 -1
  17. package/dist/esm/solana/descriptor/aligned_distributor.js +3 -1
  18. package/dist/esm/solana/descriptor/aligned_distributor.js.map +1 -0
  19. package/dist/esm/solana/descriptor/idl/aligned_distributor.json +851 -1182
  20. package/dist/esm/solana/descriptor/idl/merkle_distributor.json +1030 -0
  21. package/dist/esm/solana/descriptor/merkle_distributor.d.ts +3 -1
  22. package/dist/esm/solana/descriptor/merkle_distributor.js +3 -1
  23. package/dist/esm/solana/descriptor/merkle_distributor.js.map +1 -0
  24. package/dist/esm/solana/index.d.ts +1486 -7
  25. package/dist/esm/solana/index.js +3047 -7
  26. package/dist/esm/solana/index.js.map +1 -0
  27. package/package.json +56 -20
  28. package/dist/cjs/index.js +0 -27
  29. package/dist/cjs/solana/clients/BaseDistributorClient.js +0 -276
  30. package/dist/cjs/solana/clients/SolanaAlignedDistributorClient.js +0 -116
  31. package/dist/cjs/solana/clients/SolanaDistributorClient.js +0 -17
  32. package/dist/cjs/solana/clients/index.js +0 -10
  33. package/dist/cjs/solana/constants.js +0 -28
  34. package/dist/cjs/solana/descriptor/aligned_distributor.js +0 -2
  35. package/dist/cjs/solana/descriptor/idl/aligned_distributor.json +0 -1255
  36. package/dist/cjs/solana/descriptor/merkle_distributor.js +0 -2
  37. package/dist/cjs/solana/generated/accounts/ClaimStatus.js +0 -135
  38. package/dist/cjs/solana/generated/accounts/MerkleDistributor.js +0 -215
  39. package/dist/cjs/solana/generated/accounts/index.js +0 -7
  40. package/dist/cjs/solana/generated/errors/anchor.js +0 -712
  41. package/dist/cjs/solana/generated/errors/custom.js +0 -321
  42. package/dist/cjs/solana/generated/errors/index.js +0 -64
  43. package/dist/cjs/solana/generated/instructions/claimLocked.js +0 -22
  44. package/dist/cjs/solana/generated/instructions/clawback.js +0 -21
  45. package/dist/cjs/solana/generated/instructions/closeClaim.js +0 -57
  46. package/dist/cjs/solana/generated/instructions/index.js +0 -17
  47. package/dist/cjs/solana/generated/instructions/newClaim.js +0 -59
  48. package/dist/cjs/solana/generated/instructions/newDistributor.js +0 -104
  49. package/dist/cjs/solana/generated/instructions/setAdmin.js +0 -17
  50. package/dist/cjs/solana/generated/instructions/setClawbackReceiver.js +0 -17
  51. package/dist/cjs/solana/generated/programId.js +0 -8
  52. package/dist/cjs/solana/index.js +0 -36
  53. package/dist/cjs/solana/types.js +0 -159
  54. package/dist/cjs/solana/utils.js +0 -75
  55. package/dist/esm/solana/clients/BaseDistributorClient.d.ts +0 -43
  56. package/dist/esm/solana/clients/BaseDistributorClient.js +0 -274
  57. package/dist/esm/solana/clients/SolanaAlignedDistributorClient.d.ts +0 -16
  58. package/dist/esm/solana/clients/SolanaAlignedDistributorClient.js +0 -111
  59. package/dist/esm/solana/clients/SolanaDistributorClient.d.ts +0 -8
  60. package/dist/esm/solana/clients/SolanaDistributorClient.js +0 -11
  61. package/dist/esm/solana/clients/index.d.ts +0 -2
  62. package/dist/esm/solana/clients/index.js +0 -2
  63. package/dist/esm/solana/constants.d.ts +0 -24
  64. package/dist/esm/solana/constants.js +0 -25
  65. package/dist/esm/solana/generated/accounts/ClaimStatus.d.ts +0 -83
  66. package/dist/esm/solana/generated/accounts/ClaimStatus.js +0 -127
  67. package/dist/esm/solana/generated/accounts/MerkleDistributor.d.ts +0 -179
  68. package/dist/esm/solana/generated/accounts/MerkleDistributor.js +0 -239
  69. package/dist/esm/solana/generated/accounts/index.d.ts +0 -4
  70. package/dist/esm/solana/generated/accounts/index.js +0 -2
  71. package/dist/esm/solana/generated/errors/anchor.d.ts +0 -434
  72. package/dist/esm/solana/generated/errors/anchor.js +0 -707
  73. package/dist/esm/solana/generated/errors/custom.d.ts +0 -194
  74. package/dist/esm/solana/generated/errors/custom.js +0 -317
  75. package/dist/esm/solana/generated/errors/index.d.ts +0 -5
  76. package/dist/esm/solana/generated/errors/index.js +0 -37
  77. package/dist/esm/solana/generated/instructions/claimLocked.d.ts +0 -23
  78. package/dist/esm/solana/generated/instructions/claimLocked.js +0 -19
  79. package/dist/esm/solana/generated/instructions/clawback.d.ts +0 -17
  80. package/dist/esm/solana/generated/instructions/clawback.js +0 -18
  81. package/dist/esm/solana/generated/instructions/closeClaim.d.ts +0 -22
  82. package/dist/esm/solana/generated/instructions/closeClaim.js +0 -30
  83. package/dist/esm/solana/generated/instructions/index.d.ts +0 -14
  84. package/dist/esm/solana/generated/instructions/index.js +0 -7
  85. package/dist/esm/solana/generated/instructions/newClaim.d.ts +0 -29
  86. package/dist/esm/solana/generated/instructions/newClaim.js +0 -32
  87. package/dist/esm/solana/generated/instructions/newDistributor.d.ts +0 -58
  88. package/dist/esm/solana/generated/instructions/newDistributor.js +0 -77
  89. package/dist/esm/solana/generated/instructions/setAdmin.d.ts +0 -10
  90. package/dist/esm/solana/generated/instructions/setAdmin.js +0 -14
  91. package/dist/esm/solana/generated/instructions/setClawbackReceiver.d.ts +0 -10
  92. package/dist/esm/solana/generated/instructions/setClawbackReceiver.js +0 -14
  93. package/dist/esm/solana/generated/programId.d.ts +0 -3
  94. package/dist/esm/solana/generated/programId.js +0 -5
  95. package/dist/esm/solana/types.d.ts +0 -258
  96. package/dist/esm/solana/types.js +0 -156
  97. package/dist/esm/solana/utils.d.ts +0 -14
  98. package/dist/esm/solana/utils.js +0 -65
@@ -1,14 +0,0 @@
1
- export { newDistributor } from "./newDistributor";
2
- export type { NewDistributorArgs, NewDistributorAccounts } from "./newDistributor";
3
- export { newClaim } from "./newClaim";
4
- export type { NewClaimArgs, NewClaimAccounts } from "./newClaim";
5
- export { claimLocked } from "./claimLocked";
6
- export type { ClaimLockedAccounts } from "./claimLocked";
7
- export { clawback } from "./clawback";
8
- export type { ClawbackAccounts } from "./clawback";
9
- export { closeClaim } from "./closeClaim";
10
- export type { CloseClaimAccounts } from "./closeClaim";
11
- export { setClawbackReceiver } from "./setClawbackReceiver";
12
- export type { SetClawbackReceiverAccounts } from "./setClawbackReceiver";
13
- export { setAdmin } from "./setAdmin";
14
- export type { SetAdminAccounts } from "./setAdmin";
@@ -1,7 +0,0 @@
1
- export { newDistributor } from "./newDistributor";
2
- export { newClaim } from "./newClaim";
3
- export { claimLocked } from "./claimLocked";
4
- export { clawback } from "./clawback";
5
- export { closeClaim } from "./closeClaim";
6
- export { setClawbackReceiver } from "./setClawbackReceiver";
7
- export { setAdmin } from "./setAdmin";
@@ -1,29 +0,0 @@
1
- import { TransactionInstruction, PublicKey } from "@solana/web3.js";
2
- import BN from "bn.js";
3
- export interface NewClaimArgs {
4
- amountUnlocked: BN;
5
- amountLocked: BN;
6
- proof: Array<Array<number>>;
7
- }
8
- export interface NewClaimAccounts {
9
- /** The [MerkleDistributor]. */
10
- distributor: PublicKey;
11
- /** Claim status PDA */
12
- claimStatus: PublicKey;
13
- /** Distributor ATA containing the tokens to distribute. */
14
- from: PublicKey;
15
- /** Account to send the claimed tokens to. */
16
- to: PublicKey;
17
- /** Who is claiming the tokens. */
18
- claimant: PublicKey;
19
- /** The mint to claim. */
20
- mint: PublicKey;
21
- /** SPL [Token] program. */
22
- tokenProgram: PublicKey;
23
- /** The [System] program. */
24
- systemProgram: PublicKey;
25
- eventAuthority: PublicKey;
26
- program: PublicKey;
27
- }
28
- export declare const layout: any;
29
- export declare function newClaim(args: NewClaimArgs, accounts: NewClaimAccounts, programId?: PublicKey): TransactionInstruction;
@@ -1,32 +0,0 @@
1
- import { TransactionInstruction } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars
3
- import { PROGRAM_ID } from "../programId";
4
- export const layout = borsh.struct([
5
- borsh.u64("amountUnlocked"),
6
- borsh.u64("amountLocked"),
7
- borsh.vec(borsh.array(borsh.u8(), 32), "proof"),
8
- ]);
9
- export function newClaim(args, accounts, programId = PROGRAM_ID) {
10
- const keys = [
11
- { pubkey: accounts.distributor, isSigner: false, isWritable: true },
12
- { pubkey: accounts.claimStatus, isSigner: false, isWritable: true },
13
- { pubkey: accounts.from, isSigner: false, isWritable: true },
14
- { pubkey: accounts.to, isSigner: false, isWritable: true },
15
- { pubkey: accounts.claimant, isSigner: true, isWritable: true },
16
- { pubkey: accounts.mint, isSigner: false, isWritable: false },
17
- { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
18
- { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
19
- { pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
20
- { pubkey: accounts.program, isSigner: false, isWritable: false },
21
- ];
22
- const identifier = Buffer.from([78, 177, 98, 123, 210, 21, 187, 83]);
23
- const buffer = Buffer.alloc(1000);
24
- const len = layout.encode({
25
- amountUnlocked: args.amountUnlocked,
26
- amountLocked: args.amountLocked,
27
- proof: args.proof,
28
- }, buffer);
29
- const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
30
- const ix = new TransactionInstruction({ keys, programId, data });
31
- return ix;
32
- }
@@ -1,58 +0,0 @@
1
- import { TransactionInstruction, PublicKey } from "@solana/web3.js";
2
- import BN from "bn.js";
3
- export interface NewDistributorArgs {
4
- version: BN;
5
- root: Array<number>;
6
- maxTotalClaim: BN;
7
- maxNumNodes: BN;
8
- unlockPeriod: BN;
9
- startVestingTs: BN;
10
- endVestingTs: BN;
11
- clawbackStartTs: BN;
12
- claimsClosableByAdmin: boolean;
13
- claimsClosableByClaimant?: boolean | null;
14
- claimsLimit?: number | null;
15
- }
16
- export interface NewDistributorAccounts {
17
- /** [MerkleDistributor]. */
18
- distributor: PublicKey;
19
- /** Clawback receiver token account */
20
- clawbackReceiver: PublicKey;
21
- /** The mint to distribute. */
22
- mint: PublicKey;
23
- /** Token vault */
24
- tokenVault: PublicKey;
25
- /**
26
- * Admin wallet, responsible for creating the distributor and paying for the transaction.
27
- * Also has the authority to set the clawback receiver and change itself.
28
- */
29
- admin: PublicKey;
30
- /** The [System] program. */
31
- systemProgram: PublicKey;
32
- /** The [Associated Token] program. */
33
- associatedTokenProgram: PublicKey;
34
- /** The [Token] program. */
35
- tokenProgram: PublicKey;
36
- }
37
- export declare const layout: any;
38
- /**
39
- * READ THE FOLLOWING:
40
- *
41
- * This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.
42
- *
43
- * An attack could look like:
44
- * - A legitimate user opens a new distributor.
45
- * - Someone observes the call to this instruction.
46
- * - They replace the clawback_receiver, admin, or time parameters with their own.
47
- *
48
- * One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own
49
- * and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,
50
- * the attacker can steal all funds from the distributor to their own clawback_receiver account.
51
- *
52
- * HOW TO AVOID:
53
- * - When you call into this instruction, ensure your transaction succeeds.
54
- * - To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and
55
- * assert the parameters are what you expect, most importantly the clawback_receiver and admin.
56
- * - If your transaction fails, double check the value on-chain matches what you expect.
57
- */
58
- export declare function newDistributor(args: NewDistributorArgs, accounts: NewDistributorAccounts, programId?: PublicKey): TransactionInstruction;
@@ -1,77 +0,0 @@
1
- import { TransactionInstruction } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars
3
- import { Buffer } from "buffer";
4
- import { PROGRAM_ID } from "../programId";
5
- export const layout = borsh.struct([
6
- borsh.u64("version"),
7
- borsh.array(borsh.u8(), 32, "root"),
8
- borsh.u64("maxTotalClaim"),
9
- borsh.u64("maxNumNodes"),
10
- borsh.u64("unlockPeriod"),
11
- borsh.u64("startVestingTs"),
12
- borsh.u64("endVestingTs"),
13
- borsh.u64("clawbackStartTs"),
14
- borsh.bool("claimsClosableByAdmin"),
15
- borsh.option(borsh.bool(), "canUpdateDuration"),
16
- borsh.option(borsh.u64(), "totalAmountUnlocked"),
17
- borsh.option(borsh.u64(), "totalAmountLocked"),
18
- borsh.option(borsh.bool(), "claimsClosableByClaimant"),
19
- borsh.option(borsh.u16(), "claimsLimit"),
20
- ]);
21
- /**
22
- * READ THE FOLLOWING:
23
- *
24
- * This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.
25
- *
26
- * An attack could look like:
27
- * - A legitimate user opens a new distributor.
28
- * - Someone observes the call to this instruction.
29
- * - They replace the clawback_receiver, admin, or time parameters with their own.
30
- *
31
- * One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own
32
- * and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,
33
- * the attacker can steal all funds from the distributor to their own clawback_receiver account.
34
- *
35
- * HOW TO AVOID:
36
- * - When you call into this instruction, ensure your transaction succeeds.
37
- * - To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and
38
- * assert the parameters are what you expect, most importantly the clawback_receiver and admin.
39
- * - If your transaction fails, double check the value on-chain matches what you expect.
40
- */
41
- export function newDistributor(args, accounts, programId = PROGRAM_ID) {
42
- const keys = [
43
- { pubkey: accounts.distributor, isSigner: false, isWritable: true },
44
- { pubkey: accounts.clawbackReceiver, isSigner: false, isWritable: true },
45
- { pubkey: accounts.mint, isSigner: false, isWritable: false },
46
- { pubkey: accounts.tokenVault, isSigner: false, isWritable: true },
47
- { pubkey: accounts.admin, isSigner: true, isWritable: true },
48
- { pubkey: accounts.systemProgram, isSigner: false, isWritable: false },
49
- {
50
- pubkey: accounts.associatedTokenProgram,
51
- isSigner: false,
52
- isWritable: false,
53
- },
54
- { pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
55
- ];
56
- const identifier = Buffer.from([32, 139, 112, 171, 0, 2, 225, 155]);
57
- const buffer = Buffer.alloc(1000);
58
- const len = layout.encode({
59
- version: args.version,
60
- root: args.root,
61
- maxTotalClaim: args.maxTotalClaim,
62
- maxNumNodes: args.maxNumNodes,
63
- unlockPeriod: args.unlockPeriod,
64
- startVestingTs: args.startVestingTs,
65
- endVestingTs: args.endVestingTs,
66
- clawbackStartTs: args.clawbackStartTs,
67
- claimsClosableByAdmin: args.claimsClosableByAdmin,
68
- canUpdateDuration: null,
69
- totalAmountUnlocked: null,
70
- totalAmountLocked: null,
71
- claimsClosableByClaimant: args.claimsClosableByClaimant ?? null,
72
- claimsLimit: args.claimsLimit ?? null,
73
- }, buffer);
74
- const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len);
75
- const ix = new TransactionInstruction({ keys, programId, data });
76
- return ix;
77
- }
@@ -1,10 +0,0 @@
1
- import { TransactionInstruction, PublicKey } from "@solana/web3.js";
2
- export interface SetAdminAccounts {
3
- /** The [MerkleDistributor]. */
4
- distributor: PublicKey;
5
- /** Admin signer */
6
- admin: PublicKey;
7
- /** New admin account */
8
- newAdmin: PublicKey;
9
- }
10
- export declare function setAdmin(accounts: SetAdminAccounts, programId?: PublicKey): TransactionInstruction;
@@ -1,14 +0,0 @@
1
- import { TransactionInstruction } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import { Buffer } from "buffer";
3
- import { PROGRAM_ID } from "../programId";
4
- export function setAdmin(accounts, programId = PROGRAM_ID) {
5
- const keys = [
6
- { pubkey: accounts.distributor, isSigner: false, isWritable: true },
7
- { pubkey: accounts.admin, isSigner: true, isWritable: true },
8
- { pubkey: accounts.newAdmin, isSigner: false, isWritable: true },
9
- ];
10
- const identifier = Buffer.from([251, 163, 0, 52, 91, 194, 187, 92]);
11
- const data = identifier;
12
- const ix = new TransactionInstruction({ keys, programId, data });
13
- return ix;
14
- }
@@ -1,10 +0,0 @@
1
- import { TransactionInstruction, PublicKey } from "@solana/web3.js";
2
- export interface SetClawbackReceiverAccounts {
3
- /** The [MerkleDistributor]. */
4
- distributor: PublicKey;
5
- /** New clawback account */
6
- newClawbackAccount: PublicKey;
7
- /** Admin signer */
8
- admin: PublicKey;
9
- }
10
- export declare function setClawbackReceiver(accounts: SetClawbackReceiverAccounts, programId?: PublicKey): TransactionInstruction;
@@ -1,14 +0,0 @@
1
- import { TransactionInstruction } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import { Buffer } from "buffer";
3
- import { PROGRAM_ID } from "../programId";
4
- export function setClawbackReceiver(accounts, programId = PROGRAM_ID) {
5
- const keys = [
6
- { pubkey: accounts.distributor, isSigner: false, isWritable: true },
7
- { pubkey: accounts.newClawbackAccount, isSigner: false, isWritable: false },
8
- { pubkey: accounts.admin, isSigner: true, isWritable: true },
9
- ];
10
- const identifier = Buffer.from([153, 217, 34, 20, 19, 29, 229, 75]);
11
- const data = identifier;
12
- const ix = new TransactionInstruction({ keys, programId, data });
13
- return ix;
14
- }
@@ -1,3 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- export declare const PROGRAM_ID_CLI: PublicKey;
3
- export declare const PROGRAM_ID: PublicKey;
@@ -1,5 +0,0 @@
1
- import { PublicKey } from "@solana/web3.js";
2
- // Program ID passed with the cli --program-id flag when running the code generator. Do not edit, it will get overwritten.
3
- export const PROGRAM_ID_CLI = new PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N");
4
- // This constant will not get overwritten on subsequent code generations and it's safe to modify it's value.
5
- export const PROGRAM_ID = PROGRAM_ID_CLI;
@@ -1,258 +0,0 @@
1
- import { SignerWalletAdapter } from "@solana/wallet-adapter-base";
2
- import { Keypair, PublicKey } from "@solana/web3.js";
3
- import { ITransactionResult } from "@streamflow/common";
4
- import { ITransactionSolanaExt } from "@streamflow/common/solana";
5
- import BN from "bn.js";
6
- import { IdlTypes } from "@coral-xyz/anchor";
7
- import { AlignedDistributor as AlignedDistributorIDL } from "./descriptor/aligned_distributor.js";
8
- export type OracleType = IdlTypes<AlignedDistributorIDL>["oracleType"];
9
- export type OracleTypeName = "none" | "pyth" | "switchboard" | "test";
10
- export interface IInteractSolanaExt extends ITransactionSolanaExt {
11
- invoker: SignerWalletAdapter | Keypair;
12
- }
13
- export interface ICreateSolanaExt extends IInteractSolanaExt {
14
- isNative?: boolean;
15
- }
16
- export interface ICreateDistributorData {
17
- mint: string;
18
- version: number;
19
- root: Array<number>;
20
- maxTotalClaim: BN | number | string;
21
- maxNumNodes: BN | number | string;
22
- unlockPeriod: number;
23
- startVestingTs: number;
24
- endVestingTs: number;
25
- clawbackStartTs: number;
26
- claimsClosableByAdmin: boolean;
27
- claimsClosableByClaimant?: boolean;
28
- claimsLimit?: number;
29
- }
30
- export interface AlignedDistributorData {
31
- sender: string;
32
- minPrice: number;
33
- maxPrice: number;
34
- minPercentage: number;
35
- maxPercentage: number;
36
- oracleType: OracleTypeName;
37
- priceOracle: string | undefined;
38
- updatePeriod: number;
39
- clawedBack: boolean;
40
- initialDuration: number;
41
- initialPrice: number;
42
- lastPrice: number;
43
- lastDurationUpdateTs: number;
44
- }
45
- export interface NewAlignedDistributorArgs {
46
- totalAmountLocked: BN;
47
- totalAmountUnlocked: BN;
48
- oracleType: OracleType;
49
- minPrice: BN;
50
- maxPrice: BN;
51
- minPercentage: BN;
52
- maxPercentage: BN;
53
- tickSize: BN;
54
- skipInitial: boolean;
55
- updatePeriod: BN;
56
- }
57
- export interface ICreateAlignedDistributorData extends ICreateDistributorData {
58
- minPrice: number;
59
- maxPrice: number;
60
- minPercentage: number;
61
- maxPercentage: number;
62
- oracleType: OracleTypeName;
63
- oracleAddress: string;
64
- totalAmountLocked: BN | number | string;
65
- totalAmountUnlocked: BN | number | string;
66
- updatePeriod?: number;
67
- tickSize?: number;
68
- skipInitial?: boolean;
69
- }
70
- export interface IClaimData {
71
- id: string;
72
- amountUnlocked: BN;
73
- amountLocked: BN;
74
- proof: Array<Array<number>>;
75
- }
76
- export interface ICloseClaimData extends Partial<Omit<IClaimData, "id">> {
77
- id: string;
78
- claimant: string | PublicKey;
79
- }
80
- export interface IClawbackData {
81
- id: string;
82
- }
83
- export interface IGetClaimData {
84
- id: string;
85
- recipient: string;
86
- }
87
- export interface IGetDistributors {
88
- ids: string[];
89
- }
90
- export interface ISearchDistributors {
91
- mint?: string;
92
- admin?: string;
93
- }
94
- export interface ISetDataAdmin {
95
- id: string;
96
- newAdmin: string;
97
- }
98
- export interface ISetClawbackReceiverData {
99
- id: string;
100
- newReceiver: string;
101
- }
102
- export interface ICreateDistributorResult extends ITransactionResult {
103
- metadataId: string;
104
- }
105
- export declare enum AnchorErrorCode {
106
- /** 8 byte instruction identifier not provided */
107
- InstructionMissing = "InstructionMissing",
108
- /** Fallback functions are not supported */
109
- InstructionFallbackNotFound = "InstructionFallbackNotFound",
110
- /** The program could not deserialize the given instruction */
111
- InstructionDidNotDeserialize = "InstructionDidNotDeserialize",
112
- /** The program could not serialize the given instruction */
113
- InstructionDidNotSerialize = "InstructionDidNotSerialize",
114
- /** The program was compiled without idl instructions */
115
- IdlInstructionStub = "IdlInstructionStub",
116
- /** The transaction was given an invalid program for the IDL instruction */
117
- IdlInstructionInvalidProgram = "IdlInstructionInvalidProgram",
118
- /** A mut constraint was violated */
119
- ConstraintMut = "ConstraintMut",
120
- /** A has one constraint was violated */
121
- ConstraintHasOne = "ConstraintHasOne",
122
- /** A signer constraint was violated */
123
- ConstraintSigner = "ConstraintSigner",
124
- /** A raw constraint was violated */
125
- ConstraintRaw = "ConstraintRaw",
126
- /** An owner constraint was violated */
127
- ConstraintOwner = "ConstraintOwner",
128
- /** A rent exemption constraint was violated */
129
- ConstraintRentExempt = "ConstraintRentExempt",
130
- /** A seeds constraint was violated */
131
- ConstraintSeeds = "ConstraintSeeds",
132
- /** An executable constraint was violated */
133
- ConstraintExecutable = "ConstraintExecutable",
134
- /** Deprecated Error, feel free to replace with something else */
135
- ConstraintState = "ConstraintState",
136
- /** An associated constraint was violated */
137
- ConstraintAssociated = "ConstraintAssociated",
138
- /** An associated init constraint was violated */
139
- ConstraintAssociatedInit = "ConstraintAssociatedInit",
140
- /** A close constraint was violated */
141
- ConstraintClose = "ConstraintClose",
142
- /** An address constraint was violated */
143
- ConstraintAddress = "ConstraintAddress",
144
- /** Expected zero account discriminant */
145
- ConstraintZero = "ConstraintZero",
146
- /** A token mint constraint was violated */
147
- ConstraintTokenMint = "ConstraintTokenMint",
148
- /** A token owner constraint was violated */
149
- ConstraintTokenOwner = "ConstraintTokenOwner",
150
- /** A mint mint authority constraint was violated */
151
- ConstraintMintMintAuthority = "ConstraintMintMintAuthority",
152
- /** A mint freeze authority constraint was violated */
153
- ConstraintMintFreezeAuthority = "ConstraintMintFreezeAuthority",
154
- /** A mint decimals constraint was violated */
155
- ConstraintMintDecimals = "ConstraintMintDecimals",
156
- /** A space constraint was violated */
157
- ConstraintSpace = "ConstraintSpace",
158
- /** A required account for the constraint is None */
159
- ConstraintAccountIsNone = "ConstraintAccountIsNone",
160
- /** A require expression was violated */
161
- RequireViolated = "RequireViolated",
162
- /** A require_eq expression was violated */
163
- RequireEqViolated = "RequireEqViolated",
164
- /** A require_keys_eq expression was violated */
165
- RequireKeysEqViolated = "RequireKeysEqViolated",
166
- /** A require_neq expression was violated */
167
- RequireNeqViolated = "RequireNeqViolated",
168
- /** A require_keys_neq expression was violated */
169
- RequireKeysNeqViolated = "RequireKeysNeqViolated",
170
- /** A require_gt expression was violated */
171
- RequireGtViolated = "RequireGtViolated",
172
- /** A require_gte expression was violated */
173
- RequireGteViolated = "RequireGteViolated",
174
- /** The account discriminator was already set on this account */
175
- AccountDiscriminatorAlreadySet = "AccountDiscriminatorAlreadySet",
176
- /** No 8 byte discriminator was found on the account */
177
- AccountDiscriminatorNotFound = "AccountDiscriminatorNotFound",
178
- /** 8 byte discriminator did not match what was expected */
179
- AccountDiscriminatorMismatch = "AccountDiscriminatorMismatch",
180
- /** Failed to deserialize the account */
181
- AccountDidNotDeserialize = "AccountDidNotDeserialize",
182
- /** Failed to serialize the account */
183
- AccountDidNotSerialize = "AccountDidNotSerialize",
184
- /** Not enough account keys given to the instruction */
185
- AccountNotEnoughKeys = "AccountNotEnoughKeys",
186
- /** The given account is not mutable */
187
- AccountNotMutable = "AccountNotMutable",
188
- /** The given account is owned by a different program than expected */
189
- AccountOwnedByWrongProgram = "AccountOwnedByWrongProgram",
190
- /** Program ID was not as expected */
191
- InvalidProgramId = "InvalidProgramId",
192
- /** Program account is not executable */
193
- InvalidProgramExecutable = "InvalidProgramExecutable",
194
- /** The given account did not sign */
195
- AccountNotSigner = "AccountNotSigner",
196
- /** The given account is not owned by the system program */
197
- AccountNotSystemOwned = "AccountNotSystemOwned",
198
- /** The program expected this account to be already initialized */
199
- AccountNotInitialized = "AccountNotInitialized",
200
- /** The given account is not a program data account */
201
- AccountNotProgramData = "AccountNotProgramData",
202
- /** The given account is not the associated token account */
203
- AccountNotAssociatedTokenAccount = "AccountNotAssociatedTokenAccount",
204
- /** The given public key does not match the required sysvar */
205
- AccountSysvarMismatch = "AccountSysvarMismatch",
206
- /** The account reallocation exceeds the MAX_PERMITTED_DATA_INCREASE limit */
207
- AccountReallocExceedsLimit = "AccountReallocExceedsLimit",
208
- /** The account was duplicated for more than one reallocation */
209
- AccountDuplicateReallocs = "AccountDuplicateReallocs",
210
- /** The declared program id does not match the actual program id */
211
- DeclaredProgramIdMismatch = "DeclaredProgramIdMismatch",
212
- /** The API being used is deprecated and should no longer be used */
213
- Deprecated = "Deprecated"
214
- }
215
- export declare enum ContractErrorCode {
216
- /** Insufficient unlocked tokens */
217
- InsufficientUnlockedTokens = "InsufficientUnlockedTokens",
218
- /** Deposit Start too far in future */
219
- StartTooFarInFuture = "StartTooFarInFuture",
220
- /** Invalid Merkle proof */
221
- InvalidProof = "InvalidProof",
222
- /** Exceeded maximum claim amount */
223
- ExceededMaxClaim = "ExceededMaxClaim",
224
- /** Exceeded maximum node count */
225
- MaxNodesExceeded = "MaxNodesExceeded",
226
- /** Account is not authorized to execute this instruction */
227
- Unauthorized = "Unauthorized",
228
- /** Token account owner did not match intended owner */
229
- OwnerMismatch = "OwnerMismatch",
230
- /** Clawback cannot be before vesting starts */
231
- ClawbackBeforeVesting = "ClawbackBeforeVesting",
232
- /** Attempted clawback before start */
233
- ClawbackBeforeStart = "ClawbackBeforeStart",
234
- /** Clawback already claimed */
235
- ClawbackAlreadyClaimed = "ClawbackAlreadyClaimed",
236
- /** Clawback start must be at least one day after vesting end */
237
- InsufficientClawbackDelay = "InsufficientClawbackDelay",
238
- /** New and old Clawback receivers are identical */
239
- SameClawbackReceiver = "SameClawbackReceiver",
240
- /** New and old admin are identical */
241
- SameAdmin = "SameAdmin",
242
- /** Claim window expired */
243
- ClaimExpired = "ClaimExpired",
244
- /** Arithmetic Error (overflow/underflow) */
245
- ArithmeticError = "ArithmeticError",
246
- /** Start Timestamp cannot be after end Timestamp */
247
- StartTimestampAfterEnd = "StartTimestampAfterEnd",
248
- /** Timestamps cannot be in the past */
249
- TimestampsNotInFuture = "TimestampsNotInFuture",
250
- /** Airdrop Version Mismatch */
251
- InvalidVersion = "InvalidVersion",
252
- /** Invalid Mint */
253
- InvalidMint = "InvalidMint",
254
- /** Claim is closed */
255
- ClaimIsClosed = "ClaimIsClosed",
256
- /** Claims are not closable */
257
- ClaimsAreNotClosable = "ClaimsAreNotClosable"
258
- }