Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevNet ¶
type DevNet struct {
// contains filtered or unexported fields
}
func NewDevNet ¶
NewDevNet creates a new DevNet instance.
It accepts an optional baseURL parameter, which is a string representing the base URL of the DevNet server. If no baseURL is provided, the default value of "http://localhost:5050" is used.
Parameters: - baseURL: a string representing the base URL of the DevNet server Returns: - *DevNet: a pointer to the newly created DevNet instance
func (*DevNet) Accounts ¶
func (devnet *DevNet) Accounts() ([]TestAccount, error)
Accounts retrieves a list of test accounts from the DevNet API.
It does an HTTP GET request to the "/predeployed_accounts" endpoint and decodes the response body into a slice of TestAccount structs. It returns the list of accounts and any error that occurred during the process.
Parameters:
none
Returns: - []TestAccount: a slice of TestAccount structs
func (*DevNet) FeeToken ¶
FeeToken retrieves the fee token from the DevNet API.
This function does a GET request to the "/fee_token" endpoint of the DevNet API to retrieve the fee token.
Parameters:
none
Returns:
- *FeeToken: a pointer to a FeeToken object
- error: an error, if any
func (*DevNet) IsAlive ¶
IsAlive checks if the DevNet is alive.
It sends a GET request to the "/is_alive" endpoint of the DevNet API. It returns true if the response status code is 200 (http.StatusOK), and false otherwise.
Parameters:
none
Returns:
bool: true if the DevNet is alive, false otherwise