npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@fightmegg/transferwise

v0.0.3

Published

Node TransferWise API client

Downloads

30

Readme

TransferWise Node.js Library

Version Downloads CircleCI

An open-source TransferWise API client for Node.JS

The TransferWise Node library provides convient access to the TransferWise API from applications written in server-side JavaScript.

Documentation

See the TransferWise API docs for the offical docs, below is a list of methods supported by this library.

Installation

Install the package with:

npm install @fightmegg/transferwise

NB: Requires Node >= 12

Usage

import TransferWise from '@fightmegg/transferwise';

const tw = new TransferWise({ token: ..., sandbox: true });
const profiles = await tw.profiles();

Methods

Currently only supports methods listed below. Aim to support all API methods soon.

profiles

await tw.profiles();

borderlessAccounts

await tw.borderlessAccounts("<profileId>");

recipientAccounts

await tw.recipientAccounts.create("<accounts object>");
await tw.recipientAccounts.get("<accountId>");
await tw.recipientAccounts.delete("<accountId>");
await tw.recipientAccounts.list("<account url params>");

quotes

await tw.quotes.temporary("<quote url params>");
await tw.quotes.create("<quote object>");
await tw.quotes.get("<quoteId>");

transfers

await tw.transfers.create("<transfer object>");
await tw.transfers.cancel("<transfer object>");
await tw.transfers.get("<transferId>");
await tw.transfers.issues("<transferId>");
await tw.transfers.fund("<profileId>", "<transferId>");
await tw.transfers.deliveryEstimate("<transferId>");
await tw.transfers.list("<transfer url params>");

simulation

await tw.simulation.transfers.processing("<transferId>");
await tw.simulation.transfers.fundsConverted("<transferId>");
await tw.simulation.transfers.outgoingPaymentSent("<transferId>");
await tw.simulation.transfers.bouncedBack("<transferId>");
await tw.simulation.transfers.fundsRefunded("<transferId>");

Webhook Verification

TransferWise signs all Webhook events, and it is recommended that you verify this signature . Luckily this library can do that for you.

Similarly to how stripe node works, you should only use the event returned from the method below.

const event = tw.webhooks.constructEvent("<webhookMsg>", "<signature>");

Please note that you must pass the raw request body, exactly as recieved from TransferWise to the constructEvent() function; this will not work with a parsed (i.e., JSON) request body.

You can find an example of how to use this with Express below:

app.post("/", bodyParser.raw({ type: "application.json" }), (req, res) => {
  const sig = req.headers["x-signature"];
  const event = tw.webhooks.constructEvent(req.body, sig);
  // ...
});

Known Sandbox Issues

Below is a series of issues that l have found out through various email chains with TransferWise API team.

1. Create a Transfer

When creating a transfer, the field targetValue will always be populated as 0 regardless, therefore you should only rely on this field in production.

2. Simulate a Transfer

When funding a transfer, the transfer state might show processing, however this state is misleading. When simulating, you will still need to simulate from incoming_payment_waiting to processing.

Development

Run all tests:

$ npm test

This library is published to both the NPM and GitHub package registrys.