construction

Derive an AccountIdentifier from a PublicKey

Method: POST

https://ada-index.nownodes.io/construction/derive

Body (raw)

{
  "network_identifier": {
    "blockchain": "cardano",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "1"
    }
  },
  "public_key": {
    "hex_bytes": "22ae46272bffe077cecc46e1494d790d4ad453ae1c4228aa0c2e9671dcb16341",
    "curve_type": "edwards25519"
  }
}

Response: 200

{
    "account_identifier": {
        "address": "addr1vxx9ztw59gzp7txrhs4z03u2sfzx8y49vxn3vchzasplx3c4frngy"
    }
}

Create a Request to Fetch Metadata

Method: POST

https://ada-index.nownodes.io/construction/preprocess

Body (raw)

{
    "network_identifier": {
        "blockchain": "cardano",
        "network": "mainnet"
    },
    "operations": [
        {
            "operation_identifier": {
                "index": 0
            },
            "type": "input",
            "status": "",
            "account": {
                "address": "addr_test1vzx9ztw59gzp7txrhs4z03u2sfzx8y49vxn3vchzasplx3cwph08p"
            },
            "amount": {
                "value": "-999968487129",
                "currency": {
                    "symbol": "ADA",
                    "decimals": 6
                }
            },
            "coin_change": {
                "coin_identifier": {
                    "identifier": "8f0e1bb31ff09a8dcc8a1b13d6ccb8f873f8d94b17bb7236c62e2d9d63d5426b:0"
                },
                "coin_action": "coin_spent"
            },
            "metadata": {
                "tokenBundle": [
                    {
                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6",
                        "tokens": [
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "31",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            },
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "32",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            }
                        ]
                    }
                ]
            }
        },
        {
            "operation_identifier": {
                "index": 1
            },
            "type": "output",
            "status": "",
            "account": {
                "address": "addr_test1vrpxrjmr5rk43ace43g2hnmxzguegns3vpqc8phx7tcu8wsgmynq6"
            },
            "amount": {
                "value": "999968106116",
                "currency": {
                    "symbol": "ADA",
                    "decimals": 6
                }
            },
            "metadata": {
                "tokenBundle": [
                    {
                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6",
                        "tokens": [
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "31",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            },
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "32",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            }
                        ]
                    }
                ]
            }
        }
    ]
}

Response: 200

{
    "options": {
        "relative_ttl": 1000,
        "transaction_size": 236
    }
}

Get Metadata for Transaction Construction

Method: POST

https://ada-index.nownodes.io/construction/metadata

Body (raw)

{
  "network_identifier": {
    "blockchain": "cardano",
    "network": "mainnet",
    "sub_network_identifier": {
      "network": "1"
    }
  },
  "public_keys": [
    {
      "hex_bytes": "string",
      "curve_type": "edwards25519"
    }
  ],
   "options": {
        "relative_ttl": 1000,
        "transaction_size": 235
    }
}

Response: 200

{
    "metadata": {
        "ttl": "117992002",
        "protocol_parameters": {
            "coinsPerUtxoSize": "4310",
            "maxTxSize": 16384,
            "maxValSize": 5000,
            "keyDeposit": "2000000",
            "maxCollateralInputs": 3,
            "minFeeCoefficient": 44,
            "minFeeConstant": 155381,
            "minPoolCost": "170000000",
            "poolDeposit": "500000000",
            "protocol": 8
        }
    },
    "suggested_fee": [
        {
            "value": "165897",
            "currency": {
                "symbol": "ADA",
                "decimals": 6
            }
        }
    ]
}

Generate an Unsigned Transaction and Signing Payloads

Method: POST

https://ada-index.nownodes.io/construction/payloads

Body (raw)

{
    "network_identifier": {
        "blockchain": "cardano",
        "network": "mainnet"
    },
    "operations": [
        {
            "operation_identifier": {
                "index": 0
            },
            "type": "input",
            "status": "",
            "account": {
                "address": "addr_test1vzx9ztw59gzp7txrhs4z03u2sfzx8y49vxn3vchzasplx3cwph08p"
            },
            "amount": {
                "value": "-999968487129",
                "currency": {
                    "symbol": "ADA",
                    "decimals": 6
                }
            },
            "coin_change": {
                "coin_identifier": {
                    "identifier": "8f0e1bb31ff09a8dcc8a1b13d6ccb8f873f8d94b17bb7236c62e2d9d63d5426b:0"
                },
                "coin_action": "coin_spent"
            },
            "metadata": {
                "tokenBundle": [
                    {
                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6",
                        "tokens": [
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "31",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            },
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "32",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            }
                        ]
                    }
                ]
            }
        },
        {
            "operation_identifier": {
                "index": 1
            },
            "type": "output",
            "status": "",
            "account": {
                "address": "addr_test1vrpxrjmr5rk43ace43g2hnmxzguegns3vpqc8phx7tcu8wsgmynq6"
            },
            "amount": {
                "value": "999968106116",
                "currency": {
                    "symbol": "ADA",
                    "decimals": 6
                }
            },
            "metadata": {
                "tokenBundle": [
                    {
                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6",
                        "tokens": [
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "31",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            },
                            {
                                "value": "1",
                                "currency": {
                                    "symbol": "32",
                                    "decimals": 0,
                                    "metadata": {
                                        "policyId": "2bbd69730ab71f9c3825aef68d01400fc7c7f8270ed34082528b17a6"
                                    }
                                }
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "metadata": {
        "ttl": "20416653"
    },
    "suggested_fee": [
        {
            "value": "165897",
            "currency": {
                "symbol": "ADA",
                "decimals": 6
            }
        }
    ],
    "metadata": {
        "ttl": "117992002",
        "protocol_parameters": {
            "coinsPerUtxoSize": "4310",
            "maxTxSize": 16384,
            "maxValSize": 5000,
            "keyDeposit": "2000000",
            "maxCollateralInputs": 3,
            "minFeeCoefficient": 44,
            "minFeeConstant": 155381,
            "minPoolCost": "170000000",
            "poolDeposit": "500000000",
            "protocol": 8
        }
    }
}

Response: 200

{
    "unsigned_transaction": "8279010a6134303038313832353832303866306531626233316666303961386463633861316231336436636362386638373366386439346231376262373233366336326532643964363364353432366230303031383138323538316436306332363163623633613065643538663731396163353061626366363631323339393434653131363034313833383665366632663163336261383231623030303030306538643262653636383461313538316332626264363937333061623731663963333832356165663638643031343030666337633766383237306564333430383235323862313761366132343133313031343133323031303231613030303564303535303331613037303836613432a16a6f7065726174696f6e7381a7746f7065726174696f6e5f6964656e746966696572a165696e64657800647479706565696e7075746673746174757360676163636f756e74a16761646472657373783f616464725f7465737431767a78397a74773539677a70377478726873347a3033753273667a783879343976786e337663687a6173706c78336377706830387066616d6f756e74a26576616c75656d2d3939393936383438373132396863757272656e6379a26673796d626f6c6341444168646563696d616c73066b636f696e5f6368616e6765a26f636f696e5f6964656e746966696572a16a6964656e7469666965727842386630653162623331666630396138646363386131623133643663636238663837336638643934623137626237323336633632653264396436336435343236623a306b636f696e5f616374696f6e6a636f696e5f7370656e74686d65746164617461a16b746f6b656e42756e646c6581a268706f6c69637949647838326262643639373330616237316639633338323561656636386430313430306663376337663832373065643334303832353238623137613666746f6b656e7382a26576616c756561316863757272656e6379a36673796d626f6c62333168646563696d616c7300686d65746164617461a168706f6c696379496478383262626436393733306162373166396333383235616566363864303134303066633763376638323730656433343038323532386231376136a26576616c756561316863757272656e6379a36673796d626f6c62333268646563696d616c7300686d65746164617461a168706f6c696379496478383262626436393733306162373166396333383235616566363864303134303066633763376638323730656433343038323532386231376136",
    "payloads": [
        {
            "account_identifier": {
                "address": "addr_test1vzx9ztw59gzp7txrhs4z03u2sfzx8y49vxn3vchzasplx3cwph08p"
            },
            "hex_bytes": "ff44ced9f6b2faaff61b9ffe523fc35444c073c1c35e947e308c4e2fe8df45cf",
            "signature_type": "ed25519"
        }
    ]
}

Last updated