@fastnear/api 0.6.1 → 0.6.2

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.
@@ -1,5 +1,5 @@
1
- /* ⋈ 🏃🏻💨 FastNEAR API - CJS (@fastnear/api version 0.6.0) */
2
- /* https://www.npmjs.com/package/@fastnear/api/v/0.6.0 */
1
+ /* ⋈ 🏃🏻💨 FastNEAR API - CJS (@fastnear/api version 0.6.1) */
2
+ /* https://www.npmjs.com/package/@fastnear/api/v/0.6.1 */
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -17,18 +17,6 @@ interface TxStatus {
17
17
  type TxHistory = Record<string, TxStatus>;
18
18
 
19
19
  declare const MaxBlockDelayMs: number;
20
- declare const WIDGET_URL = "https://wallet-adapter.fastnear.com";
21
- declare const DEFAULT_NETWORK_ID = "mainnet";
22
- declare const NETWORKS: {
23
- testnet: {
24
- networkId: string;
25
- nodeUrl: string;
26
- };
27
- mainnet: {
28
- networkId: string;
29
- nodeUrl: string;
30
- };
31
- };
32
20
  declare function withBlockId(params: Record<string, any>, blockId?: string): {
33
21
  finality: string;
34
22
  } | {
@@ -157,4 +145,4 @@ declare const reExports: {
157
145
  };
158
146
  declare const utils: typeof reExportUtils;
159
147
 
160
- export { type AccessKeyView, DEFAULT_NETWORK_ID, MaxBlockDelayMs, NETWORKS, WIDGET_URL, accessKey, account, accountId, actions, afterTxSent, authStatus, block, config, localTxHistory, publicKey, queryRpc, reExports, requestSignIn, sendTx, sendTxToRpc, signOut, tx, utils, view, withBlockId };
148
+ export { type AccessKeyView, MaxBlockDelayMs, accessKey, account, accountId, actions, afterTxSent, authStatus, block, config, localTxHistory, publicKey, queryRpc, reExports, requestSignIn, sendTx, sendTxToRpc, signOut, tx, utils, view, withBlockId };
@@ -17,18 +17,6 @@ interface TxStatus {
17
17
  type TxHistory = Record<string, TxStatus>;
18
18
 
19
19
  declare const MaxBlockDelayMs: number;
20
- declare const WIDGET_URL = "https://wallet-adapter.fastnear.com";
21
- declare const DEFAULT_NETWORK_ID = "mainnet";
22
- declare const NETWORKS: {
23
- testnet: {
24
- networkId: string;
25
- nodeUrl: string;
26
- };
27
- mainnet: {
28
- networkId: string;
29
- nodeUrl: string;
30
- };
31
- };
32
20
  declare function withBlockId(params: Record<string, any>, blockId?: string): {
33
21
  finality: string;
34
22
  } | {
@@ -157,4 +145,4 @@ declare const reExports: {
157
145
  };
158
146
  declare const utils: typeof reExportUtils;
159
147
 
160
- export { type AccessKeyView, DEFAULT_NETWORK_ID, MaxBlockDelayMs, NETWORKS, WIDGET_URL, accessKey, account, accountId, actions, afterTxSent, authStatus, block, config, localTxHistory, publicKey, queryRpc, reExports, requestSignIn, sendTx, sendTxToRpc, signOut, tx, utils, view, withBlockId };
148
+ export { type AccessKeyView, MaxBlockDelayMs, accessKey, account, accountId, actions, afterTxSent, authStatus, block, config, localTxHistory, publicKey, queryRpc, reExports, requestSignIn, sendTx, sendTxToRpc, signOut, tx, utils, view, withBlockId };
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
- /* ⋈ 🏃🏻💨 FastNEAR API - ESM (@fastnear/api version 0.6.0) */
2
- /* https://www.npmjs.com/package/@fastnear/api/v/0.6.0 */
1
+ /* ⋈ 🏃🏻💨 FastNEAR API - ESM (@fastnear/api version 0.6.1) */
2
+ /* https://www.npmjs.com/package/@fastnear/api/v/0.6.1 */
3
3
  import { convertUnit } from "@fastnear/utils";
4
4
  if (typeof window !== "undefined") {
5
5
  window.$$ = convertUnit;
@@ -1,5 +1,5 @@
1
- /* ⋈ 🏃🏻💨 FastNEAR API - IIFE/UMD (@fastnear/api version 0.6.0) */
2
- /* https://www.npmjs.com/package/@fastnear/api/v/0.6.0 */
1
+ /* ⋈ 🏃🏻💨 FastNEAR API - IIFE/UMD (@fastnear/api version 0.6.1) */
2
+ /* https://www.npmjs.com/package/@fastnear/api/v/0.6.1 */
3
3
  var near = (() => {
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -23,10 +23,7 @@ var near = (() => {
23
23
  // src/index.ts
24
24
  var src_exports3 = {};
25
25
  __export(src_exports3, {
26
- DEFAULT_NETWORK_ID: () => DEFAULT_NETWORK_ID,
27
26
  MaxBlockDelayMs: () => MaxBlockDelayMs,
28
- NETWORKS: () => NETWORKS,
29
- WIDGET_URL: () => WIDGET_URL,
30
27
  accessKey: () => accessKey,
31
28
  account: () => account,
32
29
  accountId: () => accountId,
@@ -3770,6 +3767,18 @@ var near = (() => {
3770
3767
  };
3771
3768
 
3772
3769
  // src/state.ts
3770
+ var WIDGET_URL = "https://wallet-adapter.fastnear.com";
3771
+ var DEFAULT_NETWORK_ID = "mainnet";
3772
+ var NETWORKS = {
3773
+ testnet: {
3774
+ networkId: "testnet",
3775
+ nodeUrl: "https://rpc.testnet.fastnear.com/"
3776
+ },
3777
+ mainnet: {
3778
+ networkId: "mainnet",
3779
+ nodeUrl: "https://rpc.mainnet.fastnear.com/"
3780
+ }
3781
+ };
3773
3782
  var _config = lsGet("config") || {
3774
3783
  ...NETWORKS[DEFAULT_NETWORK_ID]
3775
3784
  };
@@ -3884,7 +3893,7 @@ var near = (() => {
3884
3893
  __name(getTxHistory, "getTxHistory");
3885
3894
  function setConfig(newConf) {
3886
3895
  _config = newConf;
3887
- lsSet("config", _config);
3896
+ lsSet("config", { ...NETWORKS[_config.networkId] });
3888
3897
  }
3889
3898
  __name(setConfig, "setConfig");
3890
3899
  function resetTxHistory() {
@@ -3896,18 +3905,6 @@ var near = (() => {
3896
3905
  // src/near.ts
3897
3906
  big_default.DP = 27;
3898
3907
  var MaxBlockDelayMs = 1e3 * 60 * 60 * 6;
3899
- var WIDGET_URL = "https://wallet-adapter.fastnear.com";
3900
- var DEFAULT_NETWORK_ID = "mainnet";
3901
- var NETWORKS = {
3902
- testnet: {
3903
- networkId: "testnet",
3904
- nodeUrl: "https://rpc.testnet.fastnear.com/"
3905
- },
3906
- mainnet: {
3907
- networkId: "mainnet",
3908
- nodeUrl: "https://rpc.mainnet.fastnear.com/"
3909
- }
3910
- };
3911
3908
  function withBlockId(params, blockId) {
3912
3909
  return blockId === "final" || blockId === "optimistic" ? { ...params, finality: blockId } : blockId ? { ...params, block_id: blockId } : { ...params, finality: "optimistic" };
3913
3910
  }
@@ -3987,7 +3984,7 @@ var near = (() => {
3987
3984
  const current = getConfig();
3988
3985
  if (newConfig) {
3989
3986
  if (newConfig.networkId && current.networkId !== newConfig.networkId) {
3990
- setConfig({ ...NETWORKS[newConfig.networkId] });
3987
+ setConfig(newConfig.networkId);
3991
3988
  updateState({
3992
3989
  accountId: null,
3993
3990
  privateKey: null,