btc-wallet 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ interface BTCWalletParams {
11
11
  autoConnect?: boolean;
12
12
  isDev?: boolean;
13
13
  }
14
- export declare function setupBTCWallet({ iconUrl, deprecated, autoConnect, }?: BTCWalletParams | undefined): WalletModuleFactory<InjectedWallet>;
14
+ export declare function setupBTCWallet({ iconUrl, deprecated, autoConnect, isDev, }?: BTCWalletParams | undefined): WalletModuleFactory<InjectedWallet>;
15
15
  declare const _default: {
16
16
  setupBTCWallet: typeof setupBTCWallet;
17
17
  };
package/esm/index.js CHANGED
@@ -2458,8 +2458,8 @@ var { transfer, functionCall } = actionCreators;
2458
2458
  var config = {
2459
2459
  dev: {
2460
2460
  base_url: "https://api.dev.satoshibridge.top/v1",
2461
- token: "nbtc1-nsp.dev",
2462
- contractId: "dev1-nsp.dev"
2461
+ token: "nbtc1-nsp.testnet",
2462
+ contractId: "dev1-nsp.testnet"
2463
2463
  },
2464
2464
  testnet: {
2465
2465
  base_url: "https://api.testnet.satoshibridge.top/v1",
@@ -2719,7 +2719,12 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
2719
2719
  gas_limit: "3000",
2720
2720
  use_near_pay_gas: false
2721
2721
  };
2722
- const availableBalance = parseFloat(accountInfo.available_balance) / __pow(10, 24);
2722
+ const nearAccount = yield provider.query({
2723
+ request_type: "view_account",
2724
+ account_id: accountId,
2725
+ finality: "final"
2726
+ });
2727
+ const availableBalance = parseFloat(nearAccount.amount) / __pow(10, 24);
2723
2728
  if (availableBalance > 0.2) {
2724
2729
  intention.use_near_pay_gas = true;
2725
2730
  }
@@ -2787,7 +2792,8 @@ function uploadBTCTx(url, data) {
2787
2792
  function setupBTCWallet({
2788
2793
  iconUrl = "https://assets.deltatrade.ai/assets/chain/btc.svg",
2789
2794
  deprecated = false,
2790
- autoConnect = true
2795
+ autoConnect = true,
2796
+ isDev = false
2791
2797
  } = {}) {
2792
2798
  const btcWallet = () => __async(this, null, function* () {
2793
2799
  return {
@@ -2800,7 +2806,8 @@ function setupBTCWallet({
2800
2806
  downloadUrl: iconUrl,
2801
2807
  deprecated,
2802
2808
  available: true,
2803
- autoConnect
2809
+ autoConnect,
2810
+ isDev
2804
2811
  },
2805
2812
  init: BTCWallet
2806
2813
  };
@@ -2860,7 +2867,7 @@ function pollTransactionStatuses(network, hashes) {
2860
2867
 
2861
2868
  // src/index.ts
2862
2869
  var getVersion = () => {
2863
- return "0.2.2";
2870
+ return "0.2.3";
2864
2871
  };
2865
2872
  if (typeof window !== "undefined") {
2866
2873
  window.__PARTICLE_BTC_CONNECT_VERSION = getVersion();