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

[Bug]: Make transaction error #2259

Open
1 task done
godlovericea opened this issue Jan 3, 2025 · 4 comments
Open
1 task done

[Bug]: Make transaction error #2259

godlovericea opened this issue Jan 3, 2025 · 4 comments

Comments

@godlovericea
Copy link

Issue description

When I make a transaction with nodejs, It is error:

Version

"@iota/iota-sdk": "^0.4.0",

Expected behaviour

Success to make tx

Actual behaviour

When I make a transaction with nodejs, It is error:

Can the issue reliably be reproduced?

Yes

Steps to reproduce the issue

try {
        const iotaClient = new IotaClient({ url: getFullnodeUrl('mainnet') });
        const keypair = Ed25519Keypair.fromSecretKey(fromHEX(privateKey));
        const tx = new Transaction();
        const [coin] = tx.splitCoins(tx.gas, [value]);
        tx.transferObjects([coin], to);
        const result = await iotaClient.signAndExecuteTransaction({ signer: keypair, transaction: tx });
        const res = await iotaClient.waitForTransaction({ digest: result.digest });
        ctx.body = SUCCESS_RES(res.digest)
    } catch (error) {
        ctx.body = ERROR_RES("IOTA交易失败:" + error, "IOTA交易失败:" + error)
    }

I have made tx successfully on testnet:
https://explorer.rebased.iota.org/txblock/2htcHzEjNNyGwvFB5WkDKrG64bnTr2guNSsVj4L6T5xb?network=testnet

Errors

I can not make tx on mainnet

Duplicate declaration

  • I have searched the issues tracker this issue and there is none
@github-project-automation github-project-automation bot moved this to Product Backlog in iota-sdk Jan 3, 2025
@godlovericea
Copy link
Author

I have some IOTA coins in the address

iota1qpxzfxhegpq52fkyeedspznf7uuvy52np977x3t3lpmpy8y50qlextrjkkg

@godlovericea
Copy link
Author

Why there is no Mainnet, But the network.js has declare

export declare enum Network {
    Mainnet = "mainnet",
    Devnet = "devnet",
    Testnet = "testnet",
    Localnet = "localnet",
    Custom = "custom"
}
export type NetworkId = Network | string;
export type ChainType = `${string}:${string}`;
export interface NetworkConfiguration {
    id: Network;
    name: string;
    url: string;
    explorer: string;
    chain: ChainType;
    faucet?: string;
    kiosk?: KioskConfiguration;
}
export interface KioskConfiguration {
    royaltyRulePackageId: string;
    kioskLockRulePackageId: string;
    floorPriceRulePackageId: string;
    personalKioskRulePackageId: string;
}
type NetworksConfiguration = Record<NetworkId, NetworkConfiguration>;
export declare function getAllNetworks(): NetworksConfiguration;
export declare function getNetwork(network: NetworkId): NetworkConfiguration;
export declare function getDefaultNetwork(): Network;
export declare function getFullnodeUrl(network: NetworkId): string;
export {};

@AlexLiveBot11549

This comment has been minimized.

@Thoralf-M
Copy link
Member

Hello @godlovericea, the package you use is https://github.com/iotaledger/iota/tree/develop/sdk/typescript and for rebased, which is not live on mainnet yet
For the current mainnet the npm package is in this repo and called @iota/sdk https://wiki.iota.org/iota-sdk/getting-started/nodejs
But the mainnet will be updated soon to the library you used

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

No branches or pull requests

3 participants