Skip to content

shakepay/wyre-node

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wyre

Node.js client library for the Wyre API.

Install

npm install wyre-api

Usage

const WyreClient = require('wyre-api').WyreClient
// import {WyreClient} from 'wyre-api'

let wyre = new WyreClient({
    apiKey: "P334FCDXQ4UVAWVPUZ4V",
    secretKey: "4AZEWMYB7CFJWWZMCEWX"
})

wyre.get("/account")
    .then(data => {
        // .. success
    },
    err => {
        // .. error
    })

wyre.get("/transfers", {
    limit: 1,
    offset: 1
})
    .then(successCallback, errorCallback)

wyre.post("/transfers", {
    sourceAmount: "10",
    sourceCurrency: "USD",
    dest: "email:test@sendwyre.com"
})
    .then(successCallback, errorCallback)

Ability to override options used by the Request client on both constructor and per request:

let wyre = new WyreClient({
    apiKey: "P334FCDXQ4UVAWVPUZ4V",
    secretKey: "4AZEWMYB7CFJWWZMCEWX",
    options: {
        timeout: 1500
    }
})
wyre.get("/rates", {}, {
    timeout: 1500
})
    .then(successCallback, errorCallback)

Errors

Example error response:

{
    language: "en",
    exceptionId: "8MAM48",
    compositeType: "Field deprecated",
    subType: "Field deprecated",
    message: "Field dest is required.",
    type: "FieldRequiredException",
    transient: false
}

Packages

No packages published

Languages

  • TypeScript 100.0%