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

@saberhq/chai-solana

Package Overview
Dependencies
Maintainers
2
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saberhq/chai-solana - npm Package Compare versions

Comparing version 1.13.19 to 1.13.20

2

dist/cjs/expectTXTable.d.ts

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

import type { IdlErrorCode } from "@project-serum/anchor/dist/cjs/idl";
import type { IdlErrorCode } from "@project-serum/anchor/dist/esm/idl.js";
import type { TransactionEnvelope } from "@saberhq/solana-contrib";

@@ -3,0 +3,0 @@ /**

@@ -6,4 +6,4 @@ "use strict";

const solana_contrib_1 = require("@saberhq/solana-contrib");
const printInstructionLogs_1 = require("./printInstructionLogs");
const utils_1 = require("./utils");
const printInstructionLogs_js_1 = require("./printInstructionLogs.js");
const utils_js_1 = require("./utils.js");
/**

@@ -72,3 +72,3 @@ * expectTXTable is a drop in replacement for expectTX with a cool table output like:

const parsed = (0, solana_contrib_1.parseTransactionLogs)(logs, simulation.value.err);
const fmt = (0, printInstructionLogs_1.formatInstructionLogsForConsole)(parsed);
const fmt = (0, printInstructionLogs_js_1.formatInstructionLogsForConsole)(parsed);
console.log(fmt);

@@ -104,3 +104,3 @@ }

});
return (0, utils_1.expectTX)(tx, (msg !== null && msg !== void 0 ? msg : "") + (relativePath ? ` (${relativePath})` : ""));
return (0, utils_js_1.expectTX)(tx, (msg !== null && msg !== void 0 ? msg : "") + (relativePath ? ` (${relativePath})` : ""));
};

@@ -115,3 +115,3 @@ exports.expectTXTable = expectTXTable;

const assertTXSuccess = (tx, msg) => {
return (0, utils_1.expectTX)(tx, msg).to.be.fulfilled;
return (0, utils_js_1.expectTX)(tx, msg).to.be.fulfilled;
};

@@ -126,3 +126,3 @@ exports.assertTXSuccess = assertTXSuccess;

const assertTXThrows = (tx, err, msg) => {
return (0, utils_1.expectTX)(tx, msg).to.be.rejectedWith((0, anchor_contrib_1.matchError)(err));
return (0, utils_js_1.expectTX)(tx, msg).to.be.rejectedWith((0, anchor_contrib_1.matchError)(err));
};

@@ -137,5 +137,5 @@ exports.assertTXThrows = assertTXThrows;

const assertTXThrowsCode = (tx, code, msg) => {
return (0, utils_1.expectTX)(tx, msg).to.be.rejectedWith((0, anchor_contrib_1.matchErrorCode)(code));
return (0, utils_js_1.expectTX)(tx, msg).to.be.rejectedWith((0, anchor_contrib_1.matchErrorCode)(code));
};
exports.assertTXThrowsCode = assertTXThrowsCode;
//# sourceMappingURL=expectTXTable.js.map

@@ -1,8 +0,8 @@

/// <reference types="chai" />
import "./types";
export * from "./debugAccountOwners";
export * from "./expectTXTable";
export * from "./printInstructionLogs";
export * from "./utils";
/// <reference types="chai" resolution-mode="require"/>
import "./types.js";
export * from "./debugAccountOwners.js";
export * from "./expectTXTable.js";
export * from "./printInstructionLogs.js";
export * from "./utils.js";
export declare const chaiSolana: Chai.ChaiPlugin;
//# sourceMappingURL=index.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.chaiSolana = void 0;
const tslib_1 = require("tslib");
require("./types");
require("./types.js");
const anchor_1 = require("@project-serum/anchor");
const token_utils_1 = require("@saberhq/token-utils");
const web3_js_1 = require("@solana/web3.js");
const chai_as_promised_1 = tslib_1.__importDefault(require("chai-as-promised"));
const chai_bn_1 = tslib_1.__importDefault(require("chai-bn"));
tslib_1.__exportStar(require("./debugAccountOwners"), exports);
tslib_1.__exportStar(require("./expectTXTable"), exports);
tslib_1.__exportStar(require("./printInstructionLogs"), exports);
tslib_1.__exportStar(require("./utils"), exports);
const chai_as_promised_1 = __importDefault(require("chai-as-promised"));
const chai_bn_1 = __importDefault(require("chai-bn"));
__exportStar(require("./debugAccountOwners.js"), exports);
__exportStar(require("./expectTXTable.js"), exports);
__exportStar(require("./printInstructionLogs.js"), exports);
__exportStar(require("./utils.js"), exports);
const chaiSolana = (chai) => {

@@ -16,0 +32,0 @@ chai.use((0, chai_bn_1.default)(anchor_1.BN));

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.printSendTransactionError = exports.formatInstructionLogsForConsole = void 0;
const tslib_1 = require("tslib");
const solana_contrib_1 = require("@saberhq/solana-contrib");
const safe_1 = tslib_1.__importDefault(require("colors/safe"));
const safe_js_1 = __importDefault(require("colors/safe.js"));
/**

@@ -15,6 +17,6 @@ * Formats instruction logs to be printed to the console.

[
safe_1.default.bold(safe_1.default.blue("=> ")),
safe_1.default.bold(safe_1.default.white(`Instruction #${i}: `)),
safe_js_1.default.bold(safe_js_1.default.blue("=> ")),
safe_js_1.default.bold(safe_js_1.default.white(`Instruction #${i}: `)),
log.programAddress
? safe_1.default.yellow(`Program ${log.programAddress}`)
? safe_js_1.default.yellow(`Program ${log.programAddress}`)
: "System",

@@ -26,13 +28,13 @@ ].join(""),

case "text":
return safe_1.default.white(entryStr);
return safe_js_1.default.white(entryStr);
case "cpi":
return safe_1.default.cyan(entryStr);
return safe_js_1.default.cyan(entryStr);
case "programError":
return safe_1.default.red(entryStr);
return safe_js_1.default.red(entryStr);
case "runtimeError":
return safe_1.default.red(entryStr);
return safe_js_1.default.red(entryStr);
case "system":
return safe_1.default.white(entryStr);
return safe_js_1.default.white(entryStr);
case "success":
return safe_1.default.green(entryStr);
return safe_js_1.default.green(entryStr);
}

@@ -51,3 +53,3 @@ }),

catch (e) {
console.warn(safe_1.default.yellow("Could not print logs due to error. Printing raw logs"), e);
console.warn(safe_js_1.default.yellow("Could not print logs due to error. Printing raw logs"), e);
console.log((_b = err.logs) === null || _b === void 0 ? void 0 : _b.join("\n"));

@@ -54,0 +56,0 @@ }

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

import type { IdlErrorCode } from "@project-serum/anchor/dist/cjs/idl";
import type { IdlErrorCode } from "@project-serum/anchor/dist/esm/idl.js";
import type { TransactionEnvelope } from "@saberhq/solana-contrib";

@@ -3,0 +3,0 @@ /**

import { matchError, matchErrorCode } from "@saberhq/anchor-contrib";
import { parseTransactionLogs, printTXTable } from "@saberhq/solana-contrib";
import { formatInstructionLogsForConsole } from "./printInstructionLogs";
import { expectTX } from "./utils";
import { formatInstructionLogsForConsole } from "./printInstructionLogs.js";
import { expectTX } from "./utils.js";
/**

@@ -6,0 +6,0 @@ * expectTXTable is a drop in replacement for expectTX with a cool table output like:

@@ -1,8 +0,8 @@

/// <reference types="chai" />
import "./types";
export * from "./debugAccountOwners";
export * from "./expectTXTable";
export * from "./printInstructionLogs";
export * from "./utils";
/// <reference types="chai" resolution-mode="require"/>
import "./types.js";
export * from "./debugAccountOwners.js";
export * from "./expectTXTable.js";
export * from "./printInstructionLogs.js";
export * from "./utils.js";
export declare const chaiSolana: Chai.ChaiPlugin;
//# sourceMappingURL=index.d.ts.map

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

import "./types";
import "./types.js";
import { BN } from "@project-serum/anchor";

@@ -6,7 +6,7 @@ import { TokenAmount } from "@saberhq/token-utils";

import chaiAsPromised from "chai-as-promised";
import chaiBN from "chai-bn";
export * from "./debugAccountOwners";
export * from "./expectTXTable";
export * from "./printInstructionLogs";
export * from "./utils";
import { default as chaiBN } from "chai-bn";
export * from "./debugAccountOwners.js";
export * from "./expectTXTable.js";
export * from "./printInstructionLogs.js";
export * from "./utils.js";
export const chaiSolana = (chai) => {

@@ -13,0 +13,0 @@ chai.use(chaiBN(BN));

import { formatLogEntry, parseTransactionLogs } from "@saberhq/solana-contrib";
import colors from "colors/safe";
import { default as colors } from "colors/safe.js";
/**

@@ -4,0 +4,0 @@ * Formats instruction logs to be printed to the console.

{
"name": "@saberhq/chai-solana",
"version": "1.13.19",
"version": "1.13.20",
"description": "Solana Chai helpers",

@@ -15,2 +15,3 @@ "homepage": "https://github.com/saber-hq/saber-common/packages/chai-solana#readme",

},
"type": "module",
"exports": {

@@ -29,5 +30,5 @@ ".": {

"dependencies": {
"@saberhq/anchor-contrib": "^1.13.19",
"@saberhq/solana-contrib": "^1.13.19",
"@saberhq/token-utils": "^1.13.19",
"@saberhq/anchor-contrib": "^1.13.20",
"@saberhq/solana-contrib": "^1.13.20",
"@saberhq/token-utils": "^1.13.20",
"@types/chai": "^4.3.1",

@@ -54,3 +55,3 @@ "@types/chai-as-promised": "^7.1.5",

"@project-serum/anchor": "^0.24.2",
"@saberhq/tsconfig": "1.13.19",
"@saberhq/tsconfig": "1.13.20",
"@solana/web3.js": "^1.43.2",

@@ -57,0 +58,0 @@ "bn.js": "^5.2.1",

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

import type { IdlErrorCode } from "@project-serum/anchor/dist/cjs/idl";
import type { IdlErrorCode } from "@project-serum/anchor/dist/esm/idl.js";
import { matchError, matchErrorCode } from "@saberhq/anchor-contrib";

@@ -6,4 +6,4 @@ import type { TransactionEnvelope } from "@saberhq/solana-contrib";

import { formatInstructionLogsForConsole } from "./printInstructionLogs";
import { expectTX } from "./utils";
import { formatInstructionLogsForConsole } from "./printInstructionLogs.js";
import { expectTX } from "./utils.js";

@@ -10,0 +10,0 @@ /**

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

import "./types";
import "./types.js";

@@ -8,8 +8,8 @@ import type { Address } from "@project-serum/anchor";

import chaiAsPromised from "chai-as-promised";
import chaiBN from "chai-bn";
import { default as chaiBN } from "chai-bn";
export * from "./debugAccountOwners";
export * from "./expectTXTable";
export * from "./printInstructionLogs";
export * from "./utils";
export * from "./debugAccountOwners.js";
export * from "./expectTXTable.js";
export * from "./printInstructionLogs.js";
export * from "./utils.js";

@@ -16,0 +16,0 @@ export const chaiSolana: Chai.ChaiPlugin = (chai) => {

import type { InstructionLogs } from "@saberhq/solana-contrib";
import { formatLogEntry, parseTransactionLogs } from "@saberhq/solana-contrib";
import type { SendTransactionError } from "@solana/web3.js";
import colors from "colors/safe";
import { default as colors } from "colors/safe.js";

@@ -6,0 +6,0 @@ /**

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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