@glamsystems/glam-sdk 0.1.7 → 0.1.9
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/index.cjs.js +34983 -8827
- package/index.esm.js +34975 -8828
- package/package.json +9 -7
- package/src/client/base.d.ts +22 -8
- package/src/client/drift.d.ts +33 -18
- package/src/client/investor.d.ts +10 -5
- package/src/client/jupiter.d.ts +23 -3
- package/src/client/marinade.d.ts +17 -17
- package/src/client/meteora.d.ts +31 -0
- package/src/client/mint.d.ts +51 -23
- package/src/client/price.d.ts +18 -0
- package/src/client/staking.d.ts +19 -20
- package/src/client/state.d.ts +14 -18
- package/src/client/wsol.d.ts +4 -4
- package/src/client.d.ts +7 -1
- package/src/constants.d.ts +6 -0
- package/src/glamExports.d.ts +5 -5
- package/src/index.d.ts +1 -0
- package/src/models.d.ts +34 -27
- package/src/react/glam.d.ts +2 -2
- package/src/utils/helpers.d.ts +5 -0
- package/target/idl/{glam.json → glam_protocol.json} +6498 -3229
- package/target/types/{glam.d.ts → glam_protocol.d.ts} +6480 -3211
- package/target/types/{glam.ts → glam_protocol.ts} +6500 -3231
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glamsystems/glam-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "TypeScript SDK for the GLAM Protocol",
|
|
5
5
|
"main": "./index.cjs.js",
|
|
6
6
|
"module": "./index.esm.js",
|
|
7
7
|
"homepage": "https://www.glam.systems",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git@github.com:glamsystems/glam.git"
|
|
10
|
+
"url": "git@github.com:glamsystems/glam-sdk.git"
|
|
11
11
|
},
|
|
12
12
|
"keywords": [
|
|
13
13
|
"glam",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@coral-xyz/anchor": "^0.
|
|
22
|
-
"@coral-xyz/borsh": "^0.
|
|
23
|
-
"@drift-labs/sdk": "2.
|
|
21
|
+
"@coral-xyz/anchor": "^0.31.0",
|
|
22
|
+
"@coral-xyz/borsh": "^0.31.0",
|
|
23
|
+
"@drift-labs/sdk": "2.114.0-beta.3",
|
|
24
24
|
"@marinade.finance/marinade-ts-sdk": "^5.0.15",
|
|
25
25
|
"@pythnetwork/client": "^2.21.1",
|
|
26
26
|
"@solana/spl-stake-pool": "^1.1.5",
|
|
@@ -40,10 +40,12 @@
|
|
|
40
40
|
"pnpm": {
|
|
41
41
|
"overrides": {
|
|
42
42
|
"@solana/web3.js@>=0.0.1": "^1.98.0",
|
|
43
|
-
"@solana/spl-token@>=0.0.1": "^0.
|
|
43
|
+
"@solana/spl-token@>=0.0.1": "^0.4.6",
|
|
44
44
|
"@solana/spl-stake-pool@>=0.0.1": "^1.1.5",
|
|
45
45
|
"typescript@>=0.0.1": "^5.5.3",
|
|
46
|
+
"@coral-xyz/anchor": "^0.28.0",
|
|
46
47
|
"solana-bankrun@>=0.0.1": "^0.3.0"
|
|
47
48
|
}
|
|
48
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"types": "./index.esm.d.ts"
|
|
49
51
|
}
|
package/src/client/base.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as anchor from "@coral-xyz/anchor";
|
|
2
|
+
import { BN } from "@coral-xyz/anchor";
|
|
2
3
|
import { Wallet } from "@coral-xyz/anchor";
|
|
3
4
|
import { AddressLookupTableAccount, Keypair, PublicKey, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
4
5
|
import { Mint } from "@solana/spl-token";
|
|
@@ -7,8 +8,7 @@ import { ClusterNetwork, GlamClientConfig } from "../clientConfig";
|
|
|
7
8
|
import { StateAccount, OpenfundsMetadataAccount, StateModel } from "../models";
|
|
8
9
|
import { AssetMeta } from "./assets";
|
|
9
10
|
import { BlockhashWithCache } from "../utils/blockhash";
|
|
10
|
-
export declare const JUPITER_API_DEFAULT = "https://
|
|
11
|
-
export declare const JITO_TIP_DEFAULT: anchor.web3.PublicKey;
|
|
11
|
+
export declare const JUPITER_API_DEFAULT = "https://lite-api.jup.ag";
|
|
12
12
|
export declare const isBrowser: string | boolean;
|
|
13
13
|
export type TxOptions = {
|
|
14
14
|
signer?: PublicKey;
|
|
@@ -50,7 +50,7 @@ export declare class BaseClient {
|
|
|
50
50
|
getAssetMeta(assetMint: string): AssetMeta;
|
|
51
51
|
private getComputeBudgetIxs;
|
|
52
52
|
intoVersionedTransaction(tx: Transaction, { lookupTables, signer, computeUnitLimit, getPriorityFeeMicroLamports, maxFeeLamports, useMaxFee, jitoTipLamports, simulate, }: TxOptions): Promise<VersionedTransaction>;
|
|
53
|
-
sendAndConfirm(tx: VersionedTransaction | Transaction,
|
|
53
|
+
sendAndConfirm(tx: VersionedTransaction | Transaction, additionalSigners?: Keypair[]): Promise<TransactionSignature>;
|
|
54
54
|
parseProgramLogs(logs?: null | string[]): string;
|
|
55
55
|
getAdressLookupTableAccounts(keys?: string[]): Promise<AddressLookupTableAccount[]>;
|
|
56
56
|
getWallet(): Wallet;
|
|
@@ -58,7 +58,8 @@ export declare class BaseClient {
|
|
|
58
58
|
getAta(mint: PublicKey, owner: PublicKey, tokenProgram?: anchor.web3.PublicKey): PublicKey;
|
|
59
59
|
getStatePda(stateModel: Partial<StateModel>): PublicKey;
|
|
60
60
|
getVaultPda(statePda: PublicKey): PublicKey;
|
|
61
|
-
|
|
61
|
+
getEscrowPda(statePda: PublicKey): PublicKey;
|
|
62
|
+
getVaultAta(glamState: PublicKey, mint: PublicKey, programId?: PublicKey): PublicKey;
|
|
62
63
|
/**
|
|
63
64
|
* Fetch all the token accounts (including token program and token 2022 program) owned by a public key.
|
|
64
65
|
*
|
|
@@ -67,7 +68,7 @@ export declare class BaseClient {
|
|
|
67
68
|
*/
|
|
68
69
|
getTokenAccountsByOwner(owner: PublicKey): Promise<TokenAccount[]>;
|
|
69
70
|
getVaultBalance(statePda: PublicKey): Promise<number>;
|
|
70
|
-
getVaultTokenBalance(
|
|
71
|
+
getVaultTokenBalance(glamState: PublicKey, mint: PublicKey, programId?: PublicKey): Promise<number>;
|
|
71
72
|
fetchMintWithOwner(asset: PublicKey): Promise<{
|
|
72
73
|
mint: Mint;
|
|
73
74
|
tokenProgram: anchor.web3.PublicKey;
|
|
@@ -75,7 +76,10 @@ export declare class BaseClient {
|
|
|
75
76
|
getOpenfundsPda(statePda: PublicKey): PublicKey;
|
|
76
77
|
getMintPda(statePda: PublicKey, mintIdx?: number): PublicKey;
|
|
77
78
|
getMintAta(user: PublicKey, mintPda: PublicKey): PublicKey;
|
|
79
|
+
getExtraMetasPda(glamState: PublicKey, mintIdx?: number): PublicKey;
|
|
80
|
+
getAccountPolicyPda(glamState: PublicKey, subject: PublicKey, mintIdx?: number): PublicKey;
|
|
78
81
|
getName(stateModel: Partial<StateModel>): string;
|
|
82
|
+
isLockupEnabled(statePda: PublicKey, mintIdx?: number): Promise<boolean>;
|
|
79
83
|
fetchStateAccount(statePda: PublicKey): Promise<StateAccount>;
|
|
80
84
|
fetchOpenfundsMetadataAccount(state: PublicKey): Promise<OpenfundsMetadataAccount>;
|
|
81
85
|
fetchMintAccount(state: PublicKey, mintIdx: number): Promise<Mint>;
|
|
@@ -83,9 +87,9 @@ export declare class BaseClient {
|
|
|
83
87
|
* Generates instructions to wrap SOL into wSOL if the vault doesn't have enough wSOL
|
|
84
88
|
*
|
|
85
89
|
* @param lamports Desired amount of wSOL
|
|
86
|
-
* @returns
|
|
90
|
+
* @returns Array of instructions, null if no instructions are needed
|
|
87
91
|
*/
|
|
88
|
-
maybeWrapSol(
|
|
92
|
+
maybeWrapSol(glamState: PublicKey, lamports: number | BN, signer?: PublicKey): Promise<TransactionInstruction[]>;
|
|
89
93
|
getAssetIdFromCurrency(currency: string): string;
|
|
90
94
|
listGlamStates(): Promise<PublicKey[]>;
|
|
91
95
|
/**
|
|
@@ -95,5 +99,15 @@ export declare class BaseClient {
|
|
|
95
99
|
* @returns
|
|
96
100
|
*/
|
|
97
101
|
fetchState(statePda: PublicKey): Promise<StateModel>;
|
|
98
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Fetch all glam states if no filter options provided
|
|
104
|
+
*
|
|
105
|
+
* @param filterOptions
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
fetchGlamStates(filterOptions?: {
|
|
109
|
+
owner?: PublicKey;
|
|
110
|
+
delegate?: PublicKey;
|
|
111
|
+
type?: string;
|
|
112
|
+
}): Promise<StateModel[]>;
|
|
99
113
|
}
|
package/src/client/drift.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as anchor from "@coral-xyz/anchor";
|
|
2
|
-
import { PublicKey, VersionedTransaction, TransactionSignature } from "@solana/web3.js";
|
|
2
|
+
import { PublicKey, VersionedTransaction, TransactionSignature, TransactionInstruction } from "@solana/web3.js";
|
|
3
3
|
import { MarketType, OrderParams, PositionDirection, SpotPosition, PerpPosition, ModifyOrderParams } from "@drift-labs/sdk";
|
|
4
4
|
import { BaseClient, TxOptions } from "./base";
|
|
5
5
|
import { AccountMeta } from "@solana/web3.js";
|
|
@@ -45,31 +45,38 @@ export interface DriftMarketConfigs {
|
|
|
45
45
|
export interface GlamDriftUser {
|
|
46
46
|
delegate: string;
|
|
47
47
|
name: string;
|
|
48
|
-
spotPositions: SpotPosition
|
|
48
|
+
spotPositions: (SpotPosition & {
|
|
49
|
+
balance: string;
|
|
50
|
+
})[];
|
|
49
51
|
perpPositions: PerpPosition[];
|
|
50
52
|
marginMode: string;
|
|
51
53
|
subAccountId: number;
|
|
52
54
|
isMarginTradingEnabled: boolean;
|
|
55
|
+
maxMarginRatio: number;
|
|
53
56
|
}
|
|
54
57
|
export declare class DriftClient {
|
|
55
58
|
readonly base: BaseClient;
|
|
56
59
|
constructor(base: BaseClient);
|
|
57
|
-
initialize(statePda: PublicKey): Promise<TransactionSignature>;
|
|
60
|
+
initialize(statePda: PublicKey, subAccountId?: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
58
61
|
updateUserCustomMarginRatio(statePda: PublicKey, maxLeverage: number, // 1=1x, 2=2x ... 50=50x leverage
|
|
59
62
|
subAccountId?: number): Promise<TransactionSignature>;
|
|
60
|
-
updateUserMarginTradingEnabled(statePda: PublicKey, marginTradingEnabled: boolean, subAccountId?: number): Promise<TransactionSignature>;
|
|
61
|
-
updateUserDelegate(statePda: PublicKey |
|
|
62
|
-
deleteUser(statePda: PublicKey |
|
|
63
|
-
deposit(statePda: PublicKey, amount: anchor.BN, marketIndex: number, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
64
|
-
withdraw(statePda: PublicKey, amount: anchor.BN, marketIndex: number, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
65
|
-
placeOrder(statePda: PublicKey, orderParams: OrderParams, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
66
|
-
modifyOrder(statePda: PublicKey, modifyOrderParams: ModifyOrderParams, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
67
|
-
cancelOrders(statePda: PublicKey, marketType: MarketType, marketIndex: number, direction: PositionDirection, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
68
|
-
cancelOrdersByIds(statePda: PublicKey, orderIds: number[], subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
69
|
-
|
|
70
|
-
getUser(statePda: PublicKey, subAccountId?: number): PublicKey[];
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
updateUserMarginTradingEnabled(statePda: PublicKey, marginTradingEnabled: boolean, subAccountId?: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
64
|
+
updateUserDelegate(statePda: PublicKey | string, delegate: PublicKey | string, subAccountId?: number): Promise<TransactionSignature>;
|
|
65
|
+
deleteUser(statePda: PublicKey | string, subAccountId?: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
66
|
+
deposit(statePda: PublicKey | string, amount: anchor.BN, marketIndex: number, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
67
|
+
withdraw(statePda: PublicKey | string, amount: anchor.BN, marketIndex: number, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
68
|
+
placeOrder(statePda: PublicKey | string, orderParams: OrderParams, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
69
|
+
modifyOrder(statePda: PublicKey | string, modifyOrderParams: ModifyOrderParams, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
70
|
+
cancelOrders(statePda: PublicKey | string, marketType: MarketType, marketIndex: number, direction: PositionDirection, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
71
|
+
cancelOrdersByIds(statePda: PublicKey | string, orderIds: number[], subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
72
|
+
priceDrift(statePda: PublicKey | string, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
73
|
+
getUser(statePda: PublicKey | string, subAccountId?: number): PublicKey[];
|
|
74
|
+
fetchMarketConfigs(): Promise<DriftMarketConfigs>;
|
|
75
|
+
fetchGlamDriftUser(glamState: PublicKey | string, subAccountId?: number): Promise<GlamDriftUser>;
|
|
76
|
+
getPositions(statePda: PublicKey | string, subAccountId?: number): Promise<{
|
|
77
|
+
spotPositions: (SpotPosition & {
|
|
78
|
+
balance: string;
|
|
79
|
+
})[];
|
|
73
80
|
perpPositions: PerpPosition[];
|
|
74
81
|
}>;
|
|
75
82
|
fetchPolicyConfig(glamState: StateModel): Promise<{
|
|
@@ -81,18 +88,26 @@ export declare class DriftClient {
|
|
|
81
88
|
driftEnableSpot: any;
|
|
82
89
|
driftMarketIndexesSpot: number[];
|
|
83
90
|
}>;
|
|
91
|
+
marketTypeEquals: (a: MarketType | undefined, b: MarketType) => boolean;
|
|
84
92
|
composeRemainingAccounts(glamState: PublicKey, subAccountId: number, marketConfigs: DriftMarketConfigs, marketType?: MarketType, marketIndex?: number): Promise<AccountMeta[]>;
|
|
85
|
-
|
|
93
|
+
initializeUserStatsIx(glamState: PublicKey, glamSigner: PublicKey): Promise<TransactionInstruction>;
|
|
94
|
+
initializeUserIx(glamState: PublicKey, glamSigner: PublicKey, subAccountId: number): Promise<TransactionInstruction>;
|
|
95
|
+
initializeTx(glamState: PublicKey, subAccountId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
96
|
+
updateUserCustomMarginRatioIx(glamState: PublicKey, maxLeverage: number, // 1=1x, 2=2x ... 50=50x leverage
|
|
97
|
+
subAccountId?: number, txOptions?: TxOptions): Promise<TransactionInstruction>;
|
|
86
98
|
updateUserCustomMarginRatioTx(glamState: PublicKey, maxLeverage: number, // 1=1x, 2=2x ... 50=50x leverage
|
|
87
99
|
subAccountId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
100
|
+
updateUserMarginTradingEnabledIx(glamState: PublicKey, marginTradingEnabled: boolean, subAccountId?: number, txOptions?: TxOptions): Promise<TransactionInstruction>;
|
|
88
101
|
updateUserMarginTradingEnabledTx(glamState: PublicKey, marginTradingEnabled: boolean, subAccountId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
102
|
+
updateUserDelegateIx(glamState: PublicKey, delegate: PublicKey | string, subAccountId?: number, txOptions?: TxOptions): Promise<TransactionInstruction>;
|
|
89
103
|
updateUserDelegateTx(glamState: PublicKey, delegate: PublicKey, subAccountId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
90
104
|
deleteUserTx(glamState: PublicKey, subAccountId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
91
|
-
depositTx(
|
|
105
|
+
depositTx(glamState: PublicKey, amount: anchor.BN, marketIndex: number, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
92
106
|
withdrawTx(statePda: PublicKey, amount: anchor.BN, marketIndex: number, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
93
107
|
placeOrderTx(glamState: PublicKey, orderParams: OrderParams, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
94
108
|
modifyOrderTx(statePda: PublicKey, modifyOrderParams: ModifyOrderParams, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
95
109
|
cancelOrdersTx(glamState: PublicKey, marketType: MarketType, marketIndex: number, direction: PositionDirection, subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
96
110
|
cancelOrdersByIdsTx(glamState: PublicKey, orderIds: number[], subAccountId: number, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
111
|
+
priceDriftTx(glamState: PublicKey, marketConfigs: DriftMarketConfigs, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
97
112
|
}
|
|
98
113
|
export {};
|
package/src/client/investor.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { BN } from "@coral-xyz/anchor";
|
|
2
2
|
import { PublicKey, TransactionSignature, VersionedTransaction } from "@solana/web3.js";
|
|
3
3
|
import { BaseClient, TxOptions } from "./base";
|
|
4
|
-
import { StateModel } from "../models";
|
|
5
4
|
export declare class InvestorClient {
|
|
6
5
|
readonly base: BaseClient;
|
|
7
6
|
constructor(base: BaseClient);
|
|
8
|
-
subscribe(statePda: PublicKey, asset: PublicKey, amount: BN,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
subscribe(statePda: PublicKey, asset: PublicKey, amount: BN, mintId?: number, queued?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
8
|
+
queuedRedeem(statePda: PublicKey, asset: PublicKey, amount: BN, mintId?: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
9
|
+
fulfill(statePda: PublicKey, asset: PublicKey, mintId?: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
10
|
+
claim(statePda: PublicKey, asset: PublicKey, mintId?: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
11
|
+
subscribeTx(glamState: PublicKey, asset: PublicKey, amount: BN, mintId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
12
|
+
queuedSubscribeTx(glamState: PublicKey, asset: PublicKey, amount: BN, mintId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
13
|
+
queuedRedeemTx(glamState: PublicKey, asset: PublicKey, amount: BN, mintId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
14
|
+
fulfillTx(glamState: PublicKey, asset: PublicKey, mintId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
15
|
+
claimAssetTx(glamState: PublicKey, asset: PublicKey, mintId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
16
|
+
claimShareTx(glamState: PublicKey, asset: PublicKey, mintId?: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
12
17
|
}
|
package/src/client/jupiter.d.ts
CHANGED
|
@@ -51,10 +51,21 @@ type SwapInstructions = {
|
|
|
51
51
|
export declare class JupiterSwapClient {
|
|
52
52
|
readonly base: BaseClient;
|
|
53
53
|
constructor(base: BaseClient);
|
|
54
|
-
swap(
|
|
54
|
+
swap(glamState: PublicKey, options: {
|
|
55
|
+
quoteParams?: QuoteParams;
|
|
56
|
+
quoteResponse?: QuoteResponse;
|
|
57
|
+
swapInstructions?: SwapInstructions;
|
|
58
|
+
}, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
55
59
|
setMaxSwapSlippage(statePda: PublicKey, slippageBps: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
fetchProgramLabels(): Promise<any>;
|
|
61
|
+
fetchTokenPrices(pubkeys: string[]): Promise<any>;
|
|
62
|
+
swapTx(glamState: PublicKey, options: {
|
|
63
|
+
quoteParams?: QuoteParams;
|
|
64
|
+
quoteResponse?: QuoteResponse;
|
|
65
|
+
swapInstructions?: SwapInstructions;
|
|
66
|
+
}, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
67
|
+
setMaxSwapSlippageTx(glamState: PublicKey, slippageBps: number, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
68
|
+
setMaxSwapSlippageIx(glamState: PublicKey, slippageBps: number, txOptions?: TxOptions): Promise<TransactionInstruction>;
|
|
58
69
|
getPreInstructions: (statePda: PublicKey, signer: PublicKey, inputMint: PublicKey, outputMint: PublicKey, amount: BN, inputTokenProgram?: PublicKey, outputTokenProgram?: PublicKey) => Promise<TransactionInstruction[]>;
|
|
59
70
|
getTokenProgram: (mint: PublicKey) => Promise<PublicKey>;
|
|
60
71
|
toTransactionInstruction: (ixPayload: InstructionFromJupiter, vaultStr: string) => TransactionInstruction;
|
|
@@ -82,6 +93,7 @@ export declare class JupiterVoteClient {
|
|
|
82
93
|
*/
|
|
83
94
|
unstakeJup(statePda: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
84
95
|
withdrawJup(statePda: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
96
|
+
claimAndStake(statePda: PublicKey, distributor: PublicKey, amountUnlocked: BN, amountLocked: BN, proof: number[][], txOptions?: TxOptions): Promise<string>;
|
|
85
97
|
cancelUnstake(statePda: PublicKey, txOptions?: TxOptions): Promise<string>;
|
|
86
98
|
/**
|
|
87
99
|
* Vote on a proposal. The vote account will be created if it doesn't exist.
|
|
@@ -93,7 +105,15 @@ export declare class JupiterVoteClient {
|
|
|
93
105
|
* @returns
|
|
94
106
|
*/
|
|
95
107
|
voteOnProposal(glamState: PublicKey, proposal: PublicKey, side: number, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
108
|
+
fetchVotes(glamState: PublicKey, proposals: PublicKey[] | string[]): Promise<{
|
|
109
|
+
proposal: PublicKey;
|
|
110
|
+
voter: PublicKey;
|
|
111
|
+
side: number;
|
|
112
|
+
}[]>;
|
|
96
113
|
get stakeLocker(): PublicKey;
|
|
114
|
+
getClaimStatus(claimant: PublicKey, distributor: PublicKey): PublicKey;
|
|
97
115
|
getEscrowPda(owner: PublicKey): PublicKey;
|
|
116
|
+
getVotePda(proposal: PublicKey, voter: PublicKey): PublicKey;
|
|
117
|
+
getGovernorPda(): PublicKey;
|
|
98
118
|
}
|
|
99
119
|
export {};
|
package/src/client/marinade.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { BN } from "@coral-xyz/anchor";
|
|
2
2
|
import { PublicKey, VersionedTransaction, TransactionSignature } from "@solana/web3.js";
|
|
3
3
|
import { BaseClient, TxOptions } from "./base";
|
|
4
|
+
export type Ticket = {
|
|
5
|
+
address: PublicKey;
|
|
6
|
+
lamports: number;
|
|
7
|
+
createdEpoch: number;
|
|
8
|
+
isDue: boolean;
|
|
9
|
+
isClaimable: boolean;
|
|
10
|
+
};
|
|
4
11
|
export declare class MarinadeClient {
|
|
5
12
|
readonly base: BaseClient;
|
|
6
13
|
constructor(base: BaseClient);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
getTickets(state: PublicKey): Promise<{
|
|
14
|
-
address: PublicKey;
|
|
15
|
-
lamports: number;
|
|
16
|
-
createdEpoch: number;
|
|
17
|
-
isDue: boolean;
|
|
18
|
-
}[]>;
|
|
14
|
+
deposit(statePda: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
15
|
+
depositStakeAccount(statePda: PublicKey, stakeAccount: PublicKey): Promise<TransactionSignature>;
|
|
16
|
+
orderUnstake(statePda: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
17
|
+
claim(statePda: PublicKey, tickets: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
18
|
+
getTickets(state: PublicKey): Promise<PublicKey[]>;
|
|
19
|
+
getParsedTickets(state: PublicKey): Promise<Ticket[]>;
|
|
19
20
|
getMarinadeState(): {
|
|
20
21
|
marinadeStateAddress: PublicKey;
|
|
21
22
|
msolMintAddress: PublicKey;
|
|
@@ -27,9 +28,8 @@ export declare class MarinadeClient {
|
|
|
27
28
|
solLeg: PublicKey;
|
|
28
29
|
};
|
|
29
30
|
getParsedStakeAccountInfo(stakeAccount: PublicKey): Promise<any>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
liquidUnstakeTx(statePda: PublicKey, amount: BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
31
|
+
depositTx(glamState: PublicKey, amount: BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
32
|
+
depositStakeAccountTx(glamState: PublicKey, stakeAccount: PublicKey, txOptions: TxOptions): Promise<any>;
|
|
33
|
+
orderUnstakeTx(glamState: PublicKey, amount: BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
34
|
+
claimTx(glamState: PublicKey, tickets: PublicKey[], txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
35
35
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BN } from "@coral-xyz/anchor";
|
|
2
|
+
import { PublicKey, TransactionSignature } from "@solana/web3.js";
|
|
3
|
+
import DLMM, { Strategy } from "@meteora-ag/dlmm";
|
|
4
|
+
import { BaseClient, TxOptions } from "./base";
|
|
5
|
+
export declare class MeteoraDlmmClient {
|
|
6
|
+
readonly base: BaseClient;
|
|
7
|
+
private _dlmmPool;
|
|
8
|
+
constructor(base: BaseClient);
|
|
9
|
+
getDlmmPool(pool: PublicKey | string): Promise<DLMM>;
|
|
10
|
+
initializePosition(statePda: PublicKey | string, pool: PublicKey | string, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
11
|
+
initializePositionPda(statePda: PublicKey | string, pool: PublicKey | string, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
12
|
+
addLiquidityByStrategy(statePda: PublicKey | string, position: PublicKey | string, amountX: BN | number, amountY: BN | number, strategyType: keyof typeof Strategy, txOptions?: TxOptions): Promise<string>;
|
|
13
|
+
removeLiquidityByRange(statePda: PublicKey | string, position: PublicKey | string, bpsToRemove: number, txOptions?: TxOptions): Promise<string>;
|
|
14
|
+
claimFee(statePda: PublicKey | string, position: PublicKey | string, txOptions?: TxOptions): Promise<string>;
|
|
15
|
+
closePosition(statePda: PublicKey | string, position: PublicKey | string, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
16
|
+
getPositionPda(lbPair: PublicKey, base: PublicKey, lowerBinId: number, // i32
|
|
17
|
+
width: number): PublicKey;
|
|
18
|
+
fetchPositions(owner: PublicKey): Promise<PublicKey[]>;
|
|
19
|
+
parsePosition(position: PublicKey): Promise<{
|
|
20
|
+
lowerBinId: number;
|
|
21
|
+
upperBinId: number;
|
|
22
|
+
binArrayLower: PublicKey;
|
|
23
|
+
binArrayUpper: PublicKey;
|
|
24
|
+
lbPair: PublicKey;
|
|
25
|
+
}>;
|
|
26
|
+
autoFillY(dlmmPool: DLMM, amountX: BN): Promise<{
|
|
27
|
+
amountX: BN;
|
|
28
|
+
amountY: BN;
|
|
29
|
+
activeBinId: number;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
package/src/client/mint.d.ts
CHANGED
|
@@ -1,44 +1,72 @@
|
|
|
1
1
|
import * as anchor from "@coral-xyz/anchor";
|
|
2
2
|
import { PublicKey, TransactionSignature } from "@solana/web3.js";
|
|
3
3
|
import { BaseClient, TokenAccount, TxOptions } from "./base";
|
|
4
|
+
import { MintModel } from "../models";
|
|
4
5
|
export declare class MintClient {
|
|
5
6
|
readonly base: BaseClient;
|
|
6
7
|
constructor(base: BaseClient);
|
|
8
|
+
fetchTokenHolders(state: PublicKey): Promise<TokenAccount[]>;
|
|
7
9
|
getHolders(state: PublicKey, mintId?: number): Promise<TokenAccount[]>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
update(glamState: PublicKey, mintId: number, mintModel: Partial<MintModel>): Promise<string>;
|
|
11
|
+
closeMintIx(glamState: PublicKey, mintId?: number): Promise<anchor.web3.TransactionInstruction>;
|
|
12
|
+
closeMint(glamState: PublicKey, mintId?: number, txOptions?: TxOptions): Promise<string>;
|
|
10
13
|
/**
|
|
11
|
-
* Create a
|
|
14
|
+
* Create a glam mint token account for a specific user
|
|
12
15
|
*
|
|
13
|
-
* @param
|
|
14
|
-
* @param owner
|
|
15
|
-
* @param mintId
|
|
16
|
+
* @param glamState
|
|
17
|
+
* @param owner Owner of the token account
|
|
18
|
+
* @param mintId ID of the mint (only 0 is supported)
|
|
19
|
+
* @param setFrozen If true, the token account will be frozen
|
|
16
20
|
* @param txOptions
|
|
17
|
-
* @returns
|
|
21
|
+
* @returns Transaction signature
|
|
18
22
|
*/
|
|
19
|
-
createTokenAccount(
|
|
23
|
+
createTokenAccount(glamState: PublicKey, owner: PublicKey, mintId?: number, setFrozen?: boolean, txOptions?: TxOptions): Promise<string>;
|
|
20
24
|
/**
|
|
21
|
-
* Freeze or
|
|
25
|
+
* Freeze or unfreeze token accounts of a glam mint
|
|
22
26
|
*
|
|
23
|
-
* @param
|
|
24
|
-
* @param mintId
|
|
25
|
-
* @param
|
|
27
|
+
* @param glamState
|
|
28
|
+
* @param mintId ID of the mint (only 0 is supported)
|
|
29
|
+
* @param tokenAccounts List of token accounts to freeze or unfreeze
|
|
30
|
+
* @param frozen If true, the token accounts will be frozen; otherwise, they will be unfrozen
|
|
26
31
|
* @param txOptions
|
|
27
|
-
* @returns
|
|
32
|
+
* @returns Transaction signature
|
|
33
|
+
*/
|
|
34
|
+
setTokenAccountsStates(glamState: PublicKey, mintId: number, tokenAccounts: PublicKey[], frozen: boolean, txOptions?: TxOptions): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Mint tokens to recipient. Token account will be created if it does not exist.
|
|
37
|
+
*
|
|
38
|
+
* @param glamState
|
|
39
|
+
* @param mintId ID of the mint (only 0 is supported)
|
|
40
|
+
* @param recipient Recipient public key
|
|
41
|
+
* @param amount Amount of tokens to mint
|
|
42
|
+
* @param forceThaw If true, automatically unfreeze the token account before minting
|
|
43
|
+
* @param txOptions
|
|
44
|
+
* @returns Transaction signature
|
|
28
45
|
*/
|
|
29
|
-
|
|
46
|
+
mint(glamState: PublicKey, mintId: number, recipient: PublicKey, amount: anchor.BN, forceThaw?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
30
47
|
/**
|
|
31
|
-
*
|
|
48
|
+
* Burn tokens from a token account
|
|
32
49
|
*
|
|
33
|
-
* @param
|
|
34
|
-
* @param mintId
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param forceThaw If true,
|
|
50
|
+
* @param glamState
|
|
51
|
+
* @param mintId ID of the mint (only 0 is supported)
|
|
52
|
+
* @param amount Amount of tokens to burn
|
|
53
|
+
* @param from Owner of the token account
|
|
54
|
+
* @param forceThaw If true, automatically unfree the token account before burning
|
|
38
55
|
* @param txOptions
|
|
39
56
|
* @returns Transaction signature
|
|
40
57
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
burn(glamState: PublicKey, mintId: number, amount: anchor.BN, from: PublicKey, forceThaw?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
59
|
+
/**
|
|
60
|
+
* Transfer tokens from one token account to another
|
|
61
|
+
*
|
|
62
|
+
* @param glamState
|
|
63
|
+
* @param mintId ID of the mint (only 0 is supported)
|
|
64
|
+
* @param amount Amount of tokens to transfer
|
|
65
|
+
* @param from Owner of the sender token account
|
|
66
|
+
* @param to Owner of the recipient token account
|
|
67
|
+
* @param forceThaw If true, automatically unfree the token accounts before transfer
|
|
68
|
+
* @param txOptions
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
forceTransfer(glamState: PublicKey, mintId: number, amount: anchor.BN, from: PublicKey, to: PublicKey, forceThaw?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
44
72
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
2
|
+
import { BN } from "@coral-xyz/anchor";
|
|
3
|
+
import { BaseClient } from "./base";
|
|
4
|
+
export declare class PriceClient {
|
|
5
|
+
readonly base: BaseClient;
|
|
6
|
+
constructor(base: BaseClient);
|
|
7
|
+
/**
|
|
8
|
+
* !! This is a convenience method that calculates the AUM of the vault based on priced assets.
|
|
9
|
+
* !! It doesn't reflect the actual AUM of the vault. If the vault has not been priced or pricing data is outdated, the number is NOT meaningful.
|
|
10
|
+
*/
|
|
11
|
+
getAum(glamState: PublicKey): Promise<BN>;
|
|
12
|
+
priceVaultIxs(glamState: PublicKey): Promise<TransactionInstruction[]>;
|
|
13
|
+
remainingAccountsForPricing: (glamState: PublicKey) => Promise<{
|
|
14
|
+
pubkey: PublicKey;
|
|
15
|
+
isSigner: boolean;
|
|
16
|
+
isWritable: boolean;
|
|
17
|
+
}[]>;
|
|
18
|
+
}
|
package/src/client/staking.d.ts
CHANGED
|
@@ -22,42 +22,41 @@ export declare class StakingClient {
|
|
|
22
22
|
readonly base: BaseClient;
|
|
23
23
|
readonly marinade: MarinadeClient;
|
|
24
24
|
constructor(base: BaseClient, marinade: MarinadeClient);
|
|
25
|
-
unstake(
|
|
26
|
-
stakePoolDepositSol(
|
|
27
|
-
stakePoolDepositStake(
|
|
28
|
-
stakePoolWithdrawStake(
|
|
29
|
-
initializeAndDelegateStake(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
unstake(glamState: PublicKey, asset: PublicKey, amount: number | BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
26
|
+
stakePoolDepositSol(glamState: PublicKey, stakePool: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
27
|
+
stakePoolDepositStake(glamState: PublicKey, stakePool: PublicKey, stakeAccount: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
28
|
+
stakePoolWithdrawStake(glamState: PublicKey, stakePool: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
29
|
+
initializeAndDelegateStake(glamState: PublicKey, vote: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
30
|
+
deactivate(glamState: PublicKey, stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
31
|
+
withdraw(glamState: PublicKey, stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
32
|
+
merge(glamState: PublicKey, destinationStake: PublicKey, sourceStake: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
33
|
+
split(glamState: PublicKey, existingStake: PublicKey, lamports: BN, txOptions?: TxOptions): Promise<{
|
|
34
34
|
newStake: PublicKey;
|
|
35
35
|
txSig: TransactionSignature;
|
|
36
36
|
}>;
|
|
37
|
-
|
|
37
|
+
redelegate(glamState: PublicKey, existingStake: PublicKey, vote: PublicKey, txOptions?: TxOptions): Promise<{
|
|
38
38
|
newStake: PublicKey;
|
|
39
39
|
txSig: TransactionSignature;
|
|
40
40
|
}>;
|
|
41
41
|
getStakeAccountPda(state: PublicKey, accountId: string): [PublicKey, number];
|
|
42
42
|
getStakePoolWithdrawAuthority(programId: PublicKey, stakePool: PublicKey): PublicKey;
|
|
43
43
|
getStakePoolDepositAuthority(programId: PublicKey, stakePool: PublicKey): PublicKey;
|
|
44
|
-
getStakeAccounts(withdrawAuthority: PublicKey): Promise<PublicKey[]>;
|
|
45
44
|
getStakeAccountsWithStates(withdrawAuthority: PublicKey): Promise<StakeAccountInfo[]>;
|
|
46
45
|
getStakeAccountVoter(stakeAccount: PublicKey): Promise<PublicKey | null>;
|
|
47
46
|
getStakePoolAccountData(stakePool: PublicKey): Promise<StakePoolAccountData>;
|
|
48
47
|
createStakeAccount(signer: PublicKey): Promise<[PublicKey, TransactionInstruction]>;
|
|
49
|
-
stakePoolDepositSolTx(
|
|
50
|
-
stakePoolDepositStakeTx(
|
|
51
|
-
stakePoolWithdrawStakeTx(
|
|
52
|
-
initializeAndDelegateStakeTx(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
stakePoolDepositSolTx(glamState: PublicKey, stakePool: PublicKey, lamports: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
49
|
+
stakePoolDepositStakeTx(glamState: PublicKey, stakePool: PublicKey, stakeAccount: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
50
|
+
stakePoolWithdrawStakeTx(glamState: PublicKey, stakePool: PublicKey, amount: BN, deactivate?: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
51
|
+
initializeAndDelegateStakeTx(glamState: PublicKey, vote: PublicKey, amount: BN, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
52
|
+
deactivateStakeTx(glamState: PublicKey, stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
53
|
+
withdrawStakeTx(glamState: PublicKey, stakeAccounts: PublicKey[], txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
54
|
+
mergeStakeTx(glamState: PublicKey, destinationStake: PublicKey, sourceStake: PublicKey, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
55
|
+
splitStakeTx(glamState: PublicKey, existingStake: PublicKey, lamports: BN, txOptions?: TxOptions): Promise<{
|
|
57
56
|
tx: VersionedTransaction;
|
|
58
57
|
newStake: PublicKey;
|
|
59
58
|
}>;
|
|
60
|
-
redelegateStakeTx(
|
|
59
|
+
redelegateStakeTx(glamState: PublicKey, existingStake: PublicKey, vote: PublicKey, txOptions?: TxOptions): Promise<{
|
|
61
60
|
tx: VersionedTransaction;
|
|
62
61
|
newStake: PublicKey;
|
|
63
62
|
}>;
|
package/src/client/state.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export declare class StateClient {
|
|
|
7
7
|
readonly base: BaseClient;
|
|
8
8
|
constructor(base: BaseClient);
|
|
9
9
|
createState(partialStateModel: Partial<StateModel>, singleTx?: boolean, txOptions?: TxOptions): Promise<[TransactionSignature, PublicKey]>;
|
|
10
|
-
updateState(
|
|
11
|
-
updateStateTx(
|
|
12
|
-
closeState(
|
|
10
|
+
updateState(glamState: PublicKeyOrString, updated: Partial<StateModel>, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
11
|
+
updateStateTx(glamState: PublicKey, updated: Partial<StateModel>, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
12
|
+
closeState(glamState: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
13
13
|
/**
|
|
14
14
|
* Create a full state model from a partial state model
|
|
15
15
|
*/
|
|
@@ -22,23 +22,19 @@ export declare class StateClient {
|
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
24
|
deleteDelegateAcls(statePda: PublicKey, delegates: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
25
|
-
upsertDelegateAcls(
|
|
26
|
-
|
|
27
|
-
closeTokenAccounts(statePda: PublicKey, tokenAccounts: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
25
|
+
upsertDelegateAcls(glamState: PublicKey, delegateAcls: DelegateAcl[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
26
|
+
closeTokenAccounts(glamState: PublicKey, tokenAccounts: PublicKey[], txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
28
27
|
/**
|
|
29
|
-
* Close
|
|
30
|
-
*
|
|
31
|
-
* @param statePda
|
|
32
|
-
* @param tokenAccounts
|
|
33
|
-
* @param txOptions
|
|
34
|
-
* @returns
|
|
28
|
+
* Close vault's token accounts, all token accounts must use the same token program
|
|
35
29
|
*/
|
|
36
|
-
|
|
37
|
-
closeTokenAccountsTx(
|
|
38
|
-
deposit(
|
|
39
|
-
|
|
30
|
+
closeTokenAccountIx(glamState: PublicKey, tokenAccounts: PublicKey[], tokenProgram?: PublicKey, txOptions?: TxOptions): Promise<TransactionInstruction>;
|
|
31
|
+
closeTokenAccountsTx(glamState: PublicKey, accounts: PublicKey[], txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
32
|
+
deposit(glamState: PublicKey | string, asset: PublicKey | string, amount: number | BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
33
|
+
depositSol(glamState: PublicKey, lamports: number | BN, wrap?: boolean, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
34
|
+
depositSolTx(glamState: PublicKey, lamports: number | BN, wrap?: boolean, txOptions?: TxOptions): Promise<VersionedTransaction>;
|
|
35
|
+
withdraw(glamState: PublicKey, asset: PublicKey | string, amount: number | BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
40
36
|
depositTx(statePda: PublicKey, asset: PublicKey, amount: number | BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
41
|
-
withdrawIxs(
|
|
42
|
-
withdrawTx(
|
|
37
|
+
withdrawIxs(glamState: PublicKey, asset: PublicKey, amount: number | BN, txOptions: TxOptions): Promise<TransactionInstruction[]>;
|
|
38
|
+
withdrawTx(glamState: PublicKey, asset: PublicKey, amount: number | BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
43
39
|
}
|
|
44
40
|
export {};
|
package/src/client/wsol.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { BaseClient, TxOptions } from "./base";
|
|
|
4
4
|
export declare class WSolClient {
|
|
5
5
|
readonly base: BaseClient;
|
|
6
6
|
constructor(base: BaseClient);
|
|
7
|
-
wrap(
|
|
8
|
-
unwrap(
|
|
9
|
-
wrapTx(
|
|
10
|
-
unwrapTx(
|
|
7
|
+
wrap(glamState: PublicKey, amount: BN, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
8
|
+
unwrap(glamState: PublicKey, txOptions?: TxOptions): Promise<TransactionSignature>;
|
|
9
|
+
wrapTx(glamState: PublicKey, amount: BN, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
10
|
+
unwrapTx(glamState: PublicKey, txOptions: TxOptions): Promise<VersionedTransaction>;
|
|
11
11
|
}
|