@fuul/sdk-solana 0.5.2

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 (126) hide show
  1. package/README.md +145 -0
  2. package/dist/cjs/accounts.js +84 -0
  3. package/dist/cjs/accounts.js.map +1 -0
  4. package/dist/cjs/common/contract.js +68 -0
  5. package/dist/cjs/common/contract.js.map +1 -0
  6. package/dist/cjs/common/errors.js +11 -0
  7. package/dist/cjs/common/errors.js.map +1 -0
  8. package/dist/cjs/common/index.js +20 -0
  9. package/dist/cjs/common/index.js.map +1 -0
  10. package/dist/cjs/common/messages.js +122 -0
  11. package/dist/cjs/common/messages.js.map +1 -0
  12. package/dist/cjs/constants.js +20 -0
  13. package/dist/cjs/constants.js.map +1 -0
  14. package/dist/cjs/idls/fuul.js +3 -0
  15. package/dist/cjs/idls/fuul.js.map +1 -0
  16. package/dist/cjs/idls/fuul.json +4714 -0
  17. package/dist/cjs/index.js +23 -0
  18. package/dist/cjs/index.js.map +1 -0
  19. package/dist/cjs/instructions/admin-roles.js +39 -0
  20. package/dist/cjs/instructions/admin-roles.js.map +1 -0
  21. package/dist/cjs/instructions/admin-token-management.js +39 -0
  22. package/dist/cjs/instructions/admin-token-management.js.map +1 -0
  23. package/dist/cjs/instructions/admin.js +65 -0
  24. package/dist/cjs/instructions/admin.js.map +1 -0
  25. package/dist/cjs/instructions/create-global-config.js +16 -0
  26. package/dist/cjs/instructions/create-global-config.js.map +1 -0
  27. package/dist/cjs/instructions/create-project.js +26 -0
  28. package/dist/cjs/instructions/create-project.js.map +1 -0
  29. package/dist/cjs/instructions/index.js +25 -0
  30. package/dist/cjs/instructions/index.js.map +1 -0
  31. package/dist/cjs/instructions/project-budget.js +192 -0
  32. package/dist/cjs/instructions/project-budget.js.map +1 -0
  33. package/dist/cjs/instructions/project-roles.js +39 -0
  34. package/dist/cjs/instructions/project-roles.js.map +1 -0
  35. package/dist/cjs/instructions/project.js +16 -0
  36. package/dist/cjs/instructions/project.js.map +1 -0
  37. package/dist/cjs/pdas.js +38 -0
  38. package/dist/cjs/pdas.js.map +1 -0
  39. package/dist/cjs/sdks/fuul.js +244 -0
  40. package/dist/cjs/sdks/fuul.js.map +1 -0
  41. package/dist/cjs/sdks/index.js +18 -0
  42. package/dist/cjs/sdks/index.js.map +1 -0
  43. package/dist/cjs/types.js +92 -0
  44. package/dist/cjs/types.js.map +1 -0
  45. package/dist/cjs/utils/ed25519.js +71 -0
  46. package/dist/cjs/utils/ed25519.js.map +1 -0
  47. package/dist/cjs/utils/helpers.js +71 -0
  48. package/dist/cjs/utils/helpers.js.map +1 -0
  49. package/dist/cjs/utils/index.js +18 -0
  50. package/dist/cjs/utils/index.js.map +1 -0
  51. package/dist/esm/accounts.js +76 -0
  52. package/dist/esm/accounts.js.map +1 -0
  53. package/dist/esm/common/contract.js +31 -0
  54. package/dist/esm/common/contract.js.map +1 -0
  55. package/dist/esm/common/errors.js +7 -0
  56. package/dist/esm/common/errors.js.map +1 -0
  57. package/dist/esm/common/index.js +4 -0
  58. package/dist/esm/common/index.js.map +1 -0
  59. package/dist/esm/common/messages.js +83 -0
  60. package/dist/esm/common/messages.js.map +1 -0
  61. package/dist/esm/constants.js +17 -0
  62. package/dist/esm/constants.js.map +1 -0
  63. package/dist/esm/idls/fuul.js +2 -0
  64. package/dist/esm/idls/fuul.js.map +1 -0
  65. package/dist/esm/idls/fuul.json +4714 -0
  66. package/dist/esm/index.js +7 -0
  67. package/dist/esm/index.js.map +1 -0
  68. package/dist/esm/instructions/admin-roles.js +33 -0
  69. package/dist/esm/instructions/admin-roles.js.map +1 -0
  70. package/dist/esm/instructions/admin-token-management.js +33 -0
  71. package/dist/esm/instructions/admin-token-management.js.map +1 -0
  72. package/dist/esm/instructions/admin.js +56 -0
  73. package/dist/esm/instructions/admin.js.map +1 -0
  74. package/dist/esm/instructions/create-global-config.js +12 -0
  75. package/dist/esm/instructions/create-global-config.js.map +1 -0
  76. package/dist/esm/instructions/create-project.js +22 -0
  77. package/dist/esm/instructions/create-project.js.map +1 -0
  78. package/dist/esm/instructions/index.js +9 -0
  79. package/dist/esm/instructions/index.js.map +1 -0
  80. package/dist/esm/instructions/project-budget.js +184 -0
  81. package/dist/esm/instructions/project-budget.js.map +1 -0
  82. package/dist/esm/instructions/project-roles.js +33 -0
  83. package/dist/esm/instructions/project-roles.js.map +1 -0
  84. package/dist/esm/instructions/project.js +12 -0
  85. package/dist/esm/instructions/project.js.map +1 -0
  86. package/dist/esm/pdas.js +29 -0
  87. package/dist/esm/pdas.js.map +1 -0
  88. package/dist/esm/sdks/fuul.js +237 -0
  89. package/dist/esm/sdks/fuul.js.map +1 -0
  90. package/dist/esm/sdks/index.js +2 -0
  91. package/dist/esm/sdks/index.js.map +1 -0
  92. package/dist/esm/types.js +53 -0
  93. package/dist/esm/types.js.map +1 -0
  94. package/dist/esm/utils/ed25519.js +67 -0
  95. package/dist/esm/utils/ed25519.js.map +1 -0
  96. package/dist/esm/utils/helpers.js +30 -0
  97. package/dist/esm/utils/helpers.js.map +1 -0
  98. package/dist/esm/utils/index.js +2 -0
  99. package/dist/esm/utils/index.js.map +1 -0
  100. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  101. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  102. package/dist/types/accounts.d.ts +34 -0
  103. package/dist/types/common/contract.d.ts +14 -0
  104. package/dist/types/common/errors.d.ts +3 -0
  105. package/dist/types/common/index.d.ts +3 -0
  106. package/dist/types/common/messages.d.ts +55 -0
  107. package/dist/types/constants.d.ts +9 -0
  108. package/dist/types/idls/fuul.d.ts +3823 -0
  109. package/dist/types/index.d.ts +6 -0
  110. package/dist/types/instructions/admin-roles.d.ts +26 -0
  111. package/dist/types/instructions/admin-token-management.d.ts +28 -0
  112. package/dist/types/instructions/admin.d.ts +47 -0
  113. package/dist/types/instructions/create-global-config.d.ts +10 -0
  114. package/dist/types/instructions/create-project.d.ts +11 -0
  115. package/dist/types/instructions/index.d.ts +8 -0
  116. package/dist/types/instructions/project-budget.d.ts +47 -0
  117. package/dist/types/instructions/project-roles.d.ts +29 -0
  118. package/dist/types/instructions/project.d.ts +13 -0
  119. package/dist/types/pdas.d.ts +8 -0
  120. package/dist/types/sdks/fuul.d.ts +130 -0
  121. package/dist/types/sdks/index.d.ts +1 -0
  122. package/dist/types/types.d.ts +40 -0
  123. package/dist/types/utils/ed25519.d.ts +7 -0
  124. package/dist/types/utils/helpers.d.ts +13 -0
  125. package/dist/types/utils/index.d.ts +1 -0
  126. package/package.json +59 -0
@@ -0,0 +1,6 @@
1
+ export * from './common';
2
+ export * from './constants';
3
+ export * from './idls/fuul';
4
+ export * from './pdas';
5
+ export * from './sdks';
6
+ export * from './types';
@@ -0,0 +1,26 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import * as anchor from '@coral-xyz/anchor';
3
+ import { Network, GlobalRole } from '../types';
4
+ export declare const grantGlobalRoleInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ account: PublicKey;
10
+ role: GlobalRole;
11
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
12
+ export declare const revokeGlobalRoleInstruction: (opts: {
13
+ connection: anchor.web3.Connection;
14
+ network: Network;
15
+ programId?: PublicKey;
16
+ authority: PublicKey;
17
+ account: PublicKey;
18
+ role: GlobalRole;
19
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
20
+ export declare const renounceGlobalRoleInstruction: (opts: {
21
+ connection: anchor.web3.Connection;
22
+ network: Network;
23
+ programId?: PublicKey;
24
+ authority: PublicKey;
25
+ role: GlobalRole;
26
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,28 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import * as anchor from '@coral-xyz/anchor';
3
+ import { Network, TokenType } from '../types';
4
+ export declare const addCurrencyTokenInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ tokenType: TokenType;
10
+ tokenMint: PublicKey;
11
+ claimLimitPerCooldown: anchor.BN;
12
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
13
+ export declare const updateCurrencyTokenInstruction: (opts: {
14
+ connection: anchor.web3.Connection;
15
+ network: Network;
16
+ programId?: PublicKey;
17
+ authority: PublicKey;
18
+ tokenMint: PublicKey;
19
+ claimLimitPerCooldown?: anchor.BN;
20
+ isActive?: boolean;
21
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
22
+ export declare const removeCurrencyTokenInstruction: (opts: {
23
+ connection: anchor.web3.Connection;
24
+ network: Network;
25
+ programId?: PublicKey;
26
+ authority: PublicKey;
27
+ tokenMint: PublicKey;
28
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,47 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import { Network } from '../types';
4
+ export declare const updateGlobalConfigInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ claimCoolDown?: anchor.BN;
10
+ requiredSignersForClaim?: number;
11
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
12
+ export declare const updateGlobalConfigFeesInstruction: (opts: {
13
+ connection: anchor.web3.Connection;
14
+ network: Network;
15
+ programId?: PublicKey;
16
+ authority: PublicKey;
17
+ feeCollector?: PublicKey;
18
+ userNativeClaimFee?: anchor.BN;
19
+ projectClaimFee?: number;
20
+ removeFee?: number;
21
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
22
+ export declare const pauseProgramInstruction: (opts: {
23
+ connection: anchor.web3.Connection;
24
+ network: Network;
25
+ programId?: PublicKey;
26
+ authority: PublicKey;
27
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
28
+ export declare const unpauseProgramInstruction: (opts: {
29
+ connection: anchor.web3.Connection;
30
+ network: Network;
31
+ programId?: PublicKey;
32
+ authority: PublicKey;
33
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
34
+ export declare const addNoClaimFeeWhitelistInstruction: (opts: {
35
+ connection: anchor.web3.Connection;
36
+ network: Network;
37
+ programId?: PublicKey;
38
+ authority: PublicKey;
39
+ account: PublicKey;
40
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
41
+ export declare const removeNoClaimFeeWhitelistInstruction: (opts: {
42
+ connection: anchor.web3.Connection;
43
+ network: Network;
44
+ programId?: PublicKey;
45
+ authority: PublicKey;
46
+ account: PublicKey;
47
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,10 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import { Network } from '../types';
4
+ export declare const createGlobalConfigInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ feeCollector: PublicKey;
10
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,11 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import { Network } from '../types';
4
+ export declare const createProjectInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ projectAdmin: PublicKey;
10
+ metadataUri: string;
11
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,8 @@
1
+ export * from './admin-token-management';
2
+ export * from './create-project';
3
+ export * from './create-global-config';
4
+ export * from './admin-roles';
5
+ export * from './admin';
6
+ export * from './project-budget';
7
+ export * from './project-roles';
8
+ export * from './project';
@@ -0,0 +1,47 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import { Network } from '../types';
4
+ import { ClaimMessage, Signature } from '../common';
5
+ export declare const depositFungibleTokenInstruction: (opts: {
6
+ connection: anchor.web3.Connection;
7
+ network: Network;
8
+ programId?: PublicKey;
9
+ authority: PublicKey;
10
+ projectNonce: anchor.BN;
11
+ tokenMint: PublicKey;
12
+ amount: anchor.BN;
13
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
14
+ export declare const depositNonFungibleTokenInstruction: (opts: {
15
+ connection: anchor.web3.Connection;
16
+ network: Network;
17
+ programId?: PublicKey;
18
+ authority: PublicKey;
19
+ projectNonce: anchor.BN;
20
+ tokenMint: PublicKey;
21
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
22
+ export declare const removeNonFungibleTokenInstruction: (opts: {
23
+ connection: anchor.web3.Connection;
24
+ network: Network;
25
+ programId?: PublicKey;
26
+ authority: PublicKey;
27
+ projectNonce: anchor.BN;
28
+ tokenMint: PublicKey;
29
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
30
+ export declare const removeFungibleTokenInstruction: (opts: {
31
+ connection: anchor.web3.Connection;
32
+ network: Network;
33
+ programId?: PublicKey;
34
+ authority: PublicKey;
35
+ projectNonce: anchor.BN;
36
+ tokenMint: PublicKey;
37
+ amount: anchor.BN;
38
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
39
+ export declare const claim: (opts: {
40
+ connection: anchor.web3.Connection;
41
+ network: Network;
42
+ programId?: PublicKey;
43
+ authority: PublicKey;
44
+ projectNonce: anchor.BN;
45
+ message: ClaimMessage;
46
+ signatures: Signature[];
47
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,29 @@
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import * as anchor from '@coral-xyz/anchor';
3
+ import { Network, ProjectRole } from '../types';
4
+ export declare const grantProjectRoleInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ account: PublicKey;
10
+ projectNonce: anchor.BN;
11
+ role: ProjectRole;
12
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
13
+ export declare const revokeProjectRoleInstruction: (opts: {
14
+ connection: anchor.web3.Connection;
15
+ network: Network;
16
+ programId?: PublicKey;
17
+ authority: PublicKey;
18
+ projectNonce: anchor.BN;
19
+ account: PublicKey;
20
+ role: ProjectRole;
21
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
22
+ export declare const renounceProjectRoleInstruction: (opts: {
23
+ connection: anchor.web3.Connection;
24
+ network: Network;
25
+ programId?: PublicKey;
26
+ authority: PublicKey;
27
+ projectNonce: anchor.BN;
28
+ role: ProjectRole;
29
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,13 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ import { Network } from '../types';
4
+ export declare const updateProjectFeesInstruction: (opts: {
5
+ connection: anchor.web3.Connection;
6
+ network: Network;
7
+ programId?: PublicKey;
8
+ authority: PublicKey;
9
+ projectNonce: anchor.BN;
10
+ userNativeClaimFee?: anchor.BN;
11
+ projectClaimFee?: number;
12
+ removeFee?: number;
13
+ }) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1,8 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { PublicKey } from '@solana/web3.js';
3
+ export declare const getGlobalConfigPda: (programId: PublicKey) => [anchor.web3.PublicKey, number];
4
+ export declare const getProjectPda: (programId: PublicKey, nonce: anchor.BN) => [anchor.web3.PublicKey, number];
5
+ export declare const getCurrencyTokenPda: (programId: PublicKey, tokenAccount: PublicKey) => [anchor.web3.PublicKey, number];
6
+ export declare const getProjectCurrencyBudgetPda: (programId: PublicKey, project: PublicKey, currencyToken: PublicKey) => [anchor.web3.PublicKey, number];
7
+ export declare const getProjectAttributionPda: (programId: PublicKey, project: PublicKey, proof: Buffer) => [anchor.web3.PublicKey, number];
8
+ export declare const getProjectUserPda: (programId: PublicKey, project: PublicKey, user: PublicKey) => [anchor.web3.PublicKey, number];
@@ -0,0 +1,130 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { Connection, PublicKey } from '@solana/web3.js';
3
+ import { ClaimMessage, ContractSdk, Signature } from '../common';
4
+ import { FuulIdl } from '../idls/fuul';
5
+ import { CurrencyToken, Project, GlobalConfig, Network, GlobalRole, TokenType, ProjectCurrencyBudget, ProjectRole, ProjectUser } from '../types';
6
+ export declare class FuulSdk extends ContractSdk<FuulIdl> {
7
+ constructor(connection: Connection, env: Network, programId?: PublicKey);
8
+ getGlobalConfig(): Promise<GlobalConfig | null>;
9
+ getProject(nonce: anchor.BN): Promise<Project | null>;
10
+ getCurrencyToken(tokenAccount: PublicKey): Promise<CurrencyToken | null>;
11
+ getProjectCurrencyBudget(projectNonce: anchor.BN, currencyTokenMint: PublicKey): Promise<ProjectCurrencyBudget | null>;
12
+ getProjectUser(projectNonce: anchor.BN, user: PublicKey): Promise<ProjectUser | null>;
13
+ createGlobalConfig(opts: {
14
+ authority: PublicKey;
15
+ feeCollector: PublicKey;
16
+ }): Promise<anchor.web3.TransactionInstruction[]>;
17
+ updateGlobalConfig(opts: {
18
+ authority: PublicKey;
19
+ claimCoolDown?: anchor.BN;
20
+ requiredSignersForClaim?: number;
21
+ }): Promise<anchor.web3.TransactionInstruction[]>;
22
+ updateGlobalConfigFees(opts: {
23
+ authority: PublicKey;
24
+ feeCollector?: PublicKey;
25
+ userNativeClaimFee?: anchor.BN;
26
+ projectClaimFee?: number;
27
+ removeFee?: number;
28
+ }): Promise<anchor.web3.TransactionInstruction[]>;
29
+ addNoClaimFeeWhitelist(opts: {
30
+ authority: PublicKey;
31
+ account: PublicKey;
32
+ }): Promise<anchor.web3.TransactionInstruction[]>;
33
+ removeNoClaimFeeWhitelist(opts: {
34
+ authority: PublicKey;
35
+ account: PublicKey;
36
+ }): Promise<anchor.web3.TransactionInstruction[]>;
37
+ grantGlobalRole(opts: {
38
+ authority: PublicKey;
39
+ account: PublicKey;
40
+ role: GlobalRole;
41
+ }): Promise<anchor.web3.TransactionInstruction[]>;
42
+ revokeGlobalRole(opts: {
43
+ authority: PublicKey;
44
+ account: PublicKey;
45
+ role: GlobalRole;
46
+ }): Promise<anchor.web3.TransactionInstruction[]>;
47
+ renounceGlobalRole(opts: {
48
+ authority: PublicKey;
49
+ role: GlobalRole;
50
+ }): Promise<anchor.web3.TransactionInstruction[]>;
51
+ pauseProgram(opts: {
52
+ authority: PublicKey;
53
+ }): Promise<anchor.web3.TransactionInstruction[]>;
54
+ unpauseProgram(opts: {
55
+ authority: PublicKey;
56
+ }): Promise<anchor.web3.TransactionInstruction[]>;
57
+ addCurrencyToken(opts: {
58
+ authority: PublicKey;
59
+ tokenType: TokenType;
60
+ tokenMint: PublicKey;
61
+ claimLimitPerCooldown: anchor.BN;
62
+ }): Promise<anchor.web3.TransactionInstruction[]>;
63
+ updateCurrencyToken(opts: {
64
+ authority: PublicKey;
65
+ tokenMint: PublicKey;
66
+ isActive?: boolean;
67
+ claimLimitPerCooldown?: anchor.BN;
68
+ }): Promise<anchor.web3.TransactionInstruction[]>;
69
+ removeCurrencyToken(opts: {
70
+ authority: PublicKey;
71
+ tokenMint: PublicKey;
72
+ }): Promise<anchor.web3.TransactionInstruction[]>;
73
+ createProject(opts: {
74
+ authority: PublicKey;
75
+ projectAdmin: PublicKey;
76
+ metadataUri?: string;
77
+ }): Promise<anchor.web3.TransactionInstruction[]>;
78
+ updateProjectFees(opts: {
79
+ authority: PublicKey;
80
+ projectNonce: anchor.BN;
81
+ userNativeClaimFee?: anchor.BN;
82
+ projectClaimFee?: number;
83
+ removeFee?: number;
84
+ }): Promise<anchor.web3.TransactionInstruction[]>;
85
+ grantProjectRole(opts: {
86
+ authority: PublicKey;
87
+ projectNonce: anchor.BN;
88
+ account: PublicKey;
89
+ role: ProjectRole;
90
+ }): Promise<anchor.web3.TransactionInstruction[]>;
91
+ revokeProjectRole(opts: {
92
+ authority: PublicKey;
93
+ projectNonce: anchor.BN;
94
+ account: PublicKey;
95
+ role: ProjectRole;
96
+ }): Promise<anchor.web3.TransactionInstruction[]>;
97
+ renounceProjectRole(opts: {
98
+ authority: PublicKey;
99
+ projectNonce: anchor.BN;
100
+ role: ProjectRole;
101
+ }): Promise<anchor.web3.TransactionInstruction[]>;
102
+ depositFungibleToken(opts: {
103
+ authority: PublicKey;
104
+ projectNonce: anchor.BN;
105
+ tokenMint: PublicKey;
106
+ amount: anchor.BN;
107
+ }): Promise<anchor.web3.TransactionInstruction[]>;
108
+ depositNonFungibleToken(opts: {
109
+ authority: PublicKey;
110
+ projectNonce: anchor.BN;
111
+ tokenMint: PublicKey;
112
+ }): Promise<anchor.web3.TransactionInstruction[]>;
113
+ removeNonFungibleToken(opts: {
114
+ authority: PublicKey;
115
+ projectNonce: anchor.BN;
116
+ tokenMint: PublicKey;
117
+ }): Promise<anchor.web3.TransactionInstruction[]>;
118
+ removeFungibleToken(opts: {
119
+ authority: PublicKey;
120
+ projectNonce: anchor.BN;
121
+ tokenMint: PublicKey;
122
+ amount: anchor.BN;
123
+ }): Promise<anchor.web3.TransactionInstruction[]>;
124
+ claim(opts: {
125
+ authority: PublicKey;
126
+ projectNonce: anchor.BN;
127
+ message: ClaimMessage;
128
+ signatures: Signature[];
129
+ }): Promise<anchor.web3.TransactionInstruction[]>;
130
+ }
@@ -0,0 +1 @@
1
+ export * from './fuul';
@@ -0,0 +1,40 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { FuulIdl } from './idls/fuul';
3
+ export type TransactionInstruction = anchor.web3.TransactionInstruction;
4
+ declare const program: anchor.Program<FuulIdl>;
5
+ export type GlobalConfig = Awaited<ReturnType<typeof program.account.globalConfig.fetch>>;
6
+ export type CurrencyToken = Awaited<ReturnType<typeof program.account.currencyToken.fetch>>;
7
+ export type Project = Awaited<ReturnType<typeof program.account.project.fetch>>;
8
+ export type ProjectCurrencyBudget = Awaited<ReturnType<typeof program.account.projectCurrencyBudget.fetch>>;
9
+ export type ProjectUser = Awaited<ReturnType<typeof program.account.projectUser.fetch>>;
10
+ export declare enum Network {
11
+ FOGO_MAINNET = "fogo-mainnet",
12
+ FOGO_TESTNET = "fogo-testnet",
13
+ MAINNET = "mainnet",
14
+ DEVNET = "devnet",
15
+ TESTNET = "testnet",
16
+ LOCALHOST = "localhost"
17
+ }
18
+ export declare enum TokenType {
19
+ Native = "native",
20
+ FungibleSpl = "fungibleSpl",
21
+ NonFungibleSpl = "nonFungibleSpl"
22
+ }
23
+ export declare const TokenTypeAnchor: Record<TokenType, any>;
24
+ export declare enum GlobalRole {
25
+ Admin = "admin",
26
+ Pauser = "pauser",
27
+ Unpauser = "unpauser",
28
+ Signer = "signer"
29
+ }
30
+ export declare const GlobalRoleAnchor: Record<GlobalRole, any>;
31
+ export declare enum ProjectRole {
32
+ Admin = "admin"
33
+ }
34
+ export declare const ProjectRoleAnchor: Record<ProjectRole, any>;
35
+ export declare enum ClaimReason {
36
+ AffiliatePayout = "affiliatePayout",
37
+ EndUserPayout = "endUserPayout"
38
+ }
39
+ export declare const ClaimReasonAnchor: Record<ClaimReason, any>;
40
+ export {};
@@ -0,0 +1,7 @@
1
+ import { TransactionInstruction, PublicKey } from '@solana/web3.js';
2
+ import { Signature } from '../common/messages';
3
+ export declare function createEd25519Instruction(signature: Signature, message: Buffer): TransactionInstruction;
4
+ export declare function createEd25519InstructionWithMultipleSigners(signatures: {
5
+ signature: Uint8Array;
6
+ signer: PublicKey;
7
+ }[], message: Buffer): TransactionInstruction;
@@ -0,0 +1,13 @@
1
+ import * as anchor from '@coral-xyz/anchor';
2
+ import { FuulIdl } from '../idls/fuul';
3
+ import { Network } from '../types';
4
+ import { PublicKey } from '@solana/web3.js';
5
+ export declare const getProgram: (opts: {
6
+ connection: anchor.web3.Connection;
7
+ network: Network;
8
+ programId?: PublicKey;
9
+ }) => anchor.Program<FuulIdl>;
10
+ export declare const ensureAtaAccounts: (connection: anchor.web3.Connection, payer: PublicKey, mint: PublicKey, tokenAccounts: {
11
+ owner: PublicKey;
12
+ ata: PublicKey;
13
+ }[]) => Promise<anchor.web3.TransactionInstruction[]>;
@@ -0,0 +1 @@
1
+ export * from './helpers';
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@fuul/sdk-solana",
3
+ "version": "0.5.2",
4
+ "description": "SDK to interact with the Full Solana program",
5
+ "main": "./dist/cjs/index.js",
6
+ "module": "./dist/esm/index.js",
7
+ "types": "./dist/types/index.d.ts",
8
+ "scripts": {
9
+ "build": "npm run build:cjs && npm run build:esm",
10
+ "build:cjs": "tsc -p tsconfig.cjs.json",
11
+ "build:esm": "tsc -p tsconfig.esm.json",
12
+ "prepare": "husky || true",
13
+ "lint": "eslint \"src/**/*.ts\"",
14
+ "lint:fix": "eslint \"src/**/*.ts\" --fix",
15
+ "docs": "typedoc --options typedoc.json",
16
+ "docs:serve": "serve ./docs"
17
+ },
18
+ "files": ["dist", "README.md"],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+git@github.com:fuul-protocol/protocol-program-svm.git"
22
+ },
23
+ "keywords": [
24
+ "Solana",
25
+ "Anchor",
26
+ "Web3"
27
+ ],
28
+ "author": "",
29
+ "license": "ISC",
30
+ "bugs": {
31
+ "url": "https://github.com/fuul-protocol/protocol-program-svm/issues"
32
+ },
33
+ "homepage": "https://github.com/fuul-protocol/protocol-program-svm#readme",
34
+ "dependencies": {
35
+ "@coral-xyz/anchor": "0.32.1",
36
+ "@noble/ed25519": "3.0.0",
37
+ "@solana/web3.js": "1.98.4",
38
+ "borsh": "2.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@eslint/eslintrc": "3.3.1",
42
+ "@eslint/js": "9.39.1",
43
+ "@typescript-eslint/eslint-plugin": "8.46.3",
44
+ "@typescript-eslint/parser": "8.46.3",
45
+ "eslint": "9.39.1",
46
+ "eslint-config-prettier": "10.1.8",
47
+ "eslint-plugin-prettier": "5.5.4",
48
+ "glob": "13.0.0",
49
+ "globals": "16.5.0",
50
+ "prettier": "3.6.2",
51
+ "serve": "14.2.5",
52
+ "typedoc": "^0.28.14",
53
+ "typedoc-plugin-markdown": "4.9.0",
54
+ "typescript": "5.9.3"
55
+ },
56
+ "engines": {
57
+ "node": ">=23"
58
+ }
59
+ }