Polygon
EconomyKit is a standalone inventory and trading system that works without any external integrations. However, many games want to offer their players direct ownership of their currencies and items. Our API supports minting ERC-1155 items and sending ERC-20 tokens directly to players' wallets.
Since launching in March of 2022, our Polygon integration has processed over 1,500,000 outgoing transactions!
Without EconomyKit, you have to go through the troublesome process of:
- Importing a smart contract
- Signing up for an RPC provider
- Managing private keys
- Estimating gas
- Broadcasting transactions
- Monitoring for failed mined transactions
- Adjusting gas prices for stuck gas prices
- Ensuring nonces are syncronized if the same wallet is used in parallel
Our Polygon blockchain integration handles all these problems! Just send one POST request and you're guaranteed your transaction goes through; you also get observability through our dashboard.
Creating and funding a wallet
You can create a new wallet at https://app.economykit.com/hotwallet/wallets/. After you've created your wallet, fund it with MATIC (for gas) and WRLD ERC-20 tokens. WRLD is the only token currently supported. We will have support for arbitrary token contracts soon.
Send outgoing ERC-20 transactions
POST to https://app.economykit.com/hotwallet/api/v1/YourWalletAPIKeyShownAfterCreation/send_tokens
{
"network": "Polygon",
"token": "POLYGON_WRLD",
"recipient_address": "0xeaab5d31fe27774e28fdecdea16d9f2164cbb69",
"amount": 1
}
Example response:
{
"sending_address": "0xb0395ad3494a0f00653a5719baedefea667b6c97",
"recipient_address": "0xeaab5d31fe27774e28fedecdea16d9f2164cbb69",
"status": "SUCCESSFULLY_QUEUED",
"outgoing_tx_id": 568652
}
The outgoing_tx_id
can be used to locate the status page for the transaction, such as: https://app.economykit.com/hotwallet/transaction/568652/
Supported networks are Polygon
(for Polygon mainnet) and Mumbai
(for Polygon testnet).
Mint ERC-1155 NFT
POST to https://app.economykit.com/hotwallet/api/v1/YourWalletAPIKeyShownAfterCreation/mint_erc1155
{
"network": "Mumbai",
"contract_address": "0xbcb36b79de16bc106363ea87f88fcf9b6e0bf54d",
"recipient_address": "0xeaab5d31fe27774e28fedecdea16d9f2164cbb69",
"data": "{\"foo\": \"bar\"}",
"id": 1
}
Example response:
{
"success": true,
"message": "NFT queued for minting.",
"outgoing_tx_id": 568639
}