🔎Make request

Encode parameters and then make the request

Encode x-api-key and collection-address

const { encode } = require ('@api3/airnode-abi');
const { decode } = require ('@api3/airnode-abi');

// Add your parameters here, then copy the encoded data to be used as parameters in the makeRequest function.
const params = [
    { type: 'string', name: 'collectionAddressParam', value: '0xed5af388653567af2f388e6224dc7c4b3241c544' }
];

const encodedData = encode(params);
const decodedData = decode(encodedData);

console.log(encodedData);
console.log(decodedData);

Run:

node .\src\encodeParams.js

Copy the printed encoded data for later

Run makeRequest() with values:

  • address airnode:

    0xcc217DD6ADe5cd0651E97Ac134900F1F703c036a
  • bytes32 endpointId:

    0xde4be5f377075b6f728c45157bde6fc85fcdd30fb3f36d0c9a888ced2193a62a
  • address sponsor: The deployed contract address

  • address sponsorWallet: The derived sponsorWallet from the API3 admin-cli

  • bytes parameters: The encoded data generated previously

Last updated