From b934bfb04c3f49ea37b0193e54bb4f3fcc7d3e9e Mon Sep 17 00:00:00 2001 From: Benjamin Smith Date: Tue, 11 Jun 2024 13:31:25 +0200 Subject: [PATCH] fix attached/deposit name in change method args --- src/chains/near.ts | 1 + src/mpcContract.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/chains/near.ts b/src/chains/near.ts index 44bf7c9..3ee195b 100644 --- a/src/chains/near.ts +++ b/src/chains/near.ts @@ -3,6 +3,7 @@ import { Wallet } from "@near-wallet-selector/core"; export const TGAS = 1000000000000n; export const NO_DEPOSIT = "0"; +export const ONE_YOCTO = "1"; export interface NearConfig { networkId: string; diff --git a/src/mpcContract.ts b/src/mpcContract.ts index 1dd2bf7..d7f0469 100644 --- a/src/mpcContract.ts +++ b/src/mpcContract.ts @@ -5,7 +5,7 @@ import { najPublicKeyStrToUncompressedHexPoint, uncompressedHexPointToEvmAddress, } from "./utils/kdf"; -import { NO_DEPOSIT, nearAccountFromEnv, TGAS } from "./chains/near"; +import { nearAccountFromEnv, TGAS, ONE_YOCTO } from "./chains/near"; import { MPCSignature, NearContractFunctionPayload, @@ -18,8 +18,8 @@ export interface ChangeMethodArgs { args: T; /// GasLimit on transaction execution. gas: string; - /// Deposit (i.e. payable amount) to attach to transaction. - attachedDeposit: string; + /// attachedDeposit (i.e. payable amount) to attach to transaction. + amount: string; } interface MultichainContractInterface extends Contract { @@ -74,7 +74,7 @@ export class MultichainContract { const { big_r, s } = await this.contract.sign({ args: { request: signArgs }, gas: gasOrDefault(gas), - attachedDeposit: NO_DEPOSIT, + amount: ONE_YOCTO, }); return { big_r, big_s: s }; }; @@ -93,7 +93,7 @@ export class MultichainContract { methodName: "sign", args: { request: signArgs }, gas: gasOrDefault(gas), - deposit: NO_DEPOSIT, + deposit: ONE_YOCTO, }, }, ],