Documentation ¶
Index ¶
Constants ¶
View Source
const ( // BaobabEndpoint is used to send transactions to Baobab network, that is Klaytn's testnet. // The API key is not required and it can be used for free to test your application before prod. BaobabEndpoint = "https://baobab.klayfee.com" // CypressEndpoint is used to send transactions to Cypress network, that is Klaytn's mainnet. // The API key is required for that endpoint and the transaction fee costs will be paid off your balance. CypressEndpoint = "https://cypress.klayfee.com" )
Variables ¶
View Source
var ( errors.New("unauthorized error: wrong API key or Endpoint") // ErrForbidden is retuned when server declined the request, probably based on low balance. ErrForbidden = errors.New("forbidden error: please check you API key and spendable gas balance") // ErrBadRequest is returned when server indicated that the request is missing important fields or is forged. ErrBadRequest = errors.New("bad request error: client sent a malformed request") )ErrUnauthorized =
Functions ¶
This section is empty.
Types ¶
type FeeDelegationClient ¶
type FeeDelegationClient interface { // SendRawTx sends signed raw transaction bytes to the fee delegation server. // // If succeed, that transaction will be submitted into blockchain, but gas fees // are charged regardless that. Refer to klaytn economics to decide how to work with gas. SendRawTx(ctx context.Context, rawTx []byte) (*Receipt, error) // GasBalance returns maximum spendable gas allocation of your account. // // When gas spendings are counted towards that allocation, we use GasPrice * GasUsed formula, // but when transaction is being submitted, it is evaluated as GasPrice * GasLimit, so // ensure that with your variables in signed transaction you have enough allocation beforehand. GasBalance(ctx context.Context) (*big.Int, error) // SetHTTPClient allows to set a custom HTTP client. SetHTTPClient(cli *http.Client) }
FeeDelegationClient is an interface of basic client of a fee delegation service. This is our first release, the API might change in the future.
type Receipt ¶
type Receipt struct { Status int `json:"status"` GasUsed int `json:"gasUsed"` GasPrice *big.Int `json:"gasPrice"` GasTotalCost *big.Int `json:"gasTotalCost"` TxHash common.Hash `json:"txHash"` TxHashSender common.Hash `json:"txHashSender"` }
Receipt describes transaction results and the total cost in Pebs.
Click to show internal directories.
Click to hide internal directories.