@neutral-trade/sdk 0.2.1 → 0.2.3
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 +14 -4
- package/dist/index.mjs +31 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5075,10 +5075,12 @@ declare function createBundlePrograms(connection: Connection): {
|
|
|
5075
5075
|
* These are auto-generated from the vault registry
|
|
5076
5076
|
*/
|
|
5077
5077
|
declare enum VaultId {
|
|
5078
|
-
/**
|
|
5079
|
-
|
|
5078
|
+
/** Hyperithm-CTA-USDC-Bundle */
|
|
5079
|
+
hyperithm_cta_usdc_bundle_77 = 77,
|
|
5080
5080
|
/** Master Bundle */
|
|
5081
5081
|
master_bundle_76 = 76,
|
|
5082
|
+
/** AdverseGuard Alpha */
|
|
5083
|
+
adverseguard_alpha_75 = 75,
|
|
5082
5084
|
/** Multi-Asset Volatility Arbitrage */
|
|
5083
5085
|
multi_asset_volatility_arbitrage_74 = 74,
|
|
5084
5086
|
/** Great Debasement */
|
|
@@ -5250,6 +5252,13 @@ interface NeutralTradeConfig {
|
|
|
5250
5252
|
/** Optional fallback prices map. Prices are fetched from Pyth Network first; fallback is used only if Pyth returns incomplete data */
|
|
5251
5253
|
fallbackPrices?: Partial<Record<SupportedToken, number>>;
|
|
5252
5254
|
}
|
|
5255
|
+
interface NeutralTradeCoreContext {
|
|
5256
|
+
connection: Connection;
|
|
5257
|
+
bundleProgramV1: Program<NtbundleV1>;
|
|
5258
|
+
bundleProgramV2: Program$1<NtbundleV2>;
|
|
5259
|
+
vaults: VaultRegistry;
|
|
5260
|
+
priceMap: Map<SupportedToken, number>;
|
|
5261
|
+
}
|
|
5253
5262
|
declare class NeutralTrade {
|
|
5254
5263
|
readonly connection: Connection;
|
|
5255
5264
|
readonly bundleProgramV1: Program<NtbundleV1>;
|
|
@@ -5258,11 +5267,12 @@ declare class NeutralTrade {
|
|
|
5258
5267
|
readonly vaults: VaultRegistry;
|
|
5259
5268
|
/** Price map for deposit tokens */
|
|
5260
5269
|
readonly priceMap: Map<SupportedToken, number>;
|
|
5261
|
-
|
|
5270
|
+
protected constructor(connection: Connection, bundleProgramV1: Program<NtbundleV1>, bundleProgramV2: Program$1<NtbundleV2>, vaults: VaultRegistry, priceMap: Map<SupportedToken, number>);
|
|
5262
5271
|
/**
|
|
5263
5272
|
* Create a new NeutralTrade instance
|
|
5264
5273
|
* @throws Error if registryUrl is provided but fetch fails or validation fails
|
|
5265
5274
|
*/
|
|
5275
|
+
protected static initCore(config: NeutralTradeConfig): Promise<NeutralTradeCoreContext>;
|
|
5266
5276
|
static create(config: NeutralTradeConfig): Promise<NeutralTrade>;
|
|
5267
5277
|
/**
|
|
5268
5278
|
* Fetch vault configurations from a remote registry URL
|
|
@@ -5316,4 +5326,4 @@ declare function deriveUserPDA(userKey: PublicKey, bundlePDA: PublicKey, program
|
|
|
5316
5326
|
*/
|
|
5317
5327
|
declare function getVaultDepositorAddressSync(programId: PublicKey, vault: PublicKey, authority: PublicKey): PublicKey;
|
|
5318
5328
|
//#endregion
|
|
5319
|
-
export { type BundleAccount, BundleProgramId, NeutralTrade, type NeutralTradeConfig, type OracleData, type PointsVaultEntry, SupportedChain, SupportedToken, type Token, type UserBalanceResult, type UserBundleAccount, type UserBundleTempData, type VaultBalanceData, VaultCategory, type VaultRegistryEntry as VaultConfig, type VaultRegistry as VaultConfigRecord, VaultId, VaultType, createAnchorProviderV29, createAnchorProviderV32, createBundleProgramV1, createBundleProgramV2, createBundlePrograms, createConnection, createDummyWallet, deriveOraclePDA, deriveUserPDA, estimatePendingBundleFeeToken, getBundleProgramId, getPointsVaults, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults$1 as vaults };
|
|
5329
|
+
export { type BundleAccount, BundleProgramId, NeutralTrade, type NeutralTradeConfig, type NeutralTradeCoreContext, type OracleData, type PointsVaultEntry, SupportedChain, SupportedToken, type Token, type UserBalanceResult, type UserBundleAccount, type UserBundleTempData, type VaultBalanceData, VaultCategory, type VaultRegistryEntry as VaultConfig, type VaultRegistry as VaultConfigRecord, VaultId, VaultType, createAnchorProviderV29, createAnchorProviderV32, createBundleProgramV1, createBundleProgramV2, createBundlePrograms, createConnection, createDummyWallet, deriveOraclePDA, deriveUserPDA, estimatePendingBundleFeeToken, getBundleProgramId, getPointsVaults, getVaultByAddress, getVaultById, getVaultDepositorAddressSync, isValidVaultAddress, tokens, vaults$1 as vaults };
|
package/dist/index.mjs
CHANGED
|
@@ -8145,10 +8145,12 @@ function createBundlePrograms(connection) {
|
|
|
8145
8145
|
* These are auto-generated from the vault registry
|
|
8146
8146
|
*/
|
|
8147
8147
|
let VaultId = /* @__PURE__ */ function(VaultId$1) {
|
|
8148
|
-
/**
|
|
8149
|
-
VaultId$1[VaultId$1["
|
|
8148
|
+
/** Hyperithm-CTA-USDC-Bundle */
|
|
8149
|
+
VaultId$1[VaultId$1["hyperithm_cta_usdc_bundle_77"] = 77] = "hyperithm_cta_usdc_bundle_77";
|
|
8150
8150
|
/** Master Bundle */
|
|
8151
8151
|
VaultId$1[VaultId$1["master_bundle_76"] = 76] = "master_bundle_76";
|
|
8152
|
+
/** AdverseGuard Alpha */
|
|
8153
|
+
VaultId$1[VaultId$1["adverseguard_alpha_75"] = 75] = "adverseguard_alpha_75";
|
|
8152
8154
|
/** Multi-Asset Volatility Arbitrage */
|
|
8153
8155
|
VaultId$1[VaultId$1["multi_asset_volatility_arbitrage_74"] = 74] = "multi_asset_volatility_arbitrage_74";
|
|
8154
8156
|
/** Great Debasement */
|
|
@@ -8306,14 +8308,14 @@ let VaultId = /* @__PURE__ */ function(VaultId$1) {
|
|
|
8306
8308
|
//#region src/registry/vaults.json
|
|
8307
8309
|
var vaults_default = [
|
|
8308
8310
|
{
|
|
8309
|
-
"vaultId":
|
|
8310
|
-
"name": "
|
|
8311
|
+
"vaultId": 77,
|
|
8312
|
+
"name": "Hyperithm-CTA-USDC-Bundle",
|
|
8311
8313
|
"type": "Bundle",
|
|
8312
|
-
"category": "
|
|
8313
|
-
"vaultAddress": "
|
|
8314
|
+
"category": "Directional",
|
|
8315
|
+
"vaultAddress": "Ec6uSz5EsffwfXp43pvpz4rf9ttJRFKES4ZSVX7gVVkQ",
|
|
8314
8316
|
"depositToken": "USDC",
|
|
8315
8317
|
"pointsMultiplier": 1,
|
|
8316
|
-
"pointsEnabled":
|
|
8318
|
+
"pointsEnabled": false
|
|
8317
8319
|
},
|
|
8318
8320
|
{
|
|
8319
8321
|
"vaultId": 76,
|
|
@@ -8325,6 +8327,16 @@ var vaults_default = [
|
|
|
8325
8327
|
"pointsMultiplier": 1,
|
|
8326
8328
|
"pointsEnabled": false
|
|
8327
8329
|
},
|
|
8330
|
+
{
|
|
8331
|
+
"vaultId": 75,
|
|
8332
|
+
"name": "AdverseGuard Alpha",
|
|
8333
|
+
"type": "Bundle",
|
|
8334
|
+
"category": "Market Neutral",
|
|
8335
|
+
"vaultAddress": "46gSEJLNTdDFq7DPjH8RbcTmG1gyw4JCKCr1XfuAfYvh",
|
|
8336
|
+
"depositToken": "USDC",
|
|
8337
|
+
"pointsMultiplier": 1,
|
|
8338
|
+
"pointsEnabled": true
|
|
8339
|
+
},
|
|
8328
8340
|
{
|
|
8329
8341
|
"vaultId": 74,
|
|
8330
8342
|
"name": "Multi-Asset Volatility Arbitrage",
|
|
@@ -9634,7 +9646,7 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9634
9646
|
* Create a new NeutralTrade instance
|
|
9635
9647
|
* @throws Error if registryUrl is provided but fetch fails or validation fails
|
|
9636
9648
|
*/
|
|
9637
|
-
static async
|
|
9649
|
+
static async initCore(config) {
|
|
9638
9650
|
const connection = createConnection(config.rpcUrl);
|
|
9639
9651
|
const providerV29 = createAnchorProviderV29(connection);
|
|
9640
9652
|
const providerV32 = createAnchorProviderV32(connection);
|
|
@@ -9649,7 +9661,17 @@ var NeutralTrade = class NeutralTrade {
|
|
|
9649
9661
|
};
|
|
9650
9662
|
}
|
|
9651
9663
|
const priceMap = await initializePrices(config.fallbackPrices);
|
|
9652
|
-
return
|
|
9664
|
+
return {
|
|
9665
|
+
connection,
|
|
9666
|
+
bundleProgramV1,
|
|
9667
|
+
bundleProgramV2,
|
|
9668
|
+
vaults: vaults$1,
|
|
9669
|
+
priceMap
|
|
9670
|
+
};
|
|
9671
|
+
}
|
|
9672
|
+
static async create(config) {
|
|
9673
|
+
const core = await this.initCore(config);
|
|
9674
|
+
return new NeutralTrade(core.connection, core.bundleProgramV1, core.bundleProgramV2, core.vaults, core.priceMap);
|
|
9653
9675
|
}
|
|
9654
9676
|
/**
|
|
9655
9677
|
* Fetch vault configurations from a remote registry URL
|