Skip to content

Commit

Permalink
NAJS: Fix Deprecation Warning (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith authored Jul 2, 2024
1 parent 985878d commit 3f72697
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/chains/near.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
return near.account(accountId);
};
5 changes: 4 additions & 1 deletion src/mpcContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface ChangeMethodArgs<T> {
gas: string;
/// Deposit (i.e. payable amount) to attach to transaction.
attachedDeposit: string;
/// Account Signing the call
signerAccount: Account;
}

interface MultichainContractInterface extends Contract {
Expand All @@ -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,
Expand All @@ -68,6 +70,7 @@ export class MultichainContract {
): Promise<MPCSignature> => {
const [big_r, big_s] = await this.contract.sign({
args: signArgs,
signerAccount: this.connectedAccount,
gas: gasOrDefault(gas),
attachedDeposit: NO_DEPOSIT,
});
Expand Down

0 comments on commit 3f72697

Please sign in to comment.