Skip to content

[bug] Polymath.getSecurityTokens() throws an exception #61

@remon-nashid

Description

@remon-nashid

Sample code

  const networkConfigs = {
    1: {
      polymathRegistryAddress: '0x240f9f86b1465bf1b8eb29bc88cbf65573dfdd97'
    },
    42: {
      polymathRegistryAddress: '0x5b215a7d39ee305ad28da29bf2f0425c6c2a00b3'
    },
  };
  const networkId = await browserUtils.getNetworkId();
  const currentWallet = await browserUtils.getCurrentAddress();
  console.log(currentWallet); // 0x33A2CFF8182d82AF69EbFC5d3eDF8F699555f146
  const config = networkConfigs[networkId];
  const polyClient = new Polymath();
  await polyClient.connect(config);
  const tokens = await polyClient.getSecurityTokens({owner: currentWallet});

Throws the following exception

App.js:75 Uncaught (in promise) Error: There is no Security Token with symbol 0x6fe06a0f25e4509501e80877cba89c7d7feedbc0
    at Polymath.<anonymous> (http://localhost:3000/static/js/0.chunk.js:241126:15)
    at Generator.throw (<anonymous>)
    at rejected (http://localhost:3000/static/js/0.chunk.js:240886:32)
From previous event:
    at Polymath.<anonymous> (http://localhost:3000/static/js/0.chunk.js:241097:33)
    at Generator.next (<anonymous>)
    at fulfilled (http://localhost:3000/static/js/0.chunk.js:240878:24)
PolymathError @ PolymathError.js:25
(anonymous) @ Polymath.js:257
rejected @ Polymath.js:17
async function (async)
connect @ App.js:59
(anonymous) @ App.js:117
commitHookEffectList @ react-dom.development.js:21073
commitPassiveHookEffects @ react-dom.development.js:21106
callCallback @ react-dom.development.js:363
invokeGuardedCallbackDev @ react-dom.development.js:412
invokeGuardedCallback @ react-dom.development.js:466
flushPassiveEffectsImpl @ react-dom.development.js:24196
unstable_runWithPriority @ scheduler.development.js:674
runWithPriority$2 @ react-dom.development.js:11834
flushPassiveEffects @ react-dom.development.js:24167
(anonymous) @ react-dom.development.js:23728
scheduler_flushTaskAtPriority_Normal @ scheduler.development.js:450
flushTask @ scheduler.development.js:503
flushWork @ scheduler.development.js:635
performWorkUntilDeadline @ scheduler.development.js:237

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions