diff --git a/src/chains/near.ts b/src/chains/near.ts index 0f130e8..cf056fe 100644 --- a/src/chains/near.ts +++ b/src/chains/near.ts @@ -44,6 +44,5 @@ const createNearAccount = async ( await keyStore.setKey(network.networkId, accountId, keyPair); } const near = await connect({ ...network, keyStore }); - const account = await near.account(accountId); - return account; -}; \ No newline at end of file + return near.account(accountId); +}; diff --git a/src/mpcContract.ts b/src/mpcContract.ts index b03825b..6f79baf 100644 --- a/src/mpcContract.ts +++ b/src/mpcContract.ts @@ -22,6 +22,8 @@ export interface ChangeMethodArgs { gas: string; /// Deposit (i.e. payable amount) to attach to transaction. attachedDeposit: string; + /// Account Signing the call + signerAccount: Account; } interface MultichainContractInterface extends Contract { @@ -43,7 +45,7 @@ export class MultichainContract { constructor(account: Account, contractId: string = DEFAULT_MPC_CONTRACT) { this.connectedAccount = account; - this.contract = new Contract(account, contractId, { + this.contract = new Contract(account.connection, contractId, { changeMethods: ["sign"], viewMethods: ["public_key"], useLocalViewExecution: false, @@ -68,6 +70,7 @@ export class MultichainContract { ): Promise => { const [big_r, big_s] = await this.contract.sign({ args: signArgs, + signerAccount: this.connectedAccount, gas: gasOrDefault(gas), attachedDeposit: NO_DEPOSIT, });