@everlend/general-pool
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -5,1 +5,2 @@ export * from './poolMarket'; | ||
export * from './withdrawalRequests'; | ||
export * from './userWithdrawRequest'; |
@@ -17,2 +17,3 @@ "use strict"; | ||
__exportStar(require("./withdrawalRequests"), exports); | ||
__exportStar(require("./userWithdrawRequest"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -98,8 +98,3 @@ "use strict"; | ||
const { data: { lastRequestId }, } = yield accounts_1.WithdrawalRequests.load(connection, withdrawRequests); | ||
const userWithdrawRequest = yield program_1.GeneralPoolsProgram.findProgramAddress([ | ||
lastRequestId.add(new bn_js_1.default(1, 10)).toBuffer('be'), | ||
buffer_1.Buffer.from('withdrawals'), | ||
poolMarket.toBuffer(), | ||
tokenMint.toBuffer(), | ||
]); | ||
const userWithdrawRequest = yield accounts_1.UserWithdrawRequest.getPDA(poolMarket, tokenMint, lastRequestId.add(new bn_js_1.default(1, 10))); | ||
const collateralTransit = yield program_1.GeneralPoolsProgram.findProgramAddress([ | ||
@@ -106,0 +101,0 @@ buffer_1.Buffer.from('transit'), |
{ | ||
"name": "@everlend/general-pool", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,1 +5,2 @@ export * from './poolMarket' | ||
export * from './withdrawalRequests' | ||
export * from './userWithdrawRequest' |
import { AccountLayout, MintLayout, TOKEN_PROGRAM_ID } from '@solana/spl-token' | ||
import { Connection, Keypair, PublicKey, SystemProgram, Transaction } from '@solana/web3.js' | ||
import BN from 'bn.js' | ||
import { Pool, PoolBorrowAuthority, PoolMarket, WithdrawalRequests } from './accounts' | ||
import { | ||
Pool, | ||
PoolBorrowAuthority, | ||
PoolMarket, | ||
UserWithdrawRequest, | ||
WithdrawalRequests, | ||
} from './accounts' | ||
import { GeneralPoolsProgram } from './program' | ||
@@ -164,8 +170,7 @@ import { CreateAssociatedTokenAccount, findAssociatedTokenAccount } from '@everlend/common' | ||
const userWithdrawRequest = await GeneralPoolsProgram.findProgramAddress([ | ||
lastRequestId.add(new BN(1, 10)).toBuffer('be'), | ||
Buffer.from('withdrawals'), | ||
poolMarket.toBuffer(), | ||
tokenMint.toBuffer(), | ||
]) | ||
const userWithdrawRequest = await UserWithdrawRequest.getPDA( | ||
poolMarket, | ||
tokenMint, | ||
lastRequestId.add(new BN(1, 10)), | ||
) | ||
@@ -172,0 +177,0 @@ const collateralTransit = await GeneralPoolsProgram.findProgramAddress([ |
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token' | ||
import { Keypair, PublicKey, sendAndConfirmTransaction } from '@solana/web3.js' | ||
import BN from 'bn.js' | ||
import { AccountType, createPool, deposit, Pool, withdraw } from '../src' | ||
import { AccountType, createPool, deposit, Pool, withdrawRequest } from '../src' | ||
import { | ||
@@ -109,6 +109,6 @@ connection, | ||
describe('Withdraw', () => { | ||
describe('Withdraw request', () => { | ||
test('success', async () => { | ||
const amount = new BN(1000) | ||
const { tx } = await withdraw( | ||
const { tx } = await withdrawRequest( | ||
{ connection, payerPublicKey }, | ||
@@ -115,0 +115,0 @@ POOL_PUBKEY, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
116058
84
2475