Skip to content

Commit

Permalink
Merge pull request #393 from BitGo/WP-0000-fix-ADA-broadcast-script
Browse files Browse the repository at this point in the history
docs(root): fix ADA broadcast script
  • Loading branch information
alebusse committed Feb 8, 2024
2 parents de992df + e9eeade commit 1abd492
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ADA.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,22 @@ const axiosConfig = {
headers: {
'Content-Type': 'application/cbor',
},
timeout: 10000,
timeout: 50000,
};

// Mainnet = https://api.koios.rest/api/v1/submittx
// Testnet = https://preprod.koios.rest/api/v1/submittx
const url = 'https://preprod.koios.rest/api/v1/submittx';

const serializedSignedTx = '84a...5f6';
const serializedSignedTx = '84a..af6';

const bytes = Uint8Array.from(Buffer.from(serializedSignedTx, 'hex'));

try {
async function main() {
const bytes = Uint8Array.from(Buffer.from(serializedSignedTx, 'hex'));
const res = await axios.post(url, bytes, axiosConfig);
console.log(res.data);
} catch (err) {
console.log(err);
}

main().catch(console.error);
```

- Run the following command to execute the script:
Expand Down

0 comments on commit 1abd492

Please sign in to comment.