fork download
  1. const addresses = [
  2. {
  3. "chainIndex":"1",
  4. "address":"TFDP81HHVTdvaDFapWhsWPt53a4Y6Kk78Z",
  5. },
  6. {
  7. "chainIndex":"10",
  8. "address":"TFDP81HHVTdvaDFapWhsWPt53a4Y6Kk78Z",
  9. }
  10. ];
  11.  
  12. const getCreateWalletAccountBody = {
  13. addresses: addresses
  14. };
  15.  
  16. // Define the helper function
  17. const getCreateWalletAccountData = async () => {
  18. const apiRequestUrl = getRequestUrl(
  19. apiBaseUrl,
  20. '/api/v5/wallet/account/create-wallet-account'
  21. );
  22. return fetch(apiRequestUrl, {
  23. method: 'post',
  24. headers: headersParams,
  25. body: JSON.stringify(getCreateWalletAccountBody),
  26. })
  27. .then((res) => res.json())
  28. .then((res) => {
  29. return res;
  30. });
  31. };
  32.  
  33. const { data: createWalletAccountData } = await getCreateWalletAccountData();
  34.  
  35. <hr/>
Success #stdin #stdout 0.03s 25880KB
stdin
Standard input is empty
stdout
const addresses = [
    {
      "chainIndex":"1",
      "address":"TFDP81HHVTdvaDFapWhsWPt53a4Y6Kk78Z",
    },
    {
      "chainIndex":"10",
      "address":"TFDP81HHVTdvaDFapWhsWPt53a4Y6Kk78Z",
    }
];

const getCreateWalletAccountBody = {
    addresses: addresses
};

// Define the helper function
const getCreateWalletAccountData = async () => {
    const apiRequestUrl = getRequestUrl(
        apiBaseUrl,
        '/api/v5/wallet/account/create-wallet-account'
    );
    return fetch(apiRequestUrl, {
        method: 'post',
        headers: headersParams,
        body: JSON.stringify(getCreateWalletAccountBody),
    })
    .then((res) => res.json())
    .then((res) => {
        return res;
    });
  };

const { data: createWalletAccountData } = await getCreateWalletAccountData();

<hr/>