New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.12.26 to 1.12.27

15

dist/cjs/expectTXTable.d.ts

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

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

@@ -38,2 +39,16 @@ /**

}) => Chai.PromisedAssertion;
/**
* Assert that a transaction is successful.
* @param tx
* @param msg
* @returns
*/
export declare const assertTXSuccess: (tx: TransactionEnvelope, msg?: string | undefined) => Chai.PromisedAssertion;
/**
* Assert that a transaction will throw the given error.
* @param tx
* @param msg
* @returns
*/
export declare const assertTXThrows: (tx: TransactionEnvelope, err: IdlErrorCode, msg?: string | undefined) => Chai.PromisedAssertion;
//# sourceMappingURL=expectTXTable.d.ts.map

25

dist/cjs/expectTXTable.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.expectTXTable = void 0;
exports.assertTXThrows = exports.assertTXSuccess = exports.expectTXTable = void 0;
const anchor_contrib_1 = require("@saberhq/anchor-contrib");
const solana_contrib_1 = require("@saberhq/solana-contrib");

@@ -104,2 +105,24 @@ const printInstructionLogs_1 = require("./printInstructionLogs");

exports.expectTXTable = expectTXTable;
/**
* Assert that a transaction is successful.
* @param tx
* @param msg
* @returns
*/
const assertTXSuccess = (tx, msg) => {
return (0, exports.expectTXTable)(tx, msg, {
verbosity: "error",
}).to.be.fulfilled;
};
exports.assertTXSuccess = assertTXSuccess;
/**
* Assert that a transaction will throw the given error.
* @param tx
* @param msg
* @returns
*/
const assertTXThrows = (tx, err, msg) => {
return (0, exports.expectTXTable)(tx, msg).to.be.rejectedWith((0, anchor_contrib_1.matchError)(err));
};
exports.assertTXThrows = assertTXThrows;
//# sourceMappingURL=expectTXTable.js.map

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

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

@@ -38,2 +39,16 @@ /**

}) => Chai.PromisedAssertion;
/**
* Assert that a transaction is successful.
* @param tx
* @param msg
* @returns
*/
export declare const assertTXSuccess: (tx: TransactionEnvelope, msg?: string | undefined) => Chai.PromisedAssertion;
/**
* Assert that a transaction will throw the given error.
* @param tx
* @param msg
* @returns
*/
export declare const assertTXThrows: (tx: TransactionEnvelope, err: IdlErrorCode, msg?: string | undefined) => Chai.PromisedAssertion;
//# sourceMappingURL=expectTXTable.d.ts.map

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

import { matchError } from "@saberhq/anchor-contrib";
import { parseTransactionLogs, printTXTable } from "@saberhq/solana-contrib";

@@ -100,2 +101,22 @@ import { formatInstructionLogsForConsole } from "./printInstructionLogs";

};
/**
* Assert that a transaction is successful.
* @param tx
* @param msg
* @returns
*/
export const assertTXSuccess = (tx, msg) => {
return expectTXTable(tx, msg, {
verbosity: "error",
}).to.be.fulfilled;
};
/**
* Assert that a transaction will throw the given error.
* @param tx
* @param msg
* @returns
*/
export const assertTXThrows = (tx, err, msg) => {
return expectTXTable(tx, msg).to.be.rejectedWith(matchError(err));
};
//# sourceMappingURL=expectTXTable.js.map

11

package.json
{
"name": "@saberhq/chai-solana",
"version": "1.12.26",
"version": "1.12.27",
"description": "Solana Chai helpers",

@@ -27,2 +27,5 @@ "author": "Ian Macalinao <ian@saber.so>",

"dependencies": {
"@saberhq/anchor-contrib": "^1.12.27",
"@saberhq/solana-contrib": "^1.12.27",
"@saberhq/token-utils": "^1.12.27",
"@types/chai": "^4.3.0",

@@ -37,3 +40,3 @@ "@types/chai-as-promised": "^7.1.4",

},
"gitHead": "a7a655ae330e203e61926529abf6d83f128e0885",
"gitHead": "21de76f1691a2b2f35bb7dec4ae049031e459fce",
"publishConfig": {

@@ -44,4 +47,2 @@ "access": "public"

"@project-serum/anchor": "^0.17 || ^0.18 || ^0.19",
"@saberhq/solana-contrib": "^1.3.17",
"@saberhq/token-utils": "^1.3.17",
"@solana/web3.js": "^1.29.2",

@@ -53,4 +54,2 @@ "bn.js": "^5.2.0",

"@project-serum/anchor": "^0.20.1",
"@saberhq/solana-contrib": "^1.12.26",
"@saberhq/token-utils": "^1.12.26",
"@solana/web3.js": "^1.31.0",

@@ -57,0 +56,0 @@ "bn.js": "^5.2.0",

@@ -0,1 +1,3 @@

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

@@ -138,1 +140,30 @@ import { parseTransactionLogs, printTXTable } from "@saberhq/solana-contrib";

};
/**
* Assert that a transaction is successful.
* @param tx
* @param msg
* @returns
*/
export const assertTXSuccess = (
tx: TransactionEnvelope,
msg?: string
): Chai.PromisedAssertion => {
return expectTXTable(tx, msg, {
verbosity: "error",
}).to.be.fulfilled;
};
/**
* Assert that a transaction will throw the given error.
* @param tx
* @param msg
* @returns
*/
export const assertTXThrows = (
tx: TransactionEnvelope,
err: IdlErrorCode,
msg?: string
): Chai.PromisedAssertion => {
return expectTXTable(tx, msg).to.be.rejectedWith(matchError(err));
};

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