@augustdigital/sdk 4.1.0-alpha → 4.2.1-alpha

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 (202) hide show
  1. package/README.md +169 -11
  2. package/lib/abis/Multicall3.js.map +1 -1
  3. package/lib/adapters/evm/getters.js +6 -16
  4. package/lib/adapters/evm/getters.js.map +1 -1
  5. package/lib/adapters/evm/index.d.ts +3 -3
  6. package/lib/adapters/evm/index.js +9 -10
  7. package/lib/adapters/evm/index.js.map +1 -1
  8. package/lib/adapters/evm/utils.d.ts +2 -28
  9. package/lib/adapters/evm/utils.js +29 -322
  10. package/lib/adapters/evm/utils.js.map +1 -1
  11. package/lib/adapters/solana/getters.js +26 -17
  12. package/lib/adapters/solana/getters.js.map +1 -1
  13. package/lib/core/base.class.d.ts +1 -2
  14. package/lib/core/base.class.js +11 -6
  15. package/lib/core/base.class.js.map +1 -1
  16. package/lib/core/constants.d.ts +2 -0
  17. package/lib/core/constants.js +3 -1
  18. package/lib/core/constants.js.map +1 -1
  19. package/lib/core/fetcher.js +147 -48
  20. package/lib/core/fetcher.js.map +1 -1
  21. package/lib/core/index.d.ts +1 -3
  22. package/lib/core/index.js +1 -3
  23. package/lib/core/index.js.map +1 -1
  24. package/lib/core/logger/index.d.ts +9 -0
  25. package/lib/core/logger/index.js +29 -0
  26. package/lib/core/logger/index.js.map +1 -1
  27. package/lib/core/web3.helpers.js.map +1 -1
  28. package/lib/index.d.ts +4 -5
  29. package/lib/index.js +6 -7
  30. package/lib/index.js.map +1 -1
  31. package/lib/main.d.ts +82 -14
  32. package/lib/main.js +51 -17
  33. package/lib/main.js.map +1 -1
  34. package/lib/modules/vaults/constants.js +2 -0
  35. package/lib/modules/vaults/constants.js.map +1 -1
  36. package/lib/{vaults/utils.d.ts → modules/vaults/fetcher.d.ts} +0 -20
  37. package/lib/{vaults/utils.js → modules/vaults/fetcher.js} +18 -175
  38. package/lib/modules/vaults/fetcher.js.map +1 -0
  39. package/lib/modules/vaults/getters.d.ts +12 -3
  40. package/lib/modules/vaults/getters.js +122 -23
  41. package/lib/modules/vaults/getters.js.map +1 -1
  42. package/lib/modules/vaults/index.d.ts +1 -82
  43. package/lib/modules/vaults/index.js +1 -479
  44. package/lib/modules/vaults/index.js.map +1 -1
  45. package/lib/modules/vaults/main.d.ts +24 -47
  46. package/lib/modules/vaults/main.js +103 -199
  47. package/lib/modules/vaults/main.js.map +1 -1
  48. package/lib/modules/vaults/read.actions.d.ts +3 -0
  49. package/lib/{adapters/evm → modules/vaults}/read.actions.js +12 -12
  50. package/lib/modules/vaults/read.actions.js.map +1 -0
  51. package/lib/modules/vaults/utils.d.ts +2 -103
  52. package/lib/modules/vaults/utils.js +97 -293
  53. package/lib/modules/vaults/utils.js.map +1 -1
  54. package/lib/modules/vaults/{user.actions.d.ts → write.actions.d.ts} +9 -2
  55. package/lib/modules/vaults/{user.actions.js → write.actions.js} +56 -8
  56. package/lib/modules/vaults/write.actions.js.map +1 -0
  57. package/lib/types/pools.d.ts +1 -1
  58. package/lib/types/vaults.d.ts +6 -0
  59. package/lib/types/webserver.d.ts +15 -1
  60. package/package.json +15 -10
  61. package/lib/adapters/evm/core.actions.d.ts +0 -9
  62. package/lib/adapters/evm/core.actions.js +0 -51
  63. package/lib/adapters/evm/core.actions.js.map +0 -1
  64. package/lib/adapters/evm/read.actions.d.ts +0 -3
  65. package/lib/adapters/evm/read.actions.js.map +0 -1
  66. package/lib/adapters/evm/vaults.actions.d.ts +0 -10
  67. package/lib/adapters/evm/vaults.actions.js +0 -97
  68. package/lib/adapters/evm/vaults.actions.js.map +0 -1
  69. package/lib/adapters/solana/actions.d.ts +0 -20
  70. package/lib/adapters/solana/actions.js +0 -225
  71. package/lib/adapters/solana/actions.js.map +0 -1
  72. package/lib/adapters/solana/class.d.ts +0 -45
  73. package/lib/adapters/solana/class.js +0 -135
  74. package/lib/adapters/solana/class.js.map +0 -1
  75. package/lib/adapters/solana/vault-idl.d.ts +0 -338
  76. package/lib/adapters/solana/vault-idl.js +0 -1075
  77. package/lib/adapters/solana/vault-idl.js.map +0 -1
  78. package/lib/core/base-class.d.ts +0 -34
  79. package/lib/core/base-class.js +0 -55
  80. package/lib/core/base-class.js.map +0 -1
  81. package/lib/core/helpers.core.d.ts +0 -23
  82. package/lib/core/helpers.core.js +0 -210
  83. package/lib/core/helpers.core.js.map +0 -1
  84. package/lib/core/helpers.d.ts +0 -23
  85. package/lib/core/helpers.js +0 -210
  86. package/lib/core/helpers.js.map +0 -1
  87. package/lib/core/helpers.web3.d.ts +0 -26
  88. package/lib/core/helpers.web3.js +0 -315
  89. package/lib/core/helpers.web3.js.map +0 -1
  90. package/lib/modules/vaults/admin-actions.d.ts +0 -0
  91. package/lib/modules/vaults/admin-actions.js +0 -1
  92. package/lib/modules/vaults/admin-actions.js.map +0 -1
  93. package/lib/modules/vaults/user-actions.d.ts +0 -19
  94. package/lib/modules/vaults/user-actions.js +0 -172
  95. package/lib/modules/vaults/user-actions.js.map +0 -1
  96. package/lib/modules/vaults/user.actions.js.map +0 -1
  97. package/lib/services/auth/index.d.ts +0 -1
  98. package/lib/services/auth/index.js +0 -18
  99. package/lib/services/auth/index.js.map +0 -1
  100. package/lib/services/auth/verify.d.ts +0 -2
  101. package/lib/services/auth/verify.js +0 -20
  102. package/lib/services/auth/verify.js.map +0 -1
  103. package/lib/services/index.d.ts +0 -4
  104. package/lib/services/index.js +0 -21
  105. package/lib/services/index.js.map +0 -1
  106. package/lib/services/logger/index.d.ts +0 -12
  107. package/lib/services/logger/index.js +0 -51
  108. package/lib/services/logger/index.js.map +0 -1
  109. package/lib/services/logger/slack.d.ts +0 -12
  110. package/lib/services/logger/slack.js +0 -48
  111. package/lib/services/logger/slack.js.map +0 -1
  112. package/lib/services/solana/actions.d.ts +0 -20
  113. package/lib/services/solana/actions.js +0 -225
  114. package/lib/services/solana/actions.js.map +0 -1
  115. package/lib/services/solana/class.d.ts +0 -45
  116. package/lib/services/solana/class.js +0 -135
  117. package/lib/services/solana/class.js.map +0 -1
  118. package/lib/services/solana/constants.d.ts +0 -25
  119. package/lib/services/solana/constants.js +0 -32
  120. package/lib/services/solana/constants.js.map +0 -1
  121. package/lib/services/solana/index.d.ts +0 -84
  122. package/lib/services/solana/index.js +0 -50
  123. package/lib/services/solana/index.js.map +0 -1
  124. package/lib/services/solana/types.d.ts +0 -58
  125. package/lib/services/solana/types.js +0 -3
  126. package/lib/services/solana/types.js.map +0 -1
  127. package/lib/services/solana/utils.d.ts +0 -96
  128. package/lib/services/solana/utils.js +0 -355
  129. package/lib/services/solana/utils.js.map +0 -1
  130. package/lib/services/solana/vault-idl.d.ts +0 -338
  131. package/lib/services/solana/vault-idl.js +0 -1075
  132. package/lib/services/solana/vault-idl.js.map +0 -1
  133. package/lib/utils/base-class.d.ts +0 -34
  134. package/lib/utils/base-class.js +0 -55
  135. package/lib/utils/base-class.js.map +0 -1
  136. package/lib/utils/constants/august.d.ts +0 -57
  137. package/lib/utils/constants/august.js +0 -61
  138. package/lib/utils/constants/august.js.map +0 -1
  139. package/lib/utils/constants/fallbacks.d.ts +0 -3
  140. package/lib/utils/constants/fallbacks.js +0 -26
  141. package/lib/utils/constants/fallbacks.js.map +0 -1
  142. package/lib/utils/constants/index.d.ts +0 -3
  143. package/lib/utils/constants/index.js +0 -20
  144. package/lib/utils/constants/index.js.map +0 -1
  145. package/lib/utils/constants/web3.d.ts +0 -32
  146. package/lib/utils/constants/web3.js +0 -101
  147. package/lib/utils/constants/web3.js.map +0 -1
  148. package/lib/utils/fetcher.d.ts +0 -25
  149. package/lib/utils/fetcher.js +0 -334
  150. package/lib/utils/fetcher.js.map +0 -1
  151. package/lib/utils/helpers/array.d.ts +0 -6
  152. package/lib/utils/helpers/array.js +0 -40
  153. package/lib/utils/helpers/array.js.map +0 -1
  154. package/lib/utils/helpers/datetime.d.ts +0 -5
  155. package/lib/utils/helpers/datetime.js +0 -32
  156. package/lib/utils/helpers/datetime.js.map +0 -1
  157. package/lib/utils/helpers/formatters.d.ts +0 -8
  158. package/lib/utils/helpers/formatters.js +0 -113
  159. package/lib/utils/helpers/formatters.js.map +0 -1
  160. package/lib/utils/helpers/index.d.ts +0 -6
  161. package/lib/utils/helpers/index.js +0 -23
  162. package/lib/utils/helpers/index.js.map +0 -1
  163. package/lib/utils/helpers/responses.d.ts +0 -32
  164. package/lib/utils/helpers/responses.js +0 -229
  165. package/lib/utils/helpers/responses.js.map +0 -1
  166. package/lib/utils/helpers/verify-keys.d.ts +0 -2
  167. package/lib/utils/helpers/verify-keys.js +0 -21
  168. package/lib/utils/helpers/verify-keys.js.map +0 -1
  169. package/lib/utils/helpers/web3.d.ts +0 -27
  170. package/lib/utils/helpers/web3.js +0 -339
  171. package/lib/utils/helpers/web3.js.map +0 -1
  172. package/lib/utils/index.d.ts +0 -5
  173. package/lib/utils/index.js +0 -22
  174. package/lib/utils/index.js.map +0 -1
  175. package/lib/utils/vaults.d.ts +0 -53
  176. package/lib/utils/vaults.js +0 -156
  177. package/lib/utils/vaults.js.map +0 -1
  178. package/lib/vaults/admin-actions.d.ts +0 -0
  179. package/lib/vaults/admin-actions.js +0 -1
  180. package/lib/vaults/admin-actions.js.map +0 -1
  181. package/lib/vaults/getters.d.ts +0 -38
  182. package/lib/vaults/getters.js +0 -760
  183. package/lib/vaults/getters.js.map +0 -1
  184. package/lib/vaults/index.d.ts +0 -4
  185. package/lib/vaults/index.js +0 -21
  186. package/lib/vaults/index.js.map +0 -1
  187. package/lib/vaults/main.d.ts +0 -118
  188. package/lib/vaults/main.js +0 -591
  189. package/lib/vaults/main.js.map +0 -1
  190. package/lib/vaults/rpc-config.d.ts +0 -4
  191. package/lib/vaults/rpc-config.js +0 -27
  192. package/lib/vaults/rpc-config.js.map +0 -1
  193. package/lib/vaults/subgraph.d.ts +0 -10
  194. package/lib/vaults/subgraph.js +0 -470
  195. package/lib/vaults/subgraph.js.map +0 -1
  196. package/lib/vaults/user-actions.d.ts +0 -19
  197. package/lib/vaults/user-actions.js +0 -172
  198. package/lib/vaults/user-actions.js.map +0 -1
  199. package/lib/vaults/utils.js.map +0 -1
  200. package/lib/verify.d.ts +0 -2
  201. package/lib/verify.js +0 -20
  202. package/lib/verify.js.map +0 -1
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.vaultIdl = exports.programIds = exports.fallbackRpcEndpoints = exports.fallbackNetwork = exports.fallbackDecimals = void 0;
4
- const vault_idl_1 = require("./vault-idl");
5
- Object.defineProperty(exports, "vaultIdl", { enumerable: true, get: function () { return vault_idl_1.vaultIdl; } });
6
- const fallbackDecimals = 8;
7
- exports.fallbackDecimals = fallbackDecimals;
8
- const fallbackNetwork = 'mainnet-beta';
9
- exports.fallbackNetwork = fallbackNetwork;
10
- const fallbackRpcEndpoints = {
11
- devnet: 'https://api.devnet.solana.com',
12
- mainnet: 'https://api.mainnet-beta.solana.com',
13
- testnet: 'https://api.testnet.solana.com',
14
- localnet: 'http://127.0.0.1:8899',
15
- };
16
- exports.fallbackRpcEndpoints = fallbackRpcEndpoints;
17
- const programIds = {
18
- devnet: {
19
- vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
20
- },
21
- ['mainnet-beta']: {
22
- vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
23
- },
24
- testnet: {
25
- vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
26
- },
27
- localnet: {
28
- vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
29
- },
30
- };
31
- exports.programIds = programIds;
32
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src.ts/services/solana/constants.ts"],"names":[],"mappings":";;;AACA,2CAAuC;AAmCrC,yFAnCO,oBAAQ,OAmCP;AAjCV,MAAM,gBAAgB,GAAG,CAAC,CAAC;AA6BzB,4CAAgB;AA5BlB,MAAM,eAAe,GAAG,cAAgC,CAAC;AA6BvD,0CAAe;AAxBjB,MAAM,oBAAoB,GAAG;IAC3B,MAAM,EAAE,+BAA+B;IACvC,OAAO,EAAE,qCAAqC;IAC9C,OAAO,EAAE,gCAAgC;IACzC,QAAQ,EAAE,uBAAuB;CACzB,CAAC;AAoBT,oDAAoB;AAlBtB,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE;QACN,KAAK,EAAE,8CAA8C;KACtD;IACD,CAAC,cAAc,CAAC,EAAE;QAChB,KAAK,EAAE,8CAA8C;KACtD;IACD,OAAO,EAAE;QACP,KAAK,EAAE,8CAA8C;KACtD;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,8CAA8C;KACtD;CACF,CAAC;AAMA,gCAAU"}
@@ -1,84 +0,0 @@
1
- import SolanaServiceClass from './class';
2
- import * as SolanaConstants from './constants';
3
- import * as SolanaActions from './actions';
4
- export declare const SolanaService: typeof SolanaServiceClass;
5
- export declare const Solana: {
6
- utils: {
7
- getExplorerLink: ({ signature, type, network, }: {
8
- signature: string;
9
- type: "tx" | "address" | "token";
10
- } & import("./types").ISolanaConnectionOptions) => string;
11
- isSolanaAddress: (address: string) => boolean;
12
- isSolana: (signature: string) => boolean;
13
- getProgram: ({ provider, idl, network, }: {
14
- idl: any;
15
- } & import("./types").ISolanaConnectionOptions) => import("@coral-xyz/anchor").Program<any>;
16
- getProvider: ({ connection, publicKey, signTransaction, }: {
17
- publicKey: import("@solana/web3.js").PublicKey;
18
- signTransaction: (<T extends import("@solana/web3.js").Transaction | import("@solana/web3.js").VersionedTransaction>(transaction: T) => Promise<T>) | undefined;
19
- } & import("./types").ISolanaConnectionOptions) => import("@coral-xyz/anchor").AnchorProvider;
20
- getReadOnlyProvider: ({ connection }: import("./types").ISolanaConnectionOptions) => import("@coral-xyz/anchor").AnchorProvider;
21
- deriveShareMintPda: (vaultProgramId: import("@solana/web3.js").PublicKey | string) => import("@solana/web3.js").PublicKey;
22
- deriveVaultStatePda: (vaultProgramId: import("@solana/web3.js").PublicKey | string) => import("@solana/web3.js").PublicKey;
23
- deriveVaultTokenAtaPda: (vaultProgramId: import("@solana/web3.js").PublicKey | string, depositMint: import("@solana/web3.js").PublicKey) => import("@solana/web3.js").PublicKey;
24
- getVaultState: ({ provider, connection, vaultProgramId, idl, }: {
25
- vaultProgramId: import("@solana/web3.js").PublicKey | string;
26
- idl: any;
27
- } & import("./types").ISolanaConnectionOptions) => Promise<{
28
- vaultState: unknown | null;
29
- depositMintDecimals: number | null;
30
- vaultToken: import("./types").ISolanaTokenBalance;
31
- }>;
32
- getVaultStateReadOnly: ({ vaultProgramId, connection, idl, }: {
33
- vaultProgramId: import("@solana/web3.js").PublicKey | string;
34
- idl: any;
35
- } & import("./types").ISolanaConnectionOptions) => Promise<{
36
- vaultState: unknown | null;
37
- depositMintDecimals: number | null;
38
- vaultToken: import("./types").ISolanaTokenBalance;
39
- }>;
40
- getToken: ({ mintAddress, endpoint, }: {
41
- mintAddress: string | import("@solana/web3.js").PublicKey;
42
- } & import("./types").ISolanaConnectionOptions) => Promise<{
43
- address: any;
44
- symbol: any;
45
- decimals: any;
46
- name: any;
47
- image: any;
48
- program: any;
49
- mintAuthority: any;
50
- freezeAuthority: any;
51
- supply: any;
52
- }>;
53
- getTokenSymbol: ({ endpoint, mintAddress, }: {
54
- mintAddress: string | import("@solana/web3.js").PublicKey;
55
- } & import("./types").ISolanaConnectionOptions) => Promise<string | null>;
56
- fetchUserTokenBalance: ({ connection, publicKey, depositMint, }: {
57
- publicKey: import("@solana/web3.js").PublicKey | string;
58
- depositMint?: import("@solana/web3.js").PublicKey | string;
59
- } & import("./types").ISolanaConnectionOptions) => Promise<any>;
60
- fetchUserShareBalance: ({ connection, publicKey, shareMint, network, }: {
61
- publicKey: import("@solana/web3.js").PublicKey | string;
62
- shareMint?: import("@solana/web3.js").PublicKey | string;
63
- } & import("./types").ISolanaConnectionOptions) => Promise<number>;
64
- getBestRpcEndpoint: ({ endpoint, network, connection, }: import("./types").ISolanaConnectionOptions) => Promise<`https://${string}` | "http://127.0.0.1:8899">;
65
- fallbackDecimals: number;
66
- fallbackNetwork: import("../..").ISolanaNetwork;
67
- programIds: {
68
- devnet: {
69
- vault: string;
70
- };
71
- "mainnet-beta": {
72
- vault: string;
73
- };
74
- testnet: {
75
- vault: string;
76
- };
77
- localnet: {
78
- vault: string;
79
- };
80
- };
81
- };
82
- constants: typeof SolanaConstants;
83
- actions: typeof SolanaActions;
84
- };
@@ -1,50 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.Solana = exports.SolanaService = void 0;
40
- const class_1 = __importDefault(require("./class"));
41
- const utils_1 = require("./utils");
42
- const SolanaConstants = __importStar(require("./constants"));
43
- const SolanaActions = __importStar(require("./actions"));
44
- exports.SolanaService = class_1.default;
45
- exports.Solana = {
46
- utils: utils_1.SolanaUtils,
47
- constants: SolanaConstants,
48
- actions: SolanaActions,
49
- };
50
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src.ts/services/solana/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAyC;AACzC,mCAAsC;AACtC,6DAA+C;AAC/C,yDAA2C;AAE9B,QAAA,aAAa,GAAG,eAAkB,CAAC;AAEnC,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE,mBAAW;IAClB,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,aAAa;CACvB,CAAC"}
@@ -1,58 +0,0 @@
1
- import { AnchorProvider } from '@coral-xyz/anchor';
2
- import type { Connection, PublicKey } from '@solana/web3.js';
3
- export type ISolanaRpcEndpoint = `https://${string}`;
4
- export type ISolanaNetwork = 'devnet' | 'mainnet-beta' | 'testnet' | 'localnet';
5
- export interface ISolanaConnectionOptions {
6
- endpoint?: ISolanaRpcEndpoint;
7
- connection?: Connection;
8
- provider?: AnchorProvider;
9
- network?: ISolanaNetwork;
10
- }
11
- export interface ISolanaVaultState {
12
- operator: PublicKey | null;
13
- admin: PublicKey | null;
14
- shareMint: PublicKey | null;
15
- depositMint: PublicKey | null;
16
- feeRecipient: PublicKey | null;
17
- withdrawalFee: number | null;
18
- deployedAum: number | null;
19
- pdaBump: number[] | null;
20
- paused: boolean | null;
21
- }
22
- export interface ISolanaVaultConfig {
23
- programId: string;
24
- vaultState: string;
25
- shareMint: string;
26
- vaultTokenAta: string;
27
- depositMint: string;
28
- network: ISolanaNetwork;
29
- }
30
- export interface ISolanaTokenBalance {
31
- balance: number;
32
- decimals: number;
33
- rawAmount: string;
34
- symbol?: string;
35
- name?: string;
36
- }
37
- export interface ISolanaDepositResult {
38
- success: boolean;
39
- signature?: string;
40
- sharesMinted?: number;
41
- error?: string;
42
- }
43
- export interface ISolanaWithdrawResult {
44
- success: boolean;
45
- signature?: string;
46
- tokensWithdrawn?: number;
47
- error?: string;
48
- }
49
- export interface ISolanaVaultStats {
50
- totalAssets: number;
51
- totalShares: number;
52
- isPaused: boolean;
53
- withdrawalFee: number;
54
- admin: string;
55
- operator: string;
56
- feeRecipient: string;
57
- lastUpdated: Date;
58
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src.ts/services/solana/types.ts"],"names":[],"mappings":""}
@@ -1,96 +0,0 @@
1
- import { AnchorProvider, Program, web3 } from '@coral-xyz/anchor';
2
- import { PublicKey, Transaction } from '@solana/web3.js';
3
- import { ISolanaConnectionOptions, ISolanaTokenBalance } from './types';
4
- declare function getExplorerLink({ signature, type, network, }: {
5
- signature: string;
6
- type: 'tx' | 'address' | 'token';
7
- } & ISolanaConnectionOptions): string;
8
- declare function isSolanaAddress(address: string): boolean;
9
- declare function isSolana(signature: string): boolean;
10
- declare function getProgram({ provider, idl, network, }: {
11
- idl: any;
12
- } & ISolanaConnectionOptions): Program<any>;
13
- declare function getBestRpcEndpoint({ endpoint, network, connection, }: ISolanaConnectionOptions): Promise<`https://${string}` | "http://127.0.0.1:8899">;
14
- declare function getProvider({ connection, publicKey, signTransaction, }: {
15
- publicKey: PublicKey;
16
- signTransaction: (<T extends Transaction | web3.VersionedTransaction>(transaction: T) => Promise<T>) | undefined;
17
- } & ISolanaConnectionOptions): AnchorProvider;
18
- declare function getReadOnlyProvider({ connection }: ISolanaConnectionOptions): AnchorProvider;
19
- declare function deriveVaultStatePda(vaultProgramId: PublicKey | string): web3.PublicKey;
20
- declare function deriveShareMintPda(vaultProgramId: PublicKey | string): web3.PublicKey;
21
- declare function deriveVaultTokenAtaPda(vaultProgramId: PublicKey | string, depositMint: PublicKey): web3.PublicKey;
22
- declare function getVaultState({ provider, connection, vaultProgramId, idl, }: {
23
- vaultProgramId: PublicKey | string;
24
- idl: any;
25
- } & ISolanaConnectionOptions): Promise<{
26
- vaultState: unknown | null;
27
- depositMintDecimals: number | null;
28
- vaultToken: ISolanaTokenBalance;
29
- }>;
30
- declare function getVaultStateReadOnly({ vaultProgramId, connection, idl, }: {
31
- vaultProgramId: PublicKey | string;
32
- idl: any;
33
- } & ISolanaConnectionOptions): Promise<{
34
- vaultState: unknown | null;
35
- depositMintDecimals: number | null;
36
- vaultToken: ISolanaTokenBalance;
37
- }>;
38
- declare function getToken({ mintAddress, endpoint, }: {
39
- mintAddress: string | PublicKey;
40
- } & ISolanaConnectionOptions): Promise<{
41
- address: any;
42
- symbol: any;
43
- decimals: any;
44
- name: any;
45
- image: any;
46
- program: any;
47
- mintAuthority: any;
48
- freezeAuthority: any;
49
- supply: any;
50
- }>;
51
- declare function getTokenSymbol({ endpoint, mintAddress, }: {
52
- mintAddress: string | PublicKey;
53
- } & ISolanaConnectionOptions): Promise<string | null>;
54
- declare function fetchUserTokenBalance({ connection, publicKey, depositMint, }: {
55
- publicKey: PublicKey | string;
56
- depositMint?: PublicKey | string;
57
- } & ISolanaConnectionOptions): Promise<any>;
58
- declare function fetchUserShareBalance({ connection, publicKey, shareMint, network, }: {
59
- publicKey: PublicKey | string;
60
- shareMint?: PublicKey | string;
61
- } & ISolanaConnectionOptions): Promise<number>;
62
- export declare const SolanaUtils: {
63
- getExplorerLink: typeof getExplorerLink;
64
- isSolanaAddress: typeof isSolanaAddress;
65
- isSolana: typeof isSolana;
66
- getProgram: typeof getProgram;
67
- getProvider: typeof getProvider;
68
- getReadOnlyProvider: typeof getReadOnlyProvider;
69
- deriveShareMintPda: typeof deriveShareMintPda;
70
- deriveVaultStatePda: typeof deriveVaultStatePda;
71
- deriveVaultTokenAtaPda: typeof deriveVaultTokenAtaPda;
72
- getVaultState: typeof getVaultState;
73
- getVaultStateReadOnly: typeof getVaultStateReadOnly;
74
- getToken: typeof getToken;
75
- getTokenSymbol: typeof getTokenSymbol;
76
- fetchUserTokenBalance: typeof fetchUserTokenBalance;
77
- fetchUserShareBalance: typeof fetchUserShareBalance;
78
- getBestRpcEndpoint: typeof getBestRpcEndpoint;
79
- fallbackDecimals: number;
80
- fallbackNetwork: import("../..").ISolanaNetwork;
81
- programIds: {
82
- devnet: {
83
- vault: string;
84
- };
85
- "mainnet-beta": {
86
- vault: string;
87
- };
88
- testnet: {
89
- vault: string;
90
- };
91
- localnet: {
92
- vault: string;
93
- };
94
- };
95
- };
96
- export {};