Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tarnadas/near-api-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tarnadas/near-api-js - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

lib/utils/logging.d.ts

4

lib/account.d.ts

@@ -105,6 +105,2 @@ /// <reference types="node" />

state(): Promise<AccountView>;
/** @hidden */
private printLogsAndFailures;
/** @hidden */
private printLogs;
/**

@@ -111,0 +107,0 @@ * Create a signed transaction which can be broadcast to the network

@@ -22,2 +22,3 @@ "use strict";

const errors_1 = require("./utils/errors");
const logging_1 = require("./utils/logging");
const rpc_errors_1 = require("./utils/rpc_errors");

@@ -65,22 +66,2 @@ const constants_1 = require("./constants");

}
/** @hidden */
printLogsAndFailures(contractId, results) {
if (!process.env['NEAR_NO_LOGS']) {
for (const result of results) {
console.log(`Receipt${result.receiptIds.length > 1 ? 's' : ''}: ${result.receiptIds.join(', ')}`);
this.printLogs(contractId, result.logs, '\t');
if (result.failure) {
console.warn(`\tFailure [${contractId}]: ${result.failure}`);
}
}
}
}
/** @hidden */
printLogs(contractId, logs, prefix = '') {
if (!process.env['NEAR_NO_LOGS']) {
for (const log of logs) {
console.log(`${prefix}Log [${contractId}]: ${log}`);
}
}
}
/**

@@ -137,15 +118,3 @@ * Create a signed transaction which can be broadcast to the network

}
const flatLogs = [result.transaction_outcome, ...result.receipts_outcome].reduce((acc, it) => {
if (it.outcome.logs.length ||
(typeof it.outcome.status === 'object' && typeof it.outcome.status.Failure === 'object')) {
return acc.concat({
'receiptIds': it.outcome.receipt_ids,
'logs': it.outcome.logs,
'failure': typeof it.outcome.status.Failure != 'undefined' ? (0, rpc_errors_1.parseRpcError)(it.outcome.status.Failure) : null
});
}
else
return acc;
}, []);
this.printLogsAndFailures(signedTx.transaction.receiverId, flatLogs);
(0, logging_1.printTxOutcomeLogsAndFailures)({ contractId: signedTx.transaction.receiverId, outcome: result });
// Should be falsy if result.status.Failure is null

@@ -401,3 +370,3 @@ if (!returnError && typeof result.status === 'object' && typeof result.status.Failure === 'object' && result.status.Failure !== null) {

if (result.logs) {
this.printLogs(contractId, result.logs);
(0, logging_1.printTxOutcomeLogs)({ contractId, logs: result.logs });
}

@@ -404,0 +373,0 @@ return result.result && result.result.length > 0 && parse(Buffer.from(result.result));

{
"name": "@tarnadas/near-api-js",
"description": "JavaScript library to interact with NEAR Protocol via RPC API",
"version": "1.1.1",
"version": "1.1.2",
"repository": {

@@ -10,5 +10,5 @@ "type": "git",

"homepage": "https://github.com/near/near-api-js",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "lib/index.js",
"browser": "lib/browser-index.js",
"types": "lib/index.d.ts",
"dependencies": {

@@ -25,3 +25,2 @@ "@aws-crypto/sha256-browser": "^2.0.2",

"text-encoding-utf-8": "^1.0.2",
"tsup": "^6.2.3",
"tweetnacl": "^1.0.1"

@@ -55,3 +54,3 @@ },

"dev": "pnpm compile -w",
"build": "tsup src/index.ts --format esm,cjs --dts",
"build": "pnpm compile && pnpm browserify",
"test": "jest test",

@@ -58,0 +57,0 @@ "lint": "concurrently \"pnpm:lint:*(!fix)\"",

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