js sdk updates

This commit is contained in:
Conner Gallagher 2023-07-06 23:41:18 -06:00
parent c68b2cff71
commit 4b27dbaacc
4 changed files with 12 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@switchboard-xyz/solana.js",
"version": "2.3.1",
"version": "2.3.2",
"author": "",
"license": "MIT",
"description": "A Typescript client to interact with Switchboard on Solana.",

View File

@ -199,6 +199,10 @@ export class FunctionAccount extends Account<types.FunctionAccountData> {
return this._wallet;
}
public set wallet(_wallet: Promise<SwitchboardWallet>) {
this._wallet = _wallet;
}
public static fromSeed(
program: SwitchboardProgram,
creatorSeed: Uint8Array,
@ -401,6 +405,9 @@ export class FunctionAccount extends Account<types.FunctionAccountData> {
addressLookupProgram: addressLookupProgram,
}
);
functionAccount.wallet = Promise.resolve(escrowWallet);
return [
functionAccount,
new TransactionObject(

View File

@ -264,8 +264,6 @@ export class SwitchboardWallet extends Account<SwitchboardWalletWithEscrow> {
params: SwitchboardWalletFundParams,
options?: TransactionObjectOptions
): Promise<TransactionObject> {
const walletState = await this.loadData();
let funderPubkey = payer;
if (params.funderAuthority) {
funderPubkey = params.funderAuthority.publicKey;
@ -288,12 +286,14 @@ export class SwitchboardWallet extends Account<SwitchboardWalletWithEscrow> {
wrapAmount = this.program.mint.toTokenAmountBN(params.wrapAmount);
}
const walletState = await this.loadData();
const ixn = types.walletFund(
this.program,
{ params: { transferAmount, wrapAmount } },
{
wallet: this.publicKey,
mint: walletState.mint,
mint: this.program.mint.address,
authority: walletState.authority,
attestationQueue: walletState.attestationQueue,
tokenWallet: this.tokenWallet,

View File

@ -77,7 +77,7 @@ describe("Vrf Pool Tests", () => {
rpcUrl: "http://0.0.0.0:8899",
oracleKey: oracle1.publicKey.toBase58(),
secretPath: "~/.config/solana/id.json",
silent: false,
silent: true,
});
chalkString("payer", ctx.program.walletPubkey.toBase58());