Web SDK
  • Home
  • Overview
  • Getting started
  • References
    • Authentication
    • Account
      • Users
    • Notifications
    • Bookmark
    • 2FA
    • Collection
    • Connection filters
    • Feed
    • File Upload
    • Invite
    • Messaging
    • Payment
    • Reviews
    • Search
    • Verification
      • Supported document type
      • List of expected ISO countries
    • Wallet
      • Withdrawal
  • Tutorial
  • Web API
Powered by GitBook
On this page
  • Create order
  • IPaymentCoins
  • IPaymentDataDto
  • Validate payment
  • IValidatePaymentDto
  • Release payment
  • IReleasePaymentDto
  • Fetch payment methods
  • IBlockchainCoinDto
  • Fetch RPCs
  1. References

Payment

This section is dedicated to the generation & management of escrow wallet for a collection.

PreviousMessagingNextReviews

Last updated 11 months ago

Collections are designed to be extensible, accommodating the setup of an escrow wallet. This flexibility means that not every collection necessarily requires an escrow wallet.

However, for scenarios where business logic mandates the use of a wallet, this section details each service that facilitates escrow management.

An escrow can be initiated as a one-time action for a collection, enabling the collection of funds. These deposits can subsequently undergo validation on-chain to confirm the receipt of funds.

Once the objectives of the collection or business logic are met, the funds can be disbursed to the recipients of the collection.

The following services are available:

Create order

To generate an escrow wallet, ICreatePaymentDto is needed.

The authorization jwt token is required for this operation.

ICreatePaymentDto

Field
Description
Type

coin

The crypto currency which the funds will be deposit.

see IPaymentCoins

collection

Identifier for the collection record for which the escrow wallet is being generated

string

IPaymentCoins

The accepted cryptocurrency for which payment can be made and therefore, escrow wallets can be generated.

Field

usdc

avax

See sample implementation:

 const resp: ResponseDto<IPaymentDataDto> = await init.payment.create(
   authToken,
   payload
 );

Upon success, the IPaymentDataDto is returned.

IPaymentDataDto

Field
Description
Type

coin

The cryptocurrency the funds are to be transacted

string

address

The address of the escrow

string

collectionAmount

The amount assigned to collection by the creator

string

collectionAmountCoin

The amount when converted by the rate for the coin

string

expectedFee

The fee to be paid

string

amountToPay

The total sum to be deposited, fee inclusive

string

usdFee

The business fee to be paid to the chainsite owner, based on the initial amount set

string

usdAmount

Amount to be paid inclusive of the business fee set by the chainsite owner

string

feePercentage

The chainsite owner fee, in percentage

number

rate

The exchange rate of the coin

number

chainId

The rpc chain id for the coin

string

Validate payment

When funds are transferred to the escrow wallet, this service is used to validate that the amount for that collection is confirmed.

The authorization jwt token is required for this operation.

The IValidatePaymentDto is required as the payload for this operation.

IValidatePaymentDto

Field
Description
Type

collection

Identifier for the collection record

string

See sample implementation:

 const resp: ResponseDto<{}> = await init.payment.validate(
   authToken,
   payload
  );

Release payment

When the objectives of the collection have been met, payment is released to the recipient of the collection.

The authorization jwt token is required for this operation.

IReleasePaymentDto is the payload to execute this service.

IReleasePaymentDto

Field
Description
Type

collection

Identifier for the collection record

string

amount

The funds to be released to the recipient

number

See sample implementation:

 const resp: ResponseDto<{}> = await init.payment.release(
  authToken,
  payload
 );

Fetch payment methods

Retrieve active payment methods.

The authorization jwt token is required for this operation.

See sample implementation:

const resp: ResponseDto<IBlockchainCoinDto[]> =
      await init.payment.paymentMethods(authToken);

An array of IBlockchainCoinDto is returned, upon success.

IBlockchainCoinDto

Field
Description

name

The appellation for the crypto currency

symbol

The crypto currency ticker name

icon

Active link to the graphic of the crypto currency

contractAddress

The address that locates the deployed contract for the coin

decimal

The number of decimals for the coin

rpcChainId

The identifier for the network on the chain

isToken

Identifier to determine whether the coin is a token or a native coin

active

Identifer to determine whether the rpc is actively in use.

Fetch RPCs

Retrieve the rpc that is currently active.

The authorization jwt token is required for this operation.

See sample implementation:

const resp: ResponseDto<IRPCDto> = await init.payment.activeRpc(authToken);

Upon success, IRPCDto is returned.

IRPCDto

Field
Description

rpcName

The name of the RPC

rpcChainId

Identifier for the rpc on-chain

rpcUrls

The remote access link to the rpc

blockExplorerUrls

Link to the explorer to get transaction information, contract address information etc

rpcNativeCurrency

The native crypto currency object information for the RPC

rpcNativeCurrency.name

The name of the native crypto currency

rpcNativeCurrency.symbol

The ticker name for the native crypto currency

rpcNativeCurrency.decimals

The number of decimals for the crypto currency

active

Identifier to determine whether the rpc is active

Create order
Validate payment
Release payment
Fetch payment methods
Fetch active RPC.