Documentation ¶
Index ¶
- Constants
- func GenerateDataEntry(account string, entryhash string) string
- func GenerateMintDataAccount(adi string, chainId int64, action string, symbol string) string
- func GeneratePendingChain(account string) string
- func GenerateReleaseDataAccount(adi string, chainId int64, action string) string
- func GenerateTokenAccount(adi string, chainId int64, symbol string) string
- type ADI
- type AccumulateClient
- func (c *AccumulateClient) ExecuteDirect(params *Params) (*ExecuteDirectResponse, error)
- func (c *AccumulateClient) ImportPrivateKey(pk string) (*AccumulateClient, error)
- func (c *AccumulateClient) QueryADI(adi *Params) (*QueryADIResponse, error)
- func (c *AccumulateClient) QueryDataEntry(dataAccount *Params) (*QueryDataResponse, error)
- func (c *AccumulateClient) QueryDataSet(dataAccount *Params) (*QueryDataSetResponse, error)
- func (c *AccumulateClient) QueryKeyPage(page *Params) (*QueryKeyPageResponse, error)
- func (c *AccumulateClient) QueryLatestDataEntry(dataAccount *Params) (*QueryDataResponse, error)
- func (c *AccumulateClient) QueryPendingChain(account *Params) (*QueryPendingChainResponse, error)
- func (c *AccumulateClient) QueryToken(token *Params) (*QueryTokenResponse, error)
- func (c *AccumulateClient) QueryTokenAccount(account *Params) (*QueryTokenAccountResponse, error)
- func (c *AccumulateClient) QueryTokenTx(tx *Params) (*QueryTokenTxResponse, error)
- func (c *AccumulateClient) QueryTxHistory(account *Params) (*QueryTxHistoryResponse, error)
- func (c *AccumulateClient) RemoteTransaction(from string, txhash string) (string, error)
- func (c *AccumulateClient) SendTokens(to string, amount int64, tokenURL string, chainId int64) (string, error)
- func (c *AccumulateClient) WriteData(dataAccount string, content [][]byte) (string, error)
- type DataEntry
- type ExecuteDirectResponse
- type Key
- type KeyPage
- type Params
- type QueryADIResponse
- type QueryDataResponse
- type QueryDataSetResponse
- type QueryKeyPageResponse
- type QueryPendingChainResponse
- type QueryTokenAccountResponse
- type QueryTokenResponse
- type QueryTokenTxResponse
- type QueryTxHistoryResponse
- type Token
- type TokenAccount
- type TokenTx
- type TokenTxTo
- type URL
Constants ¶
const ( ACC_KEYPAGE = "1" // bridge ADI keypage ACC_LEADER = "leader" // data account: current leader (pubkeyhash) ACC_TOKEN_REGISTRY = "tokens" // data account: token registry (accumulate token address, evm token address, evm chainid) ACC_BRIDGE_FEES = "fees" // data account: bridge fees ACC_MINT_QUEUE = "mint" // data account: mint queue, {chainid}:mint ACC_RELEASE_QUEUE = "release" // data account: release queue, {chainid}:release ACC_BRIDGE_STATUS = "status" // data account: status (1 = on, 0 = off) TOKEN_REGISTRY_VERSION = "v1" // validate token registry data entries MINT_QUEUE_VERSION = "v1" // validate burn events data entries RELEASE_QUEUE_VERSION = "v1" // validate deposit list data entries SIGNATURE_TYPE = "ed25519" ZERO_HASH = "0000000000000000000000000000000000000000000000000000000000000000" TX_TYPE_SYNTH_TOKEN_DEPOSIT = "syntheticDepositTokens" TX_TYPE_SEND_TOKENS = "sendTokens" )
Variables ¶
This section is empty.
Functions ¶
func GenerateDataEntry ¶
Generate data entry in format {entryhash}@{account}
func GenerateMintDataAccount ¶
Generate bridge data account in format audit:{chainId}:{action}:{symbol}
func GeneratePendingChain ¶
Generate pending chain in format {account}#pending
func GenerateReleaseDataAccount ¶
Generate bridge data account in format audit:{chainId}:{action}
Types ¶
type AccumulateClient ¶
type AccumulateClient struct { API string ADI string Signer string PrivateKey ed25519.PrivateKey PublicKey ed25519.PublicKey PublicKeyHash []byte Client jsonrpc.RPCClient Validate *validator.Validate }
func NewAccumulateClient ¶
func NewAccumulateClient(conf *config.Config) (*AccumulateClient, error)
NewAccumulateClient constructs the Accumulate client
func (*AccumulateClient) ExecuteDirect ¶
func (c *AccumulateClient) ExecuteDirect(params *Params) (*ExecuteDirectResponse, error)
Create calls "execute-direct" tx on Accumulate
func (*AccumulateClient) ImportPrivateKey ¶
func (c *AccumulateClient) ImportPrivateKey(pk string) (*AccumulateClient, error)
ImportPrivateKey imports private key and generates corresponding public key
func (*AccumulateClient) QueryADI ¶
func (c *AccumulateClient) QueryADI(adi *Params) (*QueryADIResponse, error)
QueryADI gets Token info
func (*AccumulateClient) QueryDataEntry ¶
func (c *AccumulateClient) QueryDataEntry(dataAccount *Params) (*QueryDataResponse, error)
QueryLatestDataEntry gets latest data entry from data account
func (*AccumulateClient) QueryDataSet ¶
func (c *AccumulateClient) QueryDataSet(dataAccount *Params) (*QueryDataSetResponse, error)
QueryDataSet gets data entries from data account
func (*AccumulateClient) QueryKeyPage ¶
func (c *AccumulateClient) QueryKeyPage(page *Params) (*QueryKeyPageResponse, error)
QueryKeyPage gets Key page info
func (*AccumulateClient) QueryLatestDataEntry ¶
func (c *AccumulateClient) QueryLatestDataEntry(dataAccount *Params) (*QueryDataResponse, error)
QueryLatestDataEntry gets latest data entry from data account
func (*AccumulateClient) QueryPendingChain ¶
func (c *AccumulateClient) QueryPendingChain(account *Params) (*QueryPendingChainResponse, error)
QueryPendingChain gets data pending data from data or token account
func (*AccumulateClient) QueryToken ¶
func (c *AccumulateClient) QueryToken(token *Params) (*QueryTokenResponse, error)
QueryToken gets Token info
func (*AccumulateClient) QueryTokenAccount ¶
func (c *AccumulateClient) QueryTokenAccount(account *Params) (*QueryTokenAccountResponse, error)
QueryTokenAccount gets Token Account info
func (*AccumulateClient) QueryTokenTx ¶
func (c *AccumulateClient) QueryTokenTx(tx *Params) (*QueryTokenTxResponse, error)
QueryTokenTx gets token tx by url
func (*AccumulateClient) QueryTxHistory ¶
func (c *AccumulateClient) QueryTxHistory(account *Params) (*QueryTxHistoryResponse, error)
QueryTxHistory gets tx history of account
func (*AccumulateClient) RemoteTransaction ¶
func (c *AccumulateClient) RemoteTransaction(from string, txhash string) (string, error)
RemoteTransaction generates remote tx for `execute-direct` API method
func (*AccumulateClient) SendTokens ¶
func (c *AccumulateClient) SendTokens(to string, amount int64, tokenURL string, chainId int64) (string, error)
SendTokens generates sendTokens tx for `execute-direct` API method
type ExecuteDirectResponse ¶
type KeyPage ¶
type KeyPage struct { Type string `json:"type" validate:"required,eq=keyPage"` KeyBook string `json:"keyBook" validate:"required"` URL string `json:"url" validate:"required"` CreditBalance int64 `json:"creditBalance"` AcceptThreshold int64 `json:"acceptThreshold"` Threshold int64 `json:"threshold"` Version uint64 `json:"version"` Keys []*Key `json:"keys"` }
type QueryADIResponse ¶
type QueryDataResponse ¶
type QueryDataSetResponse ¶
type QueryDataSetResponse struct {
Items []*DataEntry `json:"items"`
}
type QueryKeyPageResponse ¶
type QueryTokenAccountResponse ¶
type QueryTokenAccountResponse struct { Data *TokenAccount `json:"data"` LastBlockTime *time.Time `json:"lastBlockTime" validate:"required,notOlderThanOneMinute"` }
type QueryTokenResponse ¶
type QueryTokenTxResponse ¶
type QueryTxHistoryResponse ¶
type QueryTxHistoryResponse struct {
Items []*QueryTokenTxResponse `json:"items"`
}
type TokenAccount ¶
type TokenAccount struct { Type string `json:"type" validate:"required,oneof=tokenAccount liteTokenAccount"` Authorities []*URL `json:"authorities"` URL string `json:"url" validate:"required"` TokenURL string `json:"tokenUrl" validate:"required"` Balance string `json:"balance" validate:"required"` }