Thirdweb

The Thirdweb namespace is a low-level wrapper around the Thirdweb Rust library, providing a set of utility functions and classes to interact with the Thirdweb SDK.

Structures

FFIResult

Encapsulates operation results, returning success status and messages.

Properties

  • bool success: Success status of the operation result
  • const char* message: Operation result message

Member Functions

  • AssignResult(Output, bErrorOnlyResult): Assign's result and then frees the underlying pointer
  • AssignRetryResult(bCanRetry, Output, bErrorOnlyResult): Assign's result with retry and then frees the underlying pointer
  • GetOutput(): Assign's result to output directly
  • Free(): Frees the underlying pointer for functions that have no relevant output
  • Log(): Convenience function to log all properties

Internal Functions

The Thirdweb namespace in Thirdweb.h offers various methods for managing wallets and interacting with smart contracts. Note that inputs may change in future versions, so always refer to the latest documentation or source code for the most accurate information.

Wallet Management

  • create_private_key_wallet(private_key): Creates a wallet using a private key.
  • generate_private_key_wallet(): Generates a new private key wallet.
  • private_key_wallet_export(handle_id): Exports the private key of a wallet.
  • create_in_app_wallet(client_id, bundle_id, secret_key, email, storage_directory_path, oauth_provider): Creates an in-app wallet.
  • in_app_wallet_send_otp(handle_id): Sends an OTP for in-app wallet.
  • in_app_wallet_verify_otp(handle_id, otp): Verifies an OTP for in-app wallet.
  • in_app_wallet_fetch_oauth_login_link(handle_id, redirect_url): Fetches an OAuth login link for in-app wallet.
  • in_app_wallet_sign_in_with_oauth(handle_id, auth_result): Signs in with OAuth for in-app wallet.
  • get_wallet_address(handle_id): Retrieves the wallet address.
  • sign_message(handle_id, message): Signs a message with the wallet.
  • is_connected(handle_id): Checks if the wallet is connected.
  • disconnect(handle_id): Disconnects the wallet.
  • free_wallet(handle_id): Frees the wallet handle.

Smart Wallet Management

  • create_smart_wallet(client_id, bundle_id, secret_key, personal_wallet_handle_id, chain_id, gasless, factory, account_override): Creates a smart wallet.
  • smart_wallet_is_deployed(handle_id): Checks if the smart wallet is deployed.
  • smart_wallet_get_all_admins(handle_id): Retrieves all admins of the smart wallet.
  • smart_wallet_get_all_active_signers(handle_id): Retrieves all active signers of the smart wallet.
  • smart_wallet_create_session_key(handle_id, signer_address, approved_targets, approved_targets_count, native_token_limit_per_transaction_in_wei, permission_start_timestamp, permission_end_timestamp, req_validity_start_timestamp, req_validity_end_timestamp): Creates a session key for the smart wallet.
  • smart_wallet_revoke_session_key(handle_id, signer_address): Revokes a session key for the smart wallet.
  • smart_wallet_add_admin(handle_id, signer_address): Adds an admin to the smart wallet.
  • smart_wallet_remove_admin(handle_id, signer_address): Removes an admin from the smart wallet.

Utility

  • free_ffi_result(result): Frees the FFI result.
  • is_valid_address(address, check_checksum): Validates an Ethereum address.
  • to_checksummed_address(address): Converts an address to checksummed format.
  • is_valid_private_key(private_key): Validates a private key.