@exponent-labs/jito-restaking-sy-sdk 0.0.3
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/CHANGELOG.md +16 -0
- package/build/index.d.ts +63 -0
- package/build/index.js +278 -0
- package/build/index.js.map +1 -0
- package/build/tryit.d.ts +1 -0
- package/build/tryit.js +20 -0
- package/build/tryit.js.map +1 -0
- package/package.json +24 -0
- package/src/index.ts +372 -0
- package/src/tryit.ts +21 -0
- package/tsconfig.json +25 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [0.0.3](https://github.com/exponent-finance/exponent-core/compare/@exponent-labs/jito-restaking-sy-sdk@0.0.2...@exponent-labs/jito-restaking-sy-sdk@0.0.3) (2025-03-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exponent-labs/jito-restaking-sy-sdk
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.0.2](https://github.com/exponent-finance/exponent-core/compare/@exponent-labs/jito-restaking-sy-sdk@0.0.1...@exponent-labs/jito-restaking-sy-sdk@0.0.2) (2025-03-03)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @exponent-labs/jito-restaking-sy-sdk
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/// <reference types="bn.js" />
|
|
2
|
+
import { BN, Wallet, web3 } from "@coral-xyz/anchor";
|
|
3
|
+
import { JitoRestakingSyPda } from "@exponent-labs/jito-restaking-sy-pda";
|
|
4
|
+
import { JitoRestakingSyState, JitoRestakingSyMetaAccount } from "@exponent-labs/exponent-types";
|
|
5
|
+
export declare class MyWallet implements Wallet {
|
|
6
|
+
readonly payer: web3.Keypair;
|
|
7
|
+
constructor(payer: web3.Keypair);
|
|
8
|
+
signTransaction<T extends web3.Transaction | web3.VersionedTransaction>(tx: T): Promise<T>;
|
|
9
|
+
signAllTransactions<T extends web3.Transaction | web3.VersionedTransaction>(txs: T[]): Promise<T[]>;
|
|
10
|
+
get publicKey(): web3.PublicKey;
|
|
11
|
+
}
|
|
12
|
+
export declare class JitoRestakingSySdk {
|
|
13
|
+
state: JitoRestakingSyState;
|
|
14
|
+
/** Private program for building instructions */
|
|
15
|
+
private program;
|
|
16
|
+
syPda: JitoRestakingSyPda;
|
|
17
|
+
constructor(state: JitoRestakingSyState, programId?: web3.PublicKey);
|
|
18
|
+
/** Load an instance of SyMeta */
|
|
19
|
+
static load({ cnx, jitoVault, jitoRestakingSyProgramId, }: {
|
|
20
|
+
cnx: web3.Connection;
|
|
21
|
+
jitoVault: web3.PublicKey;
|
|
22
|
+
jitoRestakingSyProgramId: web3.PublicKey;
|
|
23
|
+
}): Promise<JitoRestakingSySdk>;
|
|
24
|
+
get refreshJitoRestakingVaultInstruction(): web3.TransactionInstruction;
|
|
25
|
+
/** Reload the state of the account */
|
|
26
|
+
reload(cnx: web3.Connection): Promise<void>;
|
|
27
|
+
get account(): JitoRestakingSyMetaAccount;
|
|
28
|
+
get mintSy(): web3.PublicKey;
|
|
29
|
+
get maxSySupply(): BN;
|
|
30
|
+
get emissions(): import("@exponent-labs/exponent-types").SyEmissionRaw[];
|
|
31
|
+
get minMintSize(): BN;
|
|
32
|
+
get minRedeemSize(): BN;
|
|
33
|
+
get mintBase(): web3.PublicKey;
|
|
34
|
+
get selfAddress(): web3.PublicKey;
|
|
35
|
+
get tokenProgramBase(): web3.PublicKey;
|
|
36
|
+
get tokenVrtEscrow(): web3.PublicKey;
|
|
37
|
+
get tokenSyEscrow(): web3.PublicKey;
|
|
38
|
+
get adminState(): web3.PublicKey;
|
|
39
|
+
get remainingAccounts(): {
|
|
40
|
+
pubkey: web3.PublicKey;
|
|
41
|
+
isSigner: boolean;
|
|
42
|
+
isWritable: boolean;
|
|
43
|
+
}[];
|
|
44
|
+
ixMintSy({ depositor, amountBase, baseSrc, syDst, }: {
|
|
45
|
+
depositor: web3.PublicKey;
|
|
46
|
+
amountBase: string;
|
|
47
|
+
baseSrc?: web3.PublicKey;
|
|
48
|
+
syDst?: web3.PublicKey;
|
|
49
|
+
}): Promise<web3.TransactionInstruction>;
|
|
50
|
+
ixRedeemSy({ redeemer, amountSy, baseDst, sySrc, }: {
|
|
51
|
+
redeemer: web3.PublicKey;
|
|
52
|
+
amountSy: string;
|
|
53
|
+
baseDst?: web3.PublicKey;
|
|
54
|
+
sySrc?: web3.PublicKey;
|
|
55
|
+
}): Promise<web3.TransactionInstruction>;
|
|
56
|
+
getSyState(): Promise<web3.TransactionInstruction>;
|
|
57
|
+
ixAddEmission({ signer, emissionMint, emissionTokenAccount, }: {
|
|
58
|
+
signer: web3.PublicKey;
|
|
59
|
+
emissionMint: web3.PublicKey;
|
|
60
|
+
emissionTokenAccount: web3.PublicKey;
|
|
61
|
+
}): Promise<web3.TransactionInstruction>;
|
|
62
|
+
}
|
|
63
|
+
export declare function initSy(signer: web3.PublicKey, jitoVault: web3.PublicKey, interfaceAccounts: web3.PublicKey[], vrtMint: web3.PublicKey): Promise<web3.TransactionInstruction>;
|
package/build/index.js
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initSy = exports.JitoRestakingSySdk = exports.MyWallet = void 0;
|
|
4
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
5
|
+
const jito_restaking_sy_idl_1 = require("@exponent-labs/jito-restaking-sy-idl");
|
|
6
|
+
const spl_token_1 = require("@solana/spl-token");
|
|
7
|
+
const jito_restaking_sy_pda_1 = require("@exponent-labs/jito-restaking-sy-pda");
|
|
8
|
+
const jito_restaking_sy_idl_2 = require("@exponent-labs/jito-restaking-sy-idl");
|
|
9
|
+
const exponent_fetcher_1 = require("@exponent-labs/exponent-fetcher");
|
|
10
|
+
const exponent_admin_pda_1 = require("@exponent-labs/exponent-admin-pda");
|
|
11
|
+
async function loadAccountState(cnx, jitoVault, jitoRestakingSyProgramId) {
|
|
12
|
+
const pda = new jito_restaking_sy_pda_1.JitoRestakingSyPda(jitoRestakingSyProgramId);
|
|
13
|
+
const fetcher = new exponent_fetcher_1.ExponentFetcher({ connection: cnx, jitoRestakingSyProgramId });
|
|
14
|
+
const syMetaAddress = pda.syMeta({ jitoVault });
|
|
15
|
+
const data = await fetcher.fetchJitoRestakingSyMeta(syMetaAddress);
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
class MyWallet {
|
|
19
|
+
payer;
|
|
20
|
+
constructor(payer) {
|
|
21
|
+
this.payer = payer;
|
|
22
|
+
this.payer = payer;
|
|
23
|
+
}
|
|
24
|
+
async signTransaction(tx) {
|
|
25
|
+
if (tx instanceof anchor_1.web3.Transaction) {
|
|
26
|
+
tx.partialSign(this.payer);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
tx.sign([this.payer]);
|
|
30
|
+
}
|
|
31
|
+
return tx;
|
|
32
|
+
}
|
|
33
|
+
async signAllTransactions(txs) {
|
|
34
|
+
return txs.map((t) => {
|
|
35
|
+
if (t instanceof anchor_1.web3.Transaction) {
|
|
36
|
+
t.partialSign(this.payer);
|
|
37
|
+
}
|
|
38
|
+
else if (t instanceof anchor_1.web3.VersionedTransaction) {
|
|
39
|
+
t.sign([this.payer]);
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get publicKey() {
|
|
45
|
+
return this.payer.publicKey;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.MyWallet = MyWallet;
|
|
49
|
+
class JitoRestakingSySdk {
|
|
50
|
+
state;
|
|
51
|
+
/** Private program for building instructions */
|
|
52
|
+
program;
|
|
53
|
+
syPda;
|
|
54
|
+
constructor(state, programId = new anchor_1.web3.PublicKey(jito_restaking_sy_idl_2.PROGRAM_ID)) {
|
|
55
|
+
this.state = state;
|
|
56
|
+
// create a fake AnchorProvider -- which is unused
|
|
57
|
+
this.program = new anchor_1.Program(jito_restaking_sy_idl_1.IDL, new anchor_1.AnchorProvider(new anchor_1.web3.Connection("https://api.devnet.solana.com"), new MyWallet(anchor_1.web3.Keypair.generate())));
|
|
58
|
+
this.syPda = new jito_restaking_sy_pda_1.JitoRestakingSyPda(programId);
|
|
59
|
+
}
|
|
60
|
+
/** Load an instance of SyMeta */
|
|
61
|
+
static async load({ cnx, jitoVault, jitoRestakingSyProgramId, }) {
|
|
62
|
+
const account = await loadAccountState(cnx, jitoVault, jitoRestakingSyProgramId);
|
|
63
|
+
const b = await (0, exponent_fetcher_1.fetchJitoRestaking)(cnx, account.interfaceAccounts, account.interfaceType, jitoVault);
|
|
64
|
+
// const baseMintAi = await cnx.getAccountInfo(b.)
|
|
65
|
+
const tokenProgramBase = spl_token_1.TOKEN_PROGRAM_ID;
|
|
66
|
+
const selfAddress = new jito_restaking_sy_pda_1.JitoRestakingSyPda(jitoRestakingSyProgramId).syMeta({ jitoVault });
|
|
67
|
+
const state = {
|
|
68
|
+
selfAddress,
|
|
69
|
+
account,
|
|
70
|
+
underlyingExchangeRate: b.exchangeRateUnderlying,
|
|
71
|
+
syRate: b.exchangeRate,
|
|
72
|
+
// find way to get real base mint
|
|
73
|
+
mintBase: b.mintBase,
|
|
74
|
+
tokenProgramBase,
|
|
75
|
+
};
|
|
76
|
+
return new JitoRestakingSySdk(state, jitoRestakingSyProgramId);
|
|
77
|
+
}
|
|
78
|
+
get refreshJitoRestakingVaultInstruction() {
|
|
79
|
+
return new anchor_1.web3.TransactionInstruction({
|
|
80
|
+
keys: [
|
|
81
|
+
{
|
|
82
|
+
isSigner: false,
|
|
83
|
+
isWritable: false,
|
|
84
|
+
// Global config state for the Restaking Vault
|
|
85
|
+
pubkey: new anchor_1.web3.PublicKey("UwuSgAq4zByffCGCrWH87DsjfsewYjuqHfJEpzw1Jq3"),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
isSigner: false,
|
|
89
|
+
isWritable: true,
|
|
90
|
+
pubkey: this.state.account.jitoVault,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
isSigner: false,
|
|
94
|
+
isWritable: true,
|
|
95
|
+
// JitoSOL token account for KYSOL vault
|
|
96
|
+
pubkey: new anchor_1.web3.PublicKey("CRFtzwkekKorgdTRSdvsYeqL1vEuVvwGRvweuWCyaRt3"),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
isSigner: false,
|
|
100
|
+
isWritable: true,
|
|
101
|
+
// kysol mint
|
|
102
|
+
pubkey: this.state.mintBase,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
isSigner: false,
|
|
106
|
+
isWritable: false,
|
|
107
|
+
// JitoSOL fee token account for KYSOL vault
|
|
108
|
+
pubkey: new anchor_1.web3.PublicKey("EQM9GdsSwwrUpYwUm53a1dtsQTdB8XVPVsJB8U3SV4q6"),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
isSigner: false,
|
|
112
|
+
isWritable: false,
|
|
113
|
+
// Token program
|
|
114
|
+
pubkey: new anchor_1.web3.PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
programId: new anchor_1.web3.PublicKey("Vau1t6sLNxnzB7ZDsef8TLbPLfyZMYXH8WTNqUdm9g8"),
|
|
118
|
+
data: Buffer.from(Uint8Array.from([25])),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/** Reload the state of the account */
|
|
122
|
+
async reload(cnx) {
|
|
123
|
+
const b = await (0, exponent_fetcher_1.fetchJitoRestaking)(cnx, this.state.account.interfaceAccounts, this.state.account.interfaceType, this.state.account.jitoVault);
|
|
124
|
+
const account = await loadAccountState(cnx, this.state.account.jitoVault, this.program.programId);
|
|
125
|
+
this.state.account = account;
|
|
126
|
+
this.state.syRate = b.exchangeRate;
|
|
127
|
+
}
|
|
128
|
+
get account() {
|
|
129
|
+
return this.state.account;
|
|
130
|
+
}
|
|
131
|
+
get mintSy() {
|
|
132
|
+
return this.account.mintSy;
|
|
133
|
+
}
|
|
134
|
+
get maxSySupply() {
|
|
135
|
+
return this.account.maxSySupply;
|
|
136
|
+
}
|
|
137
|
+
get emissions() {
|
|
138
|
+
return this.account.emissions;
|
|
139
|
+
}
|
|
140
|
+
get minMintSize() {
|
|
141
|
+
return this.account.minMintSize;
|
|
142
|
+
}
|
|
143
|
+
get minRedeemSize() {
|
|
144
|
+
return this.account.minRedeemSize;
|
|
145
|
+
}
|
|
146
|
+
get mintBase() {
|
|
147
|
+
return this.state.mintBase;
|
|
148
|
+
}
|
|
149
|
+
get selfAddress() {
|
|
150
|
+
return this.state.selfAddress;
|
|
151
|
+
}
|
|
152
|
+
get tokenProgramBase() {
|
|
153
|
+
return this.state.tokenProgramBase;
|
|
154
|
+
}
|
|
155
|
+
get tokenVrtEscrow() {
|
|
156
|
+
return (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintBase, this.selfAddress, true, spl_token_1.TOKEN_PROGRAM_ID);
|
|
157
|
+
}
|
|
158
|
+
get tokenSyEscrow() {
|
|
159
|
+
return this.state.account.tokenSyEscrow;
|
|
160
|
+
}
|
|
161
|
+
get adminState() {
|
|
162
|
+
return new exponent_admin_pda_1.ExponentAdminPda(exponent_admin_pda_1.EXPONENT_ADMIN_PROGRAM_ID).exponentAdmin();
|
|
163
|
+
}
|
|
164
|
+
get remainingAccounts() {
|
|
165
|
+
return this.account.interfaceAccounts
|
|
166
|
+
.map((a) => ({
|
|
167
|
+
pubkey: a,
|
|
168
|
+
isSigner: false,
|
|
169
|
+
isWritable: true,
|
|
170
|
+
}))
|
|
171
|
+
.concat(this.emissions.map((e) => ({ pubkey: e.escrowAccount, isSigner: false, isWritable: false })));
|
|
172
|
+
}
|
|
173
|
+
ixMintSy({ depositor, amountBase, baseSrc, syDst, }) {
|
|
174
|
+
baseSrc = baseSrc || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintBase, depositor, true, this.state.tokenProgramBase);
|
|
175
|
+
console.log("baseSrc", baseSrc.toBase58());
|
|
176
|
+
console.log("depositor", depositor.toBase58());
|
|
177
|
+
syDst = syDst || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
|
|
178
|
+
console.log();
|
|
179
|
+
return this.program.methods
|
|
180
|
+
.mint(new anchor_1.BN(amountBase))
|
|
181
|
+
.accountsStrict({
|
|
182
|
+
meta: this.selfAddress,
|
|
183
|
+
jitoVault: this.account.jitoVault,
|
|
184
|
+
baseTokenProgram: this.tokenProgramBase,
|
|
185
|
+
depositor,
|
|
186
|
+
mintSy: this.mintSy,
|
|
187
|
+
tokenBaseDepositor: baseSrc,
|
|
188
|
+
tokenSyDepositor: syDst,
|
|
189
|
+
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
190
|
+
tokenVrtEscrow: this.tokenVrtEscrow,
|
|
191
|
+
})
|
|
192
|
+
.remainingAccounts(this.remainingAccounts)
|
|
193
|
+
.instruction();
|
|
194
|
+
}
|
|
195
|
+
ixRedeemSy({ redeemer, amountSy, baseDst, sySrc, }) {
|
|
196
|
+
baseDst = baseDst || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintBase, redeemer, true, this.tokenProgramBase);
|
|
197
|
+
sySrc = sySrc || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, redeemer, true, spl_token_1.TOKEN_PROGRAM_ID);
|
|
198
|
+
return this.program.methods
|
|
199
|
+
.redeem(new anchor_1.BN(amountSy))
|
|
200
|
+
.accountsStrict({
|
|
201
|
+
meta: this.selfAddress,
|
|
202
|
+
mintSy: this.mintSy,
|
|
203
|
+
tokenSySigner: sySrc,
|
|
204
|
+
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
205
|
+
signer: redeemer,
|
|
206
|
+
jitoVault: this.account.jitoVault,
|
|
207
|
+
tokenBaseDst: baseDst,
|
|
208
|
+
tokenBaseProgram: this.tokenProgramBase,
|
|
209
|
+
tokenVrtEscrow: this.tokenVrtEscrow,
|
|
210
|
+
})
|
|
211
|
+
.remainingAccounts(this.remainingAccounts)
|
|
212
|
+
.instruction();
|
|
213
|
+
}
|
|
214
|
+
getSyState() {
|
|
215
|
+
return this.program.methods
|
|
216
|
+
.getState()
|
|
217
|
+
.accountsStrict({
|
|
218
|
+
meta: this.selfAddress,
|
|
219
|
+
jitoVault: this.account.jitoVault,
|
|
220
|
+
mintSy: this.mintSy,
|
|
221
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
222
|
+
})
|
|
223
|
+
.remainingAccounts(this.remainingAccounts)
|
|
224
|
+
.instruction();
|
|
225
|
+
}
|
|
226
|
+
ixAddEmission({ signer, emissionMint, emissionTokenAccount, }) {
|
|
227
|
+
return this.program.methods
|
|
228
|
+
.addEmission()
|
|
229
|
+
.accountsStrict({
|
|
230
|
+
meta: this.selfAddress,
|
|
231
|
+
signer,
|
|
232
|
+
feePayer: signer,
|
|
233
|
+
tokenEmission: emissionTokenAccount,
|
|
234
|
+
mintEmission: emissionMint,
|
|
235
|
+
systemProgram: anchor_1.web3.SystemProgram.programId,
|
|
236
|
+
adminState: this.adminState,
|
|
237
|
+
})
|
|
238
|
+
.instruction();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
exports.JitoRestakingSySdk = JitoRestakingSySdk;
|
|
242
|
+
function initSy(signer, jitoVault, interfaceAccounts, vrtMint) {
|
|
243
|
+
const program = new anchor_1.Program(jito_restaking_sy_idl_1.IDL, new anchor_1.AnchorProvider(new anchor_1.web3.Connection("https://api.devnet.solana.com"), new MyWallet(anchor_1.web3.Keypair.generate())));
|
|
244
|
+
const pda = new jito_restaking_sy_pda_1.JitoRestakingSyPda(program.programId);
|
|
245
|
+
const syMetaAddress = pda.syMeta({ jitoVault });
|
|
246
|
+
const mintSy = pda.mintSy({ jitoVault });
|
|
247
|
+
console.log("mintSy in sdk", mintSy.toBase58());
|
|
248
|
+
const exponentAdminPda = new exponent_admin_pda_1.ExponentAdminPda(exponent_admin_pda_1.EXPONENT_ADMIN_PROGRAM_ID);
|
|
249
|
+
const metaplexMetadataProgram = new anchor_1.web3.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");
|
|
250
|
+
const mintSyMetaplexMetadataPda = anchor_1.web3.PublicKey.findProgramAddressSync([Buffer.from("metadata"), metaplexMetadataProgram.toBuffer(), mintSy.toBuffer()], metaplexMetadataProgram)[0];
|
|
251
|
+
console.log("vrt mint", vrtMint.toBase58());
|
|
252
|
+
const tokenVrtEscrow = (0, spl_token_1.getAssociatedTokenAddressSync)(vrtMint, syMetaAddress, true, spl_token_1.TOKEN_PROGRAM_ID);
|
|
253
|
+
console.log("tokenVrtEscrow in sy sdk", tokenVrtEscrow.toBase58());
|
|
254
|
+
console.log("admin state key", exponentAdminPda.exponentAdmin().toBase58());
|
|
255
|
+
const interfaceType = { splStakePool: {} };
|
|
256
|
+
const ix = program.methods
|
|
257
|
+
.initSy(new anchor_1.BN(0), new anchor_1.BN(0), "Exponent Wrapped kySOL", "wkySOL", "", interfaceAccounts, interfaceType)
|
|
258
|
+
.accountsStrict({
|
|
259
|
+
syMeta: syMetaAddress,
|
|
260
|
+
jitoVault,
|
|
261
|
+
mintSy: mintSy,
|
|
262
|
+
adminState: exponentAdminPda.exponentAdmin(),
|
|
263
|
+
admin: signer,
|
|
264
|
+
interfaceProgram: anchor_1.web3.PublicKey.default,
|
|
265
|
+
vrtMint,
|
|
266
|
+
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
|
267
|
+
tokenSyEscrow: pda.syEscrow({ jitoVault }),
|
|
268
|
+
systemProgram: anchor_1.web3.SystemProgram.programId,
|
|
269
|
+
metadata: mintSyMetaplexMetadataPda,
|
|
270
|
+
tokenMetadataProgram: metaplexMetadataProgram,
|
|
271
|
+
rent: anchor_1.web3.SYSVAR_RENT_PUBKEY,
|
|
272
|
+
tokenVrtEscrow,
|
|
273
|
+
})
|
|
274
|
+
.instruction();
|
|
275
|
+
return ix;
|
|
276
|
+
}
|
|
277
|
+
exports.initSy = initSy;
|
|
278
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAAyF;AACzF,gFAAiF;AACjF,iDAAmF;AACnF,gFAAyE;AACzE,gFAAiG;AAMjG,sEAAqF;AACrF,0EAA+F;AAE/F,KAAK,UAAU,gBAAgB,CAC7B,GAAoB,EACpB,SAAyB,EACzB,wBAAwC;IAExC,MAAM,GAAG,GAAG,IAAI,0CAAkB,CAAC,wBAAwB,CAAC,CAAA;IAC5D,MAAM,OAAO,GAAG,IAAI,kCAAe,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,wBAAwB,EAAE,CAAC,CAAA;IAClF,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;IAC/C,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAA;IAClE,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAa,QAAQ;IACE;IAArB,YAAqB,KAAmB;QAAnB,UAAK,GAAL,KAAK,CAAc;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,KAAK,CAAC,eAAe,CAAyD,EAAK;QACjF,IAAI,EAAE,YAAY,aAAI,CAAC,WAAW,EAAE,CAAC;YACnC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC5B,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,K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{ value: true });
|
|
3
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
async function main() {
|
|
6
|
+
const cnx = new anchor_1.web3.Connection("https://api.mainnet-beta.solana.com");
|
|
7
|
+
const jitoVault = new anchor_1.web3.PublicKey("JitoVault111111111111111111111111111111111111111");
|
|
8
|
+
const jitoRestakingSyProgramId = new anchor_1.web3.PublicKey("JitoRestakingSy111111111111111111111111111111111");
|
|
9
|
+
const recentBlockhash = "1";
|
|
10
|
+
const sdk = await _1.JitoRestakingSySdk.load({
|
|
11
|
+
cnx,
|
|
12
|
+
jitoVault,
|
|
13
|
+
jitoRestakingSyProgramId,
|
|
14
|
+
});
|
|
15
|
+
console.log(sdk);
|
|
16
|
+
}
|
|
17
|
+
main()
|
|
18
|
+
.then(() => console.log("done"))
|
|
19
|
+
.catch((err) => console.error(err));
|
|
20
|
+
//# sourceMappingURL=tryit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tryit.js","sourceRoot":"","sources":["../src/tryit.ts"],"names":[],"mappings":";;AAAA,8CAAwC;AACxC,wBAAsC;AAEtC,KAAK,UAAU,IAAI;IACjB,MAAM,GAAG,GAAG,IAAI,aAAI,CAAC,UAAU,CAAC,qCAAqC,CAAC,CAAA;IACtE,MAAM,SAAS,GAAG,IAAI,aAAI,CAAC,SAAS,CAAC,kDAAkD,CAAC,CAAA;IACxF,MAAM,wBAAwB,GAAG,IAAI,aAAI,CAAC,SAAS,CAAC,kDAAkD,CAAC,CAAA;IACvG,MAAM,eAAe,GAAG,GAAG,CAAA;IAE3B,MAAM,GAAG,GAAG,MAAM,qBAAkB,CAAC,IAAI,CAAC;QACxC,GAAG;QACH,SAAS;QACT,wBAAwB;KACzB,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAClB,CAAC;AAED,IAAI,EAAE;KACH,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;KAC/B,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@exponent-labs/jito-restaking-sy-sdk",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"main": "build/index.js",
|
|
5
|
+
"types": "build/index.d.ts",
|
|
6
|
+
"license": "AGPL-3.0",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc --build",
|
|
9
|
+
"tryit": "ts-node src/tryit.ts"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@coral-xyz/anchor": "^0.30.1",
|
|
13
|
+
"@exponent-labs/exponent-admin-pda": "^0.0.3",
|
|
14
|
+
"@exponent-labs/exponent-fetcher": "^0.0.3",
|
|
15
|
+
"@exponent-labs/exponent-types": "^0.0.3",
|
|
16
|
+
"@exponent-labs/jito-restaking-sy-idl": "^0.0.3",
|
|
17
|
+
"@exponent-labs/jito-restaking-sy-pda": "^0.0.3",
|
|
18
|
+
"@solana/spl-token": "^0.4.6"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5.4.5"
|
|
22
|
+
},
|
|
23
|
+
"gitHead": "209b8847e9a0fadb5b5ec96b9b47f0ace4a3bf9d"
|
|
24
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { AnchorProvider, BN, BorshCoder, Program, Wallet, web3 } from "@coral-xyz/anchor"
|
|
2
|
+
import { IDL, JitoRestakingStandard } from "@exponent-labs/jito-restaking-sy-idl"
|
|
3
|
+
import { getAssociatedTokenAddressSync, TOKEN_PROGRAM_ID } from "@solana/spl-token"
|
|
4
|
+
import { JitoRestakingSyPda } from "@exponent-labs/jito-restaking-sy-pda"
|
|
5
|
+
import { PROGRAM_ID as JITO_RESTAKING_SY_PROGRAM_ID } from "@exponent-labs/jito-restaking-sy-idl"
|
|
6
|
+
import {
|
|
7
|
+
JitoRestakingSyState,
|
|
8
|
+
JitoRestakingSyMetaAccount,
|
|
9
|
+
JitoRestakingSyMetaAccountRaw,
|
|
10
|
+
} from "@exponent-labs/exponent-types"
|
|
11
|
+
import { ExponentFetcher, fetchJitoRestaking } from "@exponent-labs/exponent-fetcher"
|
|
12
|
+
import { EXPONENT_ADMIN_PROGRAM_ID, ExponentAdminPda } from "@exponent-labs/exponent-admin-pda"
|
|
13
|
+
|
|
14
|
+
async function loadAccountState(
|
|
15
|
+
cnx: web3.Connection,
|
|
16
|
+
jitoVault: web3.PublicKey,
|
|
17
|
+
jitoRestakingSyProgramId: web3.PublicKey,
|
|
18
|
+
) {
|
|
19
|
+
const pda = new JitoRestakingSyPda(jitoRestakingSyProgramId)
|
|
20
|
+
const fetcher = new ExponentFetcher({ connection: cnx, jitoRestakingSyProgramId })
|
|
21
|
+
const syMetaAddress = pda.syMeta({ jitoVault })
|
|
22
|
+
const data = await fetcher.fetchJitoRestakingSyMeta(syMetaAddress)
|
|
23
|
+
return data
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class MyWallet implements Wallet {
|
|
27
|
+
constructor(readonly payer: web3.Keypair) {
|
|
28
|
+
this.payer = payer
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async signTransaction<T extends web3.Transaction | web3.VersionedTransaction>(tx: T): Promise<T> {
|
|
32
|
+
if (tx instanceof web3.Transaction) {
|
|
33
|
+
tx.partialSign(this.payer)
|
|
34
|
+
} else {
|
|
35
|
+
tx.sign([this.payer])
|
|
36
|
+
}
|
|
37
|
+
return tx
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async signAllTransactions<T extends web3.Transaction | web3.VersionedTransaction>(txs: T[]): Promise<T[]> {
|
|
41
|
+
return txs.map((t) => {
|
|
42
|
+
if (t instanceof web3.Transaction) {
|
|
43
|
+
t.partialSign(this.payer)
|
|
44
|
+
} else if (t instanceof web3.VersionedTransaction) {
|
|
45
|
+
t.sign([this.payer])
|
|
46
|
+
}
|
|
47
|
+
return t
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
get publicKey(): web3.PublicKey {
|
|
52
|
+
return this.payer.publicKey
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class JitoRestakingSySdk {
|
|
57
|
+
/** Private program for building instructions */
|
|
58
|
+
private program: Program<JitoRestakingStandard>
|
|
59
|
+
|
|
60
|
+
syPda: JitoRestakingSyPda
|
|
61
|
+
|
|
62
|
+
constructor(
|
|
63
|
+
public state: JitoRestakingSyState,
|
|
64
|
+
programId: web3.PublicKey = new web3.PublicKey(JITO_RESTAKING_SY_PROGRAM_ID),
|
|
65
|
+
) {
|
|
66
|
+
// create a fake AnchorProvider -- which is unused
|
|
67
|
+
this.program = new Program<JitoRestakingStandard>(
|
|
68
|
+
IDL as JitoRestakingStandard,
|
|
69
|
+
new AnchorProvider(new web3.Connection("https://api.devnet.solana.com"), new MyWallet(web3.Keypair.generate())),
|
|
70
|
+
)
|
|
71
|
+
this.syPda = new JitoRestakingSyPda(programId)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Load an instance of SyMeta */
|
|
75
|
+
static async load({
|
|
76
|
+
cnx,
|
|
77
|
+
jitoVault,
|
|
78
|
+
jitoRestakingSyProgramId,
|
|
79
|
+
}: {
|
|
80
|
+
cnx: web3.Connection
|
|
81
|
+
jitoVault: web3.PublicKey
|
|
82
|
+
jitoRestakingSyProgramId: web3.PublicKey
|
|
83
|
+
}) {
|
|
84
|
+
const account = await loadAccountState(cnx, jitoVault, jitoRestakingSyProgramId)
|
|
85
|
+
const b = await fetchJitoRestaking(cnx, account.interfaceAccounts, account.interfaceType, jitoVault)
|
|
86
|
+
|
|
87
|
+
// const baseMintAi = await cnx.getAccountInfo(b.)
|
|
88
|
+
const tokenProgramBase = TOKEN_PROGRAM_ID
|
|
89
|
+
const selfAddress = new JitoRestakingSyPda(jitoRestakingSyProgramId).syMeta({ jitoVault })
|
|
90
|
+
|
|
91
|
+
const state = {
|
|
92
|
+
selfAddress,
|
|
93
|
+
account,
|
|
94
|
+
underlyingExchangeRate: b.exchangeRateUnderlying,
|
|
95
|
+
syRate: b.exchangeRate,
|
|
96
|
+
// find way to get real base mint
|
|
97
|
+
mintBase: b.mintBase,
|
|
98
|
+
tokenProgramBase,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return new JitoRestakingSySdk(state, jitoRestakingSyProgramId)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
get refreshJitoRestakingVaultInstruction() {
|
|
105
|
+
return new web3.TransactionInstruction({
|
|
106
|
+
keys: [
|
|
107
|
+
{
|
|
108
|
+
isSigner: false,
|
|
109
|
+
isWritable: false,
|
|
110
|
+
// Global config state for the Restaking Vault
|
|
111
|
+
pubkey: new web3.PublicKey("UwuSgAq4zByffCGCrWH87DsjfsewYjuqHfJEpzw1Jq3"),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
isSigner: false,
|
|
115
|
+
isWritable: true,
|
|
116
|
+
pubkey: this.state.account.jitoVault,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
isSigner: false,
|
|
120
|
+
isWritable: true,
|
|
121
|
+
// JitoSOL token account for KYSOL vault
|
|
122
|
+
pubkey: new web3.PublicKey("CRFtzwkekKorgdTRSdvsYeqL1vEuVvwGRvweuWCyaRt3"),
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
isSigner: false,
|
|
126
|
+
isWritable: true,
|
|
127
|
+
// kysol mint
|
|
128
|
+
pubkey: this.state.mintBase,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
isSigner: false,
|
|
132
|
+
isWritable: false,
|
|
133
|
+
// JitoSOL fee token account for KYSOL vault
|
|
134
|
+
pubkey: new web3.PublicKey("EQM9GdsSwwrUpYwUm53a1dtsQTdB8XVPVsJB8U3SV4q6"),
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
isSigner: false,
|
|
138
|
+
isWritable: false,
|
|
139
|
+
// Token program
|
|
140
|
+
pubkey: new web3.PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
programId: new web3.PublicKey("Vau1t6sLNxnzB7ZDsef8TLbPLfyZMYXH8WTNqUdm9g8"),
|
|
144
|
+
data: Buffer.from(Uint8Array.from([25])),
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Reload the state of the account */
|
|
149
|
+
async reload(cnx: web3.Connection) {
|
|
150
|
+
const b = await fetchJitoRestaking(
|
|
151
|
+
cnx,
|
|
152
|
+
this.state.account.interfaceAccounts,
|
|
153
|
+
this.state.account.interfaceType,
|
|
154
|
+
this.state.account.jitoVault,
|
|
155
|
+
)
|
|
156
|
+
const account = await loadAccountState(cnx, this.state.account.jitoVault, this.program.programId)
|
|
157
|
+
this.state.account = account
|
|
158
|
+
this.state.syRate = b.exchangeRate
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
get account() {
|
|
162
|
+
return this.state.account
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
get mintSy() {
|
|
166
|
+
return this.account.mintSy
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
get maxSySupply() {
|
|
170
|
+
return this.account.maxSySupply
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
get emissions() {
|
|
174
|
+
return this.account.emissions
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
get minMintSize() {
|
|
178
|
+
return this.account.minMintSize
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
get minRedeemSize() {
|
|
182
|
+
return this.account.minRedeemSize
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
get mintBase() {
|
|
186
|
+
return this.state.mintBase
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
get selfAddress() {
|
|
190
|
+
return this.state.selfAddress
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
get tokenProgramBase() {
|
|
194
|
+
return this.state.tokenProgramBase
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
get tokenVrtEscrow() {
|
|
198
|
+
return getAssociatedTokenAddressSync(this.mintBase, this.selfAddress, true, TOKEN_PROGRAM_ID)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
get tokenSyEscrow() {
|
|
202
|
+
return this.state.account.tokenSyEscrow
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
get adminState() {
|
|
206
|
+
return new ExponentAdminPda(EXPONENT_ADMIN_PROGRAM_ID).exponentAdmin()
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
get remainingAccounts() {
|
|
210
|
+
return this.account.interfaceAccounts
|
|
211
|
+
.map((a) => ({
|
|
212
|
+
pubkey: a,
|
|
213
|
+
isSigner: false,
|
|
214
|
+
isWritable: true,
|
|
215
|
+
}))
|
|
216
|
+
.concat(this.emissions.map((e) => ({ pubkey: e.escrowAccount, isSigner: false, isWritable: false })))
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
ixMintSy({
|
|
220
|
+
depositor,
|
|
221
|
+
amountBase,
|
|
222
|
+
baseSrc,
|
|
223
|
+
syDst,
|
|
224
|
+
}: {
|
|
225
|
+
depositor: web3.PublicKey
|
|
226
|
+
amountBase: string
|
|
227
|
+
baseSrc?: web3.PublicKey
|
|
228
|
+
syDst?: web3.PublicKey
|
|
229
|
+
}) {
|
|
230
|
+
baseSrc = baseSrc || getAssociatedTokenAddressSync(this.mintBase, depositor, true, this.state.tokenProgramBase)
|
|
231
|
+
console.log("baseSrc", baseSrc.toBase58())
|
|
232
|
+
console.log("depositor", depositor.toBase58())
|
|
233
|
+
syDst = syDst || getAssociatedTokenAddressSync(this.mintSy, depositor, true, TOKEN_PROGRAM_ID)
|
|
234
|
+
|
|
235
|
+
console.log()
|
|
236
|
+
|
|
237
|
+
return this.program.methods
|
|
238
|
+
.mint(new BN(amountBase))
|
|
239
|
+
.accountsStrict({
|
|
240
|
+
meta: this.selfAddress,
|
|
241
|
+
jitoVault: this.account.jitoVault,
|
|
242
|
+
baseTokenProgram: this.tokenProgramBase,
|
|
243
|
+
depositor,
|
|
244
|
+
mintSy: this.mintSy,
|
|
245
|
+
tokenBaseDepositor: baseSrc,
|
|
246
|
+
tokenSyDepositor: syDst,
|
|
247
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
248
|
+
tokenVrtEscrow: this.tokenVrtEscrow,
|
|
249
|
+
})
|
|
250
|
+
.remainingAccounts(this.remainingAccounts)
|
|
251
|
+
.instruction()
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
ixRedeemSy({
|
|
255
|
+
redeemer,
|
|
256
|
+
amountSy,
|
|
257
|
+
baseDst,
|
|
258
|
+
sySrc,
|
|
259
|
+
}: {
|
|
260
|
+
redeemer: web3.PublicKey
|
|
261
|
+
amountSy: string
|
|
262
|
+
baseDst?: web3.PublicKey
|
|
263
|
+
sySrc?: web3.PublicKey
|
|
264
|
+
}) {
|
|
265
|
+
baseDst = baseDst || getAssociatedTokenAddressSync(this.mintBase, redeemer, true, this.tokenProgramBase)
|
|
266
|
+
sySrc = sySrc || getAssociatedTokenAddressSync(this.mintSy, redeemer, true, TOKEN_PROGRAM_ID)
|
|
267
|
+
|
|
268
|
+
return this.program.methods
|
|
269
|
+
.redeem(new BN(amountSy))
|
|
270
|
+
.accountsStrict({
|
|
271
|
+
meta: this.selfAddress,
|
|
272
|
+
mintSy: this.mintSy,
|
|
273
|
+
tokenSySigner: sySrc,
|
|
274
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
275
|
+
signer: redeemer,
|
|
276
|
+
jitoVault: this.account.jitoVault,
|
|
277
|
+
tokenBaseDst: baseDst,
|
|
278
|
+
tokenBaseProgram: this.tokenProgramBase,
|
|
279
|
+
tokenVrtEscrow: this.tokenVrtEscrow,
|
|
280
|
+
})
|
|
281
|
+
.remainingAccounts(this.remainingAccounts)
|
|
282
|
+
.instruction()
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
getSyState() {
|
|
286
|
+
return this.program.methods
|
|
287
|
+
.getState()
|
|
288
|
+
.accountsStrict({
|
|
289
|
+
meta: this.selfAddress,
|
|
290
|
+
jitoVault: this.account.jitoVault,
|
|
291
|
+
mintSy: this.mintSy,
|
|
292
|
+
tokenSyEscrow: this.tokenSyEscrow,
|
|
293
|
+
})
|
|
294
|
+
.remainingAccounts(this.remainingAccounts)
|
|
295
|
+
.instruction()
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
ixAddEmission({
|
|
299
|
+
signer,
|
|
300
|
+
emissionMint,
|
|
301
|
+
emissionTokenAccount,
|
|
302
|
+
}: {
|
|
303
|
+
signer: web3.PublicKey
|
|
304
|
+
emissionMint: web3.PublicKey
|
|
305
|
+
emissionTokenAccount: web3.PublicKey
|
|
306
|
+
}) {
|
|
307
|
+
return this.program.methods
|
|
308
|
+
.addEmission()
|
|
309
|
+
.accountsStrict({
|
|
310
|
+
meta: this.selfAddress,
|
|
311
|
+
signer,
|
|
312
|
+
feePayer: signer,
|
|
313
|
+
tokenEmission: emissionTokenAccount,
|
|
314
|
+
mintEmission: emissionMint,
|
|
315
|
+
systemProgram: web3.SystemProgram.programId,
|
|
316
|
+
adminState: this.adminState,
|
|
317
|
+
})
|
|
318
|
+
.instruction()
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function initSy(
|
|
323
|
+
signer: web3.PublicKey,
|
|
324
|
+
jitoVault: web3.PublicKey,
|
|
325
|
+
interfaceAccounts: web3.PublicKey[],
|
|
326
|
+
vrtMint: web3.PublicKey,
|
|
327
|
+
) {
|
|
328
|
+
const program = new Program<JitoRestakingStandard>(
|
|
329
|
+
IDL as JitoRestakingStandard,
|
|
330
|
+
new AnchorProvider(new web3.Connection("https://api.devnet.solana.com"), new MyWallet(web3.Keypair.generate())),
|
|
331
|
+
)
|
|
332
|
+
|
|
333
|
+
const pda = new JitoRestakingSyPda(program.programId)
|
|
334
|
+
const syMetaAddress = pda.syMeta({ jitoVault })
|
|
335
|
+
const mintSy = pda.mintSy({ jitoVault })
|
|
336
|
+
console.log("mintSy in sdk", mintSy.toBase58())
|
|
337
|
+
const exponentAdminPda = new ExponentAdminPda(EXPONENT_ADMIN_PROGRAM_ID)
|
|
338
|
+
|
|
339
|
+
const metaplexMetadataProgram = new web3.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s")
|
|
340
|
+
const mintSyMetaplexMetadataPda = web3.PublicKey.findProgramAddressSync(
|
|
341
|
+
[Buffer.from("metadata"), metaplexMetadataProgram.toBuffer(), mintSy.toBuffer()],
|
|
342
|
+
metaplexMetadataProgram,
|
|
343
|
+
)[0]
|
|
344
|
+
|
|
345
|
+
console.log("vrt mint", vrtMint.toBase58())
|
|
346
|
+
const tokenVrtEscrow = getAssociatedTokenAddressSync(vrtMint, syMetaAddress, true, TOKEN_PROGRAM_ID)
|
|
347
|
+
console.log("tokenVrtEscrow in sy sdk", tokenVrtEscrow.toBase58())
|
|
348
|
+
|
|
349
|
+
console.log("admin state key", exponentAdminPda.exponentAdmin().toBase58())
|
|
350
|
+
const interfaceType = { splStakePool: {} }
|
|
351
|
+
const ix = program.methods
|
|
352
|
+
.initSy(new BN(0), new BN(0), "Exponent Wrapped kySOL", "wkySOL", "", interfaceAccounts, interfaceType)
|
|
353
|
+
.accountsStrict({
|
|
354
|
+
syMeta: syMetaAddress,
|
|
355
|
+
jitoVault,
|
|
356
|
+
mintSy: mintSy,
|
|
357
|
+
adminState: exponentAdminPda.exponentAdmin(),
|
|
358
|
+
admin: signer,
|
|
359
|
+
interfaceProgram: web3.PublicKey.default,
|
|
360
|
+
vrtMint,
|
|
361
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
362
|
+
tokenSyEscrow: pda.syEscrow({ jitoVault }),
|
|
363
|
+
systemProgram: web3.SystemProgram.programId,
|
|
364
|
+
metadata: mintSyMetaplexMetadataPda,
|
|
365
|
+
tokenMetadataProgram: metaplexMetadataProgram,
|
|
366
|
+
rent: web3.SYSVAR_RENT_PUBKEY,
|
|
367
|
+
tokenVrtEscrow,
|
|
368
|
+
})
|
|
369
|
+
.instruction()
|
|
370
|
+
|
|
371
|
+
return ix
|
|
372
|
+
}
|
package/src/tryit.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { web3 } from "@coral-xyz/anchor"
|
|
2
|
+
import { JitoRestakingSySdk } from "."
|
|
3
|
+
|
|
4
|
+
async function main() {
|
|
5
|
+
const cnx = new web3.Connection("https://api.mainnet-beta.solana.com")
|
|
6
|
+
const jitoVault = new web3.PublicKey("JitoVault111111111111111111111111111111111111111")
|
|
7
|
+
const jitoRestakingSyProgramId = new web3.PublicKey("JitoRestakingSy111111111111111111111111111111111")
|
|
8
|
+
const recentBlockhash = "1"
|
|
9
|
+
|
|
10
|
+
const sdk = await JitoRestakingSySdk.load({
|
|
11
|
+
cnx,
|
|
12
|
+
jitoVault,
|
|
13
|
+
jitoRestakingSyProgramId,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
console.log(sdk)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
main()
|
|
20
|
+
.then(() => console.log("done"))
|
|
21
|
+
.catch((err) => console.error(err))
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": "src",
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"incremental": true /* Save .tsbuildinfo files to allow for incremental compilation of projects. */,
|
|
6
|
+
"composite": true /* Enable constraints that allow a TypeScript project to be used with project references. */,
|
|
7
|
+
"target": "ESNext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
8
|
+
"module": "CommonJS" /* Specify what module code is generated. */,
|
|
9
|
+
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
10
|
+
"outDir": "./build" /* Specify an output folder for all emitted files. */,
|
|
11
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
12
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
13
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
|
14
|
+
"resolveJsonModule": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*.ts", "src/**/*.json"],
|
|
17
|
+
"exclude": ["node_modules", "build"],
|
|
18
|
+
"references": [
|
|
19
|
+
{ "path": "../jito-restaking-sy-idl" },
|
|
20
|
+
{ "path": "../exponent-types" },
|
|
21
|
+
{ "path": "../exponent-fetcher" },
|
|
22
|
+
{ "path": "../jito-restaking-sy-pda" },
|
|
23
|
+
{ "path": "../exponent-admin-pda" }
|
|
24
|
+
]
|
|
25
|
+
}
|