1.4.2 • Published 5 years ago

carbonfiber-node v1.4.2

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Carbon Module

Carbon Fiber API which implements generic Carbon Fiber functionality. Availabe as a node module on npm.

Getting Started

Before using carbonfiber-node, please have a jwt token to initialize. You can receive jwt tokens from calling,

fiber.account_getJWT(<email>, <password>)

Installing

npm install carbonfiber-node

then include atop files:

let CarbonFiber = require('carbonfiber-node')

// Get token to initialize fiber.
let token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI4MTY1NzgzZC02MDcyLTQ4YzItOGI2My0wMmU5YzA3NWNlNDIiLCJzdXBlclVzZXIiOnRydWUsImNvbnRhY3QiOmZhbHNlLCJlbWFpbCI6ImdtYWk5NWhAZ21haWwuY29tIiwiaWF0IjoxNTUzNjA2MDQ5fQ.qypcRxarvmpcJmyJTEo5EjtuWLpm_TMegHWwx3PYe8g'

// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox', token)

Usage

Methods return promises to complete described actions.

I.E:

// Method to get a jwt token. 
fiber.account_getJWT(<email_address>, <password>)

Returns a single token for use.

Account Methods

All Account functions available for Carbon Fiber.

fiber.account_getJWT(email_address, password)

Get a jwt token from the email address, and password.

Parameters

ParamTypeRequired
email_addressstringtrue
passwordstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getToken = async function(){

    let jwt_Token = await fiber.account_getJWT('email', 'password')
    return jwt_token
}

// Returns jwt token to be used. 
getToken()

fiber.account_currentSuperUser()

Get current data for super user.

Parameters

ParamTypeRequired
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let createSuper = async function(){

    return await fiber.account_currentSuperUser()

}

// Returns a super user after being created. 
createSuper()

fiber.account_changePassword(new_password, email_address)

Change password for the super user.

Parameters

ParamTypeRequired
new_passwordstringtrue
email_addressstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let changePassword = async function(){

    return await fiber.account_changePassword('new_password', 'email')

}

// Changes password and returns adequate response messages. 
changePassword()

KYC Methods

All KYC functions available for Carbon Fiber.

fiber.kyc_createContact(contact_body)

Create a KYC Contact.

Parameters

Object keys to be pushed into kyc_createContact

ParamTypeRequired
email_addressstringtrue
first_namestringtrue
last_namestringtrue
dobstringtrue
phone_numbernumbertrue
streetstringtrue
citystringtrue
regionstringtrue
postal_codestringtrue
countrystringtrue
tax-countrystringtrue
tax_idnumbertrue
sexstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let createContact = async function(){

    return await fiber.kyc_createContact({})

}

// Creates a kyc contact and returns the results. 
createContact()

fiber.kyc_uploadDocument(upload_body)

Upload a document(image, png, etc.)

Parameters

Object keys to be pushed into kyc_uploadDocument

ParamTypeRequired
contactIdstringtrue
fileBuffertrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let uploadDocument = async function(){

    let document = "<Buffer>"
    return await fiber.kyc_uploadDocument(document)

}

// Uploads a document. 
uploadDocument()

fiber.kyc_updateContact(update_body)

Update KYC Status.

Parameters

Object keys to be pushed into kyc_updateContact

ParamTypeRequired
contactIdstringtrue
email_addressstringtrue
first_namestringtrue
last_namestringtrue
dobstringtrue
phone_numbernumbertrue
streetstringtrue
citystringtrue
regionstringtrue
postal_codestringtrue
countrystringtrue
tax-countrystringtrue
tax_idnumbertrue
sexstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let updateKYC = async function(){

    return await fiber.account_changePassword({})

}

// Updates the kyc status. 
updateKYC()

fiber.kyc_getContactStatus(id)

Get KYC contact status.

Parameters

Object keys to be pushed into kyc_getContactStatus

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getAccount = async function(){

    return await fiber.kyc_getContactStatus('sdfwefwefwefwefwefwefwef')

}

// Get account from id. 
getAccount()

fiber.kyc_deleteContact(id)

Delete KYC Contact.

Parameters

Object keys to be pushed into kyc_deleteContact

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let deleteAccount = async function(){

    return await fiber.kyc_deleteContact('sdfwefwefwefwefwefwefwef')

}

// Deletes account 
deleteAccount()

fiber.kyc_getContacts()

Get all KYC contacts.

// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getContacts = async function(){

    return await fiber.kyc_getContacts()

}

// Get all the kYC contacts
getContacts()

Payment Methods

All Payment functions available for Carbon Fiber.

fiber.payment_addWireMethod(wire_body)

Method to add a wire method.

Parameters

Object keys to be pushed into payment_addWireMethod

ParamTypeRequired
is_bank_internationalbooltrue
contact-idstringtrue
bank_namestringtrue
bank_account_numbernumbertrue
beneficiary-addressstringtrue
routing-numbernumbertrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let addWire = async function(){

    return await fiber.payment_addWireMethod({})

}


addWire()

fiber.payment_getAllMethods(payment_body)

Get all payment methods.

Parameters

Object keys to be pushed into payment_getPaymentMethod

ParamTypeRequired
contactIdstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getAll = async function(){

    return await fiber.payment_getAllMethods({})

}


getAll()

fiber.payment_getPaymentMethod(id)

Get a single payment method by id.

Parameters

Object keys to be pushed into payment_getPaymentMethod

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getID = async function(){

    return await fiber.payment_getPaymentMethod('wefwefwefwefwef')

}


getID()

fiber.payment_deletePaymentMethod(id)

Delete a payment method by the id.

Parameters

Object keys to be pushed into payment_deletePaymentMethod

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let deleteID = async function(){

    return await fiber.payment_deletePaymentMethod('wefwefwefwefwef')

}


deleteID()

fiber.payment_addACH(ach_body)

Add ACH to fiber account.

Parameters

Object keys to be pushed into payment_addACH

ParamTypeRequired
contact-idstringtrue
routing-numberstringtrue
bank-account-numbernumbertrue
bank-namestringtrue
bank-account-typestringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let addACH = async function(){

    return await fiber.payment_addACH({})

}


addACH()

Deposit Methods

All Deposit functions available for Carbon Fiber.

fiber.deposit_createWireDeposit(deposit_body)

Create a wire deposit.

Parameters

Object keys to be pushed into deposit_createWireDeposit

ParamTypeRequired
amountnumbertrue
chainstringtrue
contact-idstringtrue
addressstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let createDeposit = async function(){

    return await fiber.deposit_createWireDeposit({})

}


createDeposit()

fiber.deposit_deleteDeposit(id)

Delete a deposit request.

Parameters

Object keys to be pushed into deposit_deleteDeposit

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let deleteDeposit = async function(){

    return await fiber.deposit_deleteDeposit('wefwefwef')

}


deleteDeposit()

fiber.deposit_ID(id)

Get a deposit by ID.

Parameters

Object keys to be pushed into deposit_ID

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let deleteDepositID = async function(){

    return await fiber.deposit_ID('wefwefwef')

}


deleteDepositID()

fiber.deposit_getAll(deposit_body)

Get all deposits.

Parameters

Object keys to be pushed into deposit_getAll

ParamTypeRequired
contactIdstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getDeposits = async function(){

    return await fiber.deposit_getAll('wefwefwefwefwef')

}


getDeposits()

fiber.deposit_createACH(ach_body)

Create a new ACH deposit.

Parameters

Object keys to be pushed into deposit_createACH

ParamTypeRequired
contact-idstringtrue
chainstringtrue
addressstringtrue
amountnumbertrue
routing-numbernumbertrue
bank-account-numbernumbertrue
bank-namestringtrue
bank-account-typestringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let createACH = async function(){

    return await fiber.deposit_createACH({})

}


createACH()

Withdraw Methods

All Withdraw functions available for Carbon Fiber.

fiber.withdraw_createWithdrawal(withdraw_body)

Create a Withdraw request.

Parameters

Object keys to be pushed into withdraw_createWithdrawal

ParamTypeRequired
contact-idstringtrue
chainstringtrue
amountnumbertrue
paymentMethodIdstringtrue
addressstringtrue
txHashstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let newRequest = async function(){

    return await fiber.withdraw_createWithdrawal({})

}


newRequest()

fiber.withdraw_deleteWithdrawal(id)

Delete a withdraw request.

Parameters

Object keys to be pushed into withdraw_deleteWithdrawal

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let delete = async function(){

    return await fiber.withdraw_deleteWithdrawal('fwefwewefwefwef')

}


delete()

fiber.withdraw_getAll(contact_body)

Get all withdrawals.

Parameters

String to be pushed into withdraw_getAll

ParamTypeRequired
contactIdstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getWithdrawals = async function(){

    return await fiber.withdraw_getAll('wefwefwef')

}


getWithdrawals()

fiber.withdraw_getByID(id)

Get a single withdrawal by ID.

Parameters

String to be pushed into withdraw_getByID

ParamTypeRequired
idstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let getWithdrawalID = async function(){

    return await fiber.withdraw_getByID('wefwefwefwef')

}


getWithdrawalID()

fiber.withdraw_createACH(ach_body)

Create ACH withdrawal.

Parameters

String to be pushed into withdraw_createACH

ParamTypeRequired
contact-idstringtrue
chainstringtrue
amountnumbertrue
paymentMethodIdstringtrue
addressstringtrue
txHashstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let createACH = async function(){

    return await fiber.withdraw_createACH({})

}


createACH()

Webhook Methods

All Webhook functions available for Carbon Fiber.

fiber.webhook_subscribe(webhook_body)

Subscribe to a webhook.

Parameters

Object to be pushed into webhook_subscribe

ParamTypeRequired
actionstringtrue
urlstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let webhook = async function(){

    return await fiber.webhook_subscribe({})

}


webhook()

fiber.webhook_unsubscribe(webhook_body)

Unsubscribe from a webhook.

Parameters

String to be pushed into webhook_unsubscribe

ParamTypeRequired
actionstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let webhook = async function(){

    return await fiber.webhook_unsubscribe({})

}


webhook()

fiber.webhook_removeCallbackURL(webhook_body, action)

Remove a callback url from a webhook.

Parameters

Parameters to be pushed into webhook_removeCallbackURL

ParamTypeRequired
webhook_bodyobjecttrue
actionstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let webhook = async function(){

    return await fiber.webhook_removeCallbackURL({}, 'ETHMINT')

}


webhook()

fiber.webhook_viewSubscription(action)

View a subscription via the action.

Parameters

String to be pushed into webhook_viewSubscription

ParamTypeRequired
actionstringtrue
// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let webhook = async function(){

    return await fiber.webhook_viewSubscription('EOSMINT')

}


webhook()

fiber.webhook_allSubscriptions()

View all Webhook Subscriptions.

// Require carbon fiber module. 
let CarbonFiber = require('carbonfiber-node')


// Call an instance of CarbonFiber, make sure to state whether it's "sandbox", or "main"
let fiber = new CarbonFiber('sandbox')

let webhook = async function(){

    return await fiber.webhook_allSubscriptions()

}


webhook()

Contributing

Carbon-12 Labs

License

ISC

1.4.2

5 years ago

1.3.6

5 years ago

1.0.6

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago