question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed: Error: Insufficient balance. You may need to wrap Ether.

See original GitHub issue

Hey,

I’m trying to implement the SDK for a custom implementation but when I try to add a bid to an asset using createBuyOrder I get this message:

Failed: Error: Insufficient balance. You may need to wrap Ether.

I definitely have enough ETH and WETH in my wallet to make the transaction. Is there something i’m missing here?

Just following the documentation. This is the sample of my call:

      const buyOrder = await seaport.createBuyOrder({
        asset: {
          tokenId: asset.tokenId,
          tokenAddress: asset.tokenAddress,
          schemaName: asset.schemaName
        },
        startAmount: 0.51,
        accountAddress: accountAddress[0],
      });

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

3reactions
eltywebcommented, Jun 27, 2021

Hi @botoxparty, I fixed this error by giving the token contract address to the createBuyOrder method.

if (process.env.NODE_ENV === 'production') {
  const address = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; // WETH contract address on mainnet
} else {
  const address = '0xc778417e063141139fce010982780140aa0cd5ab'; // WETH contract address on rinkeby
}

const buyOrder = await seaport.createBuyOrder({
  asset: {
    tokenId: asset.tokenId,
    tokenAddress: asset.tokenAddress,
    schemaName: asset.schemaName
  },
  startAmount: 0.51,
  accountAddress: accountAddress[0],
  paymentTokenAddress: address
});

You can also retrieve available paymentTokenAddress with const tokens = (await seaport.api.getPaymentTokens()).tokens;

getPaymentTokens() allows you to filter the response with a query parameter const tokens = (await seaport.api.getPaymentTokens({ symbol: 'WETH' })).tokens;

I hope this will help you !

2reactions
tanmaykk9commented, Oct 29, 2021

Getting the same error

Hi @botoxparty, I fixed this error by giving the token contract address to the createBuyOrder method.

if (process.env.NODE_ENV === 'production') {
  const address = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; // WETH contract address on mainnet
} else {
  const address = '0xc778417e063141139fce010982780140aa0cd5ab'; // WETH contract address on rinkeby
}

const buyOrder = await seaport.createBuyOrder({
  asset: {
    tokenId: asset.tokenId,
    tokenAddress: asset.tokenAddress,
    schemaName: asset.schemaName
  },
  startAmount: 0.51,
  accountAddress: accountAddress[0],
  paymentTokenAddress: address
});

You can also retrieve available paymentTokenAddress with const tokens = (await seaport.api.getPaymentTokens()).tokens;

getPaymentTokens() allows you to filter the response with a query parameter const tokens = (await seaport.api.getPaymentTokens({ symbol: 'WETH' })).tokens;

I hope this will help you !

Getting the same error even after performing these steps. Any solution for the above problem ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insufficient balance. You may need to wrap Ether. - Reddit
I'm trying to bid on an asset. I've 2 Eths in my MetaMask account. but still I'm getting an error: Insufficient balance. You...
Read more >
How to fix "insufficient funds" error or greyed-out confirm button
How can I fix it? You can remedy this by sending some of the necessary native token to that account in order to...
Read more >
Why is there a problem of insufficient funds in Opensea?
I have currently 0.02959 Eth in my account but when I try to pay the gas fee, there is always insufficient funds problem....
Read more >
Update about the error message “Insufficient Balance” in ...
Solution: To make this clear within our wallet, we have separated balances as awaited (under transaction) and available balance (on the chain). 2....
Read more >
Insufficient funds for gas*price+value error - Stack Overflow
If you are a contract creator, the node operator you are trying to hit may have insufficient ETH in their address, or your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found