New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

onering-solana-sdk

Package Overview
Dependencies
Maintainers
1
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onering-solana-sdk - npm Package Compare versions

Comparing version 1.5.10 to 1.5.11

2

package.json
{
"name": "onering-solana-sdk",
"version": "1.5.10",
"version": "1.5.11",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "types": "src/index.d.ts",

@@ -65,11 +65,10 @@ "use strict";

}),
yield this.program.methods
.createPool(compoundingTick)
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
pool: this.address,
poolAuthority: yield this.findAuthorityAddress(),
})
.instruction(),
this.program.instruction.createPool(compoundingTick, {
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
pool: this.address,
poolAuthority: yield this.findAuthorityAddress(),
},
}),
]);

@@ -81,11 +80,10 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.closePool()
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: realm.address,
pool: this.address,
})
.instruction(),
this.program.instruction.closePool({
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: realm.address,
pool: this.address,
},
}),
]);

@@ -92,0 +90,0 @@ });

@@ -71,9 +71,8 @@ "use strict";

}),
yield this.program.methods
.createRealm(args)
.accounts({
realm: this.address,
realmAuthority: yield this.findAuthorityAddress(),
})
.instruction(),
this.program.instruction.createRealm(args, {
accounts: {
realm: this.address,
realmAuthority: yield this.findAuthorityAddress(),
},
}),
]);

@@ -95,9 +94,8 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.updateRealm(args)
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
realm: this.address,
})
.instruction(),
this.program.instruction.updateRealm(args, {
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
realm: this.address,
},
}),
]);

@@ -109,10 +107,9 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.closeRealm()
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: this.address,
})
.instruction(),
this.program.instruction.closeRealm({
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: this.address,
},
}),
]);

@@ -119,0 +116,0 @@ });

@@ -38,10 +38,9 @@ "use strict";

}),
yield this.program.methods
.createStrategy(authorityKey)
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
strategy: this.address,
})
.instruction(),
this.program.instruction.createStrategy(authorityKey, {
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
strategy: this.address,
},
}),
]);

@@ -57,3 +56,3 @@ });

]);
const [vaultTreasuryAta, strategyTreasury, mantissaAmount] = yield Promise.all([
const [vaultTreasuryAta, strategyTreasury, rawAmount] = yield Promise.all([
vault.findAssociatedTokenAccountFor(vaultData.treasuryMint),

@@ -74,15 +73,14 @@ (0, token_utils_1.getOrCreateATA)({

}
instructions.push(yield this.program.methods
.depositToStrategy(mantissaAmount)
.accounts({
bot: botKey || this.provider.wallet.publicKey,
realm: realm.address,
vault: vault.address,
strategy: this.address,
vaultTreasuryAta,
strategyTreasuryAta: strategyTreasury.address,
vaultAuthority: yield vault.findAuthorityAddress(),
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
})
.instruction());
instructions.push(this.program.instruction.depositToStrategy(rawAmount, {
accounts: {
bot: botKey || this.provider.wallet.publicKey,
realm: realm.address,
vault: vault.address,
strategy: this.address,
vaultTreasuryAta,
strategyTreasuryAta: strategyTreasury.address,
vaultAuthority: yield vault.findAuthorityAddress(),
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -94,11 +92,10 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.closeStrategy()
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: realm.address,
strategy: this.address,
})
.instruction(),
this.program.instruction.closeStrategy({
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: realm.address,
strategy: this.address,
},
}),
]);

@@ -105,0 +102,0 @@ });

@@ -96,11 +96,10 @@ "use strict";

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.initDepositReceipt(this.address)
.accounts({
rentPayer: this.provider.wallet.publicKey,
realm: realm.address,
depositReceipt: depositReceiptAddress,
systemProgram: web3_js_1.SystemProgram.programId,
})
.instruction(),
this.program.instruction.initDepositReceipt(this.address, {
accounts: {
rentPayer: this.provider.wallet.publicKey,
realm: realm.address,
depositReceipt: depositReceiptAddress,
systemProgram: web3_js_1.SystemProgram.programId,
},
}),
]);

@@ -113,12 +112,11 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.initStakeReceipt(this.address)
.accounts({
rentPayer: this.provider.wallet.publicKey,
realm: realm.address,
pool: pool.address,
stakeReceipt: stakeReceiptAddress,
systemProgram: web3_js_1.SystemProgram.programId,
})
.instruction(),
this.program.instruction.initStakeReceipt(this.address, {
accounts: {
rentPayer: this.provider.wallet.publicKey,
realm: realm.address,
pool: pool.address,
stakeReceipt: stakeReceiptAddress,
systemProgram: web3_js_1.SystemProgram.programId,
},
}),
]);

@@ -137,3 +135,3 @@ });

]);
const [userCollat, userTreasuryAta, vaultTreasury] = yield Promise.all([
const [userCollat, userTreasuryAta, vaultTreasury, rawAmount] = yield Promise.all([
(0, token_utils_1.getOrCreateATA)({

@@ -150,2 +148,7 @@ provider: this.provider,

}),
(0, utils_1.getRawAmount)({
provider: this.provider,
mintKey: vaultData.treasuryMint,
amount,
}),
]);

@@ -162,23 +165,18 @@ if (userCollat.instruction) {

}
instructions.push(yield this.program.methods
.deposit(yield (0, utils_1.getRawAmount)({
provider: this.provider,
mintKey: vaultData.treasuryMint,
amount,
}))
.accounts({
user: this.address,
realm: realm.address,
vault: vault.address,
collatMint: realmData.collatMint,
treasuryMint: vaultData.treasuryMint,
depositReceipt: yield this.findDepositReceiptAddress(realm),
userCollatAta: userCollat.address,
userTreasuryAta,
vaultTreasuryAta: vaultTreasury.address,
vaultAuthority,
realmAuthority,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
})
.instruction());
instructions.push(this.program.instruction.deposit(rawAmount, {
accounts: {
user: this.address,
realm: realm.address,
vault: vault.address,
collatMint: realmData.collatMint,
treasuryMint: vaultData.treasuryMint,
depositReceipt: yield this.findDepositReceiptAddress(realm),
userCollatAta: userCollat.address,
userTreasuryAta,
vaultTreasuryAta: vaultTreasury.address,
vaultAuthority,
realmAuthority,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -199,3 +197,3 @@ });

]);
const [userCollatAta, userTreasury, vaultTreasury, realmTreasury] = yield Promise.all([
const [userCollatAta, userTreasury, vaultTreasury, realmTreasury, rawAmount,] = yield Promise.all([
this.findAssociatedTokenAccountFor(realmData.collatMint),

@@ -217,2 +215,7 @@ (0, token_utils_1.getOrCreateATA)({

}),
(0, utils_1.getRawAmount)({
provider: this.provider,
mintKey: realmData.collatMint,
amount,
}),
]);

@@ -228,38 +231,32 @@ if (userTreasury.instruction) {

}
instructions.push(yield this.program.methods
.withdraw(yield (0, utils_1.getRawAmount)({
provider: this.provider,
mintKey: realmData.collatMint,
amount,
}))
.accounts({
redeem: {
user: this.address,
instructions.push(this.program.instruction.withdraw(rawAmount, {
accounts: {
redeem: {
user: this.address,
realm: realm.address,
vault: vault.address,
collatMint: realmData.collatMint,
treasuryMint: vaultData.treasuryMint,
depositReceipt: depositReceiptAddress,
userCollatAta,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
userTreasuryAta: userTreasury.address,
vaultTreasuryAta: vaultTreasury.address,
realmTreasuryAta: realmTreasury.address,
vaultAuthority,
realmAuthority, // mint authority
},
}));
}
else {
instructions.push(this.program.instruction.initDepositReceipt(this.address, {
accounts: {
rentPayer: this.provider.wallet.publicKey,
realm: realm.address,
vault: vault.address,
collatMint: realmData.collatMint,
treasuryMint: vaultData.treasuryMint,
depositReceipt: depositReceiptAddress,
userCollatAta,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
systemProgram: web3_js_1.SystemProgram.programId,
},
userTreasuryAta: userTreasury.address,
vaultTreasuryAta: vaultTreasury.address,
realmTreasuryAta: realmTreasury.address,
vaultAuthority,
realmAuthority, // mint authority
})
.instruction());
}));
}
else {
instructions.push(yield this.program.methods
.initDepositReceipt(this.address)
.accounts({
rentPayer: this.provider.wallet.publicKey,
realm: realm.address,
depositReceipt: depositReceiptAddress,
systemProgram: web3_js_1.SystemProgram.programId,
})
.instruction());
}
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -296,15 +293,14 @@ });

}
instructions.push(yield this.program.methods
.stake(rawAmount)
.accounts({
user: this.address,
realm: realm.address,
pool: pool.address,
stakeReceipt: yield this.findStakeReceiptAddress(realm, pool),
userCollatAta,
poolCollatAta: poolCollat.address,
poolAuthority,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
})
.instruction());
instructions.push(this.program.instruction.stake(rawAmount, {
accounts: {
user: this.address,
realm: realm.address,
pool: pool.address,
stakeReceipt: yield this.findStakeReceiptAddress(realm, pool),
userCollatAta,
poolCollatAta: poolCollat.address,
poolAuthority,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -350,15 +346,14 @@ });

}
instructions.push(yield this.program.methods
.unstake(rawAmount)
.accounts({
user: this.address,
realm: realm.address,
pool: pool.address,
stakeReceipt: stakeReceiptAddress,
userCollatAta,
poolCollatAta: poolCollat.address,
poolAuthority,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
})
.instruction());
instructions.push(this.program.instruction.unstake(rawAmount, {
accounts: {
user: this.address,
realm: realm.address,
pool: pool.address,
stakeReceipt: stakeReceiptAddress,
userCollatAta,
poolCollatAta: poolCollat.address,
poolAuthority,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -365,0 +360,0 @@ });

@@ -65,11 +65,10 @@ "use strict";

}),
yield this.program.methods
.createVault(mintKey)
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
vault: this.address,
vaultAuthority: yield this.findAuthorityAddress(),
})
.instruction(),
this.program.instruction.createVault(mintKey, {
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
vault: this.address,
vaultAuthority: yield this.findAuthorityAddress(),
},
}),
]);

@@ -96,23 +95,22 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.depositToVault(rawAmount)
.accounts({
compounder: {
realm: realm.address,
pool: pool.address,
collatMint: realmData.collatMint,
poolCollatAta,
realmAuthority: yield realm.findAuthorityAddress(),
poolAuthority: yield pool.findAuthorityAddress(),
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
this.program.instruction.depositToVault(rawAmount, {
accounts: {
compounder: {
realm: realm.address,
pool: pool.address,
collatMint: realmData.collatMint,
poolCollatAta,
realmAuthority: yield realm.findAuthorityAddress(),
poolAuthority: yield pool.findAuthorityAddress(),
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
user: user.address,
vault: this.address,
treasuryMint: vaultData.treasuryMint,
userTreasuryAta,
realmTreasuryAta,
vaultTreasuryAta,
vaultAuthority: yield this.findAuthorityAddress(),
},
user: user.address,
vault: this.address,
treasuryMint: vaultData.treasuryMint,
userTreasuryAta,
realmTreasuryAta,
vaultTreasuryAta,
vaultAuthority: yield this.findAuthorityAddress(),
})
.instruction(),
}),
]);

@@ -124,11 +122,10 @@ });

return new solana_contrib_1.TransactionEnvelope(this.provider, [
yield this.program.methods
.closeVault()
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: realm.address,
vault: this.address,
})
.instruction(),
this.program.instruction.closeVault({
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
rentCollector: rentCollector || this.provider.wallet.publicKey,
realm: realm.address,
vault: this.address,
},
}),
]);

@@ -135,0 +132,0 @@ });

@@ -50,3 +50,32 @@ import BN from "bn.js";

instructions: TransactionInstruction[];
accounts?: Record<any, any>;
accounts?: {
user: PublicKey;
depositReceipt: PublicKey;
realm: PublicKey;
vault: PublicKey;
receipt: PublicKey;
collatMint: PublicKey;
treasuryMint: PublicKey;
poolMint: PublicKey;
realmAuthority: PublicKey;
strategyAuthority: PublicKey;
swap: PublicKey;
swapAuthority: PublicKey;
tokenAReserve: PublicKey;
tokenBReserve: PublicKey;
tokenAFee: PublicKey;
tokenBFee: PublicKey;
userCollatAta: PublicKey;
userTreasuryAta: PublicKey;
realmTreasuryAta: PublicKey;
strategyLpAta: PublicKey;
rewarder: PublicKey;
quarry: PublicKey;
miner: PublicKey;
minerVault: PublicKey;
tokenProgram: PublicKey;
stableSwapProgram: PublicKey;
quarryMineProgram: PublicKey;
collateralManagerProgram: PublicKey;
};
rawAmount?: BN;

@@ -53,0 +82,0 @@ }>;

@@ -76,4 +76,3 @@ "use strict";

}),
yield this.program.methods
.createReceipt({
this.program.instruction.createReceipt({
swap,

@@ -88,10 +87,10 @@ swapAuthority,

rewarder,
})
.accounts({
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
receipt: this.address,
strategyAuthority: yield this.findAuthorityAddress(),
})
.instruction(),
}, {
accounts: {
admin: adminKey || this.provider.wallet.publicKey,
realm: realm.address,
receipt: this.address,
strategyAuthority: yield this.findAuthorityAddress(),
},
}),
]);

@@ -147,30 +146,29 @@ });

}
instructions.push(yield this.program.methods
.deposit((0, utils_1.getRawBps)(tolerance))
.accounts({
bot: botKey || this.provider.wallet.publicKey,
rentPayer: rentPayerKey || this.provider.wallet.publicKey,
realm: realm.address,
receipt: this.address,
strategyAuthority,
swap: receiptData.swap,
swapAuthority: receiptData.swapAuthority,
tokenAReserve: receiptData.tokenAReserve,
tokenBReserve: receiptData.tokenBReserve,
poolMint: receiptData.poolMint,
tokenAMint: tokenAAccount.mint,
tokenBMint: tokenBAccount.mint,
strategyTokenAAta: strategyTokenA.address,
strategyTokenBAta: strategyTokenB.address,
strategyLpAta: strategyLp.address,
rewarder: receiptData.rewarder,
quarry: receiptData.quarry,
miner: minerAddress,
minerVault: minerVault.address,
systemProgram: web3_js_1.SystemProgram.programId,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
stableSwapProgram: stableswap_sdk_1.SWAP_PROGRAM_ID,
quarryMineProgram: quarry_sdk_1.QUARRY_ADDRESSES.Mine,
})
.instruction());
instructions.push(this.program.instruction.deposit((0, utils_1.getRawBps)(tolerance), {
accounts: {
bot: botKey || this.provider.wallet.publicKey,
rentPayer: rentPayerKey || this.provider.wallet.publicKey,
realm: realm.address,
receipt: this.address,
strategyAuthority,
swap: receiptData.swap,
swapAuthority: receiptData.swapAuthority,
tokenAReserve: receiptData.tokenAReserve,
tokenBReserve: receiptData.tokenBReserve,
poolMint: receiptData.poolMint,
tokenAMint: tokenAAccount.mint,
tokenBMint: tokenBAccount.mint,
strategyTokenAAta: strategyTokenA.address,
strategyTokenBAta: strategyTokenB.address,
strategyLpAta: strategyLp.address,
rewarder: receiptData.rewarder,
quarry: receiptData.quarry,
miner: minerAddress,
minerVault: minerVault.address,
systemProgram: web3_js_1.SystemProgram.programId,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
stableSwapProgram: stableswap_sdk_1.SWAP_PROGRAM_ID,
quarryMineProgram: quarry_sdk_1.QUARRY_ADDRESSES.Mine,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -276,6 +274,3 @@ });

if (accounts && rawAmount) {
instructions.push(yield this.program.methods
.withdrawOne(rawAmount)
.accounts(accounts)
.instruction());
instructions.push(this.program.instruction.withdrawOne(rawAmount, { accounts }));
}

@@ -294,8 +289,5 @@ return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

if (accounts && rawAmount) {
instructions.push(yield this.program.methods
.withdrawFull(rawAmount)
.accounts({
withdrawOne: accounts,
})
.instruction());
instructions.push(this.program.instruction.withdrawFull(rawAmount, {
accounts: { withdrawOne: accounts },
}));
}

@@ -329,21 +321,20 @@ return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

}
instructions.push(yield this.program.methods
.claimRewards()
.accounts({
realm: receiptData.realm,
receipt: this.address,
strategyAuthority,
rewarder: receiptData.rewarder,
quarry: receiptData.quarry,
mintWrapper: rewarderWrapper.rewarderData.mintWrapper,
minter: minterAddress,
rewardsTokenMint: mintWrapperData.tokenMint,
claimFeeTokenAccount: rewarderWrapper.rewarderData.claimFeeTokenAccount,
miner: minerAddress,
strategyRewardsTokenAta: strategyRewardsToken.address,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
quarryMineProgram: quarry_sdk_1.QUARRY_ADDRESSES.Mine,
quarryMintWrapperProgram: quarry_sdk_1.QUARRY_ADDRESSES.MintWrapper,
})
.instruction());
instructions.push(this.program.instruction.claimRewards({
accounts: {
realm: receiptData.realm,
receipt: this.address,
strategyAuthority,
rewarder: receiptData.rewarder,
quarry: receiptData.quarry,
mintWrapper: rewarderWrapper.rewarderData.mintWrapper,
minter: minterAddress,
rewardsTokenMint: mintWrapperData.tokenMint,
claimFeeTokenAccount: rewarderWrapper.rewarderData.claimFeeTokenAccount,
miner: minerAddress,
strategyRewardsTokenAta: strategyRewardsToken.address,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
quarryMineProgram: quarry_sdk_1.QUARRY_ADDRESSES.Mine,
quarryMintWrapperProgram: quarry_sdk_1.QUARRY_ADDRESSES.MintWrapper,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -376,14 +367,13 @@ });

}
instructions.push(yield this.program.methods
.withdrawRewards()
.accounts({
admin: realmData.admin,
realm: realm.address,
receipt: this.address,
strategyAuthority,
strategyAta,
beneficiaryAta: beneficiary.address,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
})
.instruction());
instructions.push(this.program.instruction.withdrawRewards({
accounts: {
admin: realmData.admin,
realm: realm.address,
receipt: this.address,
strategyAuthority,
strategyAta,
beneficiaryAta: beneficiary.address,
tokenProgram: token_utils_1.TOKEN_PROGRAM_ID,
},
}));
return new solana_contrib_1.TransactionEnvelope(this.provider, instructions);

@@ -390,0 +380,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc