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.

The method eth_sendTransaction does not exist/is not available...

See original GitHub issue

Trying to fulfill an order:

import Web3 from "web3"; import { OpenSeaPort, Network } from "opensea-js";

const provider = new Web3.providers.HttpProvider( "https://rinkeby.infura.io/v3/aRxxxxxxxxxxxxxxxxxx" );

const seaport = new OpenSeaPort(provider, { networkName: Network.Rinkeby, apiKey: "xxxxxxxxxxxxxxxxxx", });

const collectionAddress = "0xafc3cd70db252e17bbcc6ff9575cdd63514576k8"; const testedTokenId = 1;

const openSeaAsset = await seaport.api.getAsset({ tokenAddress: collectionAddress, tokenId: testedTokenId, });

const makerWalletAddress = openSeaAsset.owner.address; const order = await seaport.api.getOrder({ asset_contract_address: collectionAddress, token_id: testedTokenId, side: 1, maker: makerWalletAddress, sale_kind: 0, });

const myWalletAddress = "0xCxxxxxxxxxxxxxxxxxxxx"; await seaport.fulfillOrder({ order: order, accountAddress: myWalletAddress, });

I’m able to get results for getAsset, getOrder, etc. However when trying to fulfillOrder, I get this error message:

/Users/noam/Documents/Code/OpenseaSdk/node_modules/opensea-js/lib/seaport.js:3012 throw new Error("Failed to authorize transaction: \"" + (error_14.message

Error: Failed to authorize transaction: "The method eth_sendTransaction does not exist/is not available..." at OpenSeaPort.<anonymous> (/Users/noam/Documents/Code/OpenseaSdk/node_modules/opensea-js/lib/seaport.js:3012:31) at step (/Users/noam/Documents/Code/OpenseaSdk/node_modules/opensea-js/lib/seaport.js:44:23) at Object.throw (/Users/noam/Documents/Code/OpenseaSdk/node_modules/opensea-js/lib/seaport.js:25:53) at rejected (/Users/noam/Documents/Code/OpenseaSdk/node_modules/opensea-js/lib/seaport.js:17:65)

Read somewhere that Infura doesn’t support sendTransaction. Not sure about it. Any idea how to solve this? Sorry for the format- I’m new here…

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
trivonhancommented, Nov 4, 2022
const BASE_DERIVATION_PATH = `44'/60'/0'/0`;

    const mnemonicWalletSubprovider = new MnemonicWalletSubprovider({
      mnemonic: process.env.MNEMONIC,
      baseDerivationPath: BASE_DERIVATION_PATH,
    });
    const network = process.env.NETWORK;
    // const infuraRpcSubprovider = new RPCSubprovider({
    //   rpcUrl: 'https://goerli.infura.io/v3/8dd136f853ad4374babb7cfde0608001',
    // });

    const providerEngine = new Web3ProviderEngine();
    providerEngine.addProvider(mnemonicWalletSubprovider);
    providerEngine.addProvider(
      new RpcSubprovider({
        rpcUrl: 'https://goerli.infura.io/v3/8dd136f853ad4374babb7cfde0608001',
      }),
    );
    providerEngine.start();

    // const web3 = new Web3(
    //   // 'https://eth-goerli.g.alchemy.com/v2/JPdx9QoD-rht-Uz4QrrhIn6QYQqlf6PU',
    //   'https://goerli.infura.io/v3/8dd136f853ad4374babb7cfde0608001',
    // );
    // const account = await web3.eth.accounts.wallet.add(process.env.PRIVATE_KEY);
    // console.log('account', account);
    // console.log('web3.eth.accounts', web3.eth.accounts);

    // const provider = web3.currentProvider;

    // console.log('provider', provider);
    const openseaSDK = new OpenSeaSDK(providerEngine, {
      networkName: Network.Goerli,
    });

    // console.log('openseaSDK', openseaSDK);

    const assetBalance = await openseaSDK.getAssetBalance({
      accountAddress: '0x5C845F19EB923eEE213b620c12cc6D1d4E6E3506',
      asset: {
        tokenId: '0',
        tokenAddress: '0x1BAC1C2c2d23FcDaE91d63ff41a84f9F1c1C8aBF',
      },
    });
    console.log('assetBalance', assetBalance);

    const tokenBalance = await openseaSDK.getTokenBalance({
      accountAddress: '0x5C845F19EB923eEE213b620c12cc6D1d4E6E3506',
      tokenAddress: '0x1BAC1C2c2d23FcDaE91d63ff41a84f9F1c1C8aBF',
    });
    console.log('tokenBalance', tokenBalance);

    const getFungibleTokens = await openseaSDK.getFungibleTokens({
      symbol: 'ETH',
      address: '0xFfb99f4A02712C909d8F7cC44e67C87Ea1E71E83',
      name: 'Ethereum',
    });
    console.log('getFungibleTokens', getFungibleTokens);

    const expirationTime = Math.round(Date.now() / 1000 + 60 * 60 * 24);
    const createSellOrder = await openseaSDK.createSellOrder({
      asset: {
        tokenId: '0',
        tokenAddress: '0x1BAC1C2c2d23FcDaE91d63ff41a84f9F1c1C8aBF',
      },
      accountAddress: '0x5C845F19EB923eEE213b620c12cc6D1d4E6E3506',
      startAmount: 3,
      endAmount: 0.1,
      expirationTime,
    });
    console.log('createSellOrder', createSellOrder);
  }

I use you example but I also get error. I think you example is outdated. Here is my output

DEPRECATED: Please use providerUtils.standardizeOrThrow() instead
DEPRECATED: Please use providerUtils.standardizeOrThrow() instead
assetBalance 1
tokenBalance 2
DEPRECATION NOTICE: Use `api.getPaymentTokens` instead
getFungibleTokens []
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".

Can you give my newer solution? @esteban-OpenSea

0reactions
esteban-OpenSeacommented, Apr 14, 2022

This issue has been solved, since you are calling from client side please follow this guidance: https://github.com/ProjectOpenSea/opensea-js/issues/344#issuecomment-1020570900

@HagosAlema , I recommend you go through the opensea tutorial: https://docs.opensea.io/docs/developer-tutorials

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: The method eth_sendTransaction does not exist/is not ...
This is a sample of smart contract function execution. As we know it's not possible to make a transaction on the ...
Read more >
Returned error: The method eth_sendTransaction does not ...
I figured out the issue. It was indeed having 2 web3 objects created, one with Metamask, the other through the Web3 package.
Read more >
Web3 error: The method eth_sendTransaction does not exist ...
When a call the approve function in web3 js i'm getting error “The method eth_sendTransaction does not exist/is not available”.
Read more >
The method eth_sendTransaction does not exist/is not available
I am trying to send the args on function from owner account but getting Returned error. I am using web3 1.0 .
Read more >
ethereum/web3.py - Gitter
@kclowes If I do that then I get ModuleNotFoundError: No module named ... 'message': 'The method eth_sendTransaction does not exist/is not available'}.
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