btc-wallet 0.5.34-beta → 0.5.35-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -76,6 +76,7 @@ interface ExecuteBTCDepositAndActionParams<T extends boolean = true> {
76
76
  pollResult?: T; // optional: whether to poll for transaction result
77
77
  registerDeposit?: string; // optional: whether to register deposit,default 0.000125 NEAR
78
78
  newAccountMinDepositAmount?: boolean; // default is true, if true, new account minimum deposit BTC amount 1000sat, otherwise 0
79
+ registerContractId?: string; // if registerContractId is provided, it will be used to register the contract, otherwise it will be the default contract id
79
80
  }
80
81
 
81
82
  // Example 1: dApp one-click BTC deposit
@@ -52,12 +52,14 @@ interface ExecuteBTCDepositAndActionParams<T extends boolean = true> {
52
52
  env?: ENV;
53
53
  pollResult?: T;
54
54
  newAccountMinDepositAmount?: boolean;
55
+ /** if registerContractId is provided, it will be used to register the contract, otherwise it will be the default contract id */
56
+ registerContractId?: string;
55
57
  }
56
58
  /**
57
59
  * @param T - if true, return the poll result, otherwise return the btcTxHash
58
60
  */
59
61
  type ExecuteBTCDepositAndActionReturn<T extends boolean> = T extends true ? FinalExecutionOutcome[] : string;
60
- export declare function executeBTCDepositAndAction<T extends boolean = true>({ action, amount, feeRate, pollResult, registerDeposit, env, newAccountMinDepositAmount, }: ExecuteBTCDepositAndActionParams<T>): Promise<ExecuteBTCDepositAndActionReturn<T>>;
62
+ export declare function executeBTCDepositAndAction<T extends boolean = true>({ action, amount, feeRate, pollResult, registerDeposit, env, newAccountMinDepositAmount, registerContractId, }: ExecuteBTCDepositAndActionParams<T>): Promise<ExecuteBTCDepositAndActionReturn<T>>;
61
63
  export declare function checkSatoshiWhitelist(btcAccountId: string, env?: ENV): Promise<void>;
62
64
  interface WithdrawParams {
63
65
  amount: string | number;
package/dist/index.js CHANGED
@@ -4053,7 +4053,8 @@ function executeBTCDepositAndAction(_0) {
4053
4053
  pollResult = true,
4054
4054
  registerDeposit,
4055
4055
  env = "mainnet",
4056
- newAccountMinDepositAmount
4056
+ newAccountMinDepositAmount,
4057
+ registerContractId
4057
4058
  }) {
4058
4059
  var _a;
4059
4060
  try {
@@ -4091,17 +4092,14 @@ function executeBTCDepositAndAction(_0) {
4091
4092
  }));
4092
4093
  }
4093
4094
  const storageDepositMsg = {};
4094
- const registerContractId = ((action == null ? void 0 : action.receiver_id) || config.btcToken).replace(
4095
- config.accountContractId,
4096
- config.btcToken
4097
- );
4098
- console.log("executeBTCDepositAndAction registerContractId", registerContractId);
4099
- const registerRes = yield nearCall(registerContractId, "storage_balance_of", {
4095
+ const _registerContractId = registerContractId || ((action == null ? void 0 : action.receiver_id) || config.btcToken).replace(config.accountContractId, config.btcToken);
4096
+ console.log("executeBTCDepositAndAction registerContractId", _registerContractId);
4097
+ const registerRes = yield nearCall(_registerContractId, "storage_balance_of", {
4100
4098
  account_id: csna
4101
4099
  });
4102
4100
  if (!(registerRes == null ? void 0 : registerRes.available)) {
4103
4101
  storageDepositMsg.storage_deposit_msg = {
4104
- contract_id: registerContractId,
4102
+ contract_id: _registerContractId,
4105
4103
  deposit: registerDeposit || NEAR_STORAGE_DEPOSIT_AMOUNT,
4106
4104
  registration_only: true
4107
4105
  };
@@ -4927,7 +4925,7 @@ function getGroup(state) {
4927
4925
 
4928
4926
  // src/index.ts
4929
4927
  var getVersion = () => {
4930
- return "0.5.34-beta";
4928
+ return "0.5.35-beta";
4931
4929
  };
4932
4930
  if (typeof window !== "undefined") {
4933
4931
  window.__BTC_WALLET_VERSION = getVersion();