Wallet
With the Pakt SDK, Chainsite builders can establish user wallet features such as:
Last updated
With the Pakt SDK, Chainsite builders can establish user wallet features such as:
Last updated
With the PAKT SDK, users can fetch the prices of cryptocurrencies, at market prices. The authenticated user jwt token is required to execute this feature.
This feature returns the IWalletExchangeDto.
avax
The market price for the AVALANCHE cryptocurrency, $avax is returned
number
Here is an example depicting the call:
The PAKT SDK allows the retrieval of transaction records, paginated, for the authenticated user jwt token.
This call returns the FindTransactionsDto for a successful request.
page
The current page, list of transaction records
number
pages
The total pages of transaction records
number
total
The complete number of transaction records for the authenticated user
number
limit
The total transaction records for the page. Defaults to 12.
number
transactions
The array list of transactions records with the model ITransactionDto
Array
The ITransactionDto is the model that contains a record detailing information about a transaction.
_id
The identification for the transaction record.
string
false
owner
Details of the authenticated user that initiated the transaction. This field returns as a string or as the details of the user
string | WalletUser
false
amount
The measure of cryptocurrency that was enacted
number
false
sender
User details of the orginator of the tranasction. For withdrawals, this fields will not be returned
string
true
reciever
User details of the beneficiary of the transaction. For withdrawals, this fields will not be returned
string
true
currency
The medium, symbol of the transaction.
string
false
usdValue
The USD value of the transaction
number
false
description
Written account of the transaction
string
false
tx
Transaction block information
string
true
type
The categorization of the type of transaction
ITransactionType
false
hash
The transaction hash
string
false
method
The categorization of the method of transaction
ITransactionType
false
status
The status of the tranaction
ITransactionStatus
false
The user profile of the transaction.
_id
The identification of the user
string
firstName
The firstName of the user
string
lastName
The lasttName of the user
string
type
Categorization of the user
recipient | creator
profile.talent.tags
Array of labels for the user
string[]
profile.talent.tagsIds
Array of tags information
Record<string, any>[]
profile.talent.availability
Identifier for the user accessibility
AWAY, OFFLINE, ONLINE
The type of transaction helps to understand the description of the event that occurred.
sent
Value transferred from the initator to the beneficiary
deposit
Value moved into a user's wallet for an event
withdrawal
Value taken out of the user's wallet
recieved
Value transferred into the authenticated user's wallet
escrow
Value received into an escrow account to ensure transparency between actors.
job-payout
Value transferred to the recipient; a type of user, after the completion of a task or event
fee-payout
Value transferred to the designated chainsite wallet address in accordance with the chainsite settings or policy.
status refers to the classification of the process of the transaction.
pending
Transaction is yet to be executed
processing
Transaction is in the pipeline and is being executed
completed
Transaction is concluded and is successful, with the receipt or hash available
failed
Transaction was executed and response returned with error
Here is an example detailing the implementation of getting transactions for an authenticated user.
To get the transaction details of a transaction, the id, as well as the authenticated user jwt token, is required.
Upon successful response, returns the ITransactionDto object.
Here is an example:
With the SDK, an authenticated user can retrieve transaction statistics for an authenticated user, filterable with the following query.
format
Format refers to the timeframe in which the statistics are provided. Formats are weekly, monthly and yearly as ITransactionStatsFormat.
ITransactionStatsFormat
This feature returns an array of ITransactionStatsDto.
weekly
Statistics are fetched over a 7-day period
monthly
Statistics are fetched over a 30-day period
yearly
Statistics are fetched over a 12-month period
_id
Identification for the stats
number
count
Value calculated
number
With the SDK, aggregate transaction statistics can be retrieved for transactions with status marked as completed.
This feature returns an array of AggTxns.
type
The type of transaction helps to understand the description of the event that occurred. See ITransactionType
string
amount
Value that was transferred
number
date
The timestamp for the transaction
string
Here is an example, implementing the feature
Models for Wallet & Transaction are typed like so:
When an account is registered, wallets are auto-generated for cryptocurrencies supported. Currently, PAKT supports AVAX & Circle's USDC.
Wallets generated for an authenticated user can be retrieved.
This feature, upon success, returns an array of IWalletDto
_id
Identification of the wallet record
string
amount
Value held by the wallet
number
usdValue
USD worth held in the wallet
number
coin
The currency of the wallet
string
Here is an example function implementing how to get a list of wallets for an authenticated user.
Get a single wallet details for an authenticated user.
The feature returns IWalletDto, upon success.
Here is an example function showcasing how to implement the function