@0dotxyz/p0-ts-sdk 2.2.3 → 2.2.4
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/{dto-rate-model.types-AQ40wS-P.d.cts → dto-rate-model.types-DveIB9Ll.d.cts} +1 -1
- package/dist/{dto-rate-model.types-AQ40wS-P.d.ts → dto-rate-model.types-DveIB9Ll.d.ts} +1 -1
- package/dist/index.cjs +231 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -16
- package/dist/index.d.ts +55 -16
- package/dist/index.js +232 -98
- package/dist/index.js.map +1 -1
- package/dist/instructions.cjs +10 -2
- package/dist/instructions.cjs.map +1 -1
- package/dist/instructions.d.cts +3 -2
- package/dist/instructions.d.ts +3 -2
- package/dist/instructions.js +10 -2
- package/dist/instructions.js.map +1 -1
- package/dist/jupiter.cjs +61 -0
- package/dist/jupiter.cjs.map +1 -0
- package/dist/jupiter.d.cts +124 -0
- package/dist/jupiter.d.ts +124 -0
- package/dist/jupiter.js +58 -0
- package/dist/jupiter.js.map +1 -0
- package/dist/{types-DGWxbPM1.d.ts → types-CsLjciLo.d.cts} +2 -2
- package/dist/{types-ZvnTjjh4.d.cts → types-DuCxJVOn.d.ts} +2 -2
- package/dist/vendor.d.cts +2 -2
- package/dist/vendor.d.ts +2 -2
- package/package.json +6 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Swap direction. */
|
|
2
|
+
type SwapMode = "ExactIn" | "ExactOut";
|
|
3
|
+
/** Optional instruction format version for the swap-instructions endpoint. */
|
|
4
|
+
type InstructionVersion = "V1" | "V2";
|
|
5
|
+
/** Query parameters for `GET /quote`. */
|
|
6
|
+
interface QuoteGetRequest {
|
|
7
|
+
inputMint: string;
|
|
8
|
+
outputMint: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
slippageBps?: number;
|
|
11
|
+
swapMode?: SwapMode;
|
|
12
|
+
dexes?: Array<string>;
|
|
13
|
+
excludeDexes?: Array<string>;
|
|
14
|
+
restrictIntermediateTokens?: boolean;
|
|
15
|
+
onlyDirectRoutes?: boolean;
|
|
16
|
+
asLegacyTransaction?: boolean;
|
|
17
|
+
platformFeeBps?: number;
|
|
18
|
+
maxAccounts?: number;
|
|
19
|
+
instructionVersion?: InstructionVersion;
|
|
20
|
+
dynamicSlippage?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Set to true if the quote will be consumed in a Jito bundle. Excludes DEXes
|
|
23
|
+
* that are incompatible with Jito bundles (e.g. HumidiFi). Flashloan swaps in
|
|
24
|
+
* this SDK always execute inside a Jito bundle, so they set this to true.
|
|
25
|
+
*/
|
|
26
|
+
forJitoBundle?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface PlatformFee {
|
|
29
|
+
amount?: string;
|
|
30
|
+
feeBps?: number;
|
|
31
|
+
}
|
|
32
|
+
interface SwapInfo {
|
|
33
|
+
ammKey: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
inputMint: string;
|
|
36
|
+
outputMint: string;
|
|
37
|
+
inAmount: string;
|
|
38
|
+
outAmount: string;
|
|
39
|
+
}
|
|
40
|
+
interface RoutePlanStep {
|
|
41
|
+
swapInfo: SwapInfo;
|
|
42
|
+
percent?: number | null;
|
|
43
|
+
bps?: number;
|
|
44
|
+
}
|
|
45
|
+
/** Response from `GET /quote`. */
|
|
46
|
+
interface QuoteResponse {
|
|
47
|
+
inputMint: string;
|
|
48
|
+
inAmount: string;
|
|
49
|
+
outputMint: string;
|
|
50
|
+
outAmount: string;
|
|
51
|
+
otherAmountThreshold: string;
|
|
52
|
+
swapMode: SwapMode;
|
|
53
|
+
slippageBps: number;
|
|
54
|
+
platformFee?: PlatformFee;
|
|
55
|
+
priceImpactPct: string;
|
|
56
|
+
routePlan: Array<RoutePlanStep>;
|
|
57
|
+
contextSlot?: number;
|
|
58
|
+
timeTaken?: number;
|
|
59
|
+
}
|
|
60
|
+
interface AccountMeta {
|
|
61
|
+
pubkey: string;
|
|
62
|
+
isSigner: boolean;
|
|
63
|
+
isWritable: boolean;
|
|
64
|
+
}
|
|
65
|
+
interface Instruction {
|
|
66
|
+
programId: string;
|
|
67
|
+
accounts: Array<AccountMeta>;
|
|
68
|
+
data: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Body for `POST /swap-instructions`. Only the fields the SDK sets are modelled
|
|
72
|
+
* explicitly; the remaining optional knobs are passed through loosely so we
|
|
73
|
+
* don't have to track every Jupiter request option.
|
|
74
|
+
*/
|
|
75
|
+
interface SwapRequest {
|
|
76
|
+
quoteResponse: QuoteResponse;
|
|
77
|
+
userPublicKey: string;
|
|
78
|
+
payer?: string;
|
|
79
|
+
wrapAndUnwrapSol?: boolean;
|
|
80
|
+
useSharedAccounts?: boolean;
|
|
81
|
+
feeAccount?: string;
|
|
82
|
+
trackingAccount?: string;
|
|
83
|
+
prioritizationFeeLamports?: unknown;
|
|
84
|
+
asLegacyTransaction?: boolean;
|
|
85
|
+
destinationTokenAccount?: string;
|
|
86
|
+
nativeDestinationAccount?: string;
|
|
87
|
+
dynamicComputeUnitLimit?: boolean;
|
|
88
|
+
skipUserAccountsRpcCalls?: boolean;
|
|
89
|
+
dynamicSlippage?: boolean;
|
|
90
|
+
computeUnitPriceMicroLamports?: number;
|
|
91
|
+
blockhashSlotsToExpiry?: number;
|
|
92
|
+
}
|
|
93
|
+
/** Response from `POST /swap-instructions`. */
|
|
94
|
+
interface SwapInstructionsResponse {
|
|
95
|
+
otherInstructions: Array<Instruction>;
|
|
96
|
+
computeBudgetInstructions: Array<Instruction>;
|
|
97
|
+
setupInstructions: Array<Instruction>;
|
|
98
|
+
swapInstruction: Instruction;
|
|
99
|
+
cleanupInstruction?: Instruction;
|
|
100
|
+
addressLookupTableAddresses: Array<string>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface JupiterClientConfig {
|
|
104
|
+
/** Override the API base URL (e.g. the paid `https://api.jup.ag/swap/v1`). */
|
|
105
|
+
basePath?: string;
|
|
106
|
+
/** API key, sent as the `x-api-key` header. */
|
|
107
|
+
apiKey?: string;
|
|
108
|
+
/** Extra headers applied to every request. */
|
|
109
|
+
headers?: Record<string, string>;
|
|
110
|
+
}
|
|
111
|
+
declare class JupiterApiError extends Error {
|
|
112
|
+
status: number;
|
|
113
|
+
body: string;
|
|
114
|
+
constructor(status: number, body: string);
|
|
115
|
+
}
|
|
116
|
+
interface JupiterClient {
|
|
117
|
+
quoteGet(request: QuoteGetRequest): Promise<QuoteResponse>;
|
|
118
|
+
swapInstructionsPost(request: {
|
|
119
|
+
swapRequest: SwapRequest;
|
|
120
|
+
}): Promise<SwapInstructionsResponse>;
|
|
121
|
+
}
|
|
122
|
+
declare function createJupiterClient(config?: JupiterClientConfig): JupiterClient;
|
|
123
|
+
|
|
124
|
+
export { type AccountMeta, type Instruction, type InstructionVersion, JupiterApiError, type JupiterClient, type JupiterClientConfig, type PlatformFee, type QuoteGetRequest, type QuoteResponse, type RoutePlanStep, type SwapInfo, type SwapInstructionsResponse, type SwapMode, type SwapRequest, createJupiterClient };
|
package/dist/jupiter.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/vendor/jupiter/client.ts
|
|
2
|
+
var DEFAULT_BASE_PATH = "https://lite-api.jup.ag/swap/v1";
|
|
3
|
+
var JupiterApiError = class _JupiterApiError extends Error {
|
|
4
|
+
status;
|
|
5
|
+
body;
|
|
6
|
+
constructor(status, body) {
|
|
7
|
+
super(`Jupiter API request failed with status ${status}: ${body}`);
|
|
8
|
+
this.name = "JupiterApiError";
|
|
9
|
+
Object.setPrototypeOf(this, _JupiterApiError.prototype);
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.body = body;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function buildQuoteSearchParams(request) {
|
|
15
|
+
const params = new URLSearchParams();
|
|
16
|
+
for (const [key, value] of Object.entries(request)) {
|
|
17
|
+
if (value === void 0 || value === null) continue;
|
|
18
|
+
if (Array.isArray(value)) {
|
|
19
|
+
if (value.length > 0) params.append(key, value.join(","));
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
params.append(key, String(value));
|
|
23
|
+
}
|
|
24
|
+
return params;
|
|
25
|
+
}
|
|
26
|
+
function createJupiterClient(config = {}) {
|
|
27
|
+
const basePath = (config.basePath ?? DEFAULT_BASE_PATH).replace(/\/+$/, "");
|
|
28
|
+
const baseHeaders = { ...config.headers };
|
|
29
|
+
if (config.apiKey) baseHeaders["x-api-key"] = config.apiKey;
|
|
30
|
+
const request = async (path, init) => {
|
|
31
|
+
const response = await fetch(`${basePath}${path}`, init);
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
const body = await response.text().catch(() => "");
|
|
34
|
+
throw new JupiterApiError(response.status, body);
|
|
35
|
+
}
|
|
36
|
+
return await response.json();
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
quoteGet(quoteRequest) {
|
|
40
|
+
const search = buildQuoteSearchParams(quoteRequest);
|
|
41
|
+
return request(`/quote?${search.toString()}`, {
|
|
42
|
+
method: "GET",
|
|
43
|
+
headers: baseHeaders
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
swapInstructionsPost({ swapRequest }) {
|
|
47
|
+
return request(`/swap-instructions`, {
|
|
48
|
+
method: "POST",
|
|
49
|
+
headers: { ...baseHeaders, "content-type": "application/json" },
|
|
50
|
+
body: JSON.stringify(swapRequest)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { JupiterApiError, createJupiterClient };
|
|
57
|
+
//# sourceMappingURL=jupiter.js.map
|
|
58
|
+
//# sourceMappingURL=jupiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/vendor/jupiter/client.ts"],"names":[],"mappings":"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","file":"jupiter.js","sourcesContent":["// Minimal Jupiter Swap API client — replaces the runtime of @jup-ag/api.\n//\n// The generated @jup-ag/api client hardcodes the legacy\n// `https://quote-api.jup.ag/v6` base URL and ignores a caller-supplied\n// basePath, so we reimplement the two endpoints the SDK uses against Jupiter's\n// current Swap API (https://dev.jup.ag/docs/swap-api). Only `GET /quote` and\n// `POST /swap-instructions` are implemented.\n\nimport type {\n QuoteGetRequest,\n QuoteResponse,\n SwapInstructionsResponse,\n SwapRequest,\n} from \"./types\";\n\n// Free tier. Callers with an API key typically override this with the paid\n// base `https://api.jup.ag/swap/v1` via `basePath`.\nconst DEFAULT_BASE_PATH = \"https://lite-api.jup.ag/swap/v1\";\n\nexport interface JupiterClientConfig {\n /** Override the API base URL (e.g. the paid `https://api.jup.ag/swap/v1`). */\n basePath?: string;\n /** API key, sent as the `x-api-key` header. */\n apiKey?: string;\n /** Extra headers applied to every request. */\n headers?: Record<string, string>;\n}\n\nexport class JupiterApiError extends Error {\n status: number;\n body: string;\n\n constructor(status: number, body: string) {\n super(`Jupiter API request failed with status ${status}: ${body}`);\n this.name = \"JupiterApiError\";\n Object.setPrototypeOf(this, JupiterApiError.prototype);\n this.status = status;\n this.body = body;\n }\n}\n\nfunction buildQuoteSearchParams(request: QuoteGetRequest): URLSearchParams {\n const params = new URLSearchParams();\n for (const [key, value] of Object.entries(request)) {\n if (value === undefined || value === null) continue;\n // Arrays (dexes/excludeDexes) are comma-separated per the Jupiter spec.\n if (Array.isArray(value)) {\n if (value.length > 0) params.append(key, value.join(\",\"));\n continue;\n }\n params.append(key, String(value));\n }\n return params;\n}\n\nexport interface JupiterClient {\n quoteGet(request: QuoteGetRequest): Promise<QuoteResponse>;\n swapInstructionsPost(request: { swapRequest: SwapRequest }): Promise<SwapInstructionsResponse>;\n}\n\nexport function createJupiterClient(config: JupiterClientConfig = {}): JupiterClient {\n const basePath = (config.basePath ?? DEFAULT_BASE_PATH).replace(/\\/+$/, \"\");\n const baseHeaders: Record<string, string> = { ...config.headers };\n if (config.apiKey) baseHeaders[\"x-api-key\"] = config.apiKey;\n\n const request = async <T>(path: string, init: RequestInit): Promise<T> => {\n const response = await fetch(`${basePath}${path}`, init);\n if (!response.ok) {\n const body = await response.text().catch(() => \"\");\n throw new JupiterApiError(response.status, body);\n }\n return (await response.json()) as T;\n };\n\n return {\n quoteGet(quoteRequest) {\n const search = buildQuoteSearchParams(quoteRequest);\n return request<QuoteResponse>(`/quote?${search.toString()}`, {\n method: \"GET\",\n headers: baseHeaders,\n });\n },\n swapInstructionsPost({ swapRequest }) {\n return request<SwapInstructionsResponse>(`/swap-instructions`, {\n method: \"POST\",\n headers: { ...baseHeaders, \"content-type\": \"application/json\" },\n body: JSON.stringify(swapRequest),\n });\n },\n };\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
|
2
2
|
import { Idl, Program as Program$1, AnchorProvider } from '@coral-xyz/anchor';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
import BigNumber$1 from 'bignumber.js';
|
|
5
|
-
import { R as ReserveRaw,
|
|
5
|
+
import { R as ReserveRaw, O as ObligationRaw, F as FarmStateRaw, D as DriftSpotMarket, a as DriftUser, b as DriftRewards, c as DriftUserStats, J as JupLendingState, d as JupTokenReserve, e as JupLendingRewardsRateModel, f as JupRateModel, g as ReserveJSON, h as ObligationJSON, i as FarmStateJSON, j as DriftSpotMarketJSON, k as DriftUserJSON, l as DriftRewardsJSON, m as DriftUserStatsJSON, n as JupLendingStateJSON, o as JupTokenReserveJSON, p as JupLendingRewardsRateModelJSON, q as JupRateModelJSON } from './dto-rate-model.types-DveIB9Ll.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -15389,4 +15389,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
15389
15389
|
type: AmountType;
|
|
15390
15390
|
};
|
|
15391
15391
|
|
|
15392
|
-
export { type BankMetadataRaw as $, AssetTag as A,
|
|
15392
|
+
export { type BankMetadataRaw as $, AssetTag as A, type BankConfigCompactRaw as B, type HealthCacheType as C, type EmodePair as D, EmodeTag as E, type ActiveEmodePair as F, type ActionEmodeImpact as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, MarginRequirementType as J, EmodeImpactStatus as K, BankVaultType as L, type MarginfiProgram as M, type BankIntegrationMetadataMapDto as N, OperationalState as O, type PriceWithConfidence as P, type BankIntegrationMetadataDto as Q, RiskTier as R, type BankIntegrationMetadata as S, type TypedAmount as T, Bank as U, type Environment as V, type WrappedI80F48 as W, type Project0Config as X, type MintData as Y, BankConfig as Z, EmodeSettings as _, type BankConfigOptRaw as a, type RatePointRaw as a0, type InterestRateConfigCompactRaw as a1, type InterestRateConfigOptRaw as a2, type OracleConfigOptRaw as a3, type EmodeConfigRaw as a4, type RatePoint as a5, type InterestRateConfigOpt as a6, type EmodeEntry as a7, type OracleConfigOpt as a8, type EmodeImpact as a9, isWeightedPrice as aa, type GetAssetWeightParams as ab, getAssetWeight as ac, getLiabilityWeight as ad, computeMaxLeverage as ae, computeLoopingParams as af, type ComputeUsdValueParams as ag, computeUsdValue as ah, type ComputeLiabilityUsdValueParams as ai, computeLiabilityUsdValue as aj, type ComputeAssetUsdValueParams as ak, computeAssetUsdValue as al, computeTvl as am, type PriceWithConfidenceDto as an, MARGINFI_IDL as ao, type Program as ap, type Wallet as aq, type BankMetadata as ar, type BankAddress as as, AccountType as at, type KaminoStates as au, type BankMap as av, type OraclePriceMap as aw, type MintDataMap as ax, type AmountType as ay, resolveAmount as az, BankConfigFlag as b, OracleSetup as c, EmodeEntryFlags as d, EmodeFlags as e, type OperationalStateRaw as f, type OracleSetupRaw as g, type RiskTierRaw as h, type BankConfigOpt as i, type InterestRateConfig as j, type BankConfigType as k, type BankConfigRaw as l, type BankType as m, type EmodeSettingsType as n, type BankRaw as o, type EmodeSettingsRaw as p, type MarginfiIdlType as q, type OraclePrice as r, PriceBias as s, type OraclePriceDto as t, HealthCacheStatus as u, AccountFlags as v, type MarginfiAccountType as w, type Amount as x, type BankIntegrationMetadataMap as y, type BalanceType as z };
|
|
@@ -2,7 +2,7 @@ import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
|
2
2
|
import { Idl, Program as Program$1, AnchorProvider } from '@coral-xyz/anchor';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
import BigNumber$1 from 'bignumber.js';
|
|
5
|
-
import { R as ReserveRaw,
|
|
5
|
+
import { R as ReserveRaw, O as ObligationRaw, F as FarmStateRaw, D as DriftSpotMarket, a as DriftUser, b as DriftRewards, c as DriftUserStats, J as JupLendingState, d as JupTokenReserve, e as JupLendingRewardsRateModel, f as JupRateModel, g as ReserveJSON, h as ObligationJSON, i as FarmStateJSON, j as DriftSpotMarketJSON, k as DriftUserJSON, l as DriftRewardsJSON, m as DriftUserStatsJSON, n as JupLendingStateJSON, o as JupTokenReserveJSON, p as JupLendingRewardsRateModelJSON, q as JupRateModelJSON } from './dto-rate-model.types-DveIB9Ll.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -15389,4 +15389,4 @@ declare function resolveAmount(amount: Amount | TypedAmount): {
|
|
|
15389
15389
|
type: AmountType;
|
|
15390
15390
|
};
|
|
15391
15391
|
|
|
15392
|
-
export { type BankMetadataRaw as $, AssetTag as A,
|
|
15392
|
+
export { type BankMetadataRaw as $, AssetTag as A, type BankConfigCompactRaw as B, type HealthCacheType as C, type EmodePair as D, EmodeTag as E, type ActiveEmodePair as F, type ActionEmodeImpact as G, HealthCacheFlags as H, type InterestRateConfigRaw as I, MarginRequirementType as J, EmodeImpactStatus as K, BankVaultType as L, type MarginfiProgram as M, type BankIntegrationMetadataMapDto as N, OperationalState as O, type PriceWithConfidence as P, type BankIntegrationMetadataDto as Q, RiskTier as R, type BankIntegrationMetadata as S, type TypedAmount as T, Bank as U, type Environment as V, type WrappedI80F48 as W, type Project0Config as X, type MintData as Y, BankConfig as Z, EmodeSettings as _, type BankConfigOptRaw as a, type RatePointRaw as a0, type InterestRateConfigCompactRaw as a1, type InterestRateConfigOptRaw as a2, type OracleConfigOptRaw as a3, type EmodeConfigRaw as a4, type RatePoint as a5, type InterestRateConfigOpt as a6, type EmodeEntry as a7, type OracleConfigOpt as a8, type EmodeImpact as a9, isWeightedPrice as aa, type GetAssetWeightParams as ab, getAssetWeight as ac, getLiabilityWeight as ad, computeMaxLeverage as ae, computeLoopingParams as af, type ComputeUsdValueParams as ag, computeUsdValue as ah, type ComputeLiabilityUsdValueParams as ai, computeLiabilityUsdValue as aj, type ComputeAssetUsdValueParams as ak, computeAssetUsdValue as al, computeTvl as am, type PriceWithConfidenceDto as an, MARGINFI_IDL as ao, type Program as ap, type Wallet as aq, type BankMetadata as ar, type BankAddress as as, AccountType as at, type KaminoStates as au, type BankMap as av, type OraclePriceMap as aw, type MintDataMap as ax, type AmountType as ay, resolveAmount as az, BankConfigFlag as b, OracleSetup as c, EmodeEntryFlags as d, EmodeFlags as e, type OperationalStateRaw as f, type OracleSetupRaw as g, type RiskTierRaw as h, type BankConfigOpt as i, type InterestRateConfig as j, type BankConfigType as k, type BankConfigRaw as l, type BankType as m, type EmodeSettingsType as n, type BankRaw as o, type EmodeSettingsRaw as p, type MarginfiIdlType as q, type OraclePrice as r, PriceBias as s, type OraclePriceDto as t, HealthCacheStatus as u, AccountFlags as v, type MarginfiAccountType as w, type Amount as x, type BankIntegrationMetadataMap as y, type BalanceType as z };
|
package/dist/vendor.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment,
|
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
|
4
4
|
export { a as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './index-BDDVBMdM.cjs';
|
|
5
5
|
import { Program, BorshCoder, Address } from '@coral-xyz/anchor';
|
|
6
|
-
import { R as ReserveRaw,
|
|
7
|
-
export { aa as BigFractionBytesFields, ac as BigFractionBytesJSON, E as BorrowRateCurveFields, X as BorrowRateCurveJSON, Y as CurvePointJSON, ak as FeeTier, al as FeeTierJSON, at as HistoricalIndexDataJSON, as as HistoricalOracleDataJSON, av as InsuranceFundJSON, a9 as LastUpdateFields, ab as LastUpdateJSON, a6 as ObligationCollateralFields, a4 as ObligationCollateralJSON, a7 as ObligationLiquidityFields, a3 as ObligationLiquidityJSON, a8 as ObligationOrderFields, a5 as ObligationOrderJSON, am as OrderFillerRewardStructure, an as OrderFillerRewardStructureJSON, au as PoolBalanceJSON, ao as PriceDivergenceGuardRails, ap as PriceDivergenceGuardRailsJSON, G as PriceHeuristicFields, _ as PriceHeuristicJSON, M as PythConfigurationFields, a1 as PythConfigurationJSON, z as ReserveCollateralFields, Q as ReserveCollateralJSON, A as ReserveConfigFields, U as ReserveConfigJSON, B as ReserveFeesFields, V as ReserveFeesJSON, y as ReserveLiquidityFields, N as ReserveLiquidityJSON, ad as RewardPerTimeUnitPointFields, ag as RewardPerTimeUnitPointJSON, ae as RewardScheduleCurveFields, af as RewardScheduleCurveJSON, K as ScopeConfigurationFields, $ as ScopeConfigurationJSON, aw as SpotBalanceType, ax as SpotPositionJSON, L as SwitchboardConfigurationFields, a0 as SwitchboardConfigurationJSON, T as TokenInfoFields, Z as TokenInfoJSON, ai as UserFeesFields, ah as UserFeesJSON, aq as ValidityGuardRails, ar as ValidityGuardRailsJSON, W as WithdrawalCapsFields, a2 as WithdrawalCapsJSON, aj as isSpotBalanceTypeVariant } from './dto-rate-model.types-
|
|
6
|
+
import { R as ReserveRaw, O as ObligationRaw, h as ObligationJSON, g as ReserveJSON, C as CurvePointFields, r as RewardInfoFields, F as FarmStateRaw, i as FarmStateJSON, H as HistoricalOracleData, s as HistoricalIndexData, P as PoolBalance, I as InsuranceFund, t as FeeStructureJSON, u as OracleGuardRailsJSON, v as FeeStructure, w as OracleGuardRails, S as SpotPosition, c as DriftUserStats, m as DriftUserStatsJSON, a as DriftUser, k as DriftUserJSON, D as DriftSpotMarket, j as DriftSpotMarketJSON, b as DriftRewards, l as DriftRewardsJSON, x as DriftSpotBalanceType, J as JupLendingState, n as JupLendingStateJSON, d as JupTokenReserve, o as JupTokenReserveJSON, e as JupLendingRewardsRateModel, p as JupLendingRewardsRateModelJSON, f as JupRateModel, q as JupRateModelJSON } from './dto-rate-model.types-DveIB9Ll.cjs';
|
|
7
|
+
export { aa as BigFractionBytesFields, ac as BigFractionBytesJSON, E as BorrowRateCurveFields, X as BorrowRateCurveJSON, Y as CurvePointJSON, ak as FeeTier, al as FeeTierJSON, at as HistoricalIndexDataJSON, as as HistoricalOracleDataJSON, av as InsuranceFundJSON, a9 as LastUpdateFields, ab as LastUpdateJSON, a6 as ObligationCollateralFields, a4 as ObligationCollateralJSON, a7 as ObligationLiquidityFields, a3 as ObligationLiquidityJSON, a8 as ObligationOrderFields, a5 as ObligationOrderJSON, am as OrderFillerRewardStructure, an as OrderFillerRewardStructureJSON, au as PoolBalanceJSON, ao as PriceDivergenceGuardRails, ap as PriceDivergenceGuardRailsJSON, G as PriceHeuristicFields, _ as PriceHeuristicJSON, M as PythConfigurationFields, a1 as PythConfigurationJSON, z as ReserveCollateralFields, Q as ReserveCollateralJSON, A as ReserveConfigFields, U as ReserveConfigJSON, B as ReserveFeesFields, V as ReserveFeesJSON, y as ReserveLiquidityFields, N as ReserveLiquidityJSON, ad as RewardPerTimeUnitPointFields, ag as RewardPerTimeUnitPointJSON, ae as RewardScheduleCurveFields, af as RewardScheduleCurveJSON, K as ScopeConfigurationFields, $ as ScopeConfigurationJSON, aw as SpotBalanceType, ax as SpotPositionJSON, L as SwitchboardConfigurationFields, a0 as SwitchboardConfigurationJSON, T as TokenInfoFields, Z as TokenInfoJSON, ai as UserFeesFields, ah as UserFeesJSON, aq as ValidityGuardRails, ar as ValidityGuardRailsJSON, W as WithdrawalCapsFields, a2 as WithdrawalCapsJSON, aj as isSpotBalanceTypeVariant } from './dto-rate-model.types-DveIB9Ll.cjs';
|
|
8
8
|
import Decimal from 'decimal.js';
|
|
9
9
|
import * as _solana_buffer_layout from '@solana/buffer-layout';
|
|
10
10
|
import { Buffer as Buffer$1 } from 'buffer';
|
package/dist/vendor.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { PublicKey, TransactionInstruction, Connection, Transaction, Commitment,
|
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
|
4
4
|
export { a as CrossbarSimulatePayload, C as CurrentResult, F as FeedResponse, O as OracleSubmission, P as PullFeedAccountData, S as SWITCHBOARD_ONDEMANDE_PRICE_PRECISION, d as decodeSwitchboardPullFeedData, g as getSwitchboardProgram, s as switchboardAccountCoder } from './index-BDDVBMdM.js';
|
|
5
5
|
import { Program, BorshCoder, Address } from '@coral-xyz/anchor';
|
|
6
|
-
import { R as ReserveRaw,
|
|
7
|
-
export { aa as BigFractionBytesFields, ac as BigFractionBytesJSON, E as BorrowRateCurveFields, X as BorrowRateCurveJSON, Y as CurvePointJSON, ak as FeeTier, al as FeeTierJSON, at as HistoricalIndexDataJSON, as as HistoricalOracleDataJSON, av as InsuranceFundJSON, a9 as LastUpdateFields, ab as LastUpdateJSON, a6 as ObligationCollateralFields, a4 as ObligationCollateralJSON, a7 as ObligationLiquidityFields, a3 as ObligationLiquidityJSON, a8 as ObligationOrderFields, a5 as ObligationOrderJSON, am as OrderFillerRewardStructure, an as OrderFillerRewardStructureJSON, au as PoolBalanceJSON, ao as PriceDivergenceGuardRails, ap as PriceDivergenceGuardRailsJSON, G as PriceHeuristicFields, _ as PriceHeuristicJSON, M as PythConfigurationFields, a1 as PythConfigurationJSON, z as ReserveCollateralFields, Q as ReserveCollateralJSON, A as ReserveConfigFields, U as ReserveConfigJSON, B as ReserveFeesFields, V as ReserveFeesJSON, y as ReserveLiquidityFields, N as ReserveLiquidityJSON, ad as RewardPerTimeUnitPointFields, ag as RewardPerTimeUnitPointJSON, ae as RewardScheduleCurveFields, af as RewardScheduleCurveJSON, K as ScopeConfigurationFields, $ as ScopeConfigurationJSON, aw as SpotBalanceType, ax as SpotPositionJSON, L as SwitchboardConfigurationFields, a0 as SwitchboardConfigurationJSON, T as TokenInfoFields, Z as TokenInfoJSON, ai as UserFeesFields, ah as UserFeesJSON, aq as ValidityGuardRails, ar as ValidityGuardRailsJSON, W as WithdrawalCapsFields, a2 as WithdrawalCapsJSON, aj as isSpotBalanceTypeVariant } from './dto-rate-model.types-
|
|
6
|
+
import { R as ReserveRaw, O as ObligationRaw, h as ObligationJSON, g as ReserveJSON, C as CurvePointFields, r as RewardInfoFields, F as FarmStateRaw, i as FarmStateJSON, H as HistoricalOracleData, s as HistoricalIndexData, P as PoolBalance, I as InsuranceFund, t as FeeStructureJSON, u as OracleGuardRailsJSON, v as FeeStructure, w as OracleGuardRails, S as SpotPosition, c as DriftUserStats, m as DriftUserStatsJSON, a as DriftUser, k as DriftUserJSON, D as DriftSpotMarket, j as DriftSpotMarketJSON, b as DriftRewards, l as DriftRewardsJSON, x as DriftSpotBalanceType, J as JupLendingState, n as JupLendingStateJSON, d as JupTokenReserve, o as JupTokenReserveJSON, e as JupLendingRewardsRateModel, p as JupLendingRewardsRateModelJSON, f as JupRateModel, q as JupRateModelJSON } from './dto-rate-model.types-DveIB9Ll.js';
|
|
7
|
+
export { aa as BigFractionBytesFields, ac as BigFractionBytesJSON, E as BorrowRateCurveFields, X as BorrowRateCurveJSON, Y as CurvePointJSON, ak as FeeTier, al as FeeTierJSON, at as HistoricalIndexDataJSON, as as HistoricalOracleDataJSON, av as InsuranceFundJSON, a9 as LastUpdateFields, ab as LastUpdateJSON, a6 as ObligationCollateralFields, a4 as ObligationCollateralJSON, a7 as ObligationLiquidityFields, a3 as ObligationLiquidityJSON, a8 as ObligationOrderFields, a5 as ObligationOrderJSON, am as OrderFillerRewardStructure, an as OrderFillerRewardStructureJSON, au as PoolBalanceJSON, ao as PriceDivergenceGuardRails, ap as PriceDivergenceGuardRailsJSON, G as PriceHeuristicFields, _ as PriceHeuristicJSON, M as PythConfigurationFields, a1 as PythConfigurationJSON, z as ReserveCollateralFields, Q as ReserveCollateralJSON, A as ReserveConfigFields, U as ReserveConfigJSON, B as ReserveFeesFields, V as ReserveFeesJSON, y as ReserveLiquidityFields, N as ReserveLiquidityJSON, ad as RewardPerTimeUnitPointFields, ag as RewardPerTimeUnitPointJSON, ae as RewardScheduleCurveFields, af as RewardScheduleCurveJSON, K as ScopeConfigurationFields, $ as ScopeConfigurationJSON, aw as SpotBalanceType, ax as SpotPositionJSON, L as SwitchboardConfigurationFields, a0 as SwitchboardConfigurationJSON, T as TokenInfoFields, Z as TokenInfoJSON, ai as UserFeesFields, ah as UserFeesJSON, aq as ValidityGuardRails, ar as ValidityGuardRailsJSON, W as WithdrawalCapsFields, a2 as WithdrawalCapsJSON, aj as isSpotBalanceTypeVariant } from './dto-rate-model.types-DveIB9Ll.js';
|
|
8
8
|
import Decimal from 'decimal.js';
|
|
9
9
|
import * as _solana_buffer_layout from '@solana/buffer-layout';
|
|
10
10
|
import { Buffer as Buffer$1 } from 'buffer';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0dotxyz/p0-ts-sdk",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"packageManager": "pnpm@10.32.1",
|
|
5
5
|
"description": "TypeScript SDK for P0 Protocol - A Solana DeFi lending protocol",
|
|
6
6
|
"type": "module",
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"import": "./dist/vendor.js",
|
|
20
20
|
"require": "./dist/vendor.cjs"
|
|
21
21
|
},
|
|
22
|
+
"./jupiter": {
|
|
23
|
+
"types": "./dist/jupiter.d.ts",
|
|
24
|
+
"import": "./dist/jupiter.js",
|
|
25
|
+
"require": "./dist/jupiter.cjs"
|
|
26
|
+
},
|
|
22
27
|
"./instructions": {
|
|
23
28
|
"types": "./dist/instructions.d.ts",
|
|
24
29
|
"import": "./dist/instructions.js",
|
|
@@ -72,7 +77,6 @@
|
|
|
72
77
|
"dependencies": {
|
|
73
78
|
"@coral-xyz/anchor": "0.30.1",
|
|
74
79
|
"@coral-xyz/borsh": "0.30.1",
|
|
75
|
-
"@jup-ag/api": "6.0.47",
|
|
76
80
|
"@msgpack/msgpack": "^3.1.3",
|
|
77
81
|
"@solana/buffer-layout": "^4.0.1",
|
|
78
82
|
"@solana/buffer-layout-utils": "^0.3.0",
|