API reference

  • buildETHTransaction: Create Ethereum transactions.

    • Parameters:

      • req: A PayloadBuildETHTransactionRequest object containing the transaction details.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A Data object containing the raw Ethereum transaction in serialized form, or nil if the operation fails.

    • Throws: This method can throw an error if the input parameters are invalid or if there are issues constructing the transaction.

    • Example:

    let request = PayloadBuildETHTransactionRequest()
    
    do {
        let transaction = try client.buildETHTransaction(request, error: nil)
        if let txData = transaction {
            print("Ethereum transaction built successfully.")
        } else {
            print("Failed to build Ethereum transaction.")
        }
    } catch {
        print("Error creating Ethereum transaction: \(error.localizedDescription)")
    }
  • buildSolTransaction: Create Solana transactions.

    • Parameters:

      • req: A PayloadBuildSolTransactionRequest object containing the transaction details.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A Data object containing the raw Solana transaction in serialized form, or nil if the operation fails.

    • Throws: This method can throw an error if the input parameters are invalid or if there are issues constructing the transaction.

    • Example:

    let request = PayloadBuildSolTransactionRequest()
    
    do {
        let transaction = try client.buildSolTransaction(request, error: nil)
        if let txData = transaction {
            print("Solana transaction built successfully.")
        } else {
            print("Failed to build Solana transaction.")
        }
    } catch {
        print("Error creating Solana transaction: \(error.localizedDescription)")
    }
  • buildTronTransaction: Create Tron transactions.

    • Parameters:

      • req: A PayloadBuildTronTransactionRequest object containing the transaction details.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A Data object containing the raw Tron transaction in serialized form, or nil if the operation fails.

    • Throws: This method can throw an error if the input parameters are invalid or if there are issues constructing the transaction.

    • Example:

    let request = PayloadBuildTronTransactionRequest()
    
    do {
        let transaction = try client.buildTronTransaction(request, error: nil)
        if let txData = transaction {
            print("Tron transaction built successfully.")
        } else {
            print("Failed to build Tron transaction.")
        }
    } catch {
        print("Error creating Tron transaction: \(error.localizedDescription)")
    }

buildTonTransaction: Create Ton transactions.

  • Parameters:

    • req: A PayloadBuildTonTransactionRequest object containing the transaction details.

    • error: An optional pointer to an Error object to capture errors, if any.

  • Returns:

    • A Data object containing the raw Ton transaction in serialized form, or nil if the operation fails.

  • Throws: This method can throw an error if the input parameters are invalid or if there are issues constructing the transaction.

  • Example:

buildXrpTransaction: Create Xrp transactions.

  • Parameters:

    • req: A PayloadBuildXrpTransactionRequest object containing the transaction details.

    • error: An optional pointer to an Error object to capture errors, if any.

  • Returns:

    • A Data object containing the raw Xrp transaction in serialized form, or nil if the operation fails.

  • Throws: This method can throw an error if the input parameters are invalid or if there are issues constructing the transaction.

  • Example:

buildBtcTransaction: Create Btc transactions.

  • Parameters:

    • req: A PayloadBuildBtcTransactionRequest object containing the transaction details.

    • error: An optional pointer to an Error object to capture errors, if any.

  • Returns:

    • A Data object containing the raw Btc transaction in serialized form, or nil if the operation fails.

  • Throws: This method can throw an error if the input parameters are invalid or if there are issues constructing the transaction.

  • Example:

  • listBlockChainTransaction: Fetch a list of blockchain transactions.

    • Parameters:

      • req: A PayloadListBlockchainTransactionsRequest object containing the parameters for filtering transactions. - pageSize: The number of transactions per page.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A PayloadListBlockchainTransactionsResponse object containing the list of transactions and pagination metadata, or nil if the operation fails.

    • Throws: This method can throw an error if the request parameters are invalid or if there are runtime issues.

    • Example:

  • signing: Perform signing operations for a given MPC group.

    • Parameters:

      • req: A PayloadSigningRequest object containing the details for the signing operation.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A Data object containing the digital signature, or nil if the operation fails.

    • Throws: This method can throw an error if the signing request is invalid, if the group is misconfigured, or if there are runtime issues during the operation.

    • Example:

  • profile: Retrieve the user's profile.

    • Parameters:

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A ModelUser object containing the user's profile information, or nil if the operation fails.

    • Throws: This method can throw an error if the user's profile is unavailable or if there are runtime issues.

    • Example:

  • saveUserSetting: Save user-specific settings.

    • Parameters:

      • req: A PayloadSaveUserSettingRequest object containing the user settings to save.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A boolean value indicating whether the operation was successful (true) or not (false).

    • Throws: This method can throw an error if the request payload is invalid or if there are runtime issues.

    • Example:

  • getUserSetting: Retrieve user-specific settings.

    • Parameters:

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A Data object containing the serialized user settings, or nil if the operation fails.

    • Throws: This method can throw an error if the settings cannot be retrieved or if there are runtime issues.

    • Example:

  • prepareAASmartAccount: Prepare an Account Abstraction smart account.

    • Parameters:

      • req: A PayloadPrepareAASmartAccountRequest object containing the details for the smart account setup.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A PayloadAASmartAccount object containing the details of the prepared smart account, including the account address and configuration, or nil if the operation fails.

    • Throws: This method can throw an error if the request is invalid, the network is unsupported, or there are runtime issues during the setup process.

    • Example:

  • prepareAATxUserOp: Prepare a user operation for Account Abstraction transactions.

    • Parameters:

      • req: A PayloadPrepareAATxUserOpRequest object containing the details of the user operation to prepare.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A PayloadPrepareAATxUserOpResponse object containing the prepared user operation, including details such as the encoded operation and required fields for signing, or nil if the operation fails.

    • Throws: This method can throw an error if the request parameters are invalid or if there are runtime issues during the preparation process.

    • Example:

  • sendUserOperation: Sends a user operation to the blockchain for Account Abstraction (AA) transactions.

    • Parameters:

      • req: A PayloadSendUserOperationRequest object containing the details of the operation to execute.

      • error: An optional pointer to an Error object to capture errors, if any.

    • Returns:

      • A String object containing the transaction hash of the executed operation, or nil if the operation fails.

    • Throws: This method can throw an error if the request payload is invalid, the network is unavailable, or the operation fails during execution.

    • Example:

  • exportMnemonic: Retrieve wallet's Mnemonic phrase.

    • Parameters:

      • keygenGroupId: Master wallet's key generation group ID.

      • keyIdentities: The key identity of the wallet.

    • Returns:

      • A String containing your mnemonic, or nil if the operation fails.

    • Example:

  • deleteMPCGroup : Deletes a Paillier MPC group.

    • Parameters:

      • groupID: The unique identifier of the group to delete.

    • Throws: An error if the deletion fails.

    • Example:

  • getCurrentPolicy: Retrieves the current policy as a publisher that emits [Policy] objects.

    • Returns: An [AnyPublisher] emitting [Policy] objects.

    • Throws: An error if fetching the current policy fails.

    • Example:

  • enablePolicy: Enables the current policy with a specified delay and an option to force the operation.

    • Parameters:

      • delayHours: The number of hours to delay before enabling the policy.

      • force: A boolean flag indicating whether to force enable the policy, overriding existing conditions.

    • Returns: An [AnyPublisher] emitting the updated [Policy] object.

    • Throws: An error if enabling the policy fails.

    • Example::

  • disablePolicy: isables the current policy and returns a publisher that emits the updated [Policy] object.

    • Returns: An [AnyPublisher] emitting the updated [Policy] object.

    • Throws: An error if disabling the policy fails.

    • Example:

  • addWalletAddress: Adds a wallet address to the whitelist for a specific network chain with associated labels.

    • Parameters:

      • address: The wallet address to be added.

      • networkChain: The identifier for the blockchain network to which the address belongs.

      • labels: An array of labels to be associated with the wallet address.

    • Returns: An [AnyPublisher] emitting the newly added [Address] object.

    • Throws: An error if the wallet address cannot be added.

    • Example:

  • removeWalletAddress: Removes the wallet address associated with the specified identifier.

    • Parameter walletId: The unique identifier of the wallet address to be removed.

    • Returns: An [AnyPublisher] emitting an optional [String] that indicates the result of the removal operation.

    • Throws: An error if the wallet address removal fails.

    • Example:

  • updateWalletAddress: Updates an existing wallet address with new labels.

    • Parameters:

      • walletId: The unique identifier of the wallet address to update.

      • labels: An array of new labels to associate with the wallet address.

    • Returns: An [AnyPublisher] emitting the updated [Address] object.

    • Throws: An error if updating the wallet address fails.

    • Example:

getTransactionAmountLimit: Retrieves the current transaction amount limit policy, including per-transaction and daily limits.

  • Parameters: None

  • Returns: An AnyPublisher emitting the current TransactionLimitPolicy object.

  • Throws: An error if retrieving the transaction limit policy fails.

  • Example:

updateTransactionAmountLimit: Updates the transaction amount limit policy with new values for per-transaction and daily limits, and whether the policy is enabled.

  • Parameters:

    • perTransactionLimit: The maximum amount allowed per individual transaction (in smallest denomination).

    • dailyLimit: The maximum cumulative amount allowed per day.

    • enable: A Boolean value indicating whether the transaction limit policy is enabled.

  • Returns: An AnyPublisher<Void, Error> indicating completion of the update operation.

  • Throws: An error if retrieving the transaction limit policy fails.

  • Example:

Last updated