Skip to content

fundAccount(____)

MarcoDotIO edited this page Apr 25, 2023 · 1 revision

fundAccount(_:_:)

Fund an account on the blockchain with a specified amount of currency.

public func fundAccount(_ address: String, _ amount: Int)

This function takes an account address and an amount, and sends a request to the blockchain to mint the specified amount of currency and deposit it into the account with the specified address. The request is sent to the endpoint "/mint" on the provided base URL using an HTTP POST method. The function then waits for the transaction to be confirmed by the blockchain before returning.

Parameters

  • address: The address of the account to fund.
  • amount: The amount of currency to deposit into the account.

Throws

An error if the provided URL is invalid, or if the REST client fails to decode the response, or if the transaction fails to be confirmed by the blockchain.

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally