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

TypeError with prepareTransferFromCustodialWallet Function When Sending ERC20 Tokens from Precalculated Gas Pump Addres #1056

Open
Modelc opened this issue Jan 31, 2024 · 0 comments

Comments

@Modelc
Copy link

Modelc commented Jan 31, 2024

Issue

I am encountering a TypeError when attempting to send ERC20 tokens (specifically USDT on MATIC network) from a precalculated gas pump address using the prepareTransferFromCustodialWallet function from the Tatum SDK. My expectation was that this function would facilitate the transfer of tokens from the precalculated address to a specified recipient address, with the gas fees being covered by the master address associated with the precalculated address. However, I'm receiving an error stating that the function is not recognized.

Steps to reproduce:

  1. Precalculate gas pump addresses using Tatum SDK.
  2. Attempt to transfer USDT MATIC from one of these addresses to another address, after you have funded it.
  3. Utilize the prepareTransferFromCustodialWallet function with the necessary parameters.
  4. Encounter a TypeError indicating the function is not recognized.

Expected behavior:
The function should successfully initiate the transfer of tokens from the precalculated address to the specified recipient address, with gas fees handled by the master address.

Actual behavior:
Receiving a TypeError, indicating an issue with the function's recognition or execution.

Operating System
Windows

Environment:
NodeJS

NodeJS Version:
v20.10.0

Tatum SDK Version:
v4.2.4

Additional context or information:

Here is the code snippet that produces the error:

const { TatumPolygonSDK } = require('@tatumio/polygon');
const { prepareTransferFromCustodialWallet } = require('@tatumio/tatum');

const body = {
chain: "MATIC",
custodialAddress: address,
recipient: recipientAddress,
contractType: 0,
tokenAddress: usdtMaticContractAddress,
amount: amountToSend,
fromPrivateKey: fromMasterPrivateKey
};

const transfer = await prepareTransferFromCustodialWallet(false, body);
console.log('Transfer executed:', transfer);

Error message received:
TypeError: prepareTransferFromCustodialWallet is not a function

I have also referred to the Tatum documentation and followed their guidelines but still encounter this issue. I appreciate any guidance or assistance in resolving this.

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

No branches or pull requests

1 participant