@glamsystems/glam-sdk 1.0.0 → 1.0.1
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 +2541 -2451
- package/index.esm.js +2449 -2367
- package/package.json +1 -1
- package/src/{client/assets.d.ts → assets.d.ts} +9 -0
- package/src/client/access.d.ts +3 -5
- package/src/client/base.d.ts +26 -70
- package/src/client/drift.d.ts +4 -15
- package/src/client/fees.d.ts +2 -1
- package/src/client/invest.d.ts +2 -1
- package/src/client/jupiter.d.ts +6 -3
- package/src/client/kamino.d.ts +3 -1
- package/src/client/marinade.d.ts +1 -1
- package/src/client/mint.d.ts +24 -13
- package/src/client/price.d.ts +2 -2
- package/src/client/staking.d.ts +1 -1
- package/src/client/state.d.ts +30 -15
- package/src/client/timelock.d.ts +39 -0
- package/src/client/vault.d.ts +7 -0
- package/src/client.d.ts +3 -0
- package/src/clientConfig.d.ts +9 -0
- package/src/index.d.ts +3 -9
- package/src/models/acl.d.ts +43 -0
- package/src/models/index.d.ts +8 -0
- package/src/models/mint.d.ts +58 -0
- package/src/models/state.d.ts +90 -0
- package/src/models/types.d.ts +44 -0
- package/src/utils/accounts.d.ts +53 -0
- package/src/utils/bitmask.d.ts +38 -0
- package/src/utils/common.d.ts +12 -0
- package/src/utils/computeBudget.d.ts +15 -0
- package/src/utils/drift/index.d.ts +3 -0
- package/src/utils/{driftOrderParams.d.ts → drift/orderParams.d.ts} +1 -1
- package/src/utils/{driftTypes.d.ts → drift/types.d.ts} +32 -0
- package/src/utils/{driftUser.d.ts → drift/user.d.ts} +1 -1
- package/src/utils/index.d.ts +15 -0
- package/src/utils/lookupTables.d.ts +9 -0
- package/src/utils/meteora.d.ts +9 -0
- package/src/utils/rpc.d.ts +3 -0
- package/src/utils/transaction.d.ts +10 -0
- package/target/idl/ext_drift.json +9 -4
- package/target/idl/glam_mint.json +20 -2
- package/target/idl/glam_protocol.json +26 -1
- package/target/types/ext_drift.d.ts +9 -4
- package/target/types/ext_drift.ts +9 -4
- package/target/types/glam_mint.d.ts +20 -2
- package/target/types/glam_mint.ts +20 -2
- package/target/types/glam_protocol.d.ts +26 -1
- package/target/types/glam_protocol.ts +26 -1
- package/src/models.d.ts +0 -210
- package/src/utils/helpers.d.ts +0 -78
- /package/src/utils/{timelockUtils.d.ts → timelock.d.ts} +0 -0
|
@@ -188,17 +188,20 @@ export type GlamMint = {
|
|
|
188
188
|
"writable": true;
|
|
189
189
|
"signer": true;
|
|
190
190
|
},
|
|
191
|
+
{
|
|
192
|
+
"name": "user";
|
|
193
|
+
},
|
|
191
194
|
{
|
|
192
195
|
"name": "recoverTokenMint";
|
|
193
196
|
},
|
|
194
197
|
{
|
|
195
|
-
"name": "
|
|
198
|
+
"name": "userAta";
|
|
196
199
|
"writable": true;
|
|
197
200
|
"pda": {
|
|
198
201
|
"seeds": [
|
|
199
202
|
{
|
|
200
203
|
"kind": "account";
|
|
201
|
-
"path": "
|
|
204
|
+
"path": "user";
|
|
202
205
|
},
|
|
203
206
|
{
|
|
204
207
|
"kind": "account";
|
|
@@ -4456,6 +4459,11 @@ export type GlamMint = {
|
|
|
4456
4459
|
"code": 6012;
|
|
4457
4460
|
"name": "requestQueueFull";
|
|
4458
4461
|
"msg": "Request queue full";
|
|
4462
|
+
},
|
|
4463
|
+
{
|
|
4464
|
+
"code": 6013;
|
|
4465
|
+
"name": "protocolFeesNotCrystallized";
|
|
4466
|
+
"msg": "Protocol fees should be crystallized before updating";
|
|
4459
4467
|
}
|
|
4460
4468
|
];
|
|
4461
4469
|
"types": [
|
|
@@ -5860,11 +5868,21 @@ export type GlamMint = {
|
|
|
5860
5868
|
"type": "u64";
|
|
5861
5869
|
"value": "2";
|
|
5862
5870
|
},
|
|
5871
|
+
{
|
|
5872
|
+
"name": "protoMintPermCancelRequest";
|
|
5873
|
+
"type": "u64";
|
|
5874
|
+
"value": "128";
|
|
5875
|
+
},
|
|
5863
5876
|
{
|
|
5864
5877
|
"name": "protoMintPermClaimFees";
|
|
5865
5878
|
"type": "u64";
|
|
5866
5879
|
"value": "16";
|
|
5867
5880
|
},
|
|
5881
|
+
{
|
|
5882
|
+
"name": "protoMintPermClaimRequest";
|
|
5883
|
+
"type": "u64";
|
|
5884
|
+
"value": "256";
|
|
5885
|
+
},
|
|
5868
5886
|
{
|
|
5869
5887
|
"name": "protoMintPermEmergencyUpdate";
|
|
5870
5888
|
"type": "u64";
|
|
@@ -188,17 +188,20 @@ export type GlamMint = {
|
|
|
188
188
|
"writable": true,
|
|
189
189
|
"signer": true
|
|
190
190
|
},
|
|
191
|
+
{
|
|
192
|
+
"name": "user"
|
|
193
|
+
},
|
|
191
194
|
{
|
|
192
195
|
"name": "recoverTokenMint"
|
|
193
196
|
},
|
|
194
197
|
{
|
|
195
|
-
"name": "
|
|
198
|
+
"name": "userAta",
|
|
196
199
|
"writable": true,
|
|
197
200
|
"pda": {
|
|
198
201
|
"seeds": [
|
|
199
202
|
{
|
|
200
203
|
"kind": "account",
|
|
201
|
-
"path": "
|
|
204
|
+
"path": "user"
|
|
202
205
|
},
|
|
203
206
|
{
|
|
204
207
|
"kind": "account",
|
|
@@ -4456,6 +4459,11 @@ export type GlamMint = {
|
|
|
4456
4459
|
"code": 6012,
|
|
4457
4460
|
"name": "requestQueueFull",
|
|
4458
4461
|
"msg": "Request queue full"
|
|
4462
|
+
},
|
|
4463
|
+
{
|
|
4464
|
+
"code": 6013,
|
|
4465
|
+
"name": "protocolFeesNotCrystallized",
|
|
4466
|
+
"msg": "Protocol fees should be crystallized before updating"
|
|
4459
4467
|
}
|
|
4460
4468
|
],
|
|
4461
4469
|
"types": [
|
|
@@ -5860,11 +5868,21 @@ export type GlamMint = {
|
|
|
5860
5868
|
"type": "u64",
|
|
5861
5869
|
"value": "2"
|
|
5862
5870
|
},
|
|
5871
|
+
{
|
|
5872
|
+
"name": "protoMintPermCancelRequest",
|
|
5873
|
+
"type": "u64",
|
|
5874
|
+
"value": "128"
|
|
5875
|
+
},
|
|
5863
5876
|
{
|
|
5864
5877
|
"name": "protoMintPermClaimFees",
|
|
5865
5878
|
"type": "u64",
|
|
5866
5879
|
"value": "16"
|
|
5867
5880
|
},
|
|
5881
|
+
{
|
|
5882
|
+
"name": "protoMintPermClaimRequest",
|
|
5883
|
+
"type": "u64",
|
|
5884
|
+
"value": "256"
|
|
5885
|
+
},
|
|
5868
5886
|
{
|
|
5869
5887
|
"name": "protoMintPermEmergencyUpdate",
|
|
5870
5888
|
"type": "u64",
|
|
@@ -8,11 +8,36 @@ export type GlamProtocol = {
|
|
|
8
8
|
"address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz";
|
|
9
9
|
"metadata": {
|
|
10
10
|
"name": "glamProtocol";
|
|
11
|
-
"version": "1.0.
|
|
11
|
+
"version": "1.0.1";
|
|
12
12
|
"spec": "0.1.0";
|
|
13
13
|
"description": "Glam Protocol";
|
|
14
14
|
};
|
|
15
15
|
"instructions": [
|
|
16
|
+
{
|
|
17
|
+
"name": "cancelTimelock";
|
|
18
|
+
"discriminator": [
|
|
19
|
+
158,
|
|
20
|
+
180,
|
|
21
|
+
47,
|
|
22
|
+
81,
|
|
23
|
+
133,
|
|
24
|
+
231,
|
|
25
|
+
168,
|
|
26
|
+
238
|
|
27
|
+
];
|
|
28
|
+
"accounts": [
|
|
29
|
+
{
|
|
30
|
+
"name": "glamState";
|
|
31
|
+
"writable": true;
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "glamSigner";
|
|
35
|
+
"writable": true;
|
|
36
|
+
"signer": true;
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
"args": [];
|
|
40
|
+
},
|
|
16
41
|
{
|
|
17
42
|
"name": "closeState";
|
|
18
43
|
"discriminator": [
|
|
@@ -8,11 +8,36 @@ export type GlamProtocol = {
|
|
|
8
8
|
"address": "GLAMpaME8wdTEzxtiYEAa5yD8fZbxZiz2hNtV58RZiEz",
|
|
9
9
|
"metadata": {
|
|
10
10
|
"name": "glamProtocol",
|
|
11
|
-
"version": "1.0.
|
|
11
|
+
"version": "1.0.1",
|
|
12
12
|
"spec": "0.1.0",
|
|
13
13
|
"description": "Glam Protocol"
|
|
14
14
|
},
|
|
15
15
|
"instructions": [
|
|
16
|
+
{
|
|
17
|
+
"name": "cancelTimelock",
|
|
18
|
+
"discriminator": [
|
|
19
|
+
158,
|
|
20
|
+
180,
|
|
21
|
+
47,
|
|
22
|
+
81,
|
|
23
|
+
133,
|
|
24
|
+
231,
|
|
25
|
+
168,
|
|
26
|
+
238
|
|
27
|
+
],
|
|
28
|
+
"accounts": [
|
|
29
|
+
{
|
|
30
|
+
"name": "glamState",
|
|
31
|
+
"writable": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "glamSigner",
|
|
35
|
+
"writable": true,
|
|
36
|
+
"signer": true
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"args": []
|
|
40
|
+
},
|
|
16
41
|
{
|
|
17
42
|
"name": "closeState",
|
|
18
43
|
"discriminator": [
|
package/src/models.d.ts
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { IdlTypes, IdlAccounts } from "@coral-xyz/anchor";
|
|
2
|
-
import { GlamProtocol, GlamMint } from "./glamExports";
|
|
3
|
-
import { PublicKey } from "@solana/web3.js";
|
|
4
|
-
import { Mint } from "@solana/spl-token";
|
|
5
|
-
import { BN } from "@coral-xyz/anchor";
|
|
6
|
-
export type StateAccount = IdlAccounts<GlamProtocol>["stateAccount"];
|
|
7
|
-
export type StateModelType = IdlTypes<GlamProtocol>["stateModel"];
|
|
8
|
-
export declare class StateIdlModel implements StateModelType {
|
|
9
|
-
accountType: StateAccountType | null;
|
|
10
|
-
name: number[] | null;
|
|
11
|
-
uri: string | null;
|
|
12
|
-
enabled: boolean | null;
|
|
13
|
-
assets: PublicKey[] | null;
|
|
14
|
-
created: CreatedModel | null;
|
|
15
|
-
owner: PublicKey | null;
|
|
16
|
-
portfolioManagerName: number[] | null;
|
|
17
|
-
borrowable: PublicKey[] | null;
|
|
18
|
-
timelockDuration: number | null;
|
|
19
|
-
integrationAcls: IntegrationAcl[] | null;
|
|
20
|
-
delegateAcls: DelegateAcl[] | null;
|
|
21
|
-
constructor(data: Partial<StateModelType>);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Enriched state model built from multiple onchain accounts
|
|
25
|
-
*/
|
|
26
|
-
export declare class StateModel extends StateIdlModel {
|
|
27
|
-
readonly glamProgramId: PublicKey;
|
|
28
|
-
id: PublicKey | null;
|
|
29
|
-
mint: PublicKey | null;
|
|
30
|
-
mintModel: MintModel | null;
|
|
31
|
-
baseAssetMint: PublicKey;
|
|
32
|
-
baseAssetTokenProgram: number;
|
|
33
|
-
baseAssetDecimals: number;
|
|
34
|
-
pendingStateUpdates: any | null;
|
|
35
|
-
pendingMintUpdates: any | null;
|
|
36
|
-
timelockExpiresAt: number | null;
|
|
37
|
-
externalPositions: PublicKey[] | null;
|
|
38
|
-
pricedProtocols: any[] | null;
|
|
39
|
-
borrowable: PublicKey[] | null;
|
|
40
|
-
constructor(data: Partial<StateModel>, glamProgramId?: PublicKey);
|
|
41
|
-
get idStr(): string;
|
|
42
|
-
get nameStr(): string;
|
|
43
|
-
get vault(): PublicKey;
|
|
44
|
-
get productType(): string;
|
|
45
|
-
get launchDate(): string;
|
|
46
|
-
get sparkleKey(): string;
|
|
47
|
-
get baseAssetTokenProgramId(): PublicKey;
|
|
48
|
-
get assetsForPricing(): PublicKey[];
|
|
49
|
-
/**
|
|
50
|
-
* Build a StateModel from onchain data
|
|
51
|
-
*
|
|
52
|
-
* @param stateAccount provides core fund data
|
|
53
|
-
* @param openfundsMetadataAccount includes fund rawOpenfunds data and share class rawOpenfunds data
|
|
54
|
-
* @param glamMint
|
|
55
|
-
*/
|
|
56
|
-
static fromOnchainAccounts(statePda: PublicKey, stateAccount: StateAccount, glamMint?: Mint, requestQueue?: RequestQueue, glamProgramId?: PublicKey): StateModel;
|
|
57
|
-
}
|
|
58
|
-
export type MintModelType = IdlTypes<GlamProtocol>["mintModel"];
|
|
59
|
-
export declare class MintIdlModel implements MintModelType {
|
|
60
|
-
symbol: string | null;
|
|
61
|
-
name: number[] | null;
|
|
62
|
-
uri: string | null;
|
|
63
|
-
yearInSeconds: number | null;
|
|
64
|
-
permanentDelegate: PublicKey | null;
|
|
65
|
-
defaultAccountStateFrozen: boolean | null;
|
|
66
|
-
feeStructure: FeeStructure | null;
|
|
67
|
-
notifyAndSettle: NotifyAndSettle | null;
|
|
68
|
-
lockupPeriod: number | null;
|
|
69
|
-
maxCap: BN | null;
|
|
70
|
-
minSubscription: BN | null;
|
|
71
|
-
minRedemption: BN | null;
|
|
72
|
-
allowlist: PublicKey[] | null;
|
|
73
|
-
blocklist: PublicKey[] | null;
|
|
74
|
-
constructor(data: Partial<MintModelType>);
|
|
75
|
-
}
|
|
76
|
-
export declare class MintModel extends MintIdlModel {
|
|
77
|
-
statePda: PublicKey | null;
|
|
78
|
-
baseAssetMint: PublicKey | null;
|
|
79
|
-
transferHookProgram: PublicKey | null;
|
|
80
|
-
claimableFees: AccruedFees | null;
|
|
81
|
-
claimedFees: AccruedFees | null;
|
|
82
|
-
feeParams: FeeParams | null;
|
|
83
|
-
subscriptionPaused: boolean | null;
|
|
84
|
-
redemptionPaused: boolean | null;
|
|
85
|
-
pendingRequests: any[] | null;
|
|
86
|
-
constructor(data: Partial<MintModel>);
|
|
87
|
-
get nameStr(): string;
|
|
88
|
-
}
|
|
89
|
-
export type CreatedModelType = IdlTypes<GlamProtocol>["createdModel"];
|
|
90
|
-
export declare class CreatedModel implements CreatedModelType {
|
|
91
|
-
key: number[];
|
|
92
|
-
createdBy: PublicKey;
|
|
93
|
-
createdAt: BN;
|
|
94
|
-
constructor(obj: Partial<CreatedModelType>);
|
|
95
|
-
}
|
|
96
|
-
export type EmergencyAccessUpdateArgsType = IdlTypes<GlamProtocol>["emergencyAccessUpdateArgs"];
|
|
97
|
-
export declare class EmergencyAccessUpdateArgs implements EmergencyAccessUpdateArgsType {
|
|
98
|
-
disabledIntegrations: PublicKey[];
|
|
99
|
-
disabledDelegates: PublicKey[];
|
|
100
|
-
stateEnabled: boolean | null;
|
|
101
|
-
constructor(obj: Partial<EmergencyAccessUpdateArgsType>);
|
|
102
|
-
}
|
|
103
|
-
export type EmergencyUpdateMintArgsType = IdlTypes<GlamMint>["emergencyUpdateMintArgs"];
|
|
104
|
-
export declare class EmergencyUpdateMintArgs implements EmergencyUpdateMintArgsType {
|
|
105
|
-
requestType: RequestType;
|
|
106
|
-
setPaused: boolean;
|
|
107
|
-
}
|
|
108
|
-
export type IntegrationPermissionsType = IdlTypes<GlamProtocol>["integrationPermissions"];
|
|
109
|
-
export type ProtocolPermissionsType = IdlTypes<GlamProtocol>["protocolPermissions"];
|
|
110
|
-
export declare class IntegrationPermissions implements IntegrationPermissionsType {
|
|
111
|
-
integrationProgram: PublicKey;
|
|
112
|
-
protocolPermissions: ProtocolPermissionsType[];
|
|
113
|
-
constructor(obj: Partial<IntegrationPermissionsType>);
|
|
114
|
-
}
|
|
115
|
-
export declare class ProtocolPermissions implements ProtocolPermissionsType {
|
|
116
|
-
protocolBitflag: number;
|
|
117
|
-
permissionsBitmask: BN;
|
|
118
|
-
constructor(obj: Partial<ProtocolPermissionsType>);
|
|
119
|
-
}
|
|
120
|
-
export type ProtocolPolicyType = IdlTypes<GlamProtocol>["protocolPolicy"];
|
|
121
|
-
export declare class ProtocolPolicy implements ProtocolPolicyType {
|
|
122
|
-
protocolBitflag: number;
|
|
123
|
-
data: Buffer;
|
|
124
|
-
constructor(obj: Partial<ProtocolPolicyType>);
|
|
125
|
-
}
|
|
126
|
-
export type IntegrationAclType = IdlTypes<GlamProtocol>["integrationAcl"];
|
|
127
|
-
export declare class IntegrationAcl implements IntegrationAclType {
|
|
128
|
-
integrationProgram: PublicKey;
|
|
129
|
-
protocolsBitmask: number;
|
|
130
|
-
protocolPolicies: ProtocolPolicy[];
|
|
131
|
-
constructor(obj: Partial<IntegrationAclType>);
|
|
132
|
-
}
|
|
133
|
-
export type DelegateAclType = IdlTypes<GlamProtocol>["delegateAcl"];
|
|
134
|
-
export declare class DelegateAcl implements DelegateAclType {
|
|
135
|
-
pubkey: PublicKey;
|
|
136
|
-
integrationPermissions: IntegrationPermissions[];
|
|
137
|
-
expiresAt: BN;
|
|
138
|
-
constructor(obj: Partial<DelegateAclType>);
|
|
139
|
-
}
|
|
140
|
-
export type FeeStructure = IdlTypes<GlamProtocol>["feeStructure"];
|
|
141
|
-
export type FeeParams = IdlTypes<GlamProtocol>["feeParams"];
|
|
142
|
-
export type AccruedFees = IdlTypes<GlamProtocol>["accruedFees"];
|
|
143
|
-
export type NotifyAndSettle = IdlTypes<GlamProtocol>["notifyAndSettle"];
|
|
144
|
-
export declare class StateAccountType {
|
|
145
|
-
static readonly VAULT: {
|
|
146
|
-
vault: {};
|
|
147
|
-
};
|
|
148
|
-
static readonly TOKENIZED_VAULT: {
|
|
149
|
-
tokenizedVault: {};
|
|
150
|
-
};
|
|
151
|
-
static readonly MINT: {
|
|
152
|
-
mint: {};
|
|
153
|
-
};
|
|
154
|
-
static equals(a: StateAccountType, b: StateAccountType): boolean;
|
|
155
|
-
}
|
|
156
|
-
export declare class RequestType {
|
|
157
|
-
static readonly SUBSCRIPTION: {
|
|
158
|
-
subscription: {};
|
|
159
|
-
};
|
|
160
|
-
static readonly REDEMPTION: {
|
|
161
|
-
redemption: {};
|
|
162
|
-
};
|
|
163
|
-
static equals(a: RequestType, b: RequestType): boolean;
|
|
164
|
-
static fromInt(int: number): {
|
|
165
|
-
subscription: {};
|
|
166
|
-
} | {
|
|
167
|
-
redemption: {};
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
export declare class PriceDenom {
|
|
171
|
-
static readonly SOL: {
|
|
172
|
-
sol: {};
|
|
173
|
-
};
|
|
174
|
-
static readonly USD: {
|
|
175
|
-
usd: {};
|
|
176
|
-
};
|
|
177
|
-
static readonly ASSET: {
|
|
178
|
-
asset6: {};
|
|
179
|
-
};
|
|
180
|
-
static fromAsset(asset: PublicKey): {
|
|
181
|
-
sol: {};
|
|
182
|
-
} | {
|
|
183
|
-
usd: {};
|
|
184
|
-
} | {
|
|
185
|
-
asset6: {};
|
|
186
|
-
};
|
|
187
|
-
static fromString(str: string): {
|
|
188
|
-
sol: {};
|
|
189
|
-
} | {
|
|
190
|
-
usd: {};
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
export declare class TimeUnit {
|
|
194
|
-
static readonly Slot: {
|
|
195
|
-
slot: {};
|
|
196
|
-
};
|
|
197
|
-
static readonly Second: {
|
|
198
|
-
second: {};
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
export declare class VoteAuthorize {
|
|
202
|
-
static readonly Voter: {
|
|
203
|
-
voter: {};
|
|
204
|
-
};
|
|
205
|
-
static readonly Withdrawer: {
|
|
206
|
-
withdrawer: {};
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
export type RequestQueue = IdlTypes<GlamMint>["requestQueue"];
|
|
210
|
-
export type PendingRequest = IdlTypes<GlamMint>["pendingRequest"];
|
package/src/utils/helpers.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Connection, PublicKey, TransactionInstruction, AddressLookupTableAccount } from "@solana/web3.js";
|
|
2
|
-
import { BN } from "@coral-xyz/anchor";
|
|
3
|
-
import { type TokenAccount } from "../client/base";
|
|
4
|
-
export type StakeAccountInfo = {
|
|
5
|
-
address: PublicKey;
|
|
6
|
-
lamports: number;
|
|
7
|
-
state: string;
|
|
8
|
-
voter?: PublicKey;
|
|
9
|
-
};
|
|
10
|
-
export declare function getProgramAccountsV2(programId: PublicKey, limit?: number, filters?: any[]): Promise<any[]>;
|
|
11
|
-
export declare function getProgramAccountsWithRetry(connection: Connection, programId: PublicKey, filters?: any[]): Promise<import("@solana/web3.js").GetProgramAccountsResponse>;
|
|
12
|
-
/**
|
|
13
|
-
* Fetches all the token accounts owned by the specified pubkey.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getTokenAccountsByOwner(connection: Connection, owner: PublicKey): Promise<TokenAccount[]>;
|
|
16
|
-
export declare function getSolAndTokenBalances(connection: Connection, owner: PublicKey): Promise<{
|
|
17
|
-
balanceLamports: number;
|
|
18
|
-
uiAmount: number;
|
|
19
|
-
tokenAccounts: TokenAccount[];
|
|
20
|
-
}>;
|
|
21
|
-
export declare const findStakeAccounts: (connection: Connection, withdrawAuthority: PublicKey) => Promise<PublicKey[]>;
|
|
22
|
-
export declare const getStakeAccountsWithStates: (connection: Connection, withdrawAuthority: PublicKey) => Promise<StakeAccountInfo[]>;
|
|
23
|
-
export declare const fetchMeteoraPositions: (connection: Connection, owner: PublicKey) => Promise<PublicKey[]>;
|
|
24
|
-
export declare const parseMeteoraPosition: (connection: Connection, position: PublicKey) => Promise<{
|
|
25
|
-
lbPair: PublicKey;
|
|
26
|
-
lowerBinId: number;
|
|
27
|
-
upperBinId: number;
|
|
28
|
-
binArrayLower: PublicKey;
|
|
29
|
-
binArrayUpper: PublicKey;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* Parses program logs to extract error message
|
|
33
|
-
*/
|
|
34
|
-
export declare function parseProgramLogs(logs?: null | string[]): string;
|
|
35
|
-
export declare const getSimulationResult: (connection: Connection, instructions: Array<TransactionInstruction>, payer: PublicKey, lookupTables?: Array<AddressLookupTableAccount>) => Promise<{
|
|
36
|
-
unitsConsumed?: number;
|
|
37
|
-
error?: Error;
|
|
38
|
-
serializedTx?: String;
|
|
39
|
-
}>;
|
|
40
|
-
export declare const setsAreEqual: (a: Set<any>, b: Set<any>) => boolean;
|
|
41
|
-
export declare function charsToName(chars: number[] | Buffer): string;
|
|
42
|
-
export declare function nameToChars(name: string): number[];
|
|
43
|
-
/**
|
|
44
|
-
* Formats a bitmask as a binary string.
|
|
45
|
-
*
|
|
46
|
-
* @param bitmask - The bitmask to format, either a number or a BN.
|
|
47
|
-
* @param padding - The number of bits to pad the bitmask with.
|
|
48
|
-
* @returns e.g. '0000000000001100' if bitmask is 12 and padding is 16.
|
|
49
|
-
*/
|
|
50
|
-
export declare function formatBits(bitmask: number | BN, padding?: number): string;
|
|
51
|
-
/**
|
|
52
|
-
* Parses a bitmask into a binary string and a list of protocol names.
|
|
53
|
-
*
|
|
54
|
-
* @param integrationProgram - The integration program ID.
|
|
55
|
-
* @param protocolsBitmask - The bitmask to parse.
|
|
56
|
-
* @returns An object containing the bitmask string and a list of protocol names.
|
|
57
|
-
*/
|
|
58
|
-
export declare function parseProtocolsBitmask(integrationProgram: PublicKey, protocolsBitmask: number | BN): {
|
|
59
|
-
protocols: {
|
|
60
|
-
bitflag: number | BN;
|
|
61
|
-
name: string;
|
|
62
|
-
}[];
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* Parses a permissions bitmask for a specific protocol to get permission names.
|
|
66
|
-
*
|
|
67
|
-
* @param integrationProgram - The integration program ID.
|
|
68
|
-
* @param protocolBitflag - The protocol bitflag to identify which protocol.
|
|
69
|
-
* @param permissionsBitmask - The permissions bitmask to parse.
|
|
70
|
-
* @returns An object containing the bitmask string and a list of permission names.
|
|
71
|
-
*/
|
|
72
|
-
export declare function parseProtocolPermissionsBitmask(integrationProgram: PublicKey, protocolBitflag: number | BN, permissionsBitmask: number | BN): {
|
|
73
|
-
protocol: string;
|
|
74
|
-
permissions: {
|
|
75
|
-
bitflag: number | BN;
|
|
76
|
-
name: string;
|
|
77
|
-
}[];
|
|
78
|
-
};
|
|
File without changes
|