pinpet-sdk 2.1.30 → 2.1.32
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/pinpet-sdk.cjs.js +18 -2
- package/dist/pinpet-sdk.esm.js +18 -2
- package/dist/pinpet-sdk.js +18 -2
- package/dist/pinpet-sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/idl/pinpet_ddd.json +3735 -0
- package/src/modules/chain.js +18 -2
package/dist/pinpet-sdk.cjs.js
CHANGED
|
@@ -48158,6 +48158,12 @@ class ChainModule$1 {
|
|
|
48158
48158
|
* @returns {string} returns.poolTokenAccount - Pool token account address, stores tokens in the liquidity pool
|
|
48159
48159
|
* @returns {string} returns.poolSolAccount - Pool SOL account address, stores native SOL in the liquidity pool
|
|
48160
48160
|
*
|
|
48161
|
+
* **Token Supply Information:**
|
|
48162
|
+
* @returns {bigint} returns.totalSupply - Total token supply (smallest unit)
|
|
48163
|
+
* @returns {number} returns.decimals - Token decimal places
|
|
48164
|
+
* @returns {bigint} returns.initialBorrowPool - Initial borrow pool size = totalSupply - initialVirtualToken
|
|
48165
|
+
* @returns {bigint} returns.circulatingSupply - Circulating supply = totalSupply - borrowTokenReserve
|
|
48166
|
+
*
|
|
48161
48167
|
* **Balance Information:**
|
|
48162
48168
|
* @returns {number} returns.baseFeeRecipientBalance - SOL balance of base fee recipient address (lamports)
|
|
48163
48169
|
* @returns {number} returns.feeRecipientBalance - SOL balance of fee recipient address (lamports)
|
|
@@ -48324,18 +48330,21 @@ class ChainModule$1 {
|
|
|
48324
48330
|
let feeRecipientBalance = 0;
|
|
48325
48331
|
let poolTokenBalance = { value: { amount: '0' } };
|
|
48326
48332
|
let poolSolBalance = 0;
|
|
48333
|
+
let tokenSupply = { value: { amount: '0', decimals: 0 } };
|
|
48327
48334
|
|
|
48328
48335
|
if (!skipBalances) {
|
|
48329
48336
|
[
|
|
48330
48337
|
baseFeeRecipientBalance,
|
|
48331
48338
|
feeRecipientBalance,
|
|
48332
48339
|
poolTokenBalance,
|
|
48333
|
-
poolSolBalance
|
|
48340
|
+
poolSolBalance,
|
|
48341
|
+
tokenSupply
|
|
48334
48342
|
] = await Promise.all([
|
|
48335
48343
|
this.sdk.connection.getBalance(decodedData.baseFeeRecipient),
|
|
48336
48344
|
this.sdk.connection.getBalance(decodedData.feeRecipient),
|
|
48337
48345
|
this.sdk.connection.getTokenAccountBalance(poolTokenAccountPDA).catch(() => ({ value: { amount: '0' } })),
|
|
48338
|
-
this.sdk.connection.getBalance(poolSolAccountPDA)
|
|
48346
|
+
this.sdk.connection.getBalance(poolSolAccountPDA),
|
|
48347
|
+
this.sdk.connection.getTokenSupply(mintPubkey)
|
|
48339
48348
|
]);
|
|
48340
48349
|
}
|
|
48341
48350
|
|
|
@@ -48376,6 +48385,13 @@ class ChainModule$1 {
|
|
|
48376
48385
|
poolType: decodedData.poolType, // u8, 0=普通版, 1=高级版
|
|
48377
48386
|
borrowPoolRatio: decodedData.borrowPoolRatio, // u8, 5-30表示5%-30%
|
|
48378
48387
|
|
|
48388
|
+
// Token Supply 信息
|
|
48389
|
+
totalSupply: BigInt(tokenSupply.value.amount),
|
|
48390
|
+
decimals: tokenSupply.value.decimals,
|
|
48391
|
+
initialBorrowPool: BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()),
|
|
48392
|
+
circulatingSupply: BigInt(decodedData.initialVirtualToken.toString())
|
|
48393
|
+
+ (BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()) - BigInt(decodedData.borrowTokenReserve.toString())),
|
|
48394
|
+
|
|
48379
48395
|
// SOL balance information
|
|
48380
48396
|
baseFeeRecipientBalance: baseFeeRecipientBalance, // Unit: lamports
|
|
48381
48397
|
feeRecipientBalance: feeRecipientBalance, // Unit: lamports
|
package/dist/pinpet-sdk.esm.js
CHANGED
|
@@ -36800,6 +36800,12 @@ class ChainModule$1 {
|
|
|
36800
36800
|
* @returns {string} returns.poolTokenAccount - Pool token account address, stores tokens in the liquidity pool
|
|
36801
36801
|
* @returns {string} returns.poolSolAccount - Pool SOL account address, stores native SOL in the liquidity pool
|
|
36802
36802
|
*
|
|
36803
|
+
* **Token Supply Information:**
|
|
36804
|
+
* @returns {bigint} returns.totalSupply - Total token supply (smallest unit)
|
|
36805
|
+
* @returns {number} returns.decimals - Token decimal places
|
|
36806
|
+
* @returns {bigint} returns.initialBorrowPool - Initial borrow pool size = totalSupply - initialVirtualToken
|
|
36807
|
+
* @returns {bigint} returns.circulatingSupply - Circulating supply = totalSupply - borrowTokenReserve
|
|
36808
|
+
*
|
|
36803
36809
|
* **Balance Information:**
|
|
36804
36810
|
* @returns {number} returns.baseFeeRecipientBalance - SOL balance of base fee recipient address (lamports)
|
|
36805
36811
|
* @returns {number} returns.feeRecipientBalance - SOL balance of fee recipient address (lamports)
|
|
@@ -36966,18 +36972,21 @@ class ChainModule$1 {
|
|
|
36966
36972
|
let feeRecipientBalance = 0;
|
|
36967
36973
|
let poolTokenBalance = { value: { amount: '0' } };
|
|
36968
36974
|
let poolSolBalance = 0;
|
|
36975
|
+
let tokenSupply = { value: { amount: '0', decimals: 0 } };
|
|
36969
36976
|
|
|
36970
36977
|
if (!skipBalances) {
|
|
36971
36978
|
[
|
|
36972
36979
|
baseFeeRecipientBalance,
|
|
36973
36980
|
feeRecipientBalance,
|
|
36974
36981
|
poolTokenBalance,
|
|
36975
|
-
poolSolBalance
|
|
36982
|
+
poolSolBalance,
|
|
36983
|
+
tokenSupply
|
|
36976
36984
|
] = await Promise.all([
|
|
36977
36985
|
this.sdk.connection.getBalance(decodedData.baseFeeRecipient),
|
|
36978
36986
|
this.sdk.connection.getBalance(decodedData.feeRecipient),
|
|
36979
36987
|
this.sdk.connection.getTokenAccountBalance(poolTokenAccountPDA).catch(() => ({ value: { amount: '0' } })),
|
|
36980
|
-
this.sdk.connection.getBalance(poolSolAccountPDA)
|
|
36988
|
+
this.sdk.connection.getBalance(poolSolAccountPDA),
|
|
36989
|
+
this.sdk.connection.getTokenSupply(mintPubkey)
|
|
36981
36990
|
]);
|
|
36982
36991
|
}
|
|
36983
36992
|
|
|
@@ -37018,6 +37027,13 @@ class ChainModule$1 {
|
|
|
37018
37027
|
poolType: decodedData.poolType, // u8, 0=普通版, 1=高级版
|
|
37019
37028
|
borrowPoolRatio: decodedData.borrowPoolRatio, // u8, 5-30表示5%-30%
|
|
37020
37029
|
|
|
37030
|
+
// Token Supply 信息
|
|
37031
|
+
totalSupply: BigInt(tokenSupply.value.amount),
|
|
37032
|
+
decimals: tokenSupply.value.decimals,
|
|
37033
|
+
initialBorrowPool: BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()),
|
|
37034
|
+
circulatingSupply: BigInt(decodedData.initialVirtualToken.toString())
|
|
37035
|
+
+ (BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()) - BigInt(decodedData.borrowTokenReserve.toString())),
|
|
37036
|
+
|
|
37021
37037
|
// SOL balance information
|
|
37022
37038
|
baseFeeRecipientBalance: baseFeeRecipientBalance, // Unit: lamports
|
|
37023
37039
|
feeRecipientBalance: feeRecipientBalance, // Unit: lamports
|
package/dist/pinpet-sdk.js
CHANGED
|
@@ -36808,6 +36808,12 @@
|
|
|
36808
36808
|
* @returns {string} returns.poolTokenAccount - Pool token account address, stores tokens in the liquidity pool
|
|
36809
36809
|
* @returns {string} returns.poolSolAccount - Pool SOL account address, stores native SOL in the liquidity pool
|
|
36810
36810
|
*
|
|
36811
|
+
* **Token Supply Information:**
|
|
36812
|
+
* @returns {bigint} returns.totalSupply - Total token supply (smallest unit)
|
|
36813
|
+
* @returns {number} returns.decimals - Token decimal places
|
|
36814
|
+
* @returns {bigint} returns.initialBorrowPool - Initial borrow pool size = totalSupply - initialVirtualToken
|
|
36815
|
+
* @returns {bigint} returns.circulatingSupply - Circulating supply = totalSupply - borrowTokenReserve
|
|
36816
|
+
*
|
|
36811
36817
|
* **Balance Information:**
|
|
36812
36818
|
* @returns {number} returns.baseFeeRecipientBalance - SOL balance of base fee recipient address (lamports)
|
|
36813
36819
|
* @returns {number} returns.feeRecipientBalance - SOL balance of fee recipient address (lamports)
|
|
@@ -36974,18 +36980,21 @@
|
|
|
36974
36980
|
let feeRecipientBalance = 0;
|
|
36975
36981
|
let poolTokenBalance = { value: { amount: '0' } };
|
|
36976
36982
|
let poolSolBalance = 0;
|
|
36983
|
+
let tokenSupply = { value: { amount: '0', decimals: 0 } };
|
|
36977
36984
|
|
|
36978
36985
|
if (!skipBalances) {
|
|
36979
36986
|
[
|
|
36980
36987
|
baseFeeRecipientBalance,
|
|
36981
36988
|
feeRecipientBalance,
|
|
36982
36989
|
poolTokenBalance,
|
|
36983
|
-
poolSolBalance
|
|
36990
|
+
poolSolBalance,
|
|
36991
|
+
tokenSupply
|
|
36984
36992
|
] = await Promise.all([
|
|
36985
36993
|
this.sdk.connection.getBalance(decodedData.baseFeeRecipient),
|
|
36986
36994
|
this.sdk.connection.getBalance(decodedData.feeRecipient),
|
|
36987
36995
|
this.sdk.connection.getTokenAccountBalance(poolTokenAccountPDA).catch(() => ({ value: { amount: '0' } })),
|
|
36988
|
-
this.sdk.connection.getBalance(poolSolAccountPDA)
|
|
36996
|
+
this.sdk.connection.getBalance(poolSolAccountPDA),
|
|
36997
|
+
this.sdk.connection.getTokenSupply(mintPubkey)
|
|
36989
36998
|
]);
|
|
36990
36999
|
}
|
|
36991
37000
|
|
|
@@ -37026,6 +37035,13 @@
|
|
|
37026
37035
|
poolType: decodedData.poolType, // u8, 0=普通版, 1=高级版
|
|
37027
37036
|
borrowPoolRatio: decodedData.borrowPoolRatio, // u8, 5-30表示5%-30%
|
|
37028
37037
|
|
|
37038
|
+
// Token Supply 信息
|
|
37039
|
+
totalSupply: BigInt(tokenSupply.value.amount),
|
|
37040
|
+
decimals: tokenSupply.value.decimals,
|
|
37041
|
+
initialBorrowPool: BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()),
|
|
37042
|
+
circulatingSupply: BigInt(decodedData.initialVirtualToken.toString())
|
|
37043
|
+
+ (BigInt(tokenSupply.value.amount) - BigInt(decodedData.initialVirtualToken.toString()) - BigInt(decodedData.borrowTokenReserve.toString())),
|
|
37044
|
+
|
|
37029
37045
|
// SOL balance information
|
|
37030
37046
|
baseFeeRecipientBalance: baseFeeRecipientBalance, // Unit: lamports
|
|
37031
37047
|
feeRecipientBalance: feeRecipientBalance, // Unit: lamports
|