near-api-js 6.0.2 → 6.2.0

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.
Files changed (71) hide show
  1. package/lib/account.d.ts +8 -1
  2. package/lib/account.js +39 -4
  3. package/lib/account_creator-Bs61dnmU.d.ts +10 -0
  4. package/lib/account_creator.js +31 -6
  5. package/lib/browser-connect.d.ts +13 -3
  6. package/lib/browser-connect.js +28 -30
  7. package/lib/browser-index-RhYalP0h.d.ts +14 -0
  8. package/lib/browser-index.d.ts +23 -4
  9. package/lib/browser-index.js +40 -30
  10. package/lib/common-index.d.ts +20 -13
  11. package/lib/common-index.js +68 -48
  12. package/lib/connect.d.ts +12 -3
  13. package/lib/connect.js +66 -99
  14. package/lib/connection.js +27 -4
  15. package/lib/constants.js +27 -4
  16. package/lib/contract.js +29 -4
  17. package/lib/enums-BOxGXwY_.d.ts +8 -0
  18. package/lib/format-BlG-d3wc.d.ts +11 -0
  19. package/lib/index-B3Nnuq00.d.ts +23 -0
  20. package/lib/index-BDdRUK93.d.ts +21 -0
  21. package/lib/index-Dvb6OQET.d.ts +16 -0
  22. package/lib/index.d.ts +24 -5
  23. package/lib/index.js +42 -31
  24. package/lib/key_pair-D16Om3fY.d.ts +16 -0
  25. package/lib/key_stores/browser-index.d.ts +2 -6
  26. package/lib/key_stores/browser-index.js +36 -11
  27. package/lib/key_stores/browser_local_storage_key_store.js +27 -4
  28. package/lib/key_stores/in_memory_key_store.js +27 -4
  29. package/lib/key_stores/index.d.ts +3 -7
  30. package/lib/key_stores/index.js +39 -13
  31. package/lib/key_stores/keystore.js +27 -4
  32. package/lib/key_stores/merge_key_store.js +27 -4
  33. package/lib/key_stores/unencrypted_file_system_keystore.d.ts +1 -1
  34. package/lib/key_stores/unencrypted_file_system_keystore.js +29 -5
  35. package/lib/near.d.ts +12 -8
  36. package/lib/near.js +64 -61
  37. package/lib/providers/failover-rpc-provider.js +27 -4
  38. package/lib/providers/index.d.ts +3 -5
  39. package/lib/providers/index.js +47 -12
  40. package/lib/providers/json-rpc-provider.js +32 -7
  41. package/lib/providers/provider.d.ts +1 -1
  42. package/lib/providers/provider.js +159 -8
  43. package/lib/rpc_errors-BbA15mFX.d.ts +12 -0
  44. package/lib/serialize-DKM2UWTl.d.ts +10 -0
  45. package/lib/signer.d.ts +1 -1
  46. package/lib/signer.js +29 -5
  47. package/lib/transaction-C81hWIM7.d.ts +52 -0
  48. package/lib/transaction.d.ts +3 -13
  49. package/lib/transaction.js +100 -46
  50. package/lib/utils/enums.js +27 -4
  51. package/lib/utils/errors.d.ts +2 -0
  52. package/lib/utils/errors.js +43 -0
  53. package/lib/utils/exponential-backoff.d.ts +2 -0
  54. package/lib/utils/exponential-backoff.js +25 -0
  55. package/lib/utils/format.d.ts +1 -1
  56. package/lib/utils/format.js +33 -7
  57. package/lib/utils/index.d.ts +9 -8
  58. package/lib/utils/index.js +60 -40
  59. package/lib/utils/key_pair.d.ts +2 -2
  60. package/lib/utils/key_pair.js +35 -7
  61. package/lib/utils/logger.js +27 -4
  62. package/lib/utils/logging.d.ts +1 -0
  63. package/lib/utils/logging.js +30 -0
  64. package/lib/utils/rpc_errors.d.ts +1 -1
  65. package/lib/utils/rpc_errors.js +35 -8
  66. package/lib/utils/serialize.d.ts +2 -2
  67. package/lib/utils/serialize.js +36 -8
  68. package/lib/validators-q97R8D1k.d.ts +11 -0
  69. package/lib/validators.d.ts +1 -1
  70. package/lib/validators.js +33 -5
  71. package/package.json +16 -14
package/lib/account.d.ts CHANGED
@@ -1 +1,8 @@
1
- export { Account, AccountBalance, AccountAuthorizedApp, SignAndSendTransactionOptions, FunctionCallOptions, ChangeFunctionCallOptions, ViewFunctionCallOptions, } from "@near-js/accounts";
1
+ export { Account, AccountAuthorizedApp, AccountBalance, ChangeFunctionCallOptions, FunctionCallOptions, SignAndSendTransactionOptions, ViewFunctionCallOptions } from '@near-js/accounts';
2
+ import '@near-js/keystores';
3
+ import '@near-js/keystores-browser';
4
+ import '@near-js/utils';
5
+ import '@near-js/providers';
6
+ import '@near-js/types';
7
+ import '@near-js/signers';
8
+ import '@near-js/keystores-node';
package/lib/account.js CHANGED
@@ -1,5 +1,40 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Account = void 0;
4
- var accounts_1 = require("@near-js/accounts");
5
- Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return accounts_1.Account; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var account_exports = {};
20
+ __export(account_exports, {
21
+ Account: () => import_accounts.Account,
22
+ AccountAuthorizedApp: () => import_accounts.AccountAuthorizedApp,
23
+ AccountBalance: () => import_accounts.AccountBalance,
24
+ ChangeFunctionCallOptions: () => import_accounts.ChangeFunctionCallOptions,
25
+ FunctionCallOptions: () => import_accounts.FunctionCallOptions,
26
+ SignAndSendTransactionOptions: () => import_accounts.SignAndSendTransactionOptions,
27
+ ViewFunctionCallOptions: () => import_accounts.ViewFunctionCallOptions
28
+ });
29
+ module.exports = __toCommonJS(account_exports);
30
+ var import_accounts = require("@near-js/accounts");
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ Account,
34
+ AccountAuthorizedApp,
35
+ AccountBalance,
36
+ ChangeFunctionCallOptions,
37
+ FunctionCallOptions,
38
+ SignAndSendTransactionOptions,
39
+ ViewFunctionCallOptions
40
+ });
@@ -0,0 +1,10 @@
1
+ import { AccountCreator, LocalAccountCreator, UrlAccountCreator } from '@near-js/accounts';
2
+
3
+ declare const account_creator_AccountCreator: typeof AccountCreator;
4
+ declare const account_creator_LocalAccountCreator: typeof LocalAccountCreator;
5
+ declare const account_creator_UrlAccountCreator: typeof UrlAccountCreator;
6
+ declare namespace account_creator {
7
+ export { account_creator_AccountCreator as AccountCreator, account_creator_LocalAccountCreator as LocalAccountCreator, account_creator_UrlAccountCreator as UrlAccountCreator };
8
+ }
9
+
10
+ export { account_creator as a };
@@ -1,7 +1,32 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UrlAccountCreator = exports.LocalAccountCreator = exports.AccountCreator = void 0;
4
- var accounts_1 = require("@near-js/accounts");
5
- Object.defineProperty(exports, "AccountCreator", { enumerable: true, get: function () { return accounts_1.AccountCreator; } });
6
- Object.defineProperty(exports, "LocalAccountCreator", { enumerable: true, get: function () { return accounts_1.LocalAccountCreator; } });
7
- Object.defineProperty(exports, "UrlAccountCreator", { enumerable: true, get: function () { return accounts_1.UrlAccountCreator; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var account_creator_exports = {};
20
+ __export(account_creator_exports, {
21
+ AccountCreator: () => import_accounts.AccountCreator,
22
+ LocalAccountCreator: () => import_accounts.LocalAccountCreator,
23
+ UrlAccountCreator: () => import_accounts.UrlAccountCreator
24
+ });
25
+ module.exports = __toCommonJS(account_creator_exports);
26
+ var import_accounts = require("@near-js/accounts");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ AccountCreator,
30
+ LocalAccountCreator,
31
+ UrlAccountCreator
32
+ });
@@ -1,3 +1,11 @@
1
+ import { NearConfig, Near } from './near.js';
2
+ import '@near-js/accounts';
3
+ import '@near-js/crypto';
4
+ import '@near-js/keystores';
5
+ import '@near-js/signers';
6
+ import '@near-js/utils';
7
+ import '@near-js/providers';
8
+
1
9
  /**
2
10
  * Connect to NEAR using the provided configuration.
3
11
  *
@@ -20,12 +28,14 @@
20
28
  *
21
29
  * @module browserConnect
22
30
  */
23
- import { Near, NearConfig } from './near';
24
- export interface ConnectConfig extends NearConfig {
31
+
32
+ interface ConnectConfig extends NearConfig {
25
33
  /** @hidden */
26
34
  keyPath?: string;
27
35
  }
28
36
  /**
29
37
  * Initialize connection to Near network.
30
38
  */
31
- export declare function connect(config: ConnectConfig): Promise<Near>;
39
+ declare function connect(config: ConnectConfig): Promise<Near>;
40
+
41
+ export { type ConnectConfig, connect };
@@ -1,33 +1,31 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connect = void 0;
4
- /**
5
- * Connect to NEAR using the provided configuration.
6
- *
7
- * {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
8
- *
9
- * To sign transactions you can also pass: {@link ConnectConfig#keyStore}
10
- *
11
- * Both are passed they are prioritize in that order.
12
- *
13
- * @see {@link ConnectConfig}
14
- * @example
15
- * ```js
16
- * async function initNear() {
17
- * const near = await connect({
18
- * networkId: 'testnet',
19
- * nodeUrl: 'https://rpc.testnet.near.org'
20
- * })
21
- * }
22
- * ```
23
- *
24
- * @module browserConnect
25
- */
26
- const near_1 = require("./near");
27
- /**
28
- * Initialize connection to Near network.
29
- */
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var browser_connect_exports = {};
20
+ __export(browser_connect_exports, {
21
+ connect: () => connect
22
+ });
23
+ module.exports = __toCommonJS(browser_connect_exports);
24
+ var import_near = require('./near.js');
30
25
  async function connect(config) {
31
- return new near_1.Near(config);
26
+ return new import_near.Near(config);
32
27
  }
33
- exports.connect = connect;
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ connect
31
+ });
@@ -0,0 +1,14 @@
1
+ import { InMemoryKeyStore, KeyStore, MergeKeyStore } from '@near-js/keystores';
2
+ import { BrowserLocalStorageKeyStore } from '@near-js/keystores-browser';
3
+
4
+ /** @hidden @module */
5
+
6
+ declare const browserIndex_BrowserLocalStorageKeyStore: typeof BrowserLocalStorageKeyStore;
7
+ declare const browserIndex_InMemoryKeyStore: typeof InMemoryKeyStore;
8
+ declare const browserIndex_KeyStore: typeof KeyStore;
9
+ declare const browserIndex_MergeKeyStore: typeof MergeKeyStore;
10
+ declare namespace browserIndex {
11
+ export { browserIndex_BrowserLocalStorageKeyStore as BrowserLocalStorageKeyStore, browserIndex_InMemoryKeyStore as InMemoryKeyStore, browserIndex_KeyStore as KeyStore, browserIndex_MergeKeyStore as MergeKeyStore };
12
+ }
13
+
14
+ export { browserIndex as b };
@@ -1,4 +1,23 @@
1
- /** @hidden @module */
2
- export * as keyStores from './key_stores/browser-index';
3
- export * from './common-index';
4
- export * from './browser-connect';
1
+ export { b as keyStores } from './browser-index-RhYalP0h.js';
2
+ export { i as providers } from './index-BDdRUK93.js';
3
+ export { i as utils } from './index-B3Nnuq00.js';
4
+ export { t as transactions } from './transaction-C81hWIM7.js';
5
+ export { v as validators } from './validators-q97R8D1k.js';
6
+ export { Account, Connection, Contract } from '@near-js/accounts';
7
+ export { a as accountCreator } from './account_creator-Bs61dnmU.js';
8
+ export { KeyPairSigner, Signer } from '@near-js/signers';
9
+ export { KeyPair } from '@near-js/crypto';
10
+ export { Near } from './near.js';
11
+ export { ConnectConfig, connect } from './browser-connect.js';
12
+ import '@near-js/keystores';
13
+ import '@near-js/keystores-browser';
14
+ import '@near-js/utils';
15
+ import '@near-js/providers';
16
+ import '@near-js/types';
17
+ import './key_pair-D16Om3fY.js';
18
+ import './serialize-DKM2UWTl.js';
19
+ import 'borsh';
20
+ import './enums-BOxGXwY_.js';
21
+ import './format-BlG-d3wc.js';
22
+ import './rpc_errors-BbA15mFX.js';
23
+ import '@near-js/transactions';
@@ -1,33 +1,43 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
24
11
  };
25
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
27
19
  };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.keyStores = void 0;
30
- /** @hidden @module */
31
- exports.keyStores = __importStar(require("./key_stores/browser-index"));
32
- __exportStar(require("./common-index"), exports);
33
- __exportStar(require("./browser-connect"), exports);
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var browser_index_exports = {};
31
+ __export(browser_index_exports, {
32
+ keyStores: () => keyStores
33
+ });
34
+ module.exports = __toCommonJS(browser_index_exports);
35
+ var keyStores = __toESM(require('./key_stores/browser-index.js'));
36
+ __reExport(browser_index_exports, require('./common-index.js'), module.exports);
37
+ __reExport(browser_index_exports, require('./browser-connect.js'), module.exports);
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ keyStores,
41
+ ...require('./common-index.js'),
42
+ ...require('./browser-connect.js')
43
+ });
@@ -1,13 +1,20 @@
1
- /** @hidden @module */
2
- import * as providers from './providers';
3
- import * as utils from './utils';
4
- import * as transactions from './transaction';
5
- import * as validators from './validators';
6
- import { Account } from './account';
7
- import * as accountCreator from './account_creator';
8
- import { Connection } from './connection';
9
- import { Signer, KeyPairSigner } from './signer';
10
- import { Contract } from './contract';
11
- import { KeyPair } from './utils/key_pair';
12
- import { Near } from './near';
13
- export { accountCreator, providers, utils, transactions, validators, Account, Connection, Contract, KeyPairSigner, Signer, KeyPair, Near, };
1
+ export { i as providers } from './index-BDdRUK93.js';
2
+ export { i as utils } from './index-B3Nnuq00.js';
3
+ export { t as transactions } from './transaction-C81hWIM7.js';
4
+ export { v as validators } from './validators-q97R8D1k.js';
5
+ export { Account, Connection, Contract } from '@near-js/accounts';
6
+ export { a as accountCreator } from './account_creator-Bs61dnmU.js';
7
+ export { KeyPairSigner, Signer } from '@near-js/signers';
8
+ export { KeyPair } from '@near-js/crypto';
9
+ export { Near } from './near.js';
10
+ import '@near-js/utils';
11
+ import '@near-js/providers';
12
+ import '@near-js/types';
13
+ import './key_pair-D16Om3fY.js';
14
+ import './serialize-DKM2UWTl.js';
15
+ import 'borsh';
16
+ import './enums-BOxGXwY_.js';
17
+ import './format-BlG-d3wc.js';
18
+ import './rpc_errors-BbA15mFX.js';
19
+ import '@near-js/transactions';
20
+ import '@near-js/keystores';
@@ -1,50 +1,70 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
24
19
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Near = exports.KeyPair = exports.Signer = exports.KeyPairSigner = exports.Contract = exports.Connection = exports.Account = exports.validators = exports.transactions = exports.utils = exports.providers = exports.accountCreator = void 0;
27
- /** @hidden @module */
28
- const providers = __importStar(require("./providers"));
29
- exports.providers = providers;
30
- const utils = __importStar(require("./utils"));
31
- exports.utils = utils;
32
- const transactions = __importStar(require("./transaction"));
33
- exports.transactions = transactions;
34
- const validators = __importStar(require("./validators"));
35
- exports.validators = validators;
36
- const account_1 = require("./account");
37
- Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return account_1.Account; } });
38
- const accountCreator = __importStar(require("./account_creator"));
39
- exports.accountCreator = accountCreator;
40
- const connection_1 = require("./connection");
41
- Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_1.Connection; } });
42
- const signer_1 = require("./signer");
43
- Object.defineProperty(exports, "Signer", { enumerable: true, get: function () { return signer_1.Signer; } });
44
- Object.defineProperty(exports, "KeyPairSigner", { enumerable: true, get: function () { return signer_1.KeyPairSigner; } });
45
- const contract_1 = require("./contract");
46
- Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return contract_1.Contract; } });
47
- const key_pair_1 = require("./utils/key_pair");
48
- Object.defineProperty(exports, "KeyPair", { enumerable: true, get: function () { return key_pair_1.KeyPair; } });
49
- const near_1 = require("./near");
50
- Object.defineProperty(exports, "Near", { enumerable: true, get: function () { return near_1.Near; } });
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var common_index_exports = {};
30
+ __export(common_index_exports, {
31
+ Account: () => import_account.Account,
32
+ Connection: () => import_connection.Connection,
33
+ Contract: () => import_contract.Contract,
34
+ KeyPair: () => import_key_pair.KeyPair,
35
+ KeyPairSigner: () => import_signer.KeyPairSigner,
36
+ Near: () => import_near.Near,
37
+ Signer: () => import_signer.Signer,
38
+ accountCreator: () => accountCreator,
39
+ providers: () => providers,
40
+ transactions: () => transactions,
41
+ utils: () => utils,
42
+ validators: () => validators
43
+ });
44
+ module.exports = __toCommonJS(common_index_exports);
45
+ var providers = __toESM(require('./providers/index.js'));
46
+ var utils = __toESM(require('./utils/index.js'));
47
+ var transactions = __toESM(require('./transaction.js'));
48
+ var validators = __toESM(require('./validators.js'));
49
+ var import_account = require('./account.js');
50
+ var accountCreator = __toESM(require('./account_creator.js'));
51
+ var import_connection = require('./connection.js');
52
+ var import_signer = require('./signer.js');
53
+ var import_contract = require('./contract.js');
54
+ var import_key_pair = require('./utils/key_pair.js');
55
+ var import_near = require('./near.js');
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ Account,
59
+ Connection,
60
+ Contract,
61
+ KeyPair,
62
+ KeyPairSigner,
63
+ Near,
64
+ Signer,
65
+ accountCreator,
66
+ providers,
67
+ transactions,
68
+ utils,
69
+ validators
70
+ });
package/lib/connect.d.ts CHANGED
@@ -1,5 +1,12 @@
1
- import { Near, NearConfig } from './near';
2
- export interface ConnectConfig extends NearConfig {
1
+ import { NearConfig, Near } from './near.js';
2
+ import '@near-js/accounts';
3
+ import '@near-js/crypto';
4
+ import '@near-js/keystores';
5
+ import '@near-js/signers';
6
+ import '@near-js/utils';
7
+ import '@near-js/providers';
8
+
9
+ interface ConnectConfig extends NearConfig {
3
10
  /**
4
11
  * Initialize an {@link InMemoryKeyStore} by reading the file at keyPath.
5
12
  */
@@ -30,4 +37,6 @@ export interface ConnectConfig extends NearConfig {
30
37
  * console.log(nearConnection); // Near object representing the connection
31
38
  * ```
32
39
  */
33
- export declare function connect(config: ConnectConfig): Promise<Near>;
40
+ declare function connect(config: ConnectConfig): Promise<Near>;
41
+
42
+ export { type ConnectConfig, connect };