Documentation ¶
Index ¶
- Constants
- Variables
- func GetClient() (client *horizon.Client, err error)
- func GetClientByKinNetwork(net network.KinNetwork) (client *horizon.Client, err error)
- func GetClientV2() (client *horizonclient.Client, err error)
- func GetKin2Client() (client *horizon.Client, err error)
- func GetKin2ClientV2() (client *horizonclient.Client, err error)
- func GetKin2Issuer() (issuer string, err error)
- func GetKin2Network() (network build.Network, err error)
- func GetNetwork() (network build.Network, err error)
- func GetNetworkByKinNetwork(net network.KinNetwork) (buildNetwork build.Network, err error)
- func IsValidMemo(m Memo) bool
- func IsValidMemoStrict(m Memo) bool
- type Memo
- type TransactionType
Constants ¶
const ( // KinAssetCode is the asset code for Kin 2 KinAssetCode = "KIN" // kin2ProdIssuer is the Kin 2 issuer address on the production Kin 2 network Kin2ProdIssuer = "GDF42M3IPERQCBLWFEZKQRK77JQ65SCKTU3CW36HZVCX7XX5A5QXZIVK" // kin2TestIssuer is the Kin 2 issuer address on the test Kin 2 network Kin2TestIssuer = "GBC3SG6NGTSZ2OMH3FFGB7UVRQWILW367U4GSOOF4TFSZONV42UJXUH7" )
const HighestVersion = 1
HighestVersion is the highest 'supported' memo version by the implementation.
const MaxTransactionType = TransactionTypeP2P
MaxTransactionType is the maximum transaction type 'supported' by the implementation.
Variables ¶
var ( // ErrInvalidKinNetwork occurs when an invalid KinNetwork is provided ErrInvalidKinNetwork = errors.New("KinNetwork was not 'mainnet' or 'testnet'") )
Functions ¶
func GetClient ¶
GetClient returns the default Horizon client based on which environment the application is running in.
func GetClientByKinNetwork ¶
func GetClientByKinNetwork(net network.KinNetwork) (client *horizon.Client, err error)
GetClientByKinNetwork returns a Horizon client for the provided Kin network
func GetClientV2 ¶
func GetClientV2() (client *horizonclient.Client, err error)
GetClientV2 returns the default stellar based Horizon client based on which environment the application is running in.
The stellar based client offers some additional niceties, notably around retrieving transaction history. It's generally considered to be a better client, however, the functionality _may_ have some divergent behaviour from the kin fork. Therefore, any use of this client should be tested thoroughly.
func GetKin2Client ¶ added in v0.40.0
GetKin2Client returns the default Kin 2 Horizon client based on which environment the environment is running in
func GetKin2ClientV2 ¶ added in v0.40.0
func GetKin2ClientV2() (client *horizonclient.Client, err error)
GetKin2ClientV2 returns the default stellar-based Kin 2 Horizon client based on which environment the application is running in.
The stellar based client offers some additional niceties, notably around retrieving transaction history. It's generally considered to be a better client, however, the functionality _may_ have some divergent behaviour from the kin fork. Therefore, any use of this client should be tested thoroughly.
func GetKin2Issuer ¶ added in v0.40.0
GetKin2Issuer returns the Kin issuer address based on which environment the application is running in.
func GetKin2Network ¶ added in v0.40.0
GetKin2Network returns the default Kin 2 Network modifier based on which environment the application is running in.
func GetNetwork ¶
GetNetwork returns the default Network modifier based on which environment the application is running in.
func GetNetworkByKinNetwork ¶
func GetNetworkByKinNetwork(net network.KinNetwork) (buildNetwork build.Network, err error)
GetNetworkByKinNetwork returns a Network modifier for the provided Kin network
func IsValidMemo ¶
IsValidMemo returns whether or not the memo is valid.
It should be noted that there are no guarantees if the memo is valid, only if the memo is invalid. That is, this function may return false positives.
Stricter validation can be done via the IsValidMemoStrict. However, IsValidMemoStrict is not as forward compatible as IsValidMemo.
func IsValidMemoStrict ¶
IsValidMemoStrict returns whether or not the memo is valid checking against this SDKs supported version and transaction types.
It should be noted that there are no guarantees if the memo is valid, only if the memo is invalid. That is, this function may return false positives.
Types ¶
type Memo ¶
type Memo [32]byte
Memo is the 32 byte memo encoded into transactions, as defined in github.com/kinecosystem/agora-api-internal.
func MemoFromBase64String ¶ added in v0.45.0
func MemoFromXDR ¶
MemoFromXDR returns a Memo from an xdr.Memo, provided it is a valid (or strictly valid) memo.
func MemoFromXDRString ¶
MemoFromXDRString returns a Memo from a standard base64 encoded xdr.Memo, provided it is valid (or strictly) valid memo.
func (Memo) ForeignKey ¶
ForeignKey returns the foreign key of the memo.
func (Memo) TransactionType ¶
func (m Memo) TransactionType() TransactionType
TransactionType returns the transaction type of the memo.
func (Memo) TransactionTypeRaw ¶
func (m Memo) TransactionTypeRaw() TransactionType
TransactionTypeRaw returns the transaction type of the memo, even if it is unsupported by this SDK. It should only be used as a fall back if the raw value is needed when TransactionType() yields TransactionTypeUnknown.
type TransactionType ¶
type TransactionType int16
TransactionType is the memo transaction type.
const ( TransactionTypeUnknown TransactionType = iota - 1 TransactionTypeNone TransactionTypeEarn TransactionTypeSpend TransactionTypeP2P )