Marketplace has launched, further enabling blockchain developers! Learn more

Contents

avm.buildGenesis RPC method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. networkID - Int - The transaction ID. It should be in cb58 format.
  2. genesisData - JSON A JSON representing the genesis data. Example JSON.
  3. networkID - Integer - the ID of the network
  4. encoding - String - (optional) The encoding format to use. Can be either cb58 or hex. Defaults to cb58.

Returns:

  1. bytes - String - Genesis byte data
  2. encoding - String - The encoding format to use. Can be either cb58 or hex. Defaults to cb58.

Code Examples:

curl --location --request POST http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/vm/avm \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id"     : 1,
    "method" : "avm.buildGenesis",
    "params" : {
        "genesisData": {
            "asset1": {
                "name": "asset1",
                "symbol":"MFCA",
                "memo": "2Zc54v4ek37TEwu4LiV3j41PUMRd6acDDU3ZCVSxE7X",
                "denomination": 1, 
                "initialState": {
                    "fixedCap" : [
                        {
                            "amount":100000,
                            "address": "local18jma8ppw3nhx5r4ap8clazz0dps7rv5u00z96u"
                        }
                    ]
                }
            },
            "asset2": {
                "name": "asset2",
                "symbol":"MVCA",
                "memo": "2Zc54v4ek37TEwu4LiV3j41PUMRd6acDDU3ZCVSxE7X",
                "denomination": 2, 
                "initialState": {
                    "variableCap" : [
                        {
                            "amount":100000,
                            "address": "local18jma8ppw3nhx5r4ap8clazz0dps7rv5u00z96u"
                        }
                    ]
                }
            }
        },
        "networkId": 12345,
        "encoding":"cb58"
    }
}'
Ready to get started? Create a free account