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

lightrail-client

Package Overview
Dependencies
Maintainers
4
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightrail-client - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

dist/cardTransactions.d.ts

@@ -10,3 +10,3 @@ import { Card } from "./model/Card";

import { SimulateTransactionParams } from "./params/SimulateTransactionParams";
export declare function createTransaction(card: string | Card, params: CreateTransactionParams | SimulateTransactionParams, dryRun?: boolean): Promise<Transaction>;
export declare function createTransaction(card: string | Card, params: CreateTransactionParams | SimulateTransactionParams): Promise<Transaction>;
export declare function simulateTransaction(card: string | Card, params: SimulateTransactionParams): Promise<Transaction>;

@@ -13,0 +13,0 @@ export declare function getTransaction(card: string | Card, transaction: string | Transaction): Promise<Transaction>;

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

const LightrailRequestError_1 = require("./LightrailRequestError");
function createTransaction(card, params, dryRun = false) {
function createTransaction(card, params) {
return __awaiter(this, void 0, void 0, function* () {

@@ -24,9 +24,3 @@ if (!params) {

const cardId = cards.getCardId(card);
let resp;
if (dryRun) {
resp = yield lightrail.request("POST", `cards/${encodeURIComponent(cardId)}/transactions/dryRun`).send(params);
}
else {
resp = yield lightrail.request("POST", `cards/${encodeURIComponent(cardId)}/transactions`).send(params);
}
const resp = yield lightrail.request("POST", `cards/${encodeURIComponent(cardId)}/transactions`).send(params);
if (resp.status === 200) {

@@ -41,3 +35,14 @@ return resp.body.transaction;

return __awaiter(this, void 0, void 0, function* () {
return createTransaction(card, params, true);
if (!params) {
throw new Error("params not set");
}
else if (!params.userSuppliedId) {
throw new Error("params.userSuppliedId not set");
}
const cardId = cards.getCardId(card);
const resp = yield lightrail.request("POST", `cards/${encodeURIComponent(cardId)}/transactions/dryRun`).send(params);
if (resp.status === 200) {
return resp.body.transaction;
}
throw new LightrailRequestError_1.LightrailRequestError(resp);
});

@@ -44,0 +49,0 @@ }

@@ -12,4 +12,5 @@ export * from "./CapturePendingTransactionParams";

export * from "./PaginationParams";
export * from "./SimulateTransactionParams";
export * from "./UpdateCardParams";
export * from "./UpdateContactParams";
export * from "./VoidPendingTransactionParams";
{
"name": "lightrail-client",
"version": "1.1.0",
"version": "1.1.1",
"description": "A Javascript and Typescript client for Lightrail",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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