Sending & Receiving
8

Goal

You may want to send tokens to users, request for them to send you tokens, or even request for them to send each other tokens.

This can all be achieved using one simple query.

Process

Enjin API provides a query that allows you to send unlimited Fungible and up to 100 Non-Fungible tokens to up to 100 users, with one single transaction.

Step 1

You can use Enjin’s advanced send query to send tokens from you to your players, from your players to you, or from your players to each other.

GraphQL
mutation advancedSendAll {
CreateEnjinRequest(
 identityId:<Identity ID>
 type: ADVANCED_SEND
 advanced_send_token_data: {
 transfers:
[
{ token_id: "<TokenID>" to: "<Recipient Ethereum Address>" value: "<Amountof tokens to send>" }{ token_id: "<TokenID>" to: "<Recipient Ethereum Address>" value: "<Amountof tokens to send>" }
 ]
 }
) {
 id
 encodedData
 transactionId
 }
}
Step 2

If you want to check the status of the send transaction, so you can find out when it's complete, you can use the following query.

GraphQL
query ViewTransactionData{
EnjinTransactions(
 id: <TransactionID>,
 ) {
 id
 transactionId
 type
 recipientAddress
 createdAt
 }
}
Automatically Signing Transactions

Many of these steps involve creating blockchain transactions that need to be signed via your Enjin Wallet.  

We have created a Wallet Daemon that can sign these transactions automatically.

Here are the instructions on how to use it.

IMPORTANT: Please be aware that using a wallet daemon will mean that ANY transaction that is generated via your App Secret will be signed automatically. Please ensure there is no way for any unauthorized party to access your App Secret and process unapproved transactions.

Previous
next
On This Page