hedge-web3 0.2.20 → 0.2.24
Sign up to get free protection for your applications and to get access to all the features.
- package/declarations/Constants.d.ts +15 -0
- package/declarations/idl/pyth.d.ts +44 -24
- package/declarations/idl/switchboard.d.ts +47 -0
- package/declarations/idl/vault.d.ts +857 -157
- package/declarations/index.d.ts +26 -20
- package/declarations/instructions/closeLiquidationPoolPosition.d.ts +2 -2
- package/declarations/instructions/createReferralAccount.d.ts +17 -0
- package/declarations/instructions/createUserReferralAccount.d.ts +5 -0
- package/declarations/instructions/depositLiquidationPool.d.ts +2 -2
- package/declarations/instructions/loanVault.d.ts +2 -2
- package/declarations/instructions/psmEditAccount.d.ts +12 -0
- package/declarations/instructions/psmMintUsh.d.ts +2 -2
- package/declarations/instructions/psmRedeemUsh.d.ts +2 -2
- package/declarations/instructions/referralClaimFees.d.ts +16 -0
- package/declarations/instructions/transferVault.d.ts +3 -17
- package/declarations/instructions/updateReferralAccount.d.ts +13 -0
- package/declarations/instructions/updateReferralState.d.ts +20 -0
- package/declarations/instructions/updateVaultType.d.ts +1 -0
- package/declarations/state/VaultAccount.d.ts +2 -1
- package/lib/Constants.js +36 -1
- package/lib/idl/pyth.js +44 -24
- package/lib/idl/switchboard.js +49 -0
- package/lib/idl/vault.js +850 -150
- package/lib/index.js +26 -20
- package/lib/instructions/closeLiquidationPoolPosition.js +16 -3
- package/lib/instructions/createReferralAccount.js +80 -0
- package/lib/instructions/createUserReferralAccount.js +61 -0
- package/lib/instructions/depositLiquidationPool.js +16 -5
- package/lib/instructions/loanVault.js +16 -3
- package/lib/instructions/psmEditAccount.js +60 -0
- package/lib/instructions/psmMintUsh.js +14 -3
- package/lib/instructions/psmRedeemUsh.js +14 -3
- package/lib/instructions/referralClaimFees.js +84 -0
- package/lib/instructions/transferVault.js +10 -24
- package/lib/instructions/updateReferralAccount.js +50 -0
- package/lib/instructions/updateReferralState.js +57 -0
- package/lib/instructions/updateVaultType.js +10 -9
- package/package.json +1 -1
- package/src/Constants.ts +42 -0
- package/src/idl/pyth.ts +88 -48
- package/src/idl/switchboard.ts +93 -0
- package/src/idl/vault.ts +1762 -362
- package/src/index.ts +28 -24
- package/src/instructions/closeLiquidationPoolPosition.ts +25 -1
- package/src/instructions/createReferralAccount.ts +127 -0
- package/src/instructions/createUserReferralAccount.ts +86 -0
- package/src/instructions/depositLiquidationPool.ts +24 -4
- package/src/instructions/loanVault.ts +20 -1
- package/src/instructions/{psmEditAccount.rs → psmEditAccount.ts} +0 -0
- package/src/instructions/psmMintUsh.ts +20 -1
- package/src/instructions/psmRedeemUsh.ts +20 -1
- package/src/instructions/referralClaimFees.ts +159 -0
- package/src/instructions/transferVault.ts +21 -58
- package/src/instructions/updateReferralAccount.ts +77 -0
- package/src/instructions/updateReferralState.ts +93 -0
- package/src/instructions/updateVaultType.ts +3 -0
- package/src/state/VaultAccount.ts +1 -1
@@ -23,6 +23,21 @@ export declare function getUshMintPublicKey(): Promise<PublicKey>;
|
|
23
23
|
* @returns The Vault System State public key
|
24
24
|
*/
|
25
25
|
export declare function getVaultSystemStatePublicKey(): Promise<PublicKey>;
|
26
|
+
/**
|
27
|
+
*
|
28
|
+
* @returns The Referral State public key
|
29
|
+
*/
|
30
|
+
export declare function getReferralStatePublicKey(): Promise<PublicKey>;
|
31
|
+
/**
|
32
|
+
*
|
33
|
+
* @returns The Referral State public key based off the owner's public key
|
34
|
+
*/
|
35
|
+
export declare function getReferralAccountPublicKey(ownerPublicKey: PublicKey): Promise<PublicKey>;
|
36
|
+
/**
|
37
|
+
*
|
38
|
+
* @returns The user referral account public key based off the user's public key
|
39
|
+
*/
|
40
|
+
export declare function getUserReferralAccountPublicKey(ownerPublicKey: PublicKey): Promise<PublicKey>;
|
26
41
|
/**
|
27
42
|
*
|
28
43
|
* @returns The HDG mint public key
|
@@ -5,19 +5,9 @@ export declare type Pyth = {
|
|
5
5
|
{
|
6
6
|
"name": "initialize";
|
7
7
|
"accounts": [
|
8
|
-
{
|
9
|
-
"name": "payer";
|
10
|
-
"isMut": true;
|
11
|
-
"isSigner": true;
|
12
|
-
},
|
13
8
|
{
|
14
9
|
"name": "price";
|
15
10
|
"isMut": true;
|
16
|
-
"isSigner": true;
|
17
|
-
},
|
18
|
-
{
|
19
|
-
"name": "systemProgram";
|
20
|
-
"isMut": false;
|
21
11
|
"isSigner": false;
|
22
12
|
}
|
23
13
|
];
|
@@ -53,27 +43,57 @@ export declare type Pyth = {
|
|
53
43
|
];
|
54
44
|
}
|
55
45
|
];
|
56
|
-
"
|
46
|
+
"types": [
|
57
47
|
{
|
58
|
-
"name": "
|
48
|
+
"name": "PriceStatus";
|
59
49
|
"type": {
|
60
|
-
"kind": "
|
61
|
-
"
|
50
|
+
"kind": "enum";
|
51
|
+
"variants": [
|
52
|
+
{
|
53
|
+
"name": "Unknown";
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"name": "Trading";
|
57
|
+
},
|
62
58
|
{
|
63
|
-
"name": "
|
64
|
-
|
65
|
-
|
66
|
-
|
59
|
+
"name": "Halted";
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"name": "Auction";
|
67
63
|
}
|
68
64
|
];
|
69
65
|
};
|
70
|
-
}
|
71
|
-
|
72
|
-
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"name": "CorpAction";
|
69
|
+
"type": {
|
70
|
+
"kind": "enum";
|
71
|
+
"variants": [
|
72
|
+
{
|
73
|
+
"name": "NoCorpAct";
|
74
|
+
}
|
75
|
+
];
|
76
|
+
};
|
77
|
+
},
|
73
78
|
{
|
74
|
-
"
|
75
|
-
"
|
76
|
-
|
79
|
+
"name": "PriceType";
|
80
|
+
"type": {
|
81
|
+
"kind": "enum";
|
82
|
+
"variants": [
|
83
|
+
{
|
84
|
+
"name": "Unknown";
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"name": "Price";
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"name": "TWAP";
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"name": "Volatility";
|
94
|
+
}
|
95
|
+
];
|
96
|
+
};
|
77
97
|
}
|
78
98
|
];
|
79
99
|
};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
export declare type Switchboard = {
|
2
|
+
"version": "0.1.0";
|
3
|
+
"name": "switchboard";
|
4
|
+
"instructions": [
|
5
|
+
{
|
6
|
+
"name": "initialize";
|
7
|
+
"accounts": [
|
8
|
+
{
|
9
|
+
"name": "aggregator";
|
10
|
+
"isMut": true;
|
11
|
+
"isSigner": false;
|
12
|
+
}
|
13
|
+
];
|
14
|
+
"args": [
|
15
|
+
{
|
16
|
+
"name": "price";
|
17
|
+
"type": "u64";
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"name": "scale";
|
21
|
+
"type": "u16";
|
22
|
+
}
|
23
|
+
];
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"name": "setPrice";
|
27
|
+
"accounts": [
|
28
|
+
{
|
29
|
+
"name": "aggregator";
|
30
|
+
"isMut": true;
|
31
|
+
"isSigner": false;
|
32
|
+
}
|
33
|
+
];
|
34
|
+
"args": [
|
35
|
+
{
|
36
|
+
"name": "price";
|
37
|
+
"type": "u64";
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"name": "scale";
|
41
|
+
"type": "u16";
|
42
|
+
}
|
43
|
+
];
|
44
|
+
}
|
45
|
+
];
|
46
|
+
};
|
47
|
+
export declare const IDL: Switchboard;
|