Skip to main content

EVM Operations (sdk.web3dart)

createPublicClient

Create a public client for interacting with an EVM chain.

Parameters

  • chainId (int): The chain ID (e.g., 1 for Ethereum mainnet, 137 for Polygon)

Returns

  • Web3Client: Public client for the chain (from the web3dart package)

Example

getGasPrice

Get the current gas price for a chain.

Returns

  • EtherAmount: Current gas price in wei (from the web3dart package)

Example

sendTransaction

Send a transaction on an EVM chain.

Parameters

  • transaction (Transaction): Transaction details (from the web3dart package)
  • wallet (BaseWallet): The wallet to send from

Returns

  • String: Transaction hash

Example

Complete Example with Gas Estimation

signEthereumTransaction

Sign a transaction without sending it. Only works with embedded wallets.

Parameters

  • walletId (String): The ID of the embedded wallet to sign with
  • transaction (Transaction): Transaction to sign (from the web3dart package)

Returns

  • String: Signed transaction

Example

writeContract

Write to a smart contract (call a contract function).

Parameters

  • wallet (BaseWallet): The wallet to call from
  • input (WriteContractInput): Contract call parameters

Returns

  • String: Transaction hash

Example

Complete ERC20 Token Transfer Example

Solana Operations (sdk.solana)

createConnection

Create a connection to a Solana network.

Returns

  • Connection: Connection to the Solana network (from the solana_web3_latest package)

Example

getLatestBlockhash

Get the latest blockhash for transaction creation.

Returns

  • BlockhashWithExpiryBlockHeight: Contains the blockhash and last valid block height

Example

createSigner

Create a signer for signing Solana transactions.

Parameters

  • wallet (BaseWallet): The Solana wallet

Returns

  • DynamicSolanaSigner: Signer for the wallet

Example

signMessage

Sign a message with a Solana wallet.

Parameters

  • message (String): The message to sign

Returns

  • String: The signature

Example

signEncodedTransaction

Sign a Solana transaction (base64 encoded).

Parameters

  • base64Transaction (String): Base64 encoded transaction

Returns

  • String: Signed transaction (base64 encoded)

Example

signAndSendEncodedTransaction

Sign and send a Solana transaction.

Parameters

  • base64Transaction (String): Base64 encoded transaction
  • transactionType (SolanaTransactionType): Transaction type, defaults to versioned
  • sponsorshipMode (SolanaSponsorshipMode?): Overrides the project’s SVM gas sponsorship for this transaction. auto follows the project setting, off always pays the fee from the wallet, required fails when sponsorship is unavailable.

Returns

  • String: Transaction signature

Example

Complete Solana Transfer Example

Network Management (sdk.networks)

Available Networks

Get lists of available EVM and Solana networks.

Example

Network Selector Widget

Data Types

Transaction and EtherAmount

EVM transactions and amounts use the web3dart Transaction, EthereumAddress, and EtherAmount types.

WriteContractInput

GenericNetwork

BlockhashWithExpiryBlockHeight

Returned by connection.getLatestBlockhash() (from the solana_web3_latest package).

Using web3dart for Advanced EVM Operations

The Dynamic SDK provides integration classes for using the web3dart package with Dynamic wallets.

Gas Sponsorship

The sdk.web3dart extension exposes EVM gas sponsorship. See EVM Gas Sponsorship.

Example

DynamicRpcService

Extends RpcService from web3dart to make RPC calls through the Dynamic SDK.

Example

You do not need to construct DynamicRpcService yourself — sdk.web3dart.createPublicClient builds it internally. Use the returned Web3Client for RPC calls:

Advanced Token Operations

For more complex EVM operations, you can use the web3dart package alongside the Dynamic SDK:

Using solana package for Advanced Solana Operations

For complex Solana operations, use the solana package with Dynamic SDK:
Last modified on October 30, 2026