@0dotxyz/p0-ts-sdk 2.5.0 → 2.6.0-alpha.0
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.cjs +4110 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -2
- package/dist/index.d.ts +117 -2
- package/dist/index.js +4101 -437
- package/dist/index.js.map +1 -1
- package/dist/types-DLZaKA17.d.cts +88 -0
- package/dist/types-DLZaKA17.d.ts +88 -0
- package/dist/vendor.cjs +3389 -0
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +3318 -2
- package/dist/vendor.d.ts +3318 -2
- package/dist/vendor.js +3374 -1
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-BDDVBMdM.d.cts +0 -48
- package/dist/index-BDDVBMdM.d.ts +0 -48
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
+
import BN from 'bn.js';
|
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
|
4
|
+
|
|
5
|
+
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
|
+
interface CurrentResult {
|
|
7
|
+
value: BN;
|
|
8
|
+
std_dev: BN;
|
|
9
|
+
mean: BN;
|
|
10
|
+
range: BN;
|
|
11
|
+
min_value: BN;
|
|
12
|
+
max_vaalue: BN;
|
|
13
|
+
slot: BN;
|
|
14
|
+
min_slot: BN;
|
|
15
|
+
max_slot: BN;
|
|
16
|
+
}
|
|
17
|
+
interface OracleSubmission {
|
|
18
|
+
oracle: PublicKey;
|
|
19
|
+
slot: BN;
|
|
20
|
+
value: BN;
|
|
21
|
+
}
|
|
22
|
+
interface PullFeedAccountData {
|
|
23
|
+
submissions: OracleSubmission[];
|
|
24
|
+
authority: PublicKey;
|
|
25
|
+
queue: PublicKey;
|
|
26
|
+
feed_hash: Buffer;
|
|
27
|
+
initialized_at: BN;
|
|
28
|
+
permissions: BN;
|
|
29
|
+
max_variance: BN;
|
|
30
|
+
min_responses: number;
|
|
31
|
+
name: Buffer;
|
|
32
|
+
sample_size: number;
|
|
33
|
+
last_update_timestamp: BN;
|
|
34
|
+
lut_slot: BN;
|
|
35
|
+
result: CurrentResult;
|
|
36
|
+
max_staleness: number;
|
|
37
|
+
min_sample_size: number;
|
|
38
|
+
}
|
|
39
|
+
type CrossbarSimulatePayload = FeedResponse[];
|
|
40
|
+
interface FeedResponse {
|
|
41
|
+
feedHash: string;
|
|
42
|
+
results: number[];
|
|
43
|
+
}
|
|
44
|
+
declare const switchboardAccountCoder: BorshCoder<string, string>;
|
|
45
|
+
declare function getSwitchboardProgram(provider: Provider): Program;
|
|
46
|
+
declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountData;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Decoded Gamma `LpVault` account (raw on-chain representation).
|
|
50
|
+
* Pubkeys as {@link PublicKey}, u64/i64 numeric fields as {@link BN}.
|
|
51
|
+
*/
|
|
52
|
+
interface GammaLpVaultRaw {
|
|
53
|
+
pubkey: PublicKey;
|
|
54
|
+
assetsAccount: PublicKey;
|
|
55
|
+
pendingSharesAccount: PublicKey;
|
|
56
|
+
sharesMint: PublicKey;
|
|
57
|
+
assetsMint: PublicKey;
|
|
58
|
+
fundAuthority: PublicKey;
|
|
59
|
+
nav: BN;
|
|
60
|
+
totalShares: BN;
|
|
61
|
+
navUpdatedAt: BN;
|
|
62
|
+
navMaxStaleness: BN;
|
|
63
|
+
bump: number;
|
|
64
|
+
vaultName: string;
|
|
65
|
+
pendingWithdrawalValue: BN;
|
|
66
|
+
feeRecipient: PublicKey;
|
|
67
|
+
performanceFeeBps: number;
|
|
68
|
+
assessmentIntervalSecs: BN;
|
|
69
|
+
lastAssessmentTimestamp: BN;
|
|
70
|
+
pricePerShareAtLastAssessment: BN;
|
|
71
|
+
keeperAuthority: PublicKey;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Decoded Gamma `WithdrawReceipt` account — tracks a user's queued withdrawal
|
|
75
|
+
* against a vault (pending → claimable).
|
|
76
|
+
*/
|
|
77
|
+
interface GammaWithdrawReceiptRaw {
|
|
78
|
+
pubkey: PublicKey;
|
|
79
|
+
user: PublicKey;
|
|
80
|
+
lpVault: PublicKey;
|
|
81
|
+
pendingShares: BN;
|
|
82
|
+
claimableShares: BN;
|
|
83
|
+
claimableAssets: BN;
|
|
84
|
+
oldestPendingAt: BN;
|
|
85
|
+
bump: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { type CurrentResult as C, type FeedResponse as F, type GammaLpVaultRaw as G, type OracleSubmission as O, type PullFeedAccountData as P, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION as S, type GammaWithdrawReceiptRaw as a, type CrossbarSimulatePayload as b, decodeSwitchboardPullFeedData as d, getSwitchboardProgram as g, switchboardAccountCoder as s };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { BorshCoder, Provider, Program } from '@coral-xyz/anchor';
|
|
2
|
+
import BN from 'bn.js';
|
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
|
4
|
+
|
|
5
|
+
declare const SWITCHBOARD_ONDEMANDE_PRICE_PRECISION = 18;
|
|
6
|
+
interface CurrentResult {
|
|
7
|
+
value: BN;
|
|
8
|
+
std_dev: BN;
|
|
9
|
+
mean: BN;
|
|
10
|
+
range: BN;
|
|
11
|
+
min_value: BN;
|
|
12
|
+
max_vaalue: BN;
|
|
13
|
+
slot: BN;
|
|
14
|
+
min_slot: BN;
|
|
15
|
+
max_slot: BN;
|
|
16
|
+
}
|
|
17
|
+
interface OracleSubmission {
|
|
18
|
+
oracle: PublicKey;
|
|
19
|
+
slot: BN;
|
|
20
|
+
value: BN;
|
|
21
|
+
}
|
|
22
|
+
interface PullFeedAccountData {
|
|
23
|
+
submissions: OracleSubmission[];
|
|
24
|
+
authority: PublicKey;
|
|
25
|
+
queue: PublicKey;
|
|
26
|
+
feed_hash: Buffer;
|
|
27
|
+
initialized_at: BN;
|
|
28
|
+
permissions: BN;
|
|
29
|
+
max_variance: BN;
|
|
30
|
+
min_responses: number;
|
|
31
|
+
name: Buffer;
|
|
32
|
+
sample_size: number;
|
|
33
|
+
last_update_timestamp: BN;
|
|
34
|
+
lut_slot: BN;
|
|
35
|
+
result: CurrentResult;
|
|
36
|
+
max_staleness: number;
|
|
37
|
+
min_sample_size: number;
|
|
38
|
+
}
|
|
39
|
+
type CrossbarSimulatePayload = FeedResponse[];
|
|
40
|
+
interface FeedResponse {
|
|
41
|
+
feedHash: string;
|
|
42
|
+
results: number[];
|
|
43
|
+
}
|
|
44
|
+
declare const switchboardAccountCoder: BorshCoder<string, string>;
|
|
45
|
+
declare function getSwitchboardProgram(provider: Provider): Program;
|
|
46
|
+
declare function decodeSwitchboardPullFeedData(data: Buffer): PullFeedAccountData;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Decoded Gamma `LpVault` account (raw on-chain representation).
|
|
50
|
+
* Pubkeys as {@link PublicKey}, u64/i64 numeric fields as {@link BN}.
|
|
51
|
+
*/
|
|
52
|
+
interface GammaLpVaultRaw {
|
|
53
|
+
pubkey: PublicKey;
|
|
54
|
+
assetsAccount: PublicKey;
|
|
55
|
+
pendingSharesAccount: PublicKey;
|
|
56
|
+
sharesMint: PublicKey;
|
|
57
|
+
assetsMint: PublicKey;
|
|
58
|
+
fundAuthority: PublicKey;
|
|
59
|
+
nav: BN;
|
|
60
|
+
totalShares: BN;
|
|
61
|
+
navUpdatedAt: BN;
|
|
62
|
+
navMaxStaleness: BN;
|
|
63
|
+
bump: number;
|
|
64
|
+
vaultName: string;
|
|
65
|
+
pendingWithdrawalValue: BN;
|
|
66
|
+
feeRecipient: PublicKey;
|
|
67
|
+
performanceFeeBps: number;
|
|
68
|
+
assessmentIntervalSecs: BN;
|
|
69
|
+
lastAssessmentTimestamp: BN;
|
|
70
|
+
pricePerShareAtLastAssessment: BN;
|
|
71
|
+
keeperAuthority: PublicKey;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Decoded Gamma `WithdrawReceipt` account — tracks a user's queued withdrawal
|
|
75
|
+
* against a vault (pending → claimable).
|
|
76
|
+
*/
|
|
77
|
+
interface GammaWithdrawReceiptRaw {
|
|
78
|
+
pubkey: PublicKey;
|
|
79
|
+
user: PublicKey;
|
|
80
|
+
lpVault: PublicKey;
|
|
81
|
+
pendingShares: BN;
|
|
82
|
+
claimableShares: BN;
|
|
83
|
+
claimableAssets: BN;
|
|
84
|
+
oldestPendingAt: BN;
|
|
85
|
+
bump: number;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { type CurrentResult as C, type FeedResponse as F, type GammaLpVaultRaw as G, type OracleSubmission as O, type PullFeedAccountData as P, SWITCHBOARD_ONDEMANDE_PRICE_PRECISION as S, type GammaWithdrawReceiptRaw as a, type CrossbarSimulatePayload as b, decodeSwitchboardPullFeedData as d, getSwitchboardProgram as g, switchboardAccountCoder as s };
|