The Pillar Wallet SDK aims to make it easy for developers to get started using Pillar Wallet backend services.
- Getting started
- Config
- Response and Error
- Methods
- Wallet Update
- Wallet Register Auth Server
- Wallet Register Address
- Wallet Unregister Address
- Smart Wallet Register
- Asset Defaults
- Asset Search
- Asset List
- Connection Invite
- Connection v2 Invite
- Connection Accept
- Connection Reject
- Connection v2 Reject
- Connection Cancel
- Connection v2 Cancel
- Connection Block
- Connection v2 Block
- Connection Mute
- Connection v2 Mute
- Connection Disconnect
- Connection v2 Disconnect
- Connection Count
- Connection Map Identity Keys
- Connection Update Identity Keys
- Notification List
- Investments ICO List
- Investments Deposit Request
- User Create One Time Password
- User Delete
- User Delete Profile Image
- User Info
- User Info Smart Wallet
- User Image by User Id
- User Info By Id
- User Profile Image
- User Search
- User Update
- User Upload Profile Image
- User Update Notification Preferences
- User Username Search
- User Validate (deprecated)
- User v2 Validate
- User Validate Email
- User Validate Phone
- User Support Hmac
- Referral Send Invitation
- Referral Generate Token
- Referral List
- Tests
- Coding Style Guide
- Versioning
- License
- Acknowledgments
Install the npm package:
npm i @pillarwallet/pillarwallet-nodejs-sdk
In your project:
const { PillarSdk } = require('@pillarwallet/pillarwallet-nodejs-sdk');
During the pipeline process, we need to automatically ensure that our version number is unique. To do this, we replace the last patch digit of the package.json's version setting with the current circle CI build number. It's a bit of a hack but it means we don't need to think about the version number before committing + pushing.
For example, if you give us version=2.3.1, and this is picked up by circle's 492nd build job, your package is published as version=2.3.492
IMPORTANT! Complete these steps to use this SDK:
Instantiate the Pillar SDK, then set the apiUrl (optional) and notificationsUrl (optional).
const pillarSdk = new PillarSdk({
apiUrl: 'https://localhost:8080',
notificationsUrl: 'https://localhost:8081',
investmentsUrl: 'https://localhost:8082',
});
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
apiUrl | URL where API is hosted. String with URL format. e.g. "http://". | String | Optional |
notificationsUrl | URL where the Notifications Service is hosted. String with URL format. e.g. "http://". | String | Optional |
investmentsUrl | URL where the Investments Service is hosted. String with URL format. e.g. "http://". | String | Optional |
To use backend services, register the wallet:
pillarSdk.wallet.registerAuthServer(inputParams)
Register the wallet in the backend, create the UserProfile table, and register the wallet in BCX(Blockchain Explorer). Wallet can not be created without username.
const inputParams = {
fcmToken: 'cMctpybZfwyFTyRJBo4omxpgoF2JWf-tlJc8fB0Swrq0z7',
privateKey: '3eA19bddb978Db62344Ffba5d37Ba41C83C579173eA19bddb978Db62344Ffba5d37Ba41C83C57917',
username: 'bob123',
};
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
fcmToken | The Firebase Cloud Message Token of One Wallet. | String | Required |
privateKey | Hexadecimal string and 64 characters in length. | String | Required |
username | The Username of One Wallet. | String | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
accessToken | eg. 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiVlx1MDAxNcKbwoNUwoonbFPCu8KhwrYiLCJpYXQiOjE0NDQyNjI1NDMsImV4cCI6MTQ0NDI2MjU2M30.MldruS1PvZaRZIJR4legQaauQ3_DYKxxP2rFnD37Ip4' | String |
accessTokenExpiresAt | 'YYYY-mm-ddTHH:MM:ssZ' | String |
refreshToken | eg. 'fdb8fdbecf1d03ce5e6125c067733c0d51de209c' | String |
refreshTokenExpiresAt | 'YYYY-mm-ddTHH:MM:ssZ' | String |
fcmToken | eg. 'cMctpybZfwk:APA9arnIbla0UDSDGs_w7buoP2apxFIzI6YUdSFPLe2ANR-OrFiaAvJ' | String |
walletId | e.g. '6e081b82-dbed-4485-bdbc-a808ad911758' | UUID |
userId | e.g. '7e081b82-cabd-3321-aadd-b443212378bd' | UUID |
To get the response and error for these methods, use:
try {
const response = await pillarSdk.wallet.registerAuthServer({
fcmToken: 'cMctpybZfwyFTyRJBo4omxpgoF2JWf-tlJc8fB0Swrq0z7',
privateKey: '3eA19bddb978Db62344Ffba5d37Ba41C83C579173eA19bddb978Db62344Ffba5d37Ba41C83C57917',
username: 'bob123'
});
// Use successful response
} catch (e) {
// Handle unsuccessful response
}
IMPORTANT! All methods return promises.
pillarSdk.wallet.update(inputParams)
Updates Fcm Token in the backend.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
fcmToken | The Firebase Cloud Message Token of One Wallet. | String | |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'OK' | String |
pillarSdk.wallet.registerAuthServer(inputParams)
Register the wallet in the backend, authentication server(OAuth), create the UserProfile table, and register the wallet in BCX(Blockchain Explorer). Wallet can not be created without username.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
privateKey | Hexadecimal string and 64 characters in length. | String | Required |
fcmToken | The Firebase Cloud Message Token of One Wallet. | String | |
username | The Username of One Wallet. | String | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
accessToken | eg. 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiVlx1MDAxNcKbwoNUwoonbFPCu8KhwrYiLCJpYXQiOjE0NDQyNjI1NDMsImV4cCI6MTQ0NDI2MjU2M30.MldruS1PvZaRZIJR4legQaauQ3_DYKxxP2rFnD37Ip4' | String |
accessTokenExpiresAt | 'YYYY-mm-ddTHH:MM:ssZ' | String |
refreshToken | eg. 'fdb8fdbecf1d03ce5e6125c067733c0d51de209c' | String |
refreshTokenExpiresAt | 'YYYY-mm-ddTHH:MM:ssZ' | String |
fcmToken | eg. 'cMctpybZfwk:APA9arnIbla0UDSDGs_w7buoP2apxFIzI6YUdSFPLe2ANR-OrFiaAvJ' | String |
walletId | e.g. '6e081b82-dbed-4485-bdbc-a808ad911758' | UUID |
userId | e.g. '7e081b82-cabd-3321-aadd-b443212378bd' | UUID |
pillarSdk.wallet.registerAddress(inputParams)
Register the specified blockchain address for notifications and for BCX monitoring
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
fcmToken | The Firebase Cloud Message Token of One Wallet. | String | |
walletId | The Wallet Identifier. | UUID | Required |
blockchainAddress | The blockchain address of one wallet | String | Required |
blockchain | The blockchain environment | String |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Successfully registered address on BCX' | String |
pillarSdk.wallet.unregisterAddress(inputParams)
Unregister the specified blockchain address for notifications and for BCX monitoring
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
blockchainAddress | The blockchain address of one wallet | String | Required |
blockchain | The blockchain environment | String |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Successfully unregistered address on BCX' | String |
pillarSdk.asset.defaults(inputParams)
Returns a list of assets that are marked as default assets.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
JSON collection of objects with respective values:
Element | Description | Type |
---|---|---|
address | The Token Address | String |
decimals | The Number of Decimals | Integer |
description | The Token Description | String |
name | The Token Name | String |
symbol | The Token Ticker Symbol | String |
wallpaperUrl | One Predefined Wallpaper For Token | String |
iconUrl | The Token Icon | String |
patternUrl | The Token Icon (bigger) | String |
The Token Email | String | |
socialMedia | The token's social media. | Array |
telegram | The Token Telegram | String |
The Token Twitter | String | |
website | The Token Website | String |
whitepaper | The Token Whitepaper | String |
isDefault | isDefault Flag for Token | Boolean |
icos | Ico details of one Token. | Array |
pillarSdk.wallet.registerSmartWallet(inputParams)
Register a second wallet in the Backend and register in BCX.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
publicKey | Hexadecimal string and 64 characters in length. | String | Required |
fcmToken | The Firebase Cloud Message Token of One Wallet. | String | |
ethAddress | The ethereum Address of target user | String | Required |
Expected Output
JSON collection of objects with respective values:
Name | Output/Description | Type |
---|---|---|
result | 'success' | String |
message | 'Wallet registered successfully.' | String |
walletId | The Wallet Identifier | String |
userId | The User Identifier | Integer |
fcmToken | The Firebase Cloud Message Token of One Wallet. | String |
pillarSdk.asset.search(inputParams)
Returns a list of assets that contain the search criteria for name, token symbol, or smart contract hexadecimal address.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
query | Search Criteria | String | Required |
Expected Output
JSON collection of objects with respective values:
Element | Description | Type |
---|---|---|
address | The Token Address | String |
decimals | The Number of Decimals | Integer |
description | The Token Description | String |
name | The Token Name | String |
symbol | The Token Ticker Symbol | String |
wallpaperUrl | One Predefined Wallpaper For Token | String |
iconUrl | The Token Icon | String |
patternUrl | The Token Icon (bigger) | String |
The Token Email | String | |
socialMedia | The token's social media. | Array |
telegram | The Token Telegram | String |
The Token Twitter | String | |
website | The Token Website | String |
whitepaper | The Token Whitepaper | String |
isDefault | isDefault Flag for Token | Boolean |
icos | Ico details of one Token. | Array |
pillarSdk.asset.list(inputParams)
Returns the full list of assets.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
JSON collection of objects with respective values:
Element | Description | Type |
---|---|---|
address | The Token Address | String |
decimals | The Number of Decimals | Integer |
description | The Token Description | String |
name | The Token Name | String |
symbol | The Token Ticker Symbol | String |
wallpaperUrl | One Predefined Wallpaper For Token | String |
iconUrl | The Token Icon | String |
patternUrl | The Token Icon (bigger) | String |
The Token Email | String | |
socialMedia | The token's social media. | Array |
telegram | The Token Telegram | String |
The Token Twitter | String | |
website | The Token Website | String |
whitepaper | The Token Whitepaper | String |
isDefault | isDefault Flag for Token | Boolean |
icos | Ico details of one Token. | Array |
pillarSdk.connection.invite(inputParams)
Creates a connection invitation for a user to create a relationship with another contact.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection invitation was successfully sent' | String |
pillarSdk.connectionV2.invite(inputParams)
Creates a connection invitation for a user to create a relationship with another contact.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection invitation was successfully sent' | String |
pillarSdk.connection.accept(inputParams)
Accepts a connection invitation from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
targetUserAccessKey | Target User Access Key. | String | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection invitation accepted' | String |
pillarSdk.connectionV2.accept(inputParams)
Accepts a connection invitation from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection invitation accepted' | String |
pillarSdk.connection.reject(inputParams)
Rejects a connection invitation from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
accessKey | The Access Key. | String | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection invitation rejected' | String |
pillarSdk.connectionV2.reject(inputParams)
Rejects a connection invitation from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection invitation rejected' | String |
pillarSdk.connection.cancel(inputParams)
Cancels a connection invitation from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
accessKey | The Access Key. | String | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection canceled' | String |
pillarSdk.connectionV2.cancel(inputParams)
Cancels a connection invitation from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection canceled' | String |
pillarSdk.connection.block(inputParams)
Blocks/unblocks a connection request from another user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
accessKey | The Access Key. | String | Required |
walletId | The Wallet Identifier. | UUID | Required |
targetUserId | The Contact User Identifier. | UUID | Required |
block | True/false to block/unblock the connection. | Boolean | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection blocked/accepted' | String |
pillarSdk.connectionV2.block(inputParams)
Blocks/unblocks future communication from another contact.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
targetUserId | The Contact User Identifier. | UUID | Required |
block | True/false to block/unblock the connection. | Boolean | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection status is updated to blocked/accepted' | String |
pillarSdk.connectionV2.blacklist(inputParams)
Adds/removes a user from another user's blacklist.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
targetUserId | The Contact User Identifier. | UUID | Required |
blacklist | True/false to add/remove a user to another user's blacklist. | Boolean | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'User successfully added to blacklist.' | String |
pillarSdk.connection.mute(inputParams)
Mutes/unmutes future communication from another contact.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
accessKey | The Access Key. | String | Required |
walletId | The Wallet Identifier. | UUID | Required |
targetUserId | The Contact User Identifier. | UUID | Required |
mute | True/false to mute/unmute the connection. | Boolean | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection status is updated to muted/accepted' | String |
pillarSdk.connectionV2.mute(inputParams)
Mutes/unmutes future communication from another contact.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
targetUserId | The Contact User Identifier. | UUID | Required |
mute | True/false to mute/unmute the connection. | Boolean | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection status is updated to muted/accepted' | String |
pillarSdk.connection.disconnect(inputParams)
Disconnects a connection between two users.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
sourceUserAccessKey | Source User Access Key. | String | Required |
targetUserAccessKey | Target User Access Key. | String | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection is successfully disconnected' | String |
pillarSdk.connectionV2.disconnect(inputParams)
Disconnects a connection between two users.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
targetUserId | The Contact User Identifier. | UUID | Required |
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Connection is successfully disconnected' | String |
pillarSdk.connection.count(inputParams)
Returns the number of connections a user has
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
userId | The User Identifier | String |
currentConnectionsCount | The number of connections with sourceIdentityKey | Number |
oldConnectionsCount | The number of connections to be updated with identity keys | Number |
newReceivedConnectonsCount | The number of connections to not be updated with identity keys | Number |
pillarSdk.connection.mapIdentityKeys(inputParams)
Returns an array of user's connection mapped by identity keys
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
identityKeys | The Identity Keys of a user. | Array | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | A list of connections | Array |
pillarSdk.connection.updateIdentityKeys(inputParams)
Updates the connection's identity keys
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
connections | The Connections of a user. | Array | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | A list of connections | Array |
pillarSdk.notification.list(inputParams);
Provides a list of notifications for a specific wallet user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
fromTimestamp | Stamp of Date/Time | String (ISO 8601 timestamp format) | |
type | The notification type | String | |
fetchLatest | A flag for fetching latest notification | Boolean |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
JSON Notifications with respective values::
Name | Description | Type |
---|---|---|
type | The User Identifier. | UUID |
meta | The Sources keys support the payload | |
payload | The payload of one notification | |
createdAt | The unix timestamp of one notification |
pillarSdk.investments.icoList(inputParams);
Fetch a list of ICOs for a given user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
userId | The User's ID | String | Required |
Expected Output
Name | Description | Type |
---|---|---|
result | 'success' | String |
data | List of ICOs | [Asset] |
pillarSdk.investments.depositRequest(inputParams);
Request deposit account information/credentials from service provider.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
currency | The Currency ticker symbols | String | Required |
serviceProvider | The ICO providers | String |
Expected Output
JSON Investments with respective values::
Name | Description | Type |
---|---|---|
account | Account number | Number |
iban | International bank account number | String |
bic | A bank identifier code | String |
reference | Reference of bank transfer | String |
beneficiary | The person or entity who will receive a payment | String |
bankName | The name of the bank | String |
currency | The Currency ticker symbols | String |
pillarSdk.user.createOneTimePassword(inputParams);
Create a one-time password for email or phone store it on the user record, then send an email or sms to the wallet user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
smsNotification | Indicates if corresponds sms notification or not. If not present email notification is send | Boolean |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'One-time password sent.' | String |
userId | The User Identifier. | UUID |
pillarSdk.user.update(inputParams);
Updates data elements on a wallet user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
firstName | The User's First Name | String | Optional |
lastName | The User's Last Name | String | Optional |
country | The User's Country Or Residence | String | Optional |
state | The User's State Of Residence | String | Optional |
city | The User's City of Residence | String | Optional |
The User's Email Address | String | Optional | |
phone | The User's Phone Number | String | Optional |
tagline | The User's profile tagline | String | Optional |
taglineStatus | Whether the user has completed a tagline for their profile | Boolean | Optional |
userSearchable | Whether the user's profile is searchable in the address book | Boolean | Optional |
profileImage | The Profile Image of the user | String(Url) | Optional |
betaProgramParticipant | Flag to check if user is beta program participant | Boolean | Optional |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'User was successfully updated' | String |
JSON collection of objects with respective values:
Element | Description | Type |
---|---|---|
id | The User Identifier | UUID |
username | The Username | String |
firstName | The User's First Name | String |
lastName | The User's Last Name | String |
The User's Email Address | String | |
isEmailVerified | Flag to Determine If Email Address Is Verified | Boolean |
emailOneTimePassword | Five Digit One Time Password | String |
phone | The User's Phone | String |
isPhoneVerified | Flag to Determine If Phone Number Is Verified | String |
phoneOneTimePassword | Five Digit One Time Password | Boolean |
country | The user's country or residence | String |
state | The user's state of residence | String |
city | The user's city of residence | String |
phone | The user's phone number | String |
tagline | The user's profile tagline | String |
taglineStatus | Whether the user has completed a tagline for their profile | Boolean |
userSearchable | Whether the user's profile is searchable in the address book | Boolean |
profileImage | The profile image of the user | String(Url) |
icoService | Information related to the user's account with a service provider for ICOs. | Object |
status | The user status in the system. | String |
betaProgramParticipant | Flag to check if user is beta program participant | Boolean |
pillarSdk.user.updateNotificationPreferences(inputParams);
Update notification preferences for given user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
newOffer | Activate/Deactivate notification when user receives offers | Boolean | Optional |
newReceipt | Activate/Deactivate notification when user receives receipt | Boolean | Optional |
paymentConfirmation | Activate/Deactivate notification when payment is confirmed | Boolean | Optional |
paymentStatusUpdate | Activate/Deactivate notification whenever the status of payment changes | Boolean | Optional |
profileUpdate | Activate/Deactivate notification when user profile where updated | Boolean | Optional |
fundsDeposit | Activate/Deactivate notification when funds were deposited in user account | Boolean | Optional |
transactionEvent | Activate/Deactivate notification for user transactions | Boolean | Optional |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Notification preferences were successfully created' | String |
JSON object with respective values:
Element | Description | Type |
---|---|---|
userId | The User Identifier | UUID |
newOffer | Activate/Deactivate notification when user receives offers | Boolean |
newReceipt | Activate/Deactivate notification when user receives receipt | Boolean |
paymentConfirmation | Activate/Deactivate notification when payment is confirmed | Boolean |
paymentStatusUpdate | Activate/Deactivate notification whenever the status of payment changes | Boolean |
profileUpdate | Activate/Deactivate notification when user profile where updated | Boolean |
fundsDeposit | Activate/Deactivate notification when funds were deposited in user account | Boolean |
transactionEvent | Activate/Deactivate notification for user transactions | Boolean |
pillarSdk.user.mapContactsAddresses(inputParams);
Maps contacts smart wallet addresses for given user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
contacts | An array of contact user information object (contactId, accessKeys?, connectionKeys?) | Array | Optional |
Expected Output
JSON array with respective values:
Element | Description | Type |
---|---|---|
userId | The Contact User Identifier | UUID |
smartWallets | An array of smart wallet addresses for the contact user | Array |
pillarSdk.user.imageByUserId(inputParams);
Get user's profile image using user's ID
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
userId | The User Identifier | UUID | Required |
Expected Output
Redirects to an hosted image.
pillarSdk.user.uploadProfileImage(inputParams);
Saves or updates user's profile image.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'Profile image was successfully uploaded' | String |
profileImage | Image Url | String |
pillarSdk.user.profileImage(inputParams);
Get user's profile image.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
imageName | The User Image Identifier. | String | Required |
Expected Output
Redirects to an hosted image.
pillarSdk.user.info(inputParams);
Retrieves information on an existing wallet user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
JSON collection of objects with respective values:
Element | Description | Type |
---|---|---|
id | The User Identifier | UUID |
username | The Username | String |
firstName | The User's First Name | String |
lastName | The User's Last Name | String |
The User's Email Address | String | |
isEmailVerified | Flag to Determine If Email Address Is Verified | Boolean |
phone | The User's Phone | String |
isPhoneVerified | Flag to Determine If Phone Number Is Verified | String |
country | The user's country or residence | String |
state | The user's state of residence | String |
city | The user's city of residence | String |
The user's email address | String | |
tagline | The user's profile tagline | String |
taglineStatus | Whether the user has completed a tagline for their profile | Boolean |
userSearchable | Whether the user's profile is searchable in the address book | Boolean |
profileImage | The profile image of the user | String(Url) |
betaProgramParticipant | Flag to check if user is beta program participant | Boolean |
featureFlags | Object with features flags | Object |
pillarSdk.user.infoSmartWallet(inputParams);
Retrieve information from a user and his wallets
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
JSON collection of objects with respective values:
Element | Description | Type |
---|---|---|
user | An object with information related to the user | Object |
wallets | An array containing the user's wallets | Array |
pillarSdk.user.infoById(inputParams);
Provides the user data by the target user id and users access keys
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
userAccessKey | The current user access key | string | Required |
targetUserAccessKey | The current user access key | string | Required |
Expected Output
Name | Output | Type |
---|---|---|
ethAddress | The ethereum Address of target user | String |
id | The target user Identifier | UUID |
username | The target user Username | String |
firstName | The target user's First Name | String |
lastName | The target user's Last Name | String |
country | The target user's country or residence | String |
state | The target user's state of residence | String |
city | The target user's city of residence | String |
profileImage | The profile image of the user | String(Url) |
pillarSdk.user.search(inputParams);
Provides a list of users that contain the search criteria for first or last name, and is not the current wallet user. Also checks if the search string term is at least two characters and if the user allows their profile to be searched.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
query | The Search String | String | Required |
Expected Output
Element | Description | Type |
---|---|---|
id | The User Identifier | UUID |
username | The Username | String |
firstName | The User's First Name | String |
lastName | The User's Last Name | String |
country | The user's country or residence | String |
state | The user's state of residence | String |
city | The user's city of residence | String |
profileImage | The profile image of the user | String(Url) |
pillarSdk.user.delete(inputParams);
Removes a wallet user profile from the database.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
Name | Output | Type |
---|---|---|
result | 'success' | String |
message | 'User was successfully deleted' | String |
pillarSdk.user.deleteProfileImage(inputParams);
Removes user profile Image from the database.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The Wallet Identifier. | UUID | Required |
Expected Output
HTTP status 204: No Content
pillarSdk.user.usernameSearch(inputParams);
Retrieve the userId of an existing wallet user or return not-found. Returns an error message if the username is Inappropriate.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
username | Wallet Username | String | Required |
Expected Output
Name | Description | Type | Required |
---|---|---|---|
userId | The User Identifier | UUID | Required |
Expected Output for Inappropriate username
Name | Value |
---|---|
error | Bad Request |
message | Inappropriate username |
statusCode | 400 |
pillarSdk.user.validate(inputParams);
Retrieve the id of an validated wallet user.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
username | Wallet Username | String | One of username/blockchainAddress required |
blockchainAddress | User's blockchainAddress | String | One of username/blockchainAddress required |
Expected Output
Name | Description | Type |
---|---|---|
id | The wallet Identifier | UUID |
username | The Username | String |
walletId | The wallet Identifier | UUID |
pillarSdk.userV2.validate(inputParams, privateKey);
Validates a blockchain address, and returns user and wallet information
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
publicKey | Wallet's publicKey | String | required |
blockchainAddress | User's blockchainAddress | String | required |
privateKey | Wallet's privateKey | String | required |
Expected Output
Name | Description | Type |
---|---|---|
username | The Username | String |
walletId | The wallet Identifier | UUID |
profileImage | User's profile image | String |
pillarSdk.user.validateEmail(inputParams);
Validate a one-time password sent via email.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The wallet Identifier | UUID | Required |
oneTimePassword | User's one time password | String | Required |
Expected Output
Name | Description | Type |
---|---|---|
result | 'success' | String |
message | 'Email validated.' | String |
userId | The user Identifier | UUID |
pillarSdk.user.validatePhone(inputParams);
Validate a one-time password sent via SMS.
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The wallet Identifier | UUID | Required |
oneTimePassword | User's one time password | String | Required |
Expected Output
Name | Description | Type |
---|---|---|
result | 'success' | String |
message | 'Phone validated.' | String |
userId | The user Identifier | UUID |
pillarSdk.user.supportHmac(inputParams);
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
project | Identifies the app project, "android" or ios" | String | Required |
Expected Output
Name | Description | Type |
---|---|---|
status | 'success' | String |
hmac | HMAC for Intercom' | String |
pillarSdk.referral.list(inputParams);
Returns a list of referral invitations
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The wallet Identifier | UUID | Required |
Expected Output
Name | Description | Type |
---|---|---|
result | 'success' | String |
data | List of Referral Invitations | Array |
pillarSdk.referral.sendInvitation(inputParams);
Sends an invitation through Email or SMS
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The wallet Identifier | UUID | Required |
referralLink | The Branch.io link to invite the user | String | Required |
The user's email address to send the invitation | String | Optional | |
phone | The user's phone to send the invitation | String | Optional |
Expected Output
Name | Description | Type |
---|---|---|
result | 'success' | String |
message | 'Invitation sent' | String |
reward | Object with token and amount | Object |
pillarSdk.referral.generateToken(inputParams);
Generates a referral token invitation
Input Parameters
Name | Description | Type | Required |
---|---|---|---|
walletId | The wallet Identifier | UUID | Required |
Expected Output
Name | Description | Type |
---|---|---|
result | 'success' | String |
token | 'Generated Token' | String |
Name | Description | Type |
---|---|---|
id | Asset ID | UUID |
name | Asset name | String |
symbol | Asset symbol | String |
address | Ethereum address of the Asset | String |
decimals | The number of decimals of the Asset | Number |
description | Asset description | String |
wallpaperUrl | Asset wallpaper URL | String (URL) |
iconUrl | Icon URL | String (URL) |
Contact email address for Asset | String (Email) | |
socialMedia | A list of social media services | [SocialMedia] |
website | Website address of Asset | String (URL) |
whitepaper | Asset whitepaper | String (URL) |
isDefault | Default token ??? | Boolean |
icos | List of ICO phases | [ICO] |
Name | Description | Type |
---|---|---|
service | The social network service | String |
username | The social network account | String |
Name | Description | Type |
---|---|---|
icoStatus | 'PENING', 'ACTIVE', 'CLOSED' | String |
icoPhase | The phase of the ICO | String |
icoAddress | The smart contract address of the ICO | String |
minimumContribution | The minimum contribution in the base currency needed to invest in the ICO | Number |
maximumContribution | The maximum contribution in the base currency allowed to invest in the ICO | Number |
baseCurrency | The currency of the ICO | String |
unitPrice | The price per unit in the base currency | Number |
totalSupply | The total number of units available | Number |
totalLocked | The total number of units reserved and purchased | Number |
supportedCurrencies | A comma separated list of accepted currencies | String |
icoStartingBlockNumber | The ICO's starting block number | Number |
plannedOpeningDate | The planned opening date of the ICO | Date |
icoEndingBlockNumber | The ICO's ending block number | Number |
plannedClosingDate | The planned closing date of the ICO | Date |
nationalityRestriction | Indicates if there's a nationality restriction | Boolean |
nivauraProjectId | The ICO ID in the ICO Service | Number |
links | ICO related links | [ICOLink] |
Name | Description | Type |
---|---|---|
name | The name of the resource, i.e. Whitepaper | String |
url | The link to the resource | String (URL) |
Run the test:
npm test
or:
jest
We use the TSLint Config Airbnb Style Guide.
We use Swagger for versioning.
This project is licensed under the MIT license.
We use the Pillar Authentication SDK to create signatures.