Paymail

The Paymail module in the Neucron JavaScript SDK provides functionalities related to Paymail, including retrieving a list of Paymails associated with a user and updating a Paymail address.

Get Paymail List

To get a list of Paymails associated with a user, use the following code:

import NeucronSDK from 'neucron-sdk/src/neucron-sdk.js';

const neucronSDK = new NeucronSDK();
await neucronSDK.authentication.login({
  email: 'dummy@example.com',
  password: 'dummyPassword'
});

const response = await neucronSDK.paymail.getPaymailList();
console.log(response);

Response:

{
  data: {
    details: {
      Wallets: ['f1be9b7d-a9d5-40df-b6c6-e7f176057b14', /* Additional Wallets if available */],
      DefaultWallet: 'f1be9b7d-a9d5-40df-b6c6-e7f176057b14'
    }
  },
  status_code: 200
}

Update Paymail

To update a Paymail address, use the following code:

import NeucronSDK from 'neucron-sdk/src/neucron-sdk.js';

const neucronSDK = new NeucronSDK();
await neucronSDK.authentication.login({
  email: 'dummy@example.com',
  password: 'dummyPassword'
});

const options = {
  paymail: 'coco@dev.neucron.io',
  newPaymail: 'popo@dev.neucron.io'
};

const response = await neucronSDK.paymail.updatePaymail(options);
console.log(response);

Response:

{
  data: {
    paymail_id: 'popo@dev.neucron.io'
  },
  status_code: 200
}

This concludes the documentation for the Paymail module in the Neucron JavaScript SDK. For more details or additional functionalities, please refer to the official Neucron SDK documentation.

Last updated