Polygon (Matic) is an Ethereum EVM 100% compatible blockchain, and is very good for decentralized application (Dapp) development within many possible verticals including DeFi, NFT, Gaming, and many others.
Tatum supports 2 chains:
Tatum supports BIP44 HD wallets. It is very convenient and secure, since it can generate 2^31 addresses from 1 mnemonic phrase. Mnemonic phrase consists of 24 special words in defined order and can restore access to all generated addresses and private keys.
Each address is identified by 3 main values:
Tatum follows BIP44 specification and generates for Polygon wallet with derivation path m'/44'/966'/0'/0. More about BIP44 HD wallets can be found here - https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki. Generate BIP44 compatible Polygon wallet.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/wallet?mnemonic=string' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse",
- "xpub": "xpub6EsCk1uU6cJzqvP9CdsTiJwT2rF748YkPnhv5Qo8q44DG7nn2vbyt48YRsNSUYS44jFCW9gwvD9kLQu9AuqXpTpM1c5hgg9PsuBLdeNncid"
}
Generate Polygon account deposit address from Extended public key. Deposit address is generated for the specific index - each extended public key can generate up to 2^31 addresses starting from index 0 until 2^31.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/address/{xpub}/{index}' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "address": "0xa7673161CbfE0116A4De9E341f8465940c2211d4"
}
Generate private key of address from mnemonic for given derivation path index. Private key is generated for the specific index - each mnemonic can generate up to 2^31 private keys starting from index 0 until 2^31.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
{- "index": 0,
- "mnemonic": "urge pulp usage sister evidence arrest palm math please chief egg abuse"
}
{- "key": "cTmS2jBWXgFaXZ2xG9jhn67TiyTshnMp3UedamzEhGm6BZV1vLgQ"
}
2 credits per API call
This endpoint is deprecated. Use the HTTP-based JSON RPC driver instead.
Use this endpoint URL as a http-based web3 driver to connect directly to the Polygon node provided by Tatum. To learn more about Polygon Web3, visit the Polygon developer's guide.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
{- "jsonrpc": "2.0",
- "method": "web3_clientVersion",
- "params": [ ],
- "id": 2
}
{- "jsonrpc": "2.0",
- "id": 2,
- "result": "Geth/v1.9.9-omnibus-e320ae4c-20191206/linux-amd64/go1.13.4"
}
Get Polygon current block number. This is the number of the latest block in the blockchain.
OK
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ https://api-eu1.tatum.io/v3/polygon/block/current \ -H 'x-api-key: YOUR_API_KEY_HERE'
6491272
Get Polygon block by block hash or block number.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/block/{hash}' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "difficulty": "3296820833",
- "extraData": "0x",
- "gasLimit": 8000000,
- "gasUsed": 7985124,
- "hash": "0x5d40698ee1b1ec589035f2a39c6162287e9056868cc79d66cfb248ba9f66c3fc",
- "logsBloom": "0x042080004210492080800001610060ad9600005bc81502020800000043e302020381a404000100409102040240300641108004000400007000008000c049558055a800000a0001800748900806502004200400108205005418c0218802281a0408060000533210462021050470810a010140102809011814018281115020090201068401847000a04010000c00084062000485640d00020220181150020008589105a41c0880001112034100010882545410240011402a3480050104004c310204000002009490d0012022a040c20c20011020401020140250805100410060008280200008181a220114102800001648640828200c00a94c1003a2060e001000",
- "miner": "0xD8869d9E3d497323561Fbca2319a9FC3F6f10c4B",
- "mixHash": "0x7a44a1f56f12ae825fdc04550d7c3af2344daab987691771c06235f25fafcaa6",
- "nonce": "0xfa1692f52a7ac672",
- "number": 6470657,
- "parentHash": "0xd34aab8a455027086ac54034e68608c84d984401a883b7b5d91f9ae0bbefda15",
- "receiptsRoot": "0x4a496b6b7f2a1c5850bf9eebbea7193807be0067b1c06f17b9dde4eef7b2f960",
- "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
- "size": 15296,
- "stateRoot": "0x32757c92f10c6c5a106c6fb4b9ca3ff301e413a59ca3d0513b4bf98c72efddba",
- "timestamp": 1569600592,
- "totalDifficulty": "23329673338013873",
- "transactions": [
- {
- "blockHash": "0xcf2c40f475e78c7c19778e1ae999a0e371c9319b38182ea15dc94536f13f9137",
- "status": true,
- "blockNumber": 6470854,
- "from": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "gas": 21000,
- "gasPrice": "1000000000",
- "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7",
- "input": "0x",
- "nonce": 26836405,
- "to": "0xbC546fa1716Ed886967cf73f40e8F2F5e623a92d",
- "transactionIndex": 3,
- "value": "1000000000000000000",
- "gasUsed": 21000,
- "cumulativeGasUsed": 314159,
- "contractAddress": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "logs": [
- {
- "address": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "topics": [
- "0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"
], - "data": "string",
- "logIndex": 0,
- "transactionIndex": 0,
- "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7"
}
]
}
], - "transactionsRoot": "0x5990081ef8515d561b50255af03c5d505f7725ddef27405dc67d23bfd0f47704"
}
Get Polygon account balance in MATIC. This method does not prints any balance of the ERC20 or ERC721 tokens on the account.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/account/balance/{address}' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "balance": "10.52"
}
Get Polygon transaction by transaction hash.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/transaction/{hash}' \ -H 'x-api-key: YOUR_API_KEY_HERE'
{- "blockHash": "0xcf2c40f475e78c7c19778e1ae999a0e371c9319b38182ea15dc94536f13f9137",
- "status": true,
- "blockNumber": 6470854,
- "from": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "gas": 21000,
- "gasPrice": "1000000000",
- "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7",
- "input": "0x",
- "nonce": 26836405,
- "to": "0xbC546fa1716Ed886967cf73f40e8F2F5e623a92d",
- "transactionIndex": 3,
- "value": "1000000000000000000",
- "gasUsed": 21000,
- "cumulativeGasUsed": 314159,
- "contractAddress": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "logs": [
- {
- "address": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "topics": [
- "0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"
], - "data": "string",
- "logIndex": 0,
- "blockNumber": 6470854,
- "blockHash": "0x5d40698ee1b1ec589035f2a39c6162287e9056868cc79d66cfb248ba9f66c3fc",
- "transactionIndex": 0,
- "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7"
}
]
}
Get Polygon transactions by address. This includes incoming and outgoing transactions for the address.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/account/transaction/{address}?pageSize=10&offset=0&from=1087623&to=1087823&sort=ASC' \ -H 'x-api-key: YOUR_API_KEY_HERE'
[- {
- "blockHash": "0xcf2c40f475e78c7c19778e1ae999a0e371c9319b38182ea15dc94536f13f9137",
- "status": true,
- "blockNumber": 6470854,
- "from": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "gas": 21000,
- "gasPrice": "1000000000",
- "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7",
- "input": "0x",
- "nonce": 26836405,
- "to": "0xbC546fa1716Ed886967cf73f40e8F2F5e623a92d",
- "transactionIndex": 3,
- "value": "1000000000000000000",
- "gasUsed": 21000,
- "cumulativeGasUsed": 314159,
- "contractAddress": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "logs": [
- {
- "address": "0x81b7E08F65Bdf5648606c89998A9CC8164397647",
- "topics": [
- "0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"
], - "data": "string",
- "logIndex": 0,
- "blockNumber": 6470854,
- "blockHash": "0x5d40698ee1b1ec589035f2a39c6162287e9056868cc79d66cfb248ba9f66c3fc",
- "transactionIndex": 0,
- "transactionHash": "0xe6e7340394958674cdf8606936d292f565e4ecc476aaa8b258ec8a141f7c75d7"
}
]
}
]
Get a number of outgoing Polygon transactions for the address. When a transaction is sent, there can be multiple outgoing transactions, which are not yet processed by the blockchain. To distinguish between them, there is a counter called a nonce, which represents the order of the transaction in the list of outgoing transactions.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Internal server error. There was an error on the server during the processing of the request.
curl -i -X GET \ 'https://api-eu1.tatum.io/v3/polygon/transaction/count/{address}' \ -H 'x-api-key: YOUR_API_KEY_HERE'
5
Send MATIC from account to account.
This operation needs the private key of the blockchain address. Every time the funds are transferred, the transaction must be signed with the corresponding private key.
No one should ever send it's own private keys to the internet because there is a strong possibility of stealing keys and loss of funds. In this method, it is possible to enter privateKey
or signatureId. PrivateKey should be used only for quick development on testnet versions of blockchain when there is no risk of losing funds. In production,
Tatum KMS should be used for the highest security standards, and signatureId should be present in the request.
Alternatively, using the Tatum client library for supported languages.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.
Internal server error. There was an error on the server during the processing of the request.
{- "data": "My note to recipient.",
- "nonce": 0,
- "to": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
- "currency": "MATIC",
- "fee": {
- "gasLimit": "40000",
- "gasPrice": "20"
}, - "amount": "100000",
- "fromPrivateKey": "0x05e150c73f1920ec14caa1e0b6aa09940899678051a78542840c2668ce5080c2"
}
{- "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9",
- "failed": false
}
Invoke any method on an existing Smart Contract. It is possible to call read or write method on the Smart Contract defined via contractAddress.
For read operations, data is returned, for write operations, transaction Id of the associated transaction is returned.
This operation needs the private key of the blockchain address. Every time the funds are transferred, the transaction must be signed with the corresponding private key.
No one should ever send it's own private keys to the internet because there is a strong possibility of stealing keys and loss of funds. In this method, it is possible to enter privateKey
or signatureId. PrivateKey should be used only for quick development on testnet versions of blockchain when there is no risk of losing funds. In production,
Tatum KMS should be used for the highest security standards, and signatureId should be present in the request.
Alternatively, using the Tatum client library for supported languages.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.
Internal server error. There was an error on the server during the processing of the request.
{- "contractAddress": "0x687422eEA2cB73B5d3e242bA5456b782919AFc85",
- "methodName": "transfer",
- "methodABI": {
- "inputs": [
- {
- "internalType": "uint256",
- "name": "amount",
- "type": "uint256"
}
], - "name": "stake",
- "outputs": [ ],
- "stateMutability": "nonpayable",
- "type": "function"
}, - "params": [
- "0x632"
]
}
{- "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9",
- "failed": false
}
Broadcast signed transaction to Polygon blockchain. This method is used internally from Tatum KMS or Tatum client libraries. It is possible to create custom signing mechanism and use this method only for broadcasting data to the blockchian.
OK
Bad Request. Validation failed for the given object in the HTTP Body or Request parameters.
Unauthorized. Not valid or inactive subscription key present in the HTTP Header.
Forbidden. The request is authenticated, but it is not possible to required perform operation due to logical error or invalid permissions.
Internal server error. There was an error on the server during the processing of the request.
{- "txData": "62BD544D1B9031EFC330A3E855CC3A0D51CA5131455C1AB3BCAC6D243F65460D",
- "signatureId": "1f7f7c0c-3906-4aa1-9dfe-4b67c43918f6"
}
{- "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9",
- "failed": false
}