Socket
Socket
Sign inDemoInstall

@moovio/node

Package Overview
Dependencies
61
Maintainers
6
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.2.0

1

dist/cjs/helpers/errors.d.ts

@@ -34,2 +34,3 @@ export namespace Err {

const MISSING_WALLET_ID: string;
const MISSING_WALLET_TRANSACTION_ID: string;
}

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

MISSING_WALLET_ID: "wallet ID is required",
MISSING_WALLET_TRANSACTION_ID: "wallet transaction ID is required",
};
export * from "./moov.js";
export { CAPABILITIES } from "./capabilities.js";
export { PAYMENT_METHODS_TYPE } from "./paymentMethods.js";
export { BANK_ACCOUNT_HOLDER_TYPE, BANK_ACCOUNT_STATUS, BANK_ACCOUNT_TYPE } from "./bankAccountsTypedefs.js";
export { CAPABILITIES, CAPABILITY_REQUIREMENT, CAPABILITY_STATUS } from "./capabilities.js";
export { CARD_BRAND, CARD_TYPE, CARD_VERIFICATION_STATUS } from "./cards.js";
export { WALLET_TRANSACTION_SOURCE_TYPE, WALLET_TRANSACTION_STATUS, WALLET_TRANSACTION_TYPE } from "./wallets.js";

@@ -13,5 +13,21 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.CAPABILITIES = void 0;
exports.WALLET_TRANSACTION_TYPE = exports.WALLET_TRANSACTION_STATUS = exports.WALLET_TRANSACTION_SOURCE_TYPE = exports.PAYMENT_METHODS_TYPE = exports.CARD_VERIFICATION_STATUS = exports.CARD_TYPE = exports.CARD_BRAND = exports.CAPABILITY_STATUS = exports.CAPABILITY_REQUIREMENT = exports.CAPABILITIES = exports.BANK_ACCOUNT_TYPE = exports.BANK_ACCOUNT_STATUS = exports.BANK_ACCOUNT_HOLDER_TYPE = void 0;
__exportStar(require("./moov.js"), exports);
var bankAccountsTypedefs_js_1 = require("./bankAccountsTypedefs.js");
Object.defineProperty(exports, "BANK_ACCOUNT_HOLDER_TYPE", { enumerable: true, get: function () { return bankAccountsTypedefs_js_1.BANK_ACCOUNT_HOLDER_TYPE; } });
Object.defineProperty(exports, "BANK_ACCOUNT_STATUS", { enumerable: true, get: function () { return bankAccountsTypedefs_js_1.BANK_ACCOUNT_STATUS; } });
Object.defineProperty(exports, "BANK_ACCOUNT_TYPE", { enumerable: true, get: function () { return bankAccountsTypedefs_js_1.BANK_ACCOUNT_TYPE; } });
var capabilities_js_1 = require("./capabilities.js");
Object.defineProperty(exports, "CAPABILITIES", { enumerable: true, get: function () { return capabilities_js_1.CAPABILITIES; } });
Object.defineProperty(exports, "CAPABILITY_REQUIREMENT", { enumerable: true, get: function () { return capabilities_js_1.CAPABILITY_REQUIREMENT; } });
Object.defineProperty(exports, "CAPABILITY_STATUS", { enumerable: true, get: function () { return capabilities_js_1.CAPABILITY_STATUS; } });
var cards_js_1 = require("./cards.js");
Object.defineProperty(exports, "CARD_BRAND", { enumerable: true, get: function () { return cards_js_1.CARD_BRAND; } });
Object.defineProperty(exports, "CARD_TYPE", { enumerable: true, get: function () { return cards_js_1.CARD_TYPE; } });
Object.defineProperty(exports, "CARD_VERIFICATION_STATUS", { enumerable: true, get: function () { return cards_js_1.CARD_VERIFICATION_STATUS; } });
var paymentMethods_js_1 = require("./paymentMethods.js");
Object.defineProperty(exports, "PAYMENT_METHODS_TYPE", { enumerable: true, get: function () { return paymentMethods_js_1.PAYMENT_METHODS_TYPE; } });
var wallets_js_1 = require("./wallets.js");
Object.defineProperty(exports, "WALLET_TRANSACTION_SOURCE_TYPE", { enumerable: true, get: function () { return wallets_js_1.WALLET_TRANSACTION_SOURCE_TYPE; } });
Object.defineProperty(exports, "WALLET_TRANSACTION_STATUS", { enumerable: true, get: function () { return wallets_js_1.WALLET_TRANSACTION_STATUS; } });
Object.defineProperty(exports, "WALLET_TRANSACTION_TYPE", { enumerable: true, get: function () { return wallets_js_1.WALLET_TRANSACTION_TYPE; } });

4

dist/cjs/moov.js

@@ -229,3 +229,5 @@ "use strict";

password: this.credentials.secretKey,
}, gotDefaults, gotOptionsOrInstance || {});
}, gotDefaults, {
prefixUrl: credentials.apiRoot,
}, gotOptionsOrInstance || {});
this._accounts = null;

@@ -232,0 +234,0 @@ this._capabilities = null;

@@ -0,24 +1,64 @@

export type WALLET_TRANSACTION_TYPE = any;
export namespace WALLET_TRANSACTION_TYPE {
const ACH_REVERSAL: string;
const CARD_PAYMENT: string;
const CASH_OUT: string;
const DISPUTE: string;
const DISPUTE_REVERSAL: string;
const FACILITATOR_FEE: string;
const ISSUING_REFUND: string;
const ISSUING_TRANSACTION: string;
const ISSUING_TRANSACTION_ADJUSTMENT: string;
const ISSUING_AUTH_RELEASE: string;
const PAYMENT: string;
const PAYOUT: string;
const REFUND: string;
const REFUND_FAILURE: string;
const TOP_UP: string;
const WALLET_TRANSFER: string;
}
export type WALLET_TRANSACTION_SOURCE_TYPE = any;
export namespace WALLET_TRANSACTION_SOURCE_TYPE {
export const TRANSFER: string;
const DISPUTE_1: string;
export { DISPUTE_1 as DISPUTE };
const ISSUING_TRANSACTION_1: string;
export { ISSUING_TRANSACTION_1 as ISSUING_TRANSACTION };
}
export type WALLET_TRANSACTION_STATUS = any;
export namespace WALLET_TRANSACTION_STATUS {
const PENDING: string;
const COMPLETED: string;
const FAILED: string;
}
/**
* Describes a Moov Wallet Balance
* @typedef WalletBalance
* @property {string} currency - A 3-letter ISO 4217 currency code
* @property {number} value - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*
* @typedef WalletTransaction
* @property {string} walletID - UUID v4
* @property {string} transactionID - UUID v4
* @property {WALLET_TRANSACTION_TYPE} transactionType - wallet transaction type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} sourceType - where the transaction originated.
* @property {string} sourceID - ID of the source Moov object to which this transaction is related.
* @property {WALLET_TRANSACTION_STATUS} status - wallet transaction status.
* @property {string} memo - Detailed description of the transaction.
* @property {string} createdOn - Date transaction was created.
* @property {string} [completedOn] - Date transaction was completed.
* @property {string} currency - 3-letter ISO 4217 currency code.
* @property {integer} grossAmount - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} fee - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} netAmount - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} [availableBalance] - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @tag Wallets
*/
/**
* Describes a Moov Wallet
* @typedef Wallet
* @property {string} walletID - Payment Method identifier
* @property {WalletBalance} availableBalance - A representation of money containing an integer value and it's currency.
*
* @example
* {
"walletID": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
"availableBalance": {
"currency": "USD",
"value": 1204
}
}
*
* @typedef WalletTransactionListCriteria
* @property {WALLET_TRANSACTION_TYPE} [transactionType] - Only return transactions of this type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} [sourceType] - Only return transactions of this source type.
* @property {string} [sourceID] - Only return transactions that were part of this transfer ID.
* @property {WALLET_TRANSACTION_STATUS} [status] - Only return transactions in this state.
* @property {string} [createdStartDateTime] - Only return transactions created on or after this datetime.
* @property {string} [createdEndDateTime] - Only return transactions created before this datetime.
* @property {string} [completedStartDateTime] - Only return transactions completed on or after this datetime.
* @property {string} [completedEndDateTime] - Only return transactions completed before this datetime.
* @property {number} [count] - Maximum number of transactions to return in results
* @property {number} [skip] - Number of transactions to skip before collection results
* @tag Wallets

@@ -52,16 +92,25 @@ */

list(accountID: string): Promise<Wallet[]>;
}
/**
* Describes a Moov Wallet Balance
*/
export type WalletBalance = {
/**
* - A 3-letter ISO 4217 currency code
* Get the details of a wallet transaction.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {string} transactionID - UUID v4
* @returns {Promise<WalletTransaction>}
*
* @tag Wallets
*/
currency: string;
getTransaction(accountID: string, walletID: string, transactionID: string): Promise<WalletTransaction>;
/**
* - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* List the transactions in a wallet.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {WalletTransactionListCriteria} [criteria] - Filtering criteria to limit the results returned.
* @returns {Promise<Wallet[]>}
*
* @tag Wallets
*/
value: number;
};
listTransactions(accountID: string, walletID: string, criteria?: WalletTransactionListCriteria | undefined): Promise<Wallet[]>;
}
/**

@@ -72,9 +121,110 @@ * Describes a Moov Wallet

/**
* - Payment Method identifier
* - UUID v4
*/
walletID: string;
/**
* - A representation of money containing an integer value and it's currency.
* - Balance based on all completed transactions against the wallet.
*/
availableBalance: WalletBalance;
availableBalance: Amount;
};
export type WalletTransaction = {
/**
* - UUID v4
*/
walletID: string;
/**
* - UUID v4
*/
transactionID: string;
/**
* - wallet transaction type.
*/
transactionType: any;
/**
* - where the transaction originated.
*/
sourceType: any;
/**
* - ID of the source Moov object to which this transaction is related.
*/
sourceID: string;
/**
* - wallet transaction status.
*/
status: any;
/**
* - Detailed description of the transaction.
*/
memo: string;
/**
* - Date transaction was created.
*/
createdOn: string;
/**
* - Date transaction was completed.
*/
completedOn?: string | undefined;
/**
* - 3-letter ISO 4217 currency code.
*/
currency: string;
/**
* - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
grossAmount: integer;
/**
* - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
fee: integer;
/**
* - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
netAmount: integer;
/**
* - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
availableBalance?: any;
};
export type WalletTransactionListCriteria = {
/**
* - Only return transactions of this type.
*/
transactionType?: any;
/**
* - Only return transactions of this source type.
*/
sourceType?: any;
/**
* - Only return transactions that were part of this transfer ID.
*/
sourceID?: string | undefined;
/**
* - Only return transactions in this state.
*/
status?: any;
/**
* - Only return transactions created on or after this datetime.
*/
createdStartDateTime?: string | undefined;
/**
* - Only return transactions created before this datetime.
*/
createdEndDateTime?: string | undefined;
/**
* - Only return transactions completed on or after this datetime.
*/
completedStartDateTime?: string | undefined;
/**
* - Only return transactions completed before this datetime.
*/
completedEndDateTime?: string | undefined;
/**
* - Maximum number of transactions to return in results
*/
count?: number | undefined;
/**
* - Number of transactions to skip before collection results
*/
skip?: number | undefined;
};
import { Amount } from "./transfers.js";

@@ -13,18 +13,10 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Wallets = void 0;
exports.Wallets = exports.WALLET_TRANSACTION_STATUS = exports.WALLET_TRANSACTION_SOURCE_TYPE = exports.WALLET_TRANSACTION_TYPE = void 0;
const checks_js_1 = require("./helpers/checks.js");
const errors_js_1 = require("./helpers/errors.js");
/**
* Describes a Moov Wallet Balance
* @typedef WalletBalance
* @property {string} currency - A 3-letter ISO 4217 currency code
* @property {number} value - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*
* @tag Wallets
*/
/**
* Describes a Moov Wallet
* @typedef Wallet
* @property {string} walletID - Payment Method identifier
* @property {WalletBalance} availableBalance - A representation of money containing an integer value and it's currency.
* @property {string} walletID - UUID v4
* @property {Amount} availableBalance - Balance based on all completed transactions against the wallet.
*

@@ -36,3 +28,3 @@ * @example

"currency": "USD",
"value": 1204
"value": 1204 // $12.04
}

@@ -44,2 +36,162 @@ }

/**
* @enum
* @tag Wallets
*/
exports.WALLET_TRANSACTION_TYPE = {
/**
* When an ach payment is returned, funds are either returned or taken from the wallet balance.
* @tag Wallets
*/
ACH_REVERSAL: "ach-reversal",
/**
* A payment that was made from a card.
* @tag Wallets
*/
CARD_PAYMENT: "card-payment",
/**
* Transfer of funds out of a wallet to the account’s bank.
* @tag Wallets
*/
CASH_OUT: "cash-out",
/**
* When a customer disputes a charge, the disputed amount is debited from the wallet.
* @tag Wallets
*/
DISPUTE: "dispute",
/**
* If a dispute is won by a merchant, funds will be credited back to their wallet.
* @tag Wallets
*/
DISPUTE_REVERSAL: "dispute-reversal",
/**
* Fee earned on a transfer.
* @tag Wallets
*/
FACILITATOR_FEE: "facilitator-fee",
/**
* A refund on a purchase from a Moov issued card.
* @tag Wallets
*/
ISSUING_REFUND: "issuing-refund",
/**
* An authorized purchase from a Moov issued card.
* @tag Wallets
*/
ISSUING_TRANSACTION: "issuing-transaction",
/**
* If an authorized purchase is captured for more or less than the original authorization amount, an adjustment will be made to reflect the difference.
* @tag Wallets
*/
ISSUING_TRANSACTION_ADJUSTMENT: "issuing-transaction-adjustment",
/**
* Any funds that were not captured from an authorized purchase from a Moov issued card will be released.
* @tag Wallets
*/
ISSUING_AUTH_RELEASE: "issuing-auth-release",
/**
* An ACH payment from a bank to the account’s wallet.
* @tag Wallets
*/
PAYMENT: "payment",
/**
* A payment from a wallet to another accounts bank.
* @tag Wallets
*/
PAYOUT: "payout",
/**
* When a refund is initiated, the requested refund amount is debited from the wallet.
* @tag Wallets
*/
REFUND: "refund",
/**
* To account for refund failures, a credit will be made back into the wallet.
* @tag Wallets
*/
REFUND_FAILURE: "refund-failure",
/**
* Transfer of funds into a wallet from the account’s bank.
* @tag Wallets
*/
TOP_UP: "top-up",
/**
* Funds that move between Moov wallets.
* @tag Wallets
*/
WALLET_TRANSFER: "wallet-transfer",
};
/**
* @enum
* @tag Wallets
*/
exports.WALLET_TRANSACTION_SOURCE_TYPE = {
/**
* Transaction was part of a transfer.
* @tag Wallets
*/
TRANSFER: "transfer",
/**
* Transaction was part of a dispute.
* @tag Wallets
*/
DISPUTE: "dispute",
/**
* Transaction was part of an issuing transaction.
* @tag Wallets
*/
ISSUING_TRANSACTION: "issuing-transaction",
};
/**
* @enum
* @tag Wallets
*/
exports.WALLET_TRANSACTION_STATUS = {
/**
* Transaction has not completed.
* @tag Wallets
*/
PENDING: "pending",
/**
* Transaction has completed.
* @tag Wallets
*/
COMPLETED: "completed",
/**
* Transaction failed.
* @tag Wallets
*/
FAILED: "failed",
};
/**
* @typedef WalletTransaction
* @property {string} walletID - UUID v4
* @property {string} transactionID - UUID v4
* @property {WALLET_TRANSACTION_TYPE} transactionType - wallet transaction type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} sourceType - where the transaction originated.
* @property {string} sourceID - ID of the source Moov object to which this transaction is related.
* @property {WALLET_TRANSACTION_STATUS} status - wallet transaction status.
* @property {string} memo - Detailed description of the transaction.
* @property {string} createdOn - Date transaction was created.
* @property {string} [completedOn] - Date transaction was completed.
* @property {string} currency - 3-letter ISO 4217 currency code.
* @property {integer} grossAmount - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} fee - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} netAmount - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} [availableBalance] - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @tag Wallets
*/
/**
* @typedef WalletTransactionListCriteria
* @property {WALLET_TRANSACTION_TYPE} [transactionType] - Only return transactions of this type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} [sourceType] - Only return transactions of this source type.
* @property {string} [sourceID] - Only return transactions that were part of this transfer ID.
* @property {WALLET_TRANSACTION_STATUS} [status] - Only return transactions in this state.
* @property {string} [createdStartDateTime] - Only return transactions created on or after this datetime.
* @property {string} [createdEndDateTime] - Only return transactions created before this datetime.
* @property {string} [completedStartDateTime] - Only return transactions completed on or after this datetime.
* @property {string} [completedEndDateTime] - Only return transactions completed before this datetime.
* @property {number} [count] - Maximum number of transactions to return in results
* @property {number} [skip] - Number of transactions to skip before collection results
* @tag Wallets
*/
/**
* The Wallets API

@@ -94,3 +246,51 @@ * @tag Wallets

}
/**
* Get the details of a wallet transaction.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {string} transactionID - UUID v4
* @returns {Promise<WalletTransaction>}
*
* @tag Wallets
*/
getTransaction(accountID, walletID, transactionID) {
return __awaiter(this, void 0, void 0, function* () {
(0, checks_js_1.checkString)(accountID).or(errors_js_1.Err.MISSING_ACCOUNT_ID);
(0, checks_js_1.checkString)(walletID).or(errors_js_1.Err.MISSING_WALLET_ID);
(0, checks_js_1.checkString)(transactionID).or(errors_js_1.Err.MISSING_WALLET_TRANSACTION_ID);
const result = yield this.moov
.got({
url: `accounts/${accountID}/wallets/${walletID}/transactions/${transactionID}`,
method: "GET",
})
.json();
return result;
});
}
/**
* List the transactions in a wallet.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {WalletTransactionListCriteria} [criteria] - Filtering criteria to limit the results returned.
* @returns {Promise<Wallet[]>}
*
* @tag Wallets
*/
listTransactions(accountID, walletID, criteria) {
return __awaiter(this, void 0, void 0, function* () {
(0, checks_js_1.checkString)(accountID).or(errors_js_1.Err.MISSING_ACCOUNT_ID);
(0, checks_js_1.checkString)(walletID).or(errors_js_1.Err.MISSING_WALLET_ID);
const result = yield this.moov
.got({
url: `accounts/${accountID}/wallets/${walletID}/transactions`,
method: "GET",
searchParams: criteria,
})
.json();
return result;
});
}
}
exports.Wallets = Wallets;

@@ -34,2 +34,3 @@ export namespace Err {

const MISSING_WALLET_ID: string;
const MISSING_WALLET_TRANSACTION_ID: string;
}

@@ -38,2 +38,3 @@ export const Err = {

MISSING_WALLET_ID: "wallet ID is required",
MISSING_WALLET_TRANSACTION_ID: "wallet transaction ID is required",
};
export * from "./moov.js";
export { CAPABILITIES } from "./capabilities.js";
export { PAYMENT_METHODS_TYPE } from "./paymentMethods.js";
export { BANK_ACCOUNT_HOLDER_TYPE, BANK_ACCOUNT_STATUS, BANK_ACCOUNT_TYPE } from "./bankAccountsTypedefs.js";
export { CAPABILITIES, CAPABILITY_REQUIREMENT, CAPABILITY_STATUS } from "./capabilities.js";
export { CARD_BRAND, CARD_TYPE, CARD_VERIFICATION_STATUS } from "./cards.js";
export { WALLET_TRANSACTION_SOURCE_TYPE, WALLET_TRANSACTION_STATUS, WALLET_TRANSACTION_TYPE } from "./wallets.js";
export * from "./moov.js";
export { CAPABILITIES } from "./capabilities.js";
export { BANK_ACCOUNT_HOLDER_TYPE, BANK_ACCOUNT_STATUS, BANK_ACCOUNT_TYPE, } from "./bankAccountsTypedefs.js";
export { CAPABILITIES, CAPABILITY_REQUIREMENT, CAPABILITY_STATUS, } from "./capabilities.js";
export { CARD_BRAND, CARD_TYPE, CARD_VERIFICATION_STATUS } from "./cards.js";
export { PAYMENT_METHODS_TYPE } from "./paymentMethods.js";
export { WALLET_TRANSACTION_SOURCE_TYPE, WALLET_TRANSACTION_STATUS, WALLET_TRANSACTION_TYPE, } from "./wallets.js";

@@ -217,3 +217,5 @@ import { got } from "got-cjs";

password: this.credentials.secretKey,
}, gotDefaults, gotOptionsOrInstance || {});
}, gotDefaults, {
prefixUrl: credentials.apiRoot,
}, gotOptionsOrInstance || {});
this._accounts = null;

@@ -220,0 +222,0 @@ this._capabilities = null;

@@ -0,24 +1,64 @@

export type WALLET_TRANSACTION_TYPE = any;
export namespace WALLET_TRANSACTION_TYPE {
const ACH_REVERSAL: string;
const CARD_PAYMENT: string;
const CASH_OUT: string;
const DISPUTE: string;
const DISPUTE_REVERSAL: string;
const FACILITATOR_FEE: string;
const ISSUING_REFUND: string;
const ISSUING_TRANSACTION: string;
const ISSUING_TRANSACTION_ADJUSTMENT: string;
const ISSUING_AUTH_RELEASE: string;
const PAYMENT: string;
const PAYOUT: string;
const REFUND: string;
const REFUND_FAILURE: string;
const TOP_UP: string;
const WALLET_TRANSFER: string;
}
export type WALLET_TRANSACTION_SOURCE_TYPE = any;
export namespace WALLET_TRANSACTION_SOURCE_TYPE {
export const TRANSFER: string;
const DISPUTE_1: string;
export { DISPUTE_1 as DISPUTE };
const ISSUING_TRANSACTION_1: string;
export { ISSUING_TRANSACTION_1 as ISSUING_TRANSACTION };
}
export type WALLET_TRANSACTION_STATUS = any;
export namespace WALLET_TRANSACTION_STATUS {
const PENDING: string;
const COMPLETED: string;
const FAILED: string;
}
/**
* Describes a Moov Wallet Balance
* @typedef WalletBalance
* @property {string} currency - A 3-letter ISO 4217 currency code
* @property {number} value - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*
* @typedef WalletTransaction
* @property {string} walletID - UUID v4
* @property {string} transactionID - UUID v4
* @property {WALLET_TRANSACTION_TYPE} transactionType - wallet transaction type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} sourceType - where the transaction originated.
* @property {string} sourceID - ID of the source Moov object to which this transaction is related.
* @property {WALLET_TRANSACTION_STATUS} status - wallet transaction status.
* @property {string} memo - Detailed description of the transaction.
* @property {string} createdOn - Date transaction was created.
* @property {string} [completedOn] - Date transaction was completed.
* @property {string} currency - 3-letter ISO 4217 currency code.
* @property {integer} grossAmount - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} fee - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} netAmount - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} [availableBalance] - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @tag Wallets
*/
/**
* Describes a Moov Wallet
* @typedef Wallet
* @property {string} walletID - Payment Method identifier
* @property {WalletBalance} availableBalance - A representation of money containing an integer value and it's currency.
*
* @example
* {
"walletID": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
"availableBalance": {
"currency": "USD",
"value": 1204
}
}
*
* @typedef WalletTransactionListCriteria
* @property {WALLET_TRANSACTION_TYPE} [transactionType] - Only return transactions of this type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} [sourceType] - Only return transactions of this source type.
* @property {string} [sourceID] - Only return transactions that were part of this transfer ID.
* @property {WALLET_TRANSACTION_STATUS} [status] - Only return transactions in this state.
* @property {string} [createdStartDateTime] - Only return transactions created on or after this datetime.
* @property {string} [createdEndDateTime] - Only return transactions created before this datetime.
* @property {string} [completedStartDateTime] - Only return transactions completed on or after this datetime.
* @property {string} [completedEndDateTime] - Only return transactions completed before this datetime.
* @property {number} [count] - Maximum number of transactions to return in results
* @property {number} [skip] - Number of transactions to skip before collection results
* @tag Wallets

@@ -52,16 +92,25 @@ */

list(accountID: string): Promise<Wallet[]>;
}
/**
* Describes a Moov Wallet Balance
*/
export type WalletBalance = {
/**
* - A 3-letter ISO 4217 currency code
* Get the details of a wallet transaction.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {string} transactionID - UUID v4
* @returns {Promise<WalletTransaction>}
*
* @tag Wallets
*/
currency: string;
getTransaction(accountID: string, walletID: string, transactionID: string): Promise<WalletTransaction>;
/**
* - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* List the transactions in a wallet.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {WalletTransactionListCriteria} [criteria] - Filtering criteria to limit the results returned.
* @returns {Promise<Wallet[]>}
*
* @tag Wallets
*/
value: number;
};
listTransactions(accountID: string, walletID: string, criteria?: WalletTransactionListCriteria | undefined): Promise<Wallet[]>;
}
/**

@@ -72,9 +121,110 @@ * Describes a Moov Wallet

/**
* - Payment Method identifier
* - UUID v4
*/
walletID: string;
/**
* - A representation of money containing an integer value and it's currency.
* - Balance based on all completed transactions against the wallet.
*/
availableBalance: WalletBalance;
availableBalance: Amount;
};
export type WalletTransaction = {
/**
* - UUID v4
*/
walletID: string;
/**
* - UUID v4
*/
transactionID: string;
/**
* - wallet transaction type.
*/
transactionType: any;
/**
* - where the transaction originated.
*/
sourceType: any;
/**
* - ID of the source Moov object to which this transaction is related.
*/
sourceID: string;
/**
* - wallet transaction status.
*/
status: any;
/**
* - Detailed description of the transaction.
*/
memo: string;
/**
* - Date transaction was created.
*/
createdOn: string;
/**
* - Date transaction was completed.
*/
completedOn?: string | undefined;
/**
* - 3-letter ISO 4217 currency code.
*/
currency: string;
/**
* - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
grossAmount: integer;
/**
* - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
fee: integer;
/**
* - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
netAmount: integer;
/**
* - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
availableBalance?: any;
};
export type WalletTransactionListCriteria = {
/**
* - Only return transactions of this type.
*/
transactionType?: any;
/**
* - Only return transactions of this source type.
*/
sourceType?: any;
/**
* - Only return transactions that were part of this transfer ID.
*/
sourceID?: string | undefined;
/**
* - Only return transactions in this state.
*/
status?: any;
/**
* - Only return transactions created on or after this datetime.
*/
createdStartDateTime?: string | undefined;
/**
* - Only return transactions created before this datetime.
*/
createdEndDateTime?: string | undefined;
/**
* - Only return transactions completed on or after this datetime.
*/
completedStartDateTime?: string | undefined;
/**
* - Only return transactions completed before this datetime.
*/
completedEndDateTime?: string | undefined;
/**
* - Maximum number of transactions to return in results
*/
count?: number | undefined;
/**
* - Number of transactions to skip before collection results
*/
skip?: number | undefined;
};
import { Amount } from "./transfers.js";

@@ -5,14 +5,6 @@ /** @external Promise */

/**
* Describes a Moov Wallet Balance
* @typedef WalletBalance
* @property {string} currency - A 3-letter ISO 4217 currency code
* @property {number} value - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*
* @tag Wallets
*/
/**
* Describes a Moov Wallet
* @typedef Wallet
* @property {string} walletID - Payment Method identifier
* @property {WalletBalance} availableBalance - A representation of money containing an integer value and it's currency.
* @property {string} walletID - UUID v4
* @property {Amount} availableBalance - Balance based on all completed transactions against the wallet.
*

@@ -24,3 +16,3 @@ * @example

"currency": "USD",
"value": 1204
"value": 1204 // $12.04
}

@@ -32,2 +24,162 @@ }

/**
* @enum
* @tag Wallets
*/
export const WALLET_TRANSACTION_TYPE = {
/**
* When an ach payment is returned, funds are either returned or taken from the wallet balance.
* @tag Wallets
*/
ACH_REVERSAL: "ach-reversal",
/**
* A payment that was made from a card.
* @tag Wallets
*/
CARD_PAYMENT: "card-payment",
/**
* Transfer of funds out of a wallet to the account’s bank.
* @tag Wallets
*/
CASH_OUT: "cash-out",
/**
* When a customer disputes a charge, the disputed amount is debited from the wallet.
* @tag Wallets
*/
DISPUTE: "dispute",
/**
* If a dispute is won by a merchant, funds will be credited back to their wallet.
* @tag Wallets
*/
DISPUTE_REVERSAL: "dispute-reversal",
/**
* Fee earned on a transfer.
* @tag Wallets
*/
FACILITATOR_FEE: "facilitator-fee",
/**
* A refund on a purchase from a Moov issued card.
* @tag Wallets
*/
ISSUING_REFUND: "issuing-refund",
/**
* An authorized purchase from a Moov issued card.
* @tag Wallets
*/
ISSUING_TRANSACTION: "issuing-transaction",
/**
* If an authorized purchase is captured for more or less than the original authorization amount, an adjustment will be made to reflect the difference.
* @tag Wallets
*/
ISSUING_TRANSACTION_ADJUSTMENT: "issuing-transaction-adjustment",
/**
* Any funds that were not captured from an authorized purchase from a Moov issued card will be released.
* @tag Wallets
*/
ISSUING_AUTH_RELEASE: "issuing-auth-release",
/**
* An ACH payment from a bank to the account’s wallet.
* @tag Wallets
*/
PAYMENT: "payment",
/**
* A payment from a wallet to another accounts bank.
* @tag Wallets
*/
PAYOUT: "payout",
/**
* When a refund is initiated, the requested refund amount is debited from the wallet.
* @tag Wallets
*/
REFUND: "refund",
/**
* To account for refund failures, a credit will be made back into the wallet.
* @tag Wallets
*/
REFUND_FAILURE: "refund-failure",
/**
* Transfer of funds into a wallet from the account’s bank.
* @tag Wallets
*/
TOP_UP: "top-up",
/**
* Funds that move between Moov wallets.
* @tag Wallets
*/
WALLET_TRANSFER: "wallet-transfer",
};
/**
* @enum
* @tag Wallets
*/
export const WALLET_TRANSACTION_SOURCE_TYPE = {
/**
* Transaction was part of a transfer.
* @tag Wallets
*/
TRANSFER: "transfer",
/**
* Transaction was part of a dispute.
* @tag Wallets
*/
DISPUTE: "dispute",
/**
* Transaction was part of an issuing transaction.
* @tag Wallets
*/
ISSUING_TRANSACTION: "issuing-transaction",
};
/**
* @enum
* @tag Wallets
*/
export const WALLET_TRANSACTION_STATUS = {
/**
* Transaction has not completed.
* @tag Wallets
*/
PENDING: "pending",
/**
* Transaction has completed.
* @tag Wallets
*/
COMPLETED: "completed",
/**
* Transaction failed.
* @tag Wallets
*/
FAILED: "failed",
};
/**
* @typedef WalletTransaction
* @property {string} walletID - UUID v4
* @property {string} transactionID - UUID v4
* @property {WALLET_TRANSACTION_TYPE} transactionType - wallet transaction type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} sourceType - where the transaction originated.
* @property {string} sourceID - ID of the source Moov object to which this transaction is related.
* @property {WALLET_TRANSACTION_STATUS} status - wallet transaction status.
* @property {string} memo - Detailed description of the transaction.
* @property {string} createdOn - Date transaction was created.
* @property {string} [completedOn] - Date transaction was completed.
* @property {string} currency - 3-letter ISO 4217 currency code.
* @property {integer} grossAmount - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} fee - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} netAmount - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} [availableBalance] - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @tag Wallets
*/
/**
* @typedef WalletTransactionListCriteria
* @property {WALLET_TRANSACTION_TYPE} [transactionType] - Only return transactions of this type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} [sourceType] - Only return transactions of this source type.
* @property {string} [sourceID] - Only return transactions that were part of this transfer ID.
* @property {WALLET_TRANSACTION_STATUS} [status] - Only return transactions in this state.
* @property {string} [createdStartDateTime] - Only return transactions created on or after this datetime.
* @property {string} [createdEndDateTime] - Only return transactions created before this datetime.
* @property {string} [completedStartDateTime] - Only return transactions completed on or after this datetime.
* @property {string} [completedEndDateTime] - Only return transactions completed before this datetime.
* @property {number} [count] - Maximum number of transactions to return in results
* @property {number} [skip] - Number of transactions to skip before collection results
* @tag Wallets
*/
/**
* The Wallets API

@@ -78,2 +230,46 @@ * @tag Wallets

}
/**
* Get the details of a wallet transaction.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {string} transactionID - UUID v4
* @returns {Promise<WalletTransaction>}
*
* @tag Wallets
*/
async getTransaction(accountID, walletID, transactionID) {
checkString(accountID).or(Err.MISSING_ACCOUNT_ID);
checkString(walletID).or(Err.MISSING_WALLET_ID);
checkString(transactionID).or(Err.MISSING_WALLET_TRANSACTION_ID);
const result = await this.moov
.got({
url: `accounts/${accountID}/wallets/${walletID}/transactions/${transactionID}`,
method: "GET",
})
.json();
return result;
}
/**
* List the transactions in a wallet.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {WalletTransactionListCriteria} [criteria] - Filtering criteria to limit the results returned.
* @returns {Promise<Wallet[]>}
*
* @tag Wallets
*/
async listTransactions(accountID, walletID, criteria) {
checkString(accountID).or(Err.MISSING_ACCOUNT_ID);
checkString(walletID).or(Err.MISSING_WALLET_ID);
const result = await this.moov
.got({
url: `accounts/${accountID}/wallets/${walletID}/transactions`,
method: "GET",
searchParams: criteria,
})
.json();
return result;
}
}

@@ -41,2 +41,3 @@ export const Err = {

MISSING_WALLET_ID: "wallet ID is required",
MISSING_WALLET_TRANSACTION_ID: "wallet transaction ID is required",
};
export * from "./moov.js";
export { CAPABILITIES } from "./capabilities.js";
export {
BANK_ACCOUNT_HOLDER_TYPE,
BANK_ACCOUNT_STATUS,
BANK_ACCOUNT_TYPE,
} from "./bankAccountsTypedefs.js";
export {
CAPABILITIES,
CAPABILITY_REQUIREMENT,
CAPABILITY_STATUS,
} from "./capabilities.js";
export { CARD_BRAND, CARD_TYPE, CARD_VERIFICATION_STATUS } from "./cards.js";
export { PAYMENT_METHODS_TYPE } from "./paymentMethods.js";
export {
WALLET_TRANSACTION_SOURCE_TYPE,
WALLET_TRANSACTION_STATUS,
WALLET_TRANSACTION_TYPE,
} from "./wallets.js";

@@ -233,2 +233,5 @@ import { got } from "got-cjs";

gotDefaults,
{
prefixUrl: credentials.apiRoot,
},
gotOptionsOrInstance || {}

@@ -235,0 +238,0 @@ );

@@ -34,3 +34,4 @@ export namespace Err {

const MISSING_WALLET_ID: string;
const MISSING_WALLET_TRANSACTION_ID: string;
}
//# sourceMappingURL=errors.d.ts.map
export * from "./moov.js";
export { CAPABILITIES } from "./capabilities.js";
export { PAYMENT_METHODS_TYPE } from "./paymentMethods.js";
export { BANK_ACCOUNT_HOLDER_TYPE, BANK_ACCOUNT_STATUS, BANK_ACCOUNT_TYPE } from "./bankAccountsTypedefs.js";
export { CAPABILITIES, CAPABILITY_REQUIREMENT, CAPABILITY_STATUS } from "./capabilities.js";
export { CARD_BRAND, CARD_TYPE, CARD_VERIFICATION_STATUS } from "./cards.js";
export { WALLET_TRANSACTION_SOURCE_TYPE, WALLET_TRANSACTION_STATUS, WALLET_TRANSACTION_TYPE } from "./wallets.js";
//# sourceMappingURL=index.d.ts.map

@@ -0,24 +1,64 @@

export type WALLET_TRANSACTION_TYPE = any;
export namespace WALLET_TRANSACTION_TYPE {
const ACH_REVERSAL: string;
const CARD_PAYMENT: string;
const CASH_OUT: string;
const DISPUTE: string;
const DISPUTE_REVERSAL: string;
const FACILITATOR_FEE: string;
const ISSUING_REFUND: string;
const ISSUING_TRANSACTION: string;
const ISSUING_TRANSACTION_ADJUSTMENT: string;
const ISSUING_AUTH_RELEASE: string;
const PAYMENT: string;
const PAYOUT: string;
const REFUND: string;
const REFUND_FAILURE: string;
const TOP_UP: string;
const WALLET_TRANSFER: string;
}
export type WALLET_TRANSACTION_SOURCE_TYPE = any;
export namespace WALLET_TRANSACTION_SOURCE_TYPE {
export const TRANSFER: string;
const DISPUTE_1: string;
export { DISPUTE_1 as DISPUTE };
const ISSUING_TRANSACTION_1: string;
export { ISSUING_TRANSACTION_1 as ISSUING_TRANSACTION };
}
export type WALLET_TRANSACTION_STATUS = any;
export namespace WALLET_TRANSACTION_STATUS {
const PENDING: string;
const COMPLETED: string;
const FAILED: string;
}
/**
* Describes a Moov Wallet Balance
* @typedef WalletBalance
* @property {string} currency - A 3-letter ISO 4217 currency code
* @property {number} value - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*
* @typedef WalletTransaction
* @property {string} walletID - UUID v4
* @property {string} transactionID - UUID v4
* @property {WALLET_TRANSACTION_TYPE} transactionType - wallet transaction type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} sourceType - where the transaction originated.
* @property {string} sourceID - ID of the source Moov object to which this transaction is related.
* @property {WALLET_TRANSACTION_STATUS} status - wallet transaction status.
* @property {string} memo - Detailed description of the transaction.
* @property {string} createdOn - Date transaction was created.
* @property {string} [completedOn] - Date transaction was completed.
* @property {string} currency - 3-letter ISO 4217 currency code.
* @property {integer} grossAmount - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} fee - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} netAmount - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} [availableBalance] - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @tag Wallets
*/
/**
* Describes a Moov Wallet
* @typedef Wallet
* @property {string} walletID - Payment Method identifier
* @property {WalletBalance} availableBalance - A representation of money containing an integer value and it's currency.
*
* @example
* {
"walletID": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
"availableBalance": {
"currency": "USD",
"value": 1204
}
}
*
* @typedef WalletTransactionListCriteria
* @property {WALLET_TRANSACTION_TYPE} [transactionType] - Only return transactions of this type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} [sourceType] - Only return transactions of this source type.
* @property {string} [sourceID] - Only return transactions that were part of this transfer ID.
* @property {WALLET_TRANSACTION_STATUS} [status] - Only return transactions in this state.
* @property {string} [createdStartDateTime] - Only return transactions created on or after this datetime.
* @property {string} [createdEndDateTime] - Only return transactions created before this datetime.
* @property {string} [completedStartDateTime] - Only return transactions completed on or after this datetime.
* @property {string} [completedEndDateTime] - Only return transactions completed before this datetime.
* @property {number} [count] - Maximum number of transactions to return in results
* @property {number} [skip] - Number of transactions to skip before collection results
* @tag Wallets

@@ -52,16 +92,25 @@ */

list(accountID: string): Promise<Wallet[]>;
}
/**
* Describes a Moov Wallet Balance
*/
export type WalletBalance = {
/**
* - A 3-letter ISO 4217 currency code
* Get the details of a wallet transaction.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {string} transactionID - UUID v4
* @returns {Promise<WalletTransaction>}
*
* @tag Wallets
*/
currency: string;
getTransaction(accountID: string, walletID: string, transactionID: string): Promise<WalletTransaction>;
/**
* - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* List the transactions in a wallet.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {WalletTransactionListCriteria} [criteria] - Filtering criteria to limit the results returned.
* @returns {Promise<Wallet[]>}
*
* @tag Wallets
*/
value: number;
};
listTransactions(accountID: string, walletID: string, criteria?: WalletTransactionListCriteria): Promise<Wallet[]>;
}
/**

@@ -72,10 +121,111 @@ * Describes a Moov Wallet

/**
* - Payment Method identifier
* - UUID v4
*/
walletID: string;
/**
* - A representation of money containing an integer value and it's currency.
* - Balance based on all completed transactions against the wallet.
*/
availableBalance: WalletBalance;
availableBalance: Amount;
};
export type WalletTransaction = {
/**
* - UUID v4
*/
walletID: string;
/**
* - UUID v4
*/
transactionID: string;
/**
* - wallet transaction type.
*/
transactionType: any;
/**
* - where the transaction originated.
*/
sourceType: any;
/**
* - ID of the source Moov object to which this transaction is related.
*/
sourceID: string;
/**
* - wallet transaction status.
*/
status: any;
/**
* - Detailed description of the transaction.
*/
memo: string;
/**
* - Date transaction was created.
*/
createdOn: string;
/**
* - Date transaction was completed.
*/
completedOn?: string;
/**
* - 3-letter ISO 4217 currency code.
*/
currency: string;
/**
* - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
grossAmount: integer;
/**
* - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
fee: integer;
/**
* - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
netAmount: integer;
/**
* - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*/
availableBalance?: integer;
};
export type WalletTransactionListCriteria = {
/**
* - Only return transactions of this type.
*/
transactionType?: any;
/**
* - Only return transactions of this source type.
*/
sourceType?: any;
/**
* - Only return transactions that were part of this transfer ID.
*/
sourceID?: string;
/**
* - Only return transactions in this state.
*/
status?: any;
/**
* - Only return transactions created on or after this datetime.
*/
createdStartDateTime?: string;
/**
* - Only return transactions created before this datetime.
*/
createdEndDateTime?: string;
/**
* - Only return transactions completed on or after this datetime.
*/
completedStartDateTime?: string;
/**
* - Only return transactions completed before this datetime.
*/
completedEndDateTime?: string;
/**
* - Maximum number of transactions to return in results
*/
count?: number;
/**
* - Number of transactions to skip before collection results
*/
skip?: number;
};
import { Amount } from "./transfers.js";
//# sourceMappingURL=wallets.d.ts.map
/** @external Promise */
import { check, checkString } from "./helpers/checks.js";
import { checkString } from "./helpers/checks.js";
import { Err } from "./helpers/errors.js";
import { Amount } from "./transfers.js";
/**
* Describes a Moov Wallet Balance
* @typedef WalletBalance
* @property {string} currency - A 3-letter ISO 4217 currency code
* @property {number} value - Quantity in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
*
* @tag Wallets
*/
/**
* Describes a Moov Wallet
* @typedef Wallet
* @property {string} walletID - Payment Method identifier
* @property {WalletBalance} availableBalance - A representation of money containing an integer value and it's currency.
* @property {string} walletID - UUID v4
* @property {Amount} availableBalance - Balance based on all completed transactions against the wallet.
*

@@ -26,3 +18,3 @@ * @example

"currency": "USD",
"value": 1204
"value": 1204 // $12.04
}

@@ -35,2 +27,167 @@ }

/**
* @enum
* @tag Wallets
*/
export const WALLET_TRANSACTION_TYPE = {
/**
* When an ach payment is returned, funds are either returned or taken from the wallet balance.
* @tag Wallets
*/
ACH_REVERSAL: "ach-reversal",
/**
* A payment that was made from a card.
* @tag Wallets
*/
CARD_PAYMENT: "card-payment",
/**
* Transfer of funds out of a wallet to the account’s bank.
* @tag Wallets
*/
CASH_OUT: "cash-out",
/**
* When a customer disputes a charge, the disputed amount is debited from the wallet.
* @tag Wallets
*/
DISPUTE: "dispute",
/**
* If a dispute is won by a merchant, funds will be credited back to their wallet.
* @tag Wallets
*/
DISPUTE_REVERSAL: "dispute-reversal",
/**
* Fee earned on a transfer.
* @tag Wallets
*/
FACILITATOR_FEE: "facilitator-fee",
/**
* A refund on a purchase from a Moov issued card.
* @tag Wallets
*/
ISSUING_REFUND: "issuing-refund",
/**
* An authorized purchase from a Moov issued card.
* @tag Wallets
*/
ISSUING_TRANSACTION: "issuing-transaction",
/**
* If an authorized purchase is captured for more or less than the original authorization amount, an adjustment will be made to reflect the difference.
* @tag Wallets
*/
ISSUING_TRANSACTION_ADJUSTMENT: "issuing-transaction-adjustment",
/**
* Any funds that were not captured from an authorized purchase from a Moov issued card will be released.
* @tag Wallets
*/
ISSUING_AUTH_RELEASE: "issuing-auth-release",
/**
* An ACH payment from a bank to the account’s wallet.
* @tag Wallets
*/
PAYMENT: "payment",
/**
* A payment from a wallet to another accounts bank.
* @tag Wallets
*/
PAYOUT: "payout",
/**
* When a refund is initiated, the requested refund amount is debited from the wallet.
* @tag Wallets
*/
REFUND: "refund",
/**
* To account for refund failures, a credit will be made back into the wallet.
* @tag Wallets
*/
REFUND_FAILURE: "refund-failure",
/**
* Transfer of funds into a wallet from the account’s bank.
* @tag Wallets
*/
TOP_UP: "top-up",
/**
* Funds that move between Moov wallets.
* @tag Wallets
*/
WALLET_TRANSFER: "wallet-transfer",
};
/**
* @enum
* @tag Wallets
*/
export const WALLET_TRANSACTION_SOURCE_TYPE = {
/**
* Transaction was part of a transfer.
* @tag Wallets
*/
TRANSFER: "transfer",
/**
* Transaction was part of a dispute.
* @tag Wallets
*/
DISPUTE: "dispute",
/**
* Transaction was part of an issuing transaction.
* @tag Wallets
*/
ISSUING_TRANSACTION: "issuing-transaction",
};
/**
* @enum
* @tag Wallets
*/
export const WALLET_TRANSACTION_STATUS = {
/**
* Transaction has not completed.
* @tag Wallets
*/
PENDING: "pending",
/**
* Transaction has completed.
* @tag Wallets
*/
COMPLETED: "completed",
/**
* Transaction failed.
* @tag Wallets
*/
FAILED: "failed",
};
/**
* @typedef WalletTransaction
* @property {string} walletID - UUID v4
* @property {string} transactionID - UUID v4
* @property {WALLET_TRANSACTION_TYPE} transactionType - wallet transaction type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} sourceType - where the transaction originated.
* @property {string} sourceID - ID of the source Moov object to which this transaction is related.
* @property {WALLET_TRANSACTION_STATUS} status - wallet transaction status.
* @property {string} memo - Detailed description of the transaction.
* @property {string} createdOn - Date transaction was created.
* @property {string} [completedOn] - Date transaction was completed.
* @property {string} currency - 3-letter ISO 4217 currency code.
* @property {integer} grossAmount - The total transaction amount. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} fee - Total fees paid for the transaction. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} netAmount - Net amount is the gross amount less fees paid, and the amount that affects the wallet's balance. The amount is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @property {integer} [availableBalance] - The wallet's total available balance after recording a completed transaction. The value is in the smallest unit of the specified currency. In USD this is cents, so $12.04 is 1204 and $0.99 would be 99.
* @tag Wallets
*/
/**
* @typedef WalletTransactionListCriteria
* @property {WALLET_TRANSACTION_TYPE} [transactionType] - Only return transactions of this type.
* @property {WALLET_TRANSACTION_SOURCE_TYPE} [sourceType] - Only return transactions of this source type.
* @property {string} [sourceID] - Only return transactions that were part of this transfer ID.
* @property {WALLET_TRANSACTION_STATUS} [status] - Only return transactions in this state.
* @property {string} [createdStartDateTime] - Only return transactions created on or after this datetime.
* @property {string} [createdEndDateTime] - Only return transactions created before this datetime.
* @property {string} [completedStartDateTime] - Only return transactions completed on or after this datetime.
* @property {string} [completedEndDateTime] - Only return transactions completed before this datetime.
* @property {number} [count] - Maximum number of transactions to return in results
* @property {number} [skip] - Number of transactions to skip before collection results
* @tag Wallets
*/
/**
* The Wallets API

@@ -87,2 +244,52 @@ * @tag Wallets

}
/**
* Get the details of a wallet transaction.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {string} transactionID - UUID v4
* @returns {Promise<WalletTransaction>}
*
* @tag Wallets
*/
async getTransaction(accountID, walletID, transactionID) {
checkString(accountID).or(Err.MISSING_ACCOUNT_ID);
checkString(walletID).or(Err.MISSING_WALLET_ID);
checkString(transactionID).or(Err.MISSING_WALLET_TRANSACTION_ID);
const result = await this.moov
.got({
url: `accounts/${accountID}/wallets/${walletID}/transactions/${transactionID}`,
method: "GET",
})
.json();
return result;
}
/**
* List the transactions in a wallet.
*
* @param {string} accountID - UUID v4
* @param {string} walletID - UUID v4
* @param {WalletTransactionListCriteria} [criteria] - Filtering criteria to limit the results returned.
* @returns {Promise<Wallet[]>}
*
* @tag Wallets
*/
async listTransactions(accountID, walletID, criteria) {
checkString(accountID).or(Err.MISSING_ACCOUNT_ID);
checkString(walletID).or(Err.MISSING_WALLET_ID);
const result = await this.moov
.got({
url: `accounts/${accountID}/wallets/${walletID}/transactions`,
method: "GET",
searchParams: criteria,
})
.json();
return result;
}
}
{
"name": "@moovio/node",
"version": "1.1.2",
"version": "v1.2.0",
"description": "Node SDK for the Moov API and Dashboard",

@@ -51,3 +51,3 @@ "module": "dist/mjs/index.js",

"handlebars": "^4.7.7",
"handlebars-helpers": "^0.10.0",
"handlebars-helpers": "^0.9.8",
"jsdoc": "^3.6.7",

@@ -54,0 +54,0 @@ "lodash": "^4.17.21",

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc