100x-sdk 1.0.2 → 1.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/dist/100x-sdk.cjs.js +595 -6
- package/dist/100x-sdk.esm.js +598 -9
- package/dist/100x-sdk.js +598 -9
- package/dist/100x-sdk.js.map +1 -1
- package/package.json +1 -1
package/dist/100x-sdk.esm.js
CHANGED
|
@@ -20401,6 +20401,7 @@ class TradingModule$1 {
|
|
|
20401
20401
|
mintAccount: mint,
|
|
20402
20402
|
curveAccount: accounts.curveAccount,
|
|
20403
20403
|
poolTokenAccount: accounts.poolTokenAccount,
|
|
20404
|
+
poolBorrowTokenAccount: accounts.poolBorrowTokenAccount,
|
|
20404
20405
|
poolSolAccount: accounts.poolSolAccount,
|
|
20405
20406
|
upOrderbook: upOrderbook,
|
|
20406
20407
|
downOrderbook: downOrderbook,
|
|
@@ -20537,6 +20538,7 @@ class TradingModule$1 {
|
|
|
20537
20538
|
mintAccount: mint,
|
|
20538
20539
|
curveAccount: accounts.curveAccount,
|
|
20539
20540
|
poolTokenAccount: accounts.poolTokenAccount,
|
|
20541
|
+
poolBorrowTokenAccount: accounts.poolBorrowTokenAccount,
|
|
20540
20542
|
poolSolAccount: accounts.poolSolAccount,
|
|
20541
20543
|
upOrderbook: upOrderbook,
|
|
20542
20544
|
downOrderbook: downOrderbook,
|
|
@@ -20658,6 +20660,7 @@ class TradingModule$1 {
|
|
|
20658
20660
|
mintAccount: mint,
|
|
20659
20661
|
curveAccount: accounts.curveAccount,
|
|
20660
20662
|
poolTokenAccount: accounts.poolTokenAccount,
|
|
20663
|
+
poolBorrowTokenAccount: accounts.poolBorrowTokenAccount,
|
|
20661
20664
|
poolSolAccount: accounts.poolSolAccount,
|
|
20662
20665
|
tokenProgram: TOKEN_PROGRAM_ID$2,
|
|
20663
20666
|
systemProgram: SystemProgram$3.programId,
|
|
@@ -20769,6 +20772,7 @@ class TradingModule$1 {
|
|
|
20769
20772
|
mintAccount: mint,
|
|
20770
20773
|
curveAccount: accounts.curveAccount,
|
|
20771
20774
|
poolTokenAccount: accounts.poolTokenAccount,
|
|
20775
|
+
poolBorrowTokenAccount: accounts.poolBorrowTokenAccount,
|
|
20772
20776
|
poolSolAccount: accounts.poolSolAccount,
|
|
20773
20777
|
tokenProgram: TOKEN_PROGRAM_ID$2,
|
|
20774
20778
|
systemProgram: SystemProgram$3.programId,
|
|
@@ -20912,6 +20916,7 @@ class TradingModule$1 {
|
|
|
20912
20916
|
mintAccount: mint,
|
|
20913
20917
|
curveAccount: accounts.curveAccount,
|
|
20914
20918
|
poolTokenAccount: accounts.poolTokenAccount,
|
|
20919
|
+
poolBorrowTokenAccount: accounts.poolBorrowTokenAccount,
|
|
20915
20920
|
poolSolAccount: accounts.poolSolAccount,
|
|
20916
20921
|
userSolAccount: userSolAccountPubkey, // 开仓用户的SOL账户 / User SOL account (must be order opener)
|
|
20917
20922
|
tokenProgram: TOKEN_PROGRAM_ID$2,
|
|
@@ -21061,6 +21066,7 @@ class TradingModule$1 {
|
|
|
21061
21066
|
mintAccount: mint,
|
|
21062
21067
|
curveAccount: accounts.curveAccount,
|
|
21063
21068
|
poolTokenAccount: accounts.poolTokenAccount,
|
|
21069
|
+
poolBorrowTokenAccount: accounts.poolBorrowTokenAccount,
|
|
21064
21070
|
poolSolAccount: accounts.poolSolAccount,
|
|
21065
21071
|
userSolAccount: userSolAccountPubkey, // 开仓用户的SOL账户 / User SOL account (must be order opener)
|
|
21066
21072
|
tokenProgram: TOKEN_PROGRAM_ID$2,
|
|
@@ -21122,6 +21128,12 @@ class TradingModule$1 {
|
|
|
21122
21128
|
this.sdk.programId
|
|
21123
21129
|
);
|
|
21124
21130
|
|
|
21131
|
+
// 计算借贷池专用代币账户 PDA
|
|
21132
|
+
const [poolBorrowTokenAccount] = PublicKey$6.findProgramAddressSync(
|
|
21133
|
+
[Buffer$6.from('pool_borrow_token'), mintAccount.toBuffer()],
|
|
21134
|
+
this.sdk.programId
|
|
21135
|
+
);
|
|
21136
|
+
|
|
21125
21137
|
// 计算池子 SOL 账户 PDA
|
|
21126
21138
|
const [poolSolAccount] = PublicKey$6.findProgramAddressSync(
|
|
21127
21139
|
[Buffer$6.from('pool_sol'), mintAccount.toBuffer()],
|
|
@@ -21131,6 +21143,7 @@ class TradingModule$1 {
|
|
|
21131
21143
|
return {
|
|
21132
21144
|
curveAccount,
|
|
21133
21145
|
poolTokenAccount,
|
|
21146
|
+
poolBorrowTokenAccount,
|
|
21134
21147
|
poolSolAccount
|
|
21135
21148
|
};
|
|
21136
21149
|
}
|
|
@@ -21271,6 +21284,15 @@ class TokenModule$1 {
|
|
|
21271
21284
|
this.sdk.programId
|
|
21272
21285
|
);
|
|
21273
21286
|
|
|
21287
|
+
// Calculate borrow pool token account address (pool_borrow_token)
|
|
21288
|
+
const [poolBorrowTokenAccount] = PublicKey$5.findProgramAddressSync(
|
|
21289
|
+
[
|
|
21290
|
+
Buffer$5.from("pool_borrow_token"),
|
|
21291
|
+
mint.publicKey.toBuffer(),
|
|
21292
|
+
],
|
|
21293
|
+
this.sdk.programId
|
|
21294
|
+
);
|
|
21295
|
+
|
|
21274
21296
|
// Calculate liquidity pool SOL account address (pool_sol)
|
|
21275
21297
|
const [poolSolAccount] = PublicKey$5.findProgramAddressSync(
|
|
21276
21298
|
[
|
|
@@ -21310,6 +21332,7 @@ class TokenModule$1 {
|
|
|
21310
21332
|
console.log('Calculated account addresses:');
|
|
21311
21333
|
console.log(' Borrowing liquidity pool account:', curveAccount.toString());
|
|
21312
21334
|
console.log(' Liquidity pool token account:', poolTokenAccount.toString());
|
|
21335
|
+
console.log(' Borrow pool token account:', poolBorrowTokenAccount.toString());
|
|
21313
21336
|
console.log(' Liquidity pool SOL account:', poolSolAccount.toString());
|
|
21314
21337
|
console.log(' Up orderbook:', upOrderbook.toString());
|
|
21315
21338
|
console.log(' Down orderbook:', downOrderbook.toString());
|
|
@@ -21343,6 +21366,7 @@ class TokenModule$1 {
|
|
|
21343
21366
|
mintAccount: mint.publicKey,
|
|
21344
21367
|
curveAccount: curveAccount,
|
|
21345
21368
|
poolTokenAccount: poolTokenAccount,
|
|
21369
|
+
poolBorrowTokenAccount: poolBorrowTokenAccount,
|
|
21346
21370
|
poolSolAccount: poolSolAccount,
|
|
21347
21371
|
upOrderbook: upOrderbook,
|
|
21348
21372
|
downOrderbook: downOrderbook,
|
|
@@ -21369,6 +21393,7 @@ class TokenModule$1 {
|
|
|
21369
21393
|
mint: mint.publicKey,
|
|
21370
21394
|
curveAccount,
|
|
21371
21395
|
poolTokenAccount,
|
|
21396
|
+
poolBorrowTokenAccount,
|
|
21372
21397
|
poolSolAccount,
|
|
21373
21398
|
upOrderbook,
|
|
21374
21399
|
downOrderbook,
|
|
@@ -21532,6 +21557,7 @@ class TokenModule$1 {
|
|
|
21532
21557
|
mintAccount: mintPubkey,
|
|
21533
21558
|
curveAccount: createResult.accounts.curveAccount,
|
|
21534
21559
|
poolTokenAccount: createResult.accounts.poolTokenAccount,
|
|
21560
|
+
poolBorrowTokenAccount: createResult.accounts.poolBorrowTokenAccount,
|
|
21535
21561
|
poolSolAccount: createResult.accounts.poolSolAccount,
|
|
21536
21562
|
upOrderbook: upOrderbook,
|
|
21537
21563
|
downOrderbook: downOrderbook,
|
|
@@ -36798,12 +36824,20 @@ class ChainModule$1 {
|
|
|
36798
36824
|
* @returns {string} returns.downOrderbook - Down orderbook (long orders) PDA address
|
|
36799
36825
|
* @returns {string} returns.creator - Token creator address, the wallet that created this token
|
|
36800
36826
|
* @returns {string} returns.poolTokenAccount - Pool token account address, stores tokens in the liquidity pool
|
|
36827
|
+
* @returns {string} returns.poolBorrowTokenAccount - Pool borrow token account address (PDA seed "pool_borrow_token"), stores tokens for the borrow pool
|
|
36801
36828
|
* @returns {string} returns.poolSolAccount - Pool SOL account address, stores native SOL in the liquidity pool
|
|
36802
36829
|
*
|
|
36830
|
+
* **Dynamic Liquidity Pool Parameters:**
|
|
36831
|
+
* @returns {bigint} returns.initialVirtualSol - Initial virtual SOL reserve (lamports), used for k value / price curve
|
|
36832
|
+
* @returns {bigint} returns.initialVirtualToken - Initial virtual Token reserve (smallest unit), used for k value / price curve
|
|
36833
|
+
* @returns {bigint} returns.initialBorrowTokenReserve - Borrow pool initial funding (smallest unit), never changes after creation. Borrowed out = initialBorrowTokenReserve - borrowTokenReserve
|
|
36834
|
+
* @returns {number} returns.poolType - Pool type (0: basic version, 1: advanced version)
|
|
36835
|
+
* @returns {number} returns.borrowPoolRatio - Borrow pool token ratio (5-30 means 5%-30%, basic version fixed at 20)
|
|
36836
|
+
*
|
|
36803
36837
|
* **Token Supply Information:**
|
|
36804
36838
|
* @returns {bigint} returns.totalSupply - Total token supply (smallest unit)
|
|
36805
36839
|
* @returns {number} returns.decimals - Token decimal places
|
|
36806
|
-
* @returns {bigint} returns.initialBorrowPool - Initial borrow pool size =
|
|
36840
|
+
* @returns {bigint} returns.initialBorrowPool - Initial borrow pool size (= initialBorrowTokenReserve from chain)
|
|
36807
36841
|
* @returns {bigint} returns.circulatingSupply - Circulating supply = totalSupply - borrowTokenReserve
|
|
36808
36842
|
*
|
|
36809
36843
|
* **Balance Information:**
|
|
@@ -36959,6 +36993,15 @@ class ChainModule$1 {
|
|
|
36959
36993
|
this.sdk.programId
|
|
36960
36994
|
);
|
|
36961
36995
|
|
|
36996
|
+
// 借贷池专用 token 账户 PDA(合约新增,seed = "pool_borrow_token")
|
|
36997
|
+
const [poolBorrowTokenAccountPDA] = PublicKey$3.findProgramAddressSync(
|
|
36998
|
+
[
|
|
36999
|
+
Buffer$3.from("pool_borrow_token"),
|
|
37000
|
+
mintPubkey.toBuffer()
|
|
37001
|
+
],
|
|
37002
|
+
this.sdk.programId
|
|
37003
|
+
);
|
|
37004
|
+
|
|
36962
37005
|
const [poolSolAccountPDA] = PublicKey$3.findProgramAddressSync(
|
|
36963
37006
|
[
|
|
36964
37007
|
Buffer$3.from("pool_sol"),
|
|
@@ -36971,6 +37014,7 @@ class ChainModule$1 {
|
|
|
36971
37014
|
let baseFeeRecipientBalance = 0;
|
|
36972
37015
|
let feeRecipientBalance = 0;
|
|
36973
37016
|
let poolTokenBalance = { value: { amount: '0' } };
|
|
37017
|
+
let poolBorrowTokenBalance = { value: { amount: '0' } };
|
|
36974
37018
|
let poolSolBalance = 0;
|
|
36975
37019
|
let tokenSupply = { value: { amount: '0', decimals: 0 } };
|
|
36976
37020
|
|
|
@@ -36979,12 +37023,14 @@ class ChainModule$1 {
|
|
|
36979
37023
|
baseFeeRecipientBalance,
|
|
36980
37024
|
feeRecipientBalance,
|
|
36981
37025
|
poolTokenBalance,
|
|
37026
|
+
poolBorrowTokenBalance,
|
|
36982
37027
|
poolSolBalance,
|
|
36983
37028
|
tokenSupply
|
|
36984
37029
|
] = await Promise.all([
|
|
36985
37030
|
this.sdk.connection.getBalance(decodedData.baseFeeRecipient),
|
|
36986
37031
|
this.sdk.connection.getBalance(decodedData.feeRecipient),
|
|
36987
37032
|
this.sdk.connection.getTokenAccountBalance(poolTokenAccountPDA).catch(() => ({ value: { amount: '0' } })),
|
|
37033
|
+
this.sdk.connection.getTokenAccountBalance(poolBorrowTokenAccountPDA).catch(() => ({ value: { amount: '0' } })),
|
|
36988
37034
|
this.sdk.connection.getBalance(poolSolAccountPDA),
|
|
36989
37035
|
this.sdk.connection.getTokenSupply(mintPubkey)
|
|
36990
37036
|
]);
|
|
@@ -37023,6 +37069,10 @@ class ChainModule$1 {
|
|
|
37023
37069
|
initialVirtualSol: BigInt(decodedData.initialVirtualSol.toString()), // u64, lamports
|
|
37024
37070
|
initialVirtualToken: BigInt(decodedData.initialVirtualToken.toString()), // u64, 最小单位
|
|
37025
37071
|
|
|
37072
|
+
// 借贷池初始资金(合约新增),创建后永不变
|
|
37073
|
+
// 已借出量 = initialBorrowTokenReserve - borrowTokenReserve
|
|
37074
|
+
initialBorrowTokenReserve: BigInt(decodedData.initialBorrowTokenReserve.toString()), // u64, 最小单位
|
|
37075
|
+
|
|
37026
37076
|
// === 第二阶段新增字段:高级版池子参数 ===
|
|
37027
37077
|
poolType: decodedData.poolType, // u8, 0=普通版, 1=高级版
|
|
37028
37078
|
borrowPoolRatio: decodedData.borrowPoolRatio, // u8, 5-30表示5%-30%
|
|
@@ -37030,7 +37080,8 @@ class ChainModule$1 {
|
|
|
37030
37080
|
// Token Supply 信息
|
|
37031
37081
|
totalSupply: BigInt(tokenSupply.value.amount),
|
|
37032
37082
|
decimals: tokenSupply.value.decimals,
|
|
37033
|
-
|
|
37083
|
+
// 借贷池初始总量,直接取链上字段(旧公式 totalSupply - initialVirtualToken 已废弃)
|
|
37084
|
+
initialBorrowPool: BigInt(decodedData.initialBorrowTokenReserve.toString()),
|
|
37034
37085
|
circulatingSupply: BigInt(decodedData.initialVirtualToken.toString())
|
|
37035
37086
|
+ (BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()) - BigInt(decodedData.borrowTokenReserve.toString())),
|
|
37036
37087
|
|
|
@@ -37039,10 +37090,12 @@ class ChainModule$1 {
|
|
|
37039
37090
|
feeRecipientBalance: feeRecipientBalance, // Unit: lamports
|
|
37040
37091
|
|
|
37041
37092
|
// Pool account information
|
|
37042
|
-
poolTokenAccount: poolTokenAccountPDA.toString(),
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37093
|
+
poolTokenAccount: poolTokenAccountPDA.toString(), // Pool token account address
|
|
37094
|
+
poolBorrowTokenAccount: poolBorrowTokenAccountPDA.toString(), // Pool borrow token account address (新增)
|
|
37095
|
+
poolSolAccount: poolSolAccountPDA.toString(), // Pool SOL account address
|
|
37096
|
+
poolTokenBalance: BigInt(poolTokenBalance.value.amount), // Pool token balance
|
|
37097
|
+
poolBorrowTokenBalance: BigInt(poolBorrowTokenBalance.value.amount), // Pool borrow token balance (= borrowTokenReserve, 新增)
|
|
37098
|
+
poolSolBalance: poolSolBalance, // Pool SOL balance (lamports)
|
|
37046
37099
|
|
|
37047
37100
|
// Additional metadata
|
|
37048
37101
|
_metadata: {
|
|
@@ -38680,6 +38733,40 @@ var instructions$1 = [
|
|
|
38680
38733
|
]
|
|
38681
38734
|
}
|
|
38682
38735
|
},
|
|
38736
|
+
{
|
|
38737
|
+
name: "pool_borrow_token_account",
|
|
38738
|
+
writable: true,
|
|
38739
|
+
pda: {
|
|
38740
|
+
seeds: [
|
|
38741
|
+
{
|
|
38742
|
+
kind: "const",
|
|
38743
|
+
value: [
|
|
38744
|
+
112,
|
|
38745
|
+
111,
|
|
38746
|
+
111,
|
|
38747
|
+
108,
|
|
38748
|
+
95,
|
|
38749
|
+
98,
|
|
38750
|
+
111,
|
|
38751
|
+
114,
|
|
38752
|
+
114,
|
|
38753
|
+
111,
|
|
38754
|
+
119,
|
|
38755
|
+
95,
|
|
38756
|
+
116,
|
|
38757
|
+
111,
|
|
38758
|
+
107,
|
|
38759
|
+
101,
|
|
38760
|
+
110
|
|
38761
|
+
]
|
|
38762
|
+
},
|
|
38763
|
+
{
|
|
38764
|
+
kind: "account",
|
|
38765
|
+
path: "mint_account"
|
|
38766
|
+
}
|
|
38767
|
+
]
|
|
38768
|
+
}
|
|
38769
|
+
},
|
|
38683
38770
|
{
|
|
38684
38771
|
name: "pool_sol_account",
|
|
38685
38772
|
writable: true,
|
|
@@ -39007,6 +39094,40 @@ var instructions$1 = [
|
|
|
39007
39094
|
]
|
|
39008
39095
|
}
|
|
39009
39096
|
},
|
|
39097
|
+
{
|
|
39098
|
+
name: "pool_borrow_token_account",
|
|
39099
|
+
writable: true,
|
|
39100
|
+
pda: {
|
|
39101
|
+
seeds: [
|
|
39102
|
+
{
|
|
39103
|
+
kind: "const",
|
|
39104
|
+
value: [
|
|
39105
|
+
112,
|
|
39106
|
+
111,
|
|
39107
|
+
111,
|
|
39108
|
+
108,
|
|
39109
|
+
95,
|
|
39110
|
+
98,
|
|
39111
|
+
111,
|
|
39112
|
+
114,
|
|
39113
|
+
114,
|
|
39114
|
+
111,
|
|
39115
|
+
119,
|
|
39116
|
+
95,
|
|
39117
|
+
116,
|
|
39118
|
+
111,
|
|
39119
|
+
107,
|
|
39120
|
+
101,
|
|
39121
|
+
110
|
|
39122
|
+
]
|
|
39123
|
+
},
|
|
39124
|
+
{
|
|
39125
|
+
kind: "account",
|
|
39126
|
+
path: "mint_account"
|
|
39127
|
+
}
|
|
39128
|
+
]
|
|
39129
|
+
}
|
|
39130
|
+
},
|
|
39010
39131
|
{
|
|
39011
39132
|
name: "pool_sol_account",
|
|
39012
39133
|
writable: true,
|
|
@@ -39219,6 +39340,40 @@ var instructions$1 = [
|
|
|
39219
39340
|
]
|
|
39220
39341
|
}
|
|
39221
39342
|
},
|
|
39343
|
+
{
|
|
39344
|
+
name: "pool_borrow_token_account",
|
|
39345
|
+
writable: true,
|
|
39346
|
+
pda: {
|
|
39347
|
+
seeds: [
|
|
39348
|
+
{
|
|
39349
|
+
kind: "const",
|
|
39350
|
+
value: [
|
|
39351
|
+
112,
|
|
39352
|
+
111,
|
|
39353
|
+
111,
|
|
39354
|
+
108,
|
|
39355
|
+
95,
|
|
39356
|
+
98,
|
|
39357
|
+
111,
|
|
39358
|
+
114,
|
|
39359
|
+
114,
|
|
39360
|
+
111,
|
|
39361
|
+
119,
|
|
39362
|
+
95,
|
|
39363
|
+
116,
|
|
39364
|
+
111,
|
|
39365
|
+
107,
|
|
39366
|
+
101,
|
|
39367
|
+
110
|
|
39368
|
+
]
|
|
39369
|
+
},
|
|
39370
|
+
{
|
|
39371
|
+
kind: "account",
|
|
39372
|
+
path: "mint_account"
|
|
39373
|
+
}
|
|
39374
|
+
]
|
|
39375
|
+
}
|
|
39376
|
+
},
|
|
39222
39377
|
{
|
|
39223
39378
|
name: "pool_sol_account",
|
|
39224
39379
|
writable: true,
|
|
@@ -39659,6 +39814,40 @@ var instructions$1 = [
|
|
|
39659
39814
|
]
|
|
39660
39815
|
}
|
|
39661
39816
|
},
|
|
39817
|
+
{
|
|
39818
|
+
name: "pool_borrow_token_account",
|
|
39819
|
+
writable: true,
|
|
39820
|
+
pda: {
|
|
39821
|
+
seeds: [
|
|
39822
|
+
{
|
|
39823
|
+
kind: "const",
|
|
39824
|
+
value: [
|
|
39825
|
+
112,
|
|
39826
|
+
111,
|
|
39827
|
+
111,
|
|
39828
|
+
108,
|
|
39829
|
+
95,
|
|
39830
|
+
98,
|
|
39831
|
+
111,
|
|
39832
|
+
114,
|
|
39833
|
+
114,
|
|
39834
|
+
111,
|
|
39835
|
+
119,
|
|
39836
|
+
95,
|
|
39837
|
+
116,
|
|
39838
|
+
111,
|
|
39839
|
+
107,
|
|
39840
|
+
101,
|
|
39841
|
+
110
|
|
39842
|
+
]
|
|
39843
|
+
},
|
|
39844
|
+
{
|
|
39845
|
+
kind: "account",
|
|
39846
|
+
path: "mint_account"
|
|
39847
|
+
}
|
|
39848
|
+
]
|
|
39849
|
+
}
|
|
39850
|
+
},
|
|
39662
39851
|
{
|
|
39663
39852
|
name: "pool_sol_account",
|
|
39664
39853
|
writable: true,
|
|
@@ -39894,6 +40083,40 @@ var instructions$1 = [
|
|
|
39894
40083
|
]
|
|
39895
40084
|
}
|
|
39896
40085
|
},
|
|
40086
|
+
{
|
|
40087
|
+
name: "pool_borrow_token_account",
|
|
40088
|
+
writable: true,
|
|
40089
|
+
pda: {
|
|
40090
|
+
seeds: [
|
|
40091
|
+
{
|
|
40092
|
+
kind: "const",
|
|
40093
|
+
value: [
|
|
40094
|
+
112,
|
|
40095
|
+
111,
|
|
40096
|
+
111,
|
|
40097
|
+
108,
|
|
40098
|
+
95,
|
|
40099
|
+
98,
|
|
40100
|
+
111,
|
|
40101
|
+
114,
|
|
40102
|
+
114,
|
|
40103
|
+
111,
|
|
40104
|
+
119,
|
|
40105
|
+
95,
|
|
40106
|
+
116,
|
|
40107
|
+
111,
|
|
40108
|
+
107,
|
|
40109
|
+
101,
|
|
40110
|
+
110
|
|
40111
|
+
]
|
|
40112
|
+
},
|
|
40113
|
+
{
|
|
40114
|
+
kind: "account",
|
|
40115
|
+
path: "mint_account"
|
|
40116
|
+
}
|
|
40117
|
+
]
|
|
40118
|
+
}
|
|
40119
|
+
},
|
|
39897
40120
|
{
|
|
39898
40121
|
name: "pool_sol_account",
|
|
39899
40122
|
writable: true,
|
|
@@ -40106,6 +40329,40 @@ var instructions$1 = [
|
|
|
40106
40329
|
]
|
|
40107
40330
|
}
|
|
40108
40331
|
},
|
|
40332
|
+
{
|
|
40333
|
+
name: "pool_borrow_token_account",
|
|
40334
|
+
writable: true,
|
|
40335
|
+
pda: {
|
|
40336
|
+
seeds: [
|
|
40337
|
+
{
|
|
40338
|
+
kind: "const",
|
|
40339
|
+
value: [
|
|
40340
|
+
112,
|
|
40341
|
+
111,
|
|
40342
|
+
111,
|
|
40343
|
+
108,
|
|
40344
|
+
95,
|
|
40345
|
+
98,
|
|
40346
|
+
111,
|
|
40347
|
+
114,
|
|
40348
|
+
114,
|
|
40349
|
+
111,
|
|
40350
|
+
119,
|
|
40351
|
+
95,
|
|
40352
|
+
116,
|
|
40353
|
+
111,
|
|
40354
|
+
107,
|
|
40355
|
+
101,
|
|
40356
|
+
110
|
|
40357
|
+
]
|
|
40358
|
+
},
|
|
40359
|
+
{
|
|
40360
|
+
kind: "account",
|
|
40361
|
+
path: "mint_account"
|
|
40362
|
+
}
|
|
40363
|
+
]
|
|
40364
|
+
}
|
|
40365
|
+
},
|
|
40109
40366
|
{
|
|
40110
40367
|
name: "pool_sol_account",
|
|
40111
40368
|
writable: true,
|
|
@@ -40433,6 +40690,40 @@ var instructions$1 = [
|
|
|
40433
40690
|
]
|
|
40434
40691
|
}
|
|
40435
40692
|
},
|
|
40693
|
+
{
|
|
40694
|
+
name: "pool_borrow_token_account",
|
|
40695
|
+
writable: true,
|
|
40696
|
+
pda: {
|
|
40697
|
+
seeds: [
|
|
40698
|
+
{
|
|
40699
|
+
kind: "const",
|
|
40700
|
+
value: [
|
|
40701
|
+
112,
|
|
40702
|
+
111,
|
|
40703
|
+
111,
|
|
40704
|
+
108,
|
|
40705
|
+
95,
|
|
40706
|
+
98,
|
|
40707
|
+
111,
|
|
40708
|
+
114,
|
|
40709
|
+
114,
|
|
40710
|
+
111,
|
|
40711
|
+
119,
|
|
40712
|
+
95,
|
|
40713
|
+
116,
|
|
40714
|
+
111,
|
|
40715
|
+
107,
|
|
40716
|
+
101,
|
|
40717
|
+
110
|
|
40718
|
+
]
|
|
40719
|
+
},
|
|
40720
|
+
{
|
|
40721
|
+
kind: "account",
|
|
40722
|
+
path: "mint_account"
|
|
40723
|
+
}
|
|
40724
|
+
]
|
|
40725
|
+
}
|
|
40726
|
+
},
|
|
40436
40727
|
{
|
|
40437
40728
|
name: "pool_sol_account",
|
|
40438
40729
|
writable: true,
|
|
@@ -41602,6 +41893,16 @@ var types$1 = [
|
|
|
41602
41893
|
],
|
|
41603
41894
|
type: "u64"
|
|
41604
41895
|
},
|
|
41896
|
+
{
|
|
41897
|
+
name: "initial_borrow_token_reserve",
|
|
41898
|
+
docs: [
|
|
41899
|
+
"Borrow pool initial funding (initial token amount minted into borrow pool at creation)",
|
|
41900
|
+
"Unlike borrow_token_reserve which changes in real time with borrow/repay,",
|
|
41901
|
+
"this field never changes after creation; used by external parties to compute",
|
|
41902
|
+
"\"borrowed out = initial funding - current available reserve\"."
|
|
41903
|
+
],
|
|
41904
|
+
type: "u64"
|
|
41905
|
+
},
|
|
41605
41906
|
{
|
|
41606
41907
|
name: "pool_type",
|
|
41607
41908
|
docs: [
|
|
@@ -41729,9 +42030,21 @@ var types$1 = [
|
|
|
41729
42030
|
type: "pubkey"
|
|
41730
42031
|
},
|
|
41731
42032
|
{
|
|
41732
|
-
name: "
|
|
41733
|
-
type: "
|
|
41734
|
-
},
|
|
42033
|
+
name: "is_buy",
|
|
42034
|
+
type: "bool"
|
|
42035
|
+
},
|
|
42036
|
+
{
|
|
42037
|
+
name: "token_amount",
|
|
42038
|
+
type: "u64"
|
|
42039
|
+
},
|
|
42040
|
+
{
|
|
42041
|
+
name: "sol_amount",
|
|
42042
|
+
type: "u64"
|
|
42043
|
+
},
|
|
42044
|
+
{
|
|
42045
|
+
name: "order_id",
|
|
42046
|
+
type: "u64"
|
|
42047
|
+
},
|
|
41735
42048
|
{
|
|
41736
42049
|
name: "order_index",
|
|
41737
42050
|
type: "u16"
|
|
@@ -42070,6 +42383,10 @@ var types$1 = [
|
|
|
42070
42383
|
name: "pool_token_account",
|
|
42071
42384
|
type: "pubkey"
|
|
42072
42385
|
},
|
|
42386
|
+
{
|
|
42387
|
+
name: "pool_borrow_token_account",
|
|
42388
|
+
type: "pubkey"
|
|
42389
|
+
},
|
|
42073
42390
|
{
|
|
42074
42391
|
name: "pool_sol_account",
|
|
42075
42392
|
type: "pubkey"
|
|
@@ -42130,6 +42447,10 @@ var types$1 = [
|
|
|
42130
42447
|
name: "initial_virtual_token",
|
|
42131
42448
|
type: "u64"
|
|
42132
42449
|
},
|
|
42450
|
+
{
|
|
42451
|
+
name: "initial_borrow_token_reserve",
|
|
42452
|
+
type: "u64"
|
|
42453
|
+
},
|
|
42133
42454
|
{
|
|
42134
42455
|
name: "pool_type",
|
|
42135
42456
|
type: "u8"
|
|
@@ -42426,6 +42747,40 @@ var instructions = [
|
|
|
42426
42747
|
]
|
|
42427
42748
|
}
|
|
42428
42749
|
},
|
|
42750
|
+
{
|
|
42751
|
+
name: "pool_borrow_token_account",
|
|
42752
|
+
writable: true,
|
|
42753
|
+
pda: {
|
|
42754
|
+
seeds: [
|
|
42755
|
+
{
|
|
42756
|
+
kind: "const",
|
|
42757
|
+
value: [
|
|
42758
|
+
112,
|
|
42759
|
+
111,
|
|
42760
|
+
111,
|
|
42761
|
+
108,
|
|
42762
|
+
95,
|
|
42763
|
+
98,
|
|
42764
|
+
111,
|
|
42765
|
+
114,
|
|
42766
|
+
114,
|
|
42767
|
+
111,
|
|
42768
|
+
119,
|
|
42769
|
+
95,
|
|
42770
|
+
116,
|
|
42771
|
+
111,
|
|
42772
|
+
107,
|
|
42773
|
+
101,
|
|
42774
|
+
110
|
|
42775
|
+
]
|
|
42776
|
+
},
|
|
42777
|
+
{
|
|
42778
|
+
kind: "account",
|
|
42779
|
+
path: "mint_account"
|
|
42780
|
+
}
|
|
42781
|
+
]
|
|
42782
|
+
}
|
|
42783
|
+
},
|
|
42429
42784
|
{
|
|
42430
42785
|
name: "pool_sol_account",
|
|
42431
42786
|
writable: true,
|
|
@@ -42753,6 +43108,40 @@ var instructions = [
|
|
|
42753
43108
|
]
|
|
42754
43109
|
}
|
|
42755
43110
|
},
|
|
43111
|
+
{
|
|
43112
|
+
name: "pool_borrow_token_account",
|
|
43113
|
+
writable: true,
|
|
43114
|
+
pda: {
|
|
43115
|
+
seeds: [
|
|
43116
|
+
{
|
|
43117
|
+
kind: "const",
|
|
43118
|
+
value: [
|
|
43119
|
+
112,
|
|
43120
|
+
111,
|
|
43121
|
+
111,
|
|
43122
|
+
108,
|
|
43123
|
+
95,
|
|
43124
|
+
98,
|
|
43125
|
+
111,
|
|
43126
|
+
114,
|
|
43127
|
+
114,
|
|
43128
|
+
111,
|
|
43129
|
+
119,
|
|
43130
|
+
95,
|
|
43131
|
+
116,
|
|
43132
|
+
111,
|
|
43133
|
+
107,
|
|
43134
|
+
101,
|
|
43135
|
+
110
|
|
43136
|
+
]
|
|
43137
|
+
},
|
|
43138
|
+
{
|
|
43139
|
+
kind: "account",
|
|
43140
|
+
path: "mint_account"
|
|
43141
|
+
}
|
|
43142
|
+
]
|
|
43143
|
+
}
|
|
43144
|
+
},
|
|
42756
43145
|
{
|
|
42757
43146
|
name: "pool_sol_account",
|
|
42758
43147
|
writable: true,
|
|
@@ -42965,6 +43354,40 @@ var instructions = [
|
|
|
42965
43354
|
]
|
|
42966
43355
|
}
|
|
42967
43356
|
},
|
|
43357
|
+
{
|
|
43358
|
+
name: "pool_borrow_token_account",
|
|
43359
|
+
writable: true,
|
|
43360
|
+
pda: {
|
|
43361
|
+
seeds: [
|
|
43362
|
+
{
|
|
43363
|
+
kind: "const",
|
|
43364
|
+
value: [
|
|
43365
|
+
112,
|
|
43366
|
+
111,
|
|
43367
|
+
111,
|
|
43368
|
+
108,
|
|
43369
|
+
95,
|
|
43370
|
+
98,
|
|
43371
|
+
111,
|
|
43372
|
+
114,
|
|
43373
|
+
114,
|
|
43374
|
+
111,
|
|
43375
|
+
119,
|
|
43376
|
+
95,
|
|
43377
|
+
116,
|
|
43378
|
+
111,
|
|
43379
|
+
107,
|
|
43380
|
+
101,
|
|
43381
|
+
110
|
|
43382
|
+
]
|
|
43383
|
+
},
|
|
43384
|
+
{
|
|
43385
|
+
kind: "account",
|
|
43386
|
+
path: "mint_account"
|
|
43387
|
+
}
|
|
43388
|
+
]
|
|
43389
|
+
}
|
|
43390
|
+
},
|
|
42968
43391
|
{
|
|
42969
43392
|
name: "pool_sol_account",
|
|
42970
43393
|
writable: true,
|
|
@@ -43405,6 +43828,40 @@ var instructions = [
|
|
|
43405
43828
|
]
|
|
43406
43829
|
}
|
|
43407
43830
|
},
|
|
43831
|
+
{
|
|
43832
|
+
name: "pool_borrow_token_account",
|
|
43833
|
+
writable: true,
|
|
43834
|
+
pda: {
|
|
43835
|
+
seeds: [
|
|
43836
|
+
{
|
|
43837
|
+
kind: "const",
|
|
43838
|
+
value: [
|
|
43839
|
+
112,
|
|
43840
|
+
111,
|
|
43841
|
+
111,
|
|
43842
|
+
108,
|
|
43843
|
+
95,
|
|
43844
|
+
98,
|
|
43845
|
+
111,
|
|
43846
|
+
114,
|
|
43847
|
+
114,
|
|
43848
|
+
111,
|
|
43849
|
+
119,
|
|
43850
|
+
95,
|
|
43851
|
+
116,
|
|
43852
|
+
111,
|
|
43853
|
+
107,
|
|
43854
|
+
101,
|
|
43855
|
+
110
|
|
43856
|
+
]
|
|
43857
|
+
},
|
|
43858
|
+
{
|
|
43859
|
+
kind: "account",
|
|
43860
|
+
path: "mint_account"
|
|
43861
|
+
}
|
|
43862
|
+
]
|
|
43863
|
+
}
|
|
43864
|
+
},
|
|
43408
43865
|
{
|
|
43409
43866
|
name: "pool_sol_account",
|
|
43410
43867
|
writable: true,
|
|
@@ -43640,6 +44097,40 @@ var instructions = [
|
|
|
43640
44097
|
]
|
|
43641
44098
|
}
|
|
43642
44099
|
},
|
|
44100
|
+
{
|
|
44101
|
+
name: "pool_borrow_token_account",
|
|
44102
|
+
writable: true,
|
|
44103
|
+
pda: {
|
|
44104
|
+
seeds: [
|
|
44105
|
+
{
|
|
44106
|
+
kind: "const",
|
|
44107
|
+
value: [
|
|
44108
|
+
112,
|
|
44109
|
+
111,
|
|
44110
|
+
111,
|
|
44111
|
+
108,
|
|
44112
|
+
95,
|
|
44113
|
+
98,
|
|
44114
|
+
111,
|
|
44115
|
+
114,
|
|
44116
|
+
114,
|
|
44117
|
+
111,
|
|
44118
|
+
119,
|
|
44119
|
+
95,
|
|
44120
|
+
116,
|
|
44121
|
+
111,
|
|
44122
|
+
107,
|
|
44123
|
+
101,
|
|
44124
|
+
110
|
|
44125
|
+
]
|
|
44126
|
+
},
|
|
44127
|
+
{
|
|
44128
|
+
kind: "account",
|
|
44129
|
+
path: "mint_account"
|
|
44130
|
+
}
|
|
44131
|
+
]
|
|
44132
|
+
}
|
|
44133
|
+
},
|
|
43643
44134
|
{
|
|
43644
44135
|
name: "pool_sol_account",
|
|
43645
44136
|
writable: true,
|
|
@@ -43852,6 +44343,40 @@ var instructions = [
|
|
|
43852
44343
|
]
|
|
43853
44344
|
}
|
|
43854
44345
|
},
|
|
44346
|
+
{
|
|
44347
|
+
name: "pool_borrow_token_account",
|
|
44348
|
+
writable: true,
|
|
44349
|
+
pda: {
|
|
44350
|
+
seeds: [
|
|
44351
|
+
{
|
|
44352
|
+
kind: "const",
|
|
44353
|
+
value: [
|
|
44354
|
+
112,
|
|
44355
|
+
111,
|
|
44356
|
+
111,
|
|
44357
|
+
108,
|
|
44358
|
+
95,
|
|
44359
|
+
98,
|
|
44360
|
+
111,
|
|
44361
|
+
114,
|
|
44362
|
+
114,
|
|
44363
|
+
111,
|
|
44364
|
+
119,
|
|
44365
|
+
95,
|
|
44366
|
+
116,
|
|
44367
|
+
111,
|
|
44368
|
+
107,
|
|
44369
|
+
101,
|
|
44370
|
+
110
|
|
44371
|
+
]
|
|
44372
|
+
},
|
|
44373
|
+
{
|
|
44374
|
+
kind: "account",
|
|
44375
|
+
path: "mint_account"
|
|
44376
|
+
}
|
|
44377
|
+
]
|
|
44378
|
+
}
|
|
44379
|
+
},
|
|
43855
44380
|
{
|
|
43856
44381
|
name: "pool_sol_account",
|
|
43857
44382
|
writable: true,
|
|
@@ -44179,6 +44704,40 @@ var instructions = [
|
|
|
44179
44704
|
]
|
|
44180
44705
|
}
|
|
44181
44706
|
},
|
|
44707
|
+
{
|
|
44708
|
+
name: "pool_borrow_token_account",
|
|
44709
|
+
writable: true,
|
|
44710
|
+
pda: {
|
|
44711
|
+
seeds: [
|
|
44712
|
+
{
|
|
44713
|
+
kind: "const",
|
|
44714
|
+
value: [
|
|
44715
|
+
112,
|
|
44716
|
+
111,
|
|
44717
|
+
111,
|
|
44718
|
+
108,
|
|
44719
|
+
95,
|
|
44720
|
+
98,
|
|
44721
|
+
111,
|
|
44722
|
+
114,
|
|
44723
|
+
114,
|
|
44724
|
+
111,
|
|
44725
|
+
119,
|
|
44726
|
+
95,
|
|
44727
|
+
116,
|
|
44728
|
+
111,
|
|
44729
|
+
107,
|
|
44730
|
+
101,
|
|
44731
|
+
110
|
|
44732
|
+
]
|
|
44733
|
+
},
|
|
44734
|
+
{
|
|
44735
|
+
kind: "account",
|
|
44736
|
+
path: "mint_account"
|
|
44737
|
+
}
|
|
44738
|
+
]
|
|
44739
|
+
}
|
|
44740
|
+
},
|
|
44182
44741
|
{
|
|
44183
44742
|
name: "pool_sol_account",
|
|
44184
44743
|
writable: true,
|
|
@@ -45348,6 +45907,16 @@ var types = [
|
|
|
45348
45907
|
],
|
|
45349
45908
|
type: "u64"
|
|
45350
45909
|
},
|
|
45910
|
+
{
|
|
45911
|
+
name: "initial_borrow_token_reserve",
|
|
45912
|
+
docs: [
|
|
45913
|
+
"Borrow pool initial funding (initial token amount minted into borrow pool at creation)",
|
|
45914
|
+
"Unlike borrow_token_reserve which changes in real time with borrow/repay,",
|
|
45915
|
+
"this field never changes after creation; used by external parties to compute",
|
|
45916
|
+
"\"borrowed out = initial funding - current available reserve\"."
|
|
45917
|
+
],
|
|
45918
|
+
type: "u64"
|
|
45919
|
+
},
|
|
45351
45920
|
{
|
|
45352
45921
|
name: "pool_type",
|
|
45353
45922
|
docs: [
|
|
@@ -45474,6 +46043,18 @@ var types = [
|
|
|
45474
46043
|
name: "mint_account",
|
|
45475
46044
|
type: "pubkey"
|
|
45476
46045
|
},
|
|
46046
|
+
{
|
|
46047
|
+
name: "is_buy",
|
|
46048
|
+
type: "bool"
|
|
46049
|
+
},
|
|
46050
|
+
{
|
|
46051
|
+
name: "token_amount",
|
|
46052
|
+
type: "u64"
|
|
46053
|
+
},
|
|
46054
|
+
{
|
|
46055
|
+
name: "sol_amount",
|
|
46056
|
+
type: "u64"
|
|
46057
|
+
},
|
|
45477
46058
|
{
|
|
45478
46059
|
name: "order_id",
|
|
45479
46060
|
type: "u64"
|
|
@@ -45816,6 +46397,10 @@ var types = [
|
|
|
45816
46397
|
name: "pool_token_account",
|
|
45817
46398
|
type: "pubkey"
|
|
45818
46399
|
},
|
|
46400
|
+
{
|
|
46401
|
+
name: "pool_borrow_token_account",
|
|
46402
|
+
type: "pubkey"
|
|
46403
|
+
},
|
|
45819
46404
|
{
|
|
45820
46405
|
name: "pool_sol_account",
|
|
45821
46406
|
type: "pubkey"
|
|
@@ -45876,6 +46461,10 @@ var types = [
|
|
|
45876
46461
|
name: "initial_virtual_token",
|
|
45877
46462
|
type: "u64"
|
|
45878
46463
|
},
|
|
46464
|
+
{
|
|
46465
|
+
name: "initial_borrow_token_reserve",
|
|
46466
|
+
type: "u64"
|
|
46467
|
+
},
|
|
45879
46468
|
{
|
|
45880
46469
|
name: "pool_type",
|
|
45881
46470
|
type: "u8"
|