Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"items must be object, received item of type: string" at whitelisting an address #3928

Open
Antuan03 opened this issue Sep 23, 2023 · 2 comments
Labels

Comments

@Antuan03
Copy link

i get: "items must be object, received item of type: string",

at sending a createPolicyRule for example:

` const wallet = await bitgo
.coin(coin)
.wallets()
.get({ id: userWallet?.wallet_id });

  const policy = {
    action: {
      type: 'getApproval',
    },
    condition: {
      add: 'address',
    },
    id: 'withdraw_policy',
    type: 'advancedWhitelist',
  };

  const result = await wallet.createPolicyRule(policy);

  console.log(result);`

that code is exactly the same as the one in the docs here

also via API it gives me 401 and I have others calls with other endpoints and the same Authorization token works

@Antuan03 Antuan03 added the bug label Sep 23, 2023
@KayBeSee
Copy link

I am getting the same error.

@KayBeSee
Copy link

I figured out why my code wasn't working.

Here is the payload I am using now:

{
  id: crypto.randomUUID(),
  type: "advancedWhitelist",
  condition: {
    add: {
      item: whitelistAddress,
      type: "address",
    },
  },
  action: {
    type: "deny",
  },
}

The add condition needs to be an object with item property and type property.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants