Socket
Socket
Sign inDemoInstall

near-api-js

Package Overview
Dependencies
Maintainers
8
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

near-api-js - npm Package Compare versions

Comparing version 2.1.4 to 3.0.0

lib/utils/logger.d.ts

4

lib/browser-connect.d.ts
/**
* Connect to NEAR using the provided configuration.
*
* {@link ConnectConfig.networkId} and {@link ConnectConfig.nodeUrl} are required.
* {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
*
* To sign transactions you can also pass: {@link ConnectConfig.keyStore}
* To sign transactions you can also pass: {@link ConnectConfig#keyStore}
*

@@ -8,0 +8,0 @@ * Both are passed they are prioritize in that order.

@@ -16,5 +16,5 @@ "use strict";

*
* {@link ConnectConfig.networkId} and {@link ConnectConfig.nodeUrl} are required.
* {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
*
* To sign transactions you can also pass: {@link ConnectConfig.keyStore}
* To sign transactions you can also pass: {@link ConnectConfig#keyStore}
*

@@ -21,0 +21,0 @@ * Both are passed they are prioritize in that order.

import { Near, NearConfig } from './near';
export interface ConnectConfig extends NearConfig {
/**
* Initialize an {@link key_stores/in_memory_key_store!InMemoryKeyStore} by reading the file at keyPath.
* Initialize an {@link InMemoryKeyStore} by reading the file at keyPath.
*/

@@ -6,0 +6,0 @@ keyPath?: string;

@@ -11,5 +11,2 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -20,8 +17,8 @@ exports.connect = void 0;

*
* {@link ConnectConfig.networkId} and {@link ConnectConfig.nodeUrl} are required.
* {@link ConnectConfig#networkId} and {@link ConnectConfig#nodeUrl} are required.
*
* To sign transactions you can also pass:
* 1. {@link ConnectConfig.keyStore}
* 2. {@link ConnectConfig.keyPath}
* 3. {@link ConnectConfig.deps.keyStore} (deprecated, only for use in legacy applications)
* 1. {@link ConnectConfig#keyStore}
* 2. {@link ConnectConfig#keyPath}
* 3. {@link ConnectConfig#deps.keyStore} (deprecated, only for use in legacy applications)
*

@@ -40,2 +37,11 @@ * If all three are passed they are prioritize in that order.

* ```
* @example disable library logs
* ```js
* async function initNear() {
* const near = await connect({
* networkId: 'testnet',
* nodeUrl: 'https://rpc.testnet.near.org',
* logger: false
* })
* }
* @module connect

@@ -46,5 +52,3 @@ */

const near_1 = require("./near");
const setup_node_fetch_1 = __importDefault(require("./utils/setup-node-fetch"));
const utils_1 = require("./utils");
global.fetch = setup_node_fetch_1.default;
const utils_1 = require("@near-js/utils");
/**

@@ -56,2 +60,9 @@ * Initialize connection to Near network.

return __awaiter(this, void 0, void 0, function* () {
if (config.logger === false) {
// disables logging
utils_1.Logger.overrideLogger(undefined);
}
else if (config.logger !== undefined && config.logger !== null) {
utils_1.Logger.overrideLogger(config.logger);
}
// Try to find extra key in `KeyPath` if provided.

@@ -73,9 +84,7 @@ if (config.keyPath && (config.keyStore || ((_a = config.deps) === null || _a === void 0 ? void 0 : _a.keyStore))) {

], { writeKeyStoreIndex: 1 });
if (!process.env['NEAR_NO_LOGS']) {
console.log(`Loaded master account ${accountKeyFile[0]} key from ${config.keyPath} with public key = ${keyPair.getPublicKey()}`);
}
utils_1.Logger.log(`Loaded master account ${accountKeyFile[0]} key from ${config.keyPath} with public key = ${keyPair.getPublicKey()}`);
}
}
catch (error) {
(0, utils_1.logWarning)(`Failed to load master account key from ${config.keyPath}: ${error}`);
utils_1.Logger.warn(`Failed to load master account key from ${config.keyPath}: ${error}`);
}

@@ -82,0 +91,0 @@ }

@@ -9,2 +9,3 @@ import * as key_pair from './key_pair';

import { logWarning } from './errors';
export { key_pair, serialize, web, enums, format, PublicKey, KeyPair, KeyPairEd25519, rpc_errors, logWarning, };
import { Logger } from './logger';
export { key_pair, serialize, web, enums, format, PublicKey, KeyPair, KeyPairEd25519, rpc_errors, logWarning, Logger };

@@ -26,3 +26,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.logWarning = exports.rpc_errors = exports.KeyPairEd25519 = exports.KeyPair = exports.PublicKey = exports.format = exports.enums = exports.web = exports.serialize = exports.key_pair = void 0;
exports.Logger = exports.logWarning = exports.rpc_errors = exports.KeyPairEd25519 = exports.KeyPair = exports.PublicKey = exports.format = exports.enums = exports.web = exports.serialize = exports.key_pair = void 0;
const key_pair = __importStar(require("./key_pair"));

@@ -46,1 +46,3 @@ exports.key_pair = key_pair;

Object.defineProperty(exports, "logWarning", { enumerable: true, get: function () { return errors_1.logWarning; } });
const logger_1 = require("./logger");
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });

@@ -1,1 +0,2 @@

export { baseEncode as base_encode, baseDecode as base_decode, serialize, deserialize, Schema, BorshError, BinaryWriter, BinaryReader, } from 'borsh';
export { serialize, deserialize, Schema, } from 'borsh';
export { baseEncode as base_encode, baseDecode as base_decode, } from '@near-js/utils';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BinaryReader = exports.BinaryWriter = exports.BorshError = exports.deserialize = exports.serialize = exports.base_decode = exports.base_encode = void 0;
exports.base_decode = exports.base_encode = exports.deserialize = exports.serialize = void 0;
var borsh_1 = require("borsh");
Object.defineProperty(exports, "base_encode", { enumerable: true, get: function () { return borsh_1.baseEncode; } });
Object.defineProperty(exports, "base_decode", { enumerable: true, get: function () { return borsh_1.baseDecode; } });
Object.defineProperty(exports, "serialize", { enumerable: true, get: function () { return borsh_1.serialize; } });
Object.defineProperty(exports, "deserialize", { enumerable: true, get: function () { return borsh_1.deserialize; } });
Object.defineProperty(exports, "BorshError", { enumerable: true, get: function () { return borsh_1.BorshError; } });
Object.defineProperty(exports, "BinaryWriter", { enumerable: true, get: function () { return borsh_1.BinaryWriter; } });
Object.defineProperty(exports, "BinaryReader", { enumerable: true, get: function () { return borsh_1.BinaryReader; } });
var utils_1 = require("@near-js/utils");
Object.defineProperty(exports, "base_encode", { enumerable: true, get: function () { return utils_1.baseEncode; } });
Object.defineProperty(exports, "base_decode", { enumerable: true, get: function () { return utils_1.baseDecode; } });
{
"name": "near-api-js",
"description": "JavaScript library to interact with NEAR Protocol via RPC API",
"version": "2.1.4",
"version": "3.0.0",
"repository": {

@@ -14,42 +14,42 @@ "type": "git",

"dependencies": {
"ajv": "^8.11.2",
"ajv-formats": "^2.1.1",
"ajv": "8.11.2",
"ajv-formats": "2.1.1",
"bn.js": "5.2.1",
"borsh": "^0.7.0",
"depd": "^2.0.0",
"error-polyfill": "^0.1.3",
"http-errors": "^1.7.2",
"borsh": "1.0.0",
"depd": "2.0.0",
"error-polyfill": "0.1.3",
"http-errors": "1.7.2",
"near-abi": "0.1.1",
"node-fetch": "^2.6.1",
"tweetnacl": "^1.0.1",
"@near-js/accounts": "0.1.4",
"@near-js/crypto": "0.0.5",
"@near-js/keystores": "0.0.5",
"@near-js/keystores-browser": "0.0.5",
"@near-js/keystores-node": "0.0.5",
"@near-js/providers": "0.0.7",
"@near-js/signers": "0.0.5",
"@near-js/transactions": "0.2.1",
"node-fetch": "2.6.7",
"@noble/curves": "1.2.0",
"@near-js/accounts": "1.0.0",
"@near-js/crypto": "1.0.0",
"@near-js/keystores": "0.0.6",
"@near-js/keystores-browser": "0.0.6",
"@near-js/keystores-node": "0.0.6",
"@near-js/providers": "0.0.8",
"@near-js/signers": "0.0.6",
"@near-js/transactions": "1.0.0",
"@near-js/types": "0.0.4",
"@near-js/utils": "0.0.4",
"@near-js/wallet-account": "0.0.7"
"@near-js/utils": "0.0.5",
"@near-js/wallet-account": "1.0.0"
},
"devDependencies": {
"@types/bn.js": "^5.1.0",
"@types/http-errors": "^1.6.1",
"@types/node": "^18.11.18",
"browserify": "^16.2.3",
"bs58": "^4.0.0",
"bundlewatch": "^0.3.1",
"concurrently": "^7.3.0",
"danger": "^11.1.1",
"danger-plugin-yarn": "^1.3.2",
"in-publish": "^2.0.0",
"jest": "^26.0.1",
"localstorage-memory": "^1.0.3",
"near-hello": "^0.5.1",
"rimraf": "^3.0.0",
"semver": "^7.1.1",
"ts-jest": "^26.5.6",
"uglifyify": "^5.0.1"
"@types/bn.js": "5.1.0",
"@types/http-errors": "1.6.1",
"@types/node": "18.11.18",
"browserify": "16.2.3",
"bs58": "4.0.0",
"bundlewatch": "0.3.1",
"concurrently": "7.3.0",
"danger": "11.1.1",
"danger-plugin-yarn": "1.3.2",
"in-publish": "2.0.0",
"jest": "26.0.1",
"localstorage-memory": "1.0.3",
"near-hello": "0.5.1",
"rimraf": "3.0.2",
"semver": "7.1.1",
"ts-jest": "26.5.6",
"uglifyify": "5.0.1"
},

@@ -56,0 +56,0 @@ "keywords": [],

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc