Skip to content

Commit

Permalink
Bump to 2.3.0-canary.01
Browse files Browse the repository at this point in the history
  • Loading branch information
aeksco committed Jun 21, 2022
1 parent 616fdb6 commit b1d35a4
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 36 deletions.
8 changes: 4 additions & 4 deletions sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@castlefinance/vault-sdk",
"version": "2.3.0",
"version": "2.3.0-canary.01",
"license": "MIT",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"dependencies": {
"@castlefinance/vault-core": "^0.1.0",
"@jet-lab/jet-engine": "^0.2.51",
"@jet-lab/jet-engine": "0.3.8",
"@port.finance/port-sdk": "^0.2.67",
"@project-serum/anchor": "^0.23.0",
"@solana/spl-token": "^0.1.8",
"@project-serum/anchor": "^0.24.0",
"@solana/spl-token": "^0.2.0",
"@solana/web3.js": "^1.31.0",
"@solendprotocol/solend-sdk": "^0.4.9",
"big.js": "^6.1.1",
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/adapters/jet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface JetAccounts {

export class JetReserveAsset extends Asset {
private constructor(
public provider: anchor.Provider,
public provider: anchor.AnchorProvider,
public accounts: JetAccounts,
public market: JetMarket,
public reserve: JetReserve
Expand All @@ -49,7 +49,7 @@ export class JetReserveAsset extends Asset {
}

static async load(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
cluster: Cluster,
reserveMint: PublicKey
): Promise<JetReserveAsset> {
Expand Down Expand Up @@ -98,7 +98,7 @@ export class JetReserveAsset extends Asset {
* @returns
*/
static async initialize(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
wallet: anchor.Wallet,
owner: Signer,
marketQuoteTokenMint: PublicKey,
Expand Down Expand Up @@ -138,7 +138,7 @@ export class JetReserveAsset extends Asset {
ownerReserveTokenAccount,
Amount.tokens(initialReserveAmount)
);
await provider.send(depositTx, [owner]);
await provider.sendAndConfirm(depositTx, [owner]);

return new JetReserveAsset(provider, accounts, market, reserve);
}
Expand Down
18 changes: 9 additions & 9 deletions sdk/src/adapters/port.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ const DEVNET_ASSETS = [

export class PortReserveAsset extends Asset {
private constructor(
public provider: anchor.Provider,
public provider: anchor.AnchorProvider,
public accounts: PortAccounts,
public client: Port
) {
super();
}

static async load(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
cluster: Cluster,
reserveMint: PublicKey
): Promise<PortReserveAsset> {
Expand Down Expand Up @@ -114,7 +114,7 @@ export class PortReserveAsset extends Asset {
}

static async initialize(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
owner: Keypair,
reserveTokenMint: PublicKey,
pythPrice: PublicKey,
Expand Down Expand Up @@ -224,7 +224,7 @@ const DEFAULT_RESERVE_CONFIG: ReserveConfigProto = {

// TODO move to common utils
const createAccount = async (
provider: anchor.Provider,
provider: anchor.AnchorProvider,
space: number,
owner: PublicKey
): Promise<Keypair> => {
Expand All @@ -241,19 +241,19 @@ const createAccount = async (
space,
})
);
await provider.send(createTx, [newAccount]);
await provider.sendAndConfirm(createTx, [newAccount]);
return newAccount;
};

async function createLendingMarket(
provider: anchor.Provider
provider: anchor.AnchorProvider
): Promise<Keypair> {
const lendingMarket = await createAccount(
provider,
LENDING_MARKET_LEN,
DEVNET_LENDING_PROGRAM_ID
);
await provider.send(
await provider.sendAndConfirm(
(() => {
const tx = new Transaction();
tx.add(
Expand All @@ -275,7 +275,7 @@ async function createLendingMarket(
}

async function createDefaultReserve(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
initialLiquidity: number | anchor.BN,
liquidityMint: PublicKey,
sourceTokenWallet: PublicKey,
Expand Down Expand Up @@ -359,7 +359,7 @@ async function createDefaultReserve(
)
);

await provider.send(tx, [owner]);
await provider.sendAndConfirm(tx, [owner]);

return {
program: DEVNET_LENDING_PROGRAM_ID,
Expand Down
12 changes: 6 additions & 6 deletions sdk/src/adapters/solend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface SolendAccounts {

export class SolendReserveAsset extends Asset {
private constructor(
public provider: anchor.Provider,
public provider: anchor.AnchorProvider,
public accounts: SolendAccounts,
public reserve: SolendReserve
) {
Expand All @@ -50,7 +50,7 @@ export class SolendReserveAsset extends Asset {

// TODO change to connection instead of provider so it doesn't need to be reloaded when wallet changes
static async load(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
cluster: Cluster,
reserveMint: PublicKey
): Promise<SolendReserveAsset> {
Expand Down Expand Up @@ -89,7 +89,7 @@ export class SolendReserveAsset extends Asset {
}

static async initialize(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
owner: Keypair,
wallet: anchor.Wallet,
reserveTokenMint: PublicKey,
Expand Down Expand Up @@ -210,7 +210,7 @@ const DEVNET_PROGRAM_ID = new PublicKey(
);

export async function initLendingMarket(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
owner: PublicKey,
payer: Keypair,
pythProgramId: PublicKey,
Expand Down Expand Up @@ -242,12 +242,12 @@ export async function initLendingMarket(
DEVNET_PROGRAM_ID
)
);
await provider.send(initTx, [payer, lendingMarketAccount]);
await provider.sendAndConfirm(initTx, [payer, lendingMarketAccount]);
return lendingMarketAccount;
}

export async function addReserve(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
liquidityAmount: number,
ownerReserveTokenAccount: PublicKey,
owner: Keypair,
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class VaultClient {
) {}

static async load(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
vaultId: PublicKey,
env: DeploymentEnv = DeploymentEnvs.mainnet
): Promise<VaultClient> {
Expand Down Expand Up @@ -90,7 +90,7 @@ export class VaultClient {
}

static async initialize(
provider: anchor.Provider,
provider: anchor.AnchorProvider,
wallet: anchor.Wallet,
env: DeploymentEnv,
reserveTokenMint: PublicKey,
Expand Down
35 changes: 24 additions & 11 deletions sdk/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@
resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==

"@jet-lab/jet-engine@^0.2.51":
version "0.2.51"
resolved "https://registry.yarnpkg.com/@jet-lab/jet-engine/-/jet-engine-0.2.51.tgz#acb5dde1be3d37cc759822589dbb7927fc629437"
integrity sha512-/u7WZ+HuwAmyK/Fg7+KDuM7+caALfWjEvPeom2z1UOZYQCUvhnTtzomsePoJs/0RWRS3A/GSIjdyMlscMSiBYw==
"@jet-lab/jet-engine@0.3.8":
version "0.3.8"
resolved "https://registry.yarnpkg.com/@jet-lab/jet-engine/-/jet-engine-0.3.8.tgz#02870efd2ec8c7c5bd5d7b1181bb73d1b73943bd"
integrity sha512-Mq1jN9dbn8rYFf+3Z5qtSmp19OCSDPraUzEM/4tukQPukKhhpgSVQ7wF3DfKg86lFTf/6Tnfs5wS4HM1vtf5JA==
dependencies:
"@project-serum/anchor" "^0.23.0"
"@project-serum/anchor" "^0.24.2"
"@project-serum/serum" "^0.13.60"
"@pythnetwork/client" "^2.5.1"
"@solana/buffer-layout" "^4.0.0"
"@solana/buffer-layout-utils" "^0.2.0"
"@solana/spl-governance" "^0.0.29"
"@solana/spl-token" "^0.2.0"
"@solana/web3.js" "^1.36.0"
bs58 "^5.0.0"
eventemitter3 "^4.0.7"
lodash "^4.17.21"
pako "^2.0.4"
react "^17.0.0"
react-dom "^17.0.0"

Expand Down Expand Up @@ -175,10 +177,10 @@
snake-case "^3.0.4"
toml "^3.0.0"

"@project-serum/anchor@^0.23.0":
version "0.23.0"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.23.0.tgz#2b2eb6b51601b073e8db26663aa2d6c2f2841771"
integrity sha512-LV2/ifZOJVFTZ4GbEloXln3iVfCvO1YM8i7BBCrUm4tehP7irMx4nr4/IabHWOzrQcQElsxSP/lb1tBp+2ff8A==
"@project-serum/anchor@^0.24.0", "@project-serum/anchor@^0.24.2":
version "0.24.2"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.24.2.tgz#a3c52a99605c80735f446ca9b3a4885034731004"
integrity sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA==
dependencies:
"@project-serum/borsh" "^0.2.5"
"@solana/web3.js" "^1.36.0"
Expand All @@ -190,7 +192,6 @@
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
find "^0.3.0"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
Expand Down Expand Up @@ -688,6 +689,11 @@ base-x@^3.0.2:
dependencies:
safe-buffer "^5.0.1"

base-x@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a"
integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==

base64-js@^1.3.1, base64-js@^1.5.1:
version "1.5.1"
resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"
Expand Down Expand Up @@ -788,6 +794,13 @@ bs58@^4.0.0, bs58@^4.0.1:
dependencies:
base-x "^3.0.2"

bs58@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279"
integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==
dependencies:
base-x "^4.0.0"

buffer-from@^1.0.0, buffer-from@^1.1.0:
version "1.1.2"
resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz"
Expand Down Expand Up @@ -2149,7 +2162,7 @@ p-locate@^5.0.0:
dependencies:
p-limit "^3.0.2"

pako@^2.0.3:
pako@^2.0.3, pako@^2.0.4:
version "2.0.4"
resolved "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz"
integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg==
Expand Down

0 comments on commit b1d35a4

Please sign in to comment.