@neutral-trade/sdk 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -5045,6 +5045,19 @@ declare enum BundleProgramId {
5045
5045
  V1 = "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU",
5046
5046
  V2 = "BUNDeH5A4c47bcEoAjBhN3sCjLgYnRsmt9ibMztqVkC9",
5047
5047
  }
5048
+ /**
5049
+ * Create Bundle Program instances for a given provider
5050
+ */
5051
+ declare function createBundleProgramV1(provider: AnchorProvider): Program<NtbundleV1>;
5052
+ declare function createBundleProgramV2(provider: AnchorProvider$1): Program$1<NtbundleV2>;
5053
+ /**
5054
+ * Create both Bundle Program instances from a connection.
5055
+ * Use bundleProgramV1 for V1 vaults, bundleProgramV2 for V2 vaults (e.g. vault 69).
5056
+ */
5057
+ declare function createBundlePrograms(connection: Connection): {
5058
+ bundleProgramV1: Program<NtbundleV1>;
5059
+ bundleProgramV2: Program$1<NtbundleV2>;
5060
+ };
5048
5061
  //#endregion
5049
5062
  //#region src/constants/vault-ids.d.ts
5050
5063
  /**
@@ -5275,4 +5288,4 @@ declare function deriveUserPDA(userKey: PublicKey, bundlePDA: PublicKey, program
5275
5288
  */
5276
5289
  declare function getVaultDepositorAddressSync(programId: PublicKey, vault: PublicKey, authority: PublicKey): PublicKey;
5277
5290
  //#endregion
5278
- export { type BundleAccount, BundleProgramId, NeutralTrade, type NeutralTradeConfig, type OracleData, type PointsVaultEntry, SupportedChain, SupportedToken, type Token, type UserBalanceResult, type UserBundleAccount, type VaultBalanceData, VaultCategory, type VaultRegistryEntry as VaultConfig, type VaultRegistry as VaultConfigRecord, VaultId, VaultType, deriveOraclePDA, deriveUserPDA, getBundleProgramId, getDriftProgramId, getPointsVaults, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults };
5291
+ export { type BundleAccount, BundleProgramId, NeutralTrade, type NeutralTradeConfig, type OracleData, type PointsVaultEntry, SupportedChain, SupportedToken, type Token, type UserBalanceResult, type UserBundleAccount, type VaultBalanceData, VaultCategory, type VaultRegistryEntry as VaultConfig, type VaultRegistry as VaultConfigRecord, VaultId, VaultType, createBundleProgramV1, createBundleProgramV2, createBundlePrograms, deriveOraclePDA, deriveUserPDA, getBundleProgramId, getDriftProgramId, getPointsVaults, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults };
package/dist/index.mjs CHANGED
@@ -8086,6 +8086,31 @@ var bundle_v2_default = {
8086
8086
  ]
8087
8087
  };
8088
8088
 
8089
+ //#endregion
8090
+ //#region src/constants/addr.ts
8091
+ const ZERO_ADDRESS = new PublicKey("11111111111111111111111111111111");
8092
+ const WSOL_MINT = new PublicKey("So11111111111111111111111111111111111111112");
8093
+
8094
+ //#endregion
8095
+ //#region src/constants/client.ts
8096
+ function createDummyWallet() {
8097
+ return {
8098
+ publicKey: ZERO_ADDRESS,
8099
+ signTransaction: async (tx) => tx,
8100
+ signAllTransactions: async (txs) => txs,
8101
+ payer: Keypair.generate()
8102
+ };
8103
+ }
8104
+ function createConnection(rpcUrl) {
8105
+ return new Connection(rpcUrl, "confirmed");
8106
+ }
8107
+ function createAnchorProviderV29(connection, wallet) {
8108
+ return new AnchorProvider(connection, wallet ?? createDummyWallet(), AnchorProvider.defaultOptions());
8109
+ }
8110
+ function createAnchorProviderV32(connection, wallet) {
8111
+ return new AnchorProvider$1(connection, wallet ?? createDummyWallet(), AnchorProvider$1.defaultOptions());
8112
+ }
8113
+
8089
8114
  //#endregion
8090
8115
  //#region src/constants/programs.ts
8091
8116
  let BundleProgramId = /* @__PURE__ */ function(BundleProgramId$1) {
@@ -8102,6 +8127,18 @@ function createBundleProgramV1(provider) {
8102
8127
  function createBundleProgramV2(provider) {
8103
8128
  return new Program$1(bundle_v2_default, provider);
8104
8129
  }
8130
+ /**
8131
+ * Create both Bundle Program instances from a connection.
8132
+ * Use bundleProgramV1 for V1 vaults, bundleProgramV2 for V2 vaults (e.g. vault 69).
8133
+ */
8134
+ function createBundlePrograms(connection) {
8135
+ const providerV29 = createAnchorProviderV29(connection);
8136
+ const providerV32 = createAnchorProviderV32(connection);
8137
+ return {
8138
+ bundleProgramV1: createBundleProgramV1(providerV29),
8139
+ bundleProgramV2: createBundleProgramV2(providerV32)
8140
+ };
8141
+ }
8105
8142
 
8106
8143
  //#endregion
8107
8144
  //#region src/constants/vault-ids.ts
@@ -9261,31 +9298,6 @@ function getVaultById(vaultId) {
9261
9298
  return vaults[vaultId];
9262
9299
  }
9263
9300
 
9264
- //#endregion
9265
- //#region src/constants/addr.ts
9266
- const ZERO_ADDRESS = new PublicKey("11111111111111111111111111111111");
9267
- const WSOL_MINT = new PublicKey("So11111111111111111111111111111111111111112");
9268
-
9269
- //#endregion
9270
- //#region src/constants/client.ts
9271
- function createDummyWallet() {
9272
- return {
9273
- publicKey: ZERO_ADDRESS,
9274
- signTransaction: async (tx) => tx,
9275
- signAllTransactions: async (txs) => txs,
9276
- payer: Keypair.generate()
9277
- };
9278
- }
9279
- function createConnection(rpcUrl) {
9280
- return new Connection(rpcUrl, "confirmed");
9281
- }
9282
- function createAnchorProviderV29(connection, wallet) {
9283
- return new AnchorProvider(connection, wallet ?? createDummyWallet(), AnchorProvider.defaultOptions());
9284
- }
9285
- function createAnchorProviderV32(connection, wallet) {
9286
- return new AnchorProvider$1(connection, wallet ?? createDummyWallet(), AnchorProvider$1.defaultOptions());
9287
- }
9288
-
9289
9301
  //#endregion
9290
9302
  //#region src/utils/pda.ts
9291
9303
  const encoder = new TextEncoder();
@@ -9722,4 +9734,4 @@ var NeutralTrade = class NeutralTrade {
9722
9734
  };
9723
9735
 
9724
9736
  //#endregion
9725
- export { BundleProgramId, NeutralTrade, SupportedChain, SupportedToken, VaultCategory, VaultId, VaultType, deriveOraclePDA, deriveUserPDA, getBundleProgramId, getDriftProgramId, getPointsVaults, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults };
9737
+ export { BundleProgramId, NeutralTrade, SupportedChain, SupportedToken, VaultCategory, VaultId, VaultType, createBundleProgramV1, createBundleProgramV2, createBundlePrograms, deriveOraclePDA, deriveUserPDA, getBundleProgramId, getDriftProgramId, getPointsVaults, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neutral-trade/sdk",
3
3
  "type": "module",
4
- "version": "0.1.11",
4
+ "version": "0.1.13",
5
5
  "description": "SDK for Neutral Trade vaults",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/neutral-trade/sdk#readme",