Documentation
¶
Index ¶
- Constants
- Variables
- func BlacklistAddr() common.Address
- func FindLogByTopic(txReceipt *Receipt, topic common.Hash) (*types.Log, error)
- func GatekeeperLiveAddr() common.Address
- func GatekeeperSidechainAddr() common.Address
- func MarketAddr() common.Address
- func OracleUsdAddr() common.Address
- func ProfileRegistryAddr() common.Address
- func SNMAddr() common.Address
- func SNMSidechainAddr() common.Address
- type API
- type AddedToBlacklistData
- type BasicAPI
- func (api *BasicAPI) Blacklist() BlacklistAPI
- func (api *BasicAPI) Events() EventsAPI
- func (api *BasicAPI) LiveToken() TokenAPI
- func (api *BasicAPI) Market() MarketAPI
- func (api *BasicAPI) MasterchainGate() SimpleGatekeeperAPI
- func (api *BasicAPI) OracleUSD() OracleAPI
- func (api *BasicAPI) ProfileRegistry() ProfileRegistryAPI
- func (api *BasicAPI) SideToken() TokenAPI
- func (api *BasicAPI) SidechainGate() SimpleGatekeeperAPI
- func (api *BasicAPI) TestToken() TestTokenAPI
- type BasicBlacklistAPI
- func (api *BasicBlacklistAPI) Add(ctx context.Context, key *ecdsa.PrivateKey, who, whom common.Address) (*types.Transaction, error)
- func (api *BasicBlacklistAPI) AddMaster(ctx context.Context, key *ecdsa.PrivateKey, root common.Address) (*types.Transaction, error)
- func (api *BasicBlacklistAPI) Check(ctx context.Context, who, whom common.Address) (bool, error)
- func (api *BasicBlacklistAPI) Remove(ctx context.Context, key *ecdsa.PrivateKey, whom common.Address) error
- func (api *BasicBlacklistAPI) RemoveMaster(ctx context.Context, key *ecdsa.PrivateKey, root common.Address) (*types.Transaction, error)
- func (api *BasicBlacklistAPI) SetMarketAddress(ctx context.Context, key *ecdsa.PrivateKey, market common.Address) (*types.Transaction, error)
- type BasicEventsAPI
- type BasicMarketAPI
- func (api *BasicMarketAPI) Bill(ctx context.Context, key *ecdsa.PrivateKey, dealID *big.Int) <-chan error
- func (api *BasicMarketAPI) CancelChangeRequest(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) error
- func (api *BasicMarketAPI) CancelOrder(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) <-chan error
- func (api *BasicMarketAPI) CloseDeal(ctx context.Context, key *ecdsa.PrivateKey, dealID *big.Int, blacklisted bool) <-chan error
- func (api *BasicMarketAPI) ConfirmWorker(ctx context.Context, key *ecdsa.PrivateKey, slave common.Address) <-chan error
- func (api *BasicMarketAPI) CreateChangeRequest(ctx context.Context, key *ecdsa.PrivateKey, req *pb.DealChangeRequest) (*big.Int, error)
- func (api *BasicMarketAPI) GetDealChangeRequestInfo(ctx context.Context, changeRequestID *big.Int) (*pb.DealChangeRequest, error)
- func (api *BasicMarketAPI) GetDealInfo(ctx context.Context, dealID *big.Int) (*pb.Deal, error)
- func (api *BasicMarketAPI) GetDealsAmount(ctx context.Context) (*big.Int, error)
- func (api *BasicMarketAPI) GetMaster(ctx context.Context, slave common.Address) (common.Address, error)
- func (api *BasicMarketAPI) GetNumBenchmarks(ctx context.Context) (uint64, error)
- func (api *BasicMarketAPI) GetOrderInfo(ctx context.Context, orderID *big.Int) (*pb.Order, error)
- func (api *BasicMarketAPI) GetOrdersAmount(ctx context.Context) (*big.Int, error)
- func (api *BasicMarketAPI) OpenDeal(ctx context.Context, key *ecdsa.PrivateKey, askID, bidID *big.Int) <-chan DealOrError
- func (api *BasicMarketAPI) PlaceOrder(ctx context.Context, key *ecdsa.PrivateKey, order *pb.Order) <-chan OrderOrError
- func (api *BasicMarketAPI) QuickBuy(ctx context.Context, key *ecdsa.PrivateKey, askId *big.Int) (*types.Transaction, error)
- func (api *BasicMarketAPI) RegisterWorker(ctx context.Context, key *ecdsa.PrivateKey, master common.Address) <-chan error
- func (api *BasicMarketAPI) RemoveWorker(ctx context.Context, key *ecdsa.PrivateKey, master, slave common.Address) <-chan error
- type BasicSimpleGatekeeper
- func (api *BasicSimpleGatekeeper) Kill(ctx context.Context, key *ecdsa.PrivateKey) (*types.Transaction, error)
- func (api *BasicSimpleGatekeeper) PayIn(ctx context.Context, key *ecdsa.PrivateKey, value *big.Int) (*types.Transaction, error)
- func (api *BasicSimpleGatekeeper) Payout(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, value *big.Int, ...) (*types.Transaction, error)
- type BilledData
- type BlacklistAPI
- type CertificateCreatedData
- type Config
- type CustomClient
- type CustomEthereumClient
- type DealChangeRequestSentData
- type DealChangeRequestUpdatedData
- type DealOpenedData
- type DealOrError
- type DealUpdatedData
- type ErrorData
- type EthereumClientBackend
- type Event
- type EventsAPI
- type MarketAPI
- type Option
- func WithBlockConfirmations(c int64) Option
- func WithConfig(cfg *Config) Option
- func WithMasterchainClient(c CustomEthereumClient) Option
- func WithMasterchainEndpoint(s string) Option
- func WithMasterchainGasPrice(p int64) Option
- func WithSidechainClient(c CustomEthereumClient) Option
- func WithSidechainEndpoint(s string) Option
- func WithSidechainGasPrice(p int64) Option
- func WithTimeout(d time.Duration) Option
- type OracleAPI
- type OracleUSDAPI
- type OrderOrError
- type OrderPlacedData
- type OrderUpdatedData
- type ProfileRegistry
- func (api *ProfileRegistry) AddValidator(ctx context.Context, key *ecdsa.PrivateKey, validator common.Address, ...) (*types.Transaction, error)
- func (api *ProfileRegistry) CreateCertificate(ctx context.Context, key *ecdsa.PrivateKey, owner common.Address, ...) (*types.Transaction, error)
- func (api *ProfileRegistry) GetAttributeCount(ctx context.Context, owner common.Address, attributeType *big.Int) (*big.Int, error)
- func (api *ProfileRegistry) GetAttributeValue(ctx context.Context, owner common.Address, attributeType *big.Int) ([]byte, error)
- func (api *ProfileRegistry) GetCertificate(ctx context.Context, certificateID *big.Int) (*pb.Certificate, error)
- func (api *ProfileRegistry) GetValidator(ctx context.Context, validatorID common.Address) (*pb.Validator, error)
- func (api *ProfileRegistry) RemoveCertificate(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) (*types.Transaction, error)
- func (api *ProfileRegistry) RemoveValidator(ctx context.Context, key *ecdsa.PrivateKey, validator common.Address) (*types.Transaction, error)
- type ProfileRegistryAPI
- type Receipt
- type RemovedFromBlacklistData
- type SimpleGatekeeperAPI
- type StandardTokenApi
- func (api *StandardTokenApi) AllowanceOf(ctx context.Context, from, to common.Address) (*big.Int, error)
- func (api *StandardTokenApi) Approve(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, amount *big.Int) (*types.Transaction, error)
- func (api *StandardTokenApi) BalanceOf(ctx context.Context, address common.Address) (*big.Int, error)
- func (api *StandardTokenApi) TotalSupply(ctx context.Context) (*big.Int, error)
- func (api *StandardTokenApi) Transfer(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, amount *big.Int) (*types.Transaction, error)
- func (api *StandardTokenApi) TransferFrom(ctx context.Context, key *ecdsa.PrivateKey, from common.Address, ...) (*types.Transaction, error)
- type TestTokenAPI
- type TestTokenApi
- type TokenAPI
- type ValidatorCreatedData
- type ValidatorDeletedData
- type WorkerAnnouncedData
- type WorkerConfirmedData
- type WorkerRemovedData
Constants ¶
const BlacklistAddress string = "0x9ad1e969ec5842ee5d67414536813e224ceb56b1"
const GatekeeperLiveAddress string = "0xbc29310be3693949094ce452b11829dbccca7d49"
const GatekeeperSidechainAddress string = "0x9414922e778a0038058e9ea786e9474a89ad1ec0"
const MarketAddress string = "0x51a1d1d1821b4109eb84edc4ca8ec814b1fe9876"
const OracleUsdAddress string = "0x1f995e52dcbec7c0d00d45b8b1bf43b29dd12b5b"
const ProfileRegistryAddress string = "0x1b3a50ee228b040e1b00ef7e7f99058be2684408"
const SNMAddress string = "0x06bda3cf79946e8b32a0bb6a3daa174b577c55b5"
rinkeby
const SNMSidechainAddress string = "0x26524b1234e361eb4e3ddf7600d41271620fcb0a"
private chain
Variables ¶
var ( DealOpenedTopic = common.HexToHash("0xb9ffc65567b7238dd641372277b8c93ed03df73945932dd84fd3cbb33f3eddbf") DealUpdatedTopic = common.HexToHash("0x0b27183934cfdbeb1fbbe288c2e163ed7aa8f458a954054970f78446bccb36e0") OrderPlacedTopic = common.HexToHash("0xffa896d8919f0556f53ace1395617969a3b53ab5271a085e28ac0c4a3724e63d") OrderUpdatedTopic = common.HexToHash("0xb8b459bc0688c37baf5f735d17f1711684bc14ab7db116f88bc18bf409b9309a") DealChangeRequestSentTopic = common.HexToHash("0x7ff56b2eb3ce318aad93d0ba39a3e4a406992a136f9554f17f6bcc43509275d1") DealChangeRequestUpdatedTopic = common.HexToHash("0x4b92d35447745e95b7344414a41ae94984787d0ebcd2c12021169197bb59af39") BilledTopic = common.HexToHash("0x51f87cd83a2ce6c4ff7957861f7aba400dc3857d2325e0c94cc69f468874515c") WorkerAnnouncedTopic = common.HexToHash("0xe398d33bf7e881cdfc9f34c743822904d4e45a0be0db740dd88cb132e4ce2ed9") WorkerConfirmedTopic = common.HexToHash("0x4940ef08d5aed63b7d3d3db293d69d6ed1d624995b90e9e944839c8ea0ae450d") WorkerRemovedTopic = common.HexToHash("0x7822736ed69a5fe0ad6dc2c6669e8053495d711118e5435b047f9b83deda4c37") NumBenchmarksUpdatedTopic = common.HexToHash("0x1acf16d0a0451282e1d2cac3f5473ca7c931bcda610ff6e061041af50e2abc13") )
Market topics
var ( PayInTopic = common.HexToHash("0x63768eabd21c026cb17439a3c6556436c1b0219c2046875297ad3f4b14e6700f") PayOutTopic = common.HexToHash("0x731af16374848c2c73a6154fd410cb421138e7db45c5a904e5a475c756faa8d9") SuicideTopic = common.HexToHash("0xa1ea9b09ea114021983e9ecf71cf2ffddfd80f5cb4f925e5bf24f9bdb5e55fde") )
Gatekeeper topics
var ( AddedToBlacklistTopic = common.HexToHash("0x708802ac7da0a63d9f6b2df693b53345ad263e42d74c245110e1ec1e03a1567e") RemovedFromBlacklistTopic = common.HexToHash("0x576a9aef294e1b4baf3617fde4cbc80ba5344d5eb508222f29e558981704a457") )
Blacklist topics
var ( ValidatorCreatedTopic = common.HexToHash("0x02db26aafd16e8ecd93c4fa202917d50b1693f30b1594e57f7a432ede944eefc") ValidatorDeletedTopic = common.HexToHash("0xa7a579573d398d7b67cd7450121bb250bbd060b29eabafdebc3ce0918658635c") CertificateCreatedTopic = common.HexToHash("0xb9bb1df26fde5c1295a7ccd167330e5d6cb9df14fe4c3884669a64433cc9e760") CertificateUpdatedTopic = common.HexToHash("0x9a100d2018161ede6ca34c8007992b09bbffc636a636014a922e4c8750412628") )
ProfileRegistry topics
var ( TransferTopic = common.HexToHash("0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") ApprovalTopic = common.HexToHash("0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925") )
StandardToken topics
var (
GiveAwayTopic = common.HexToHash("0xe08e9d066634006283658128ec91f58d444719d7a07d49f72924da4352ff94ad")
)
SNMT topics
var (
OwnershipTransferredTopic = common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0")
)
Ownable topics
Functions ¶
func BlacklistAddr ¶
func FindLogByTopic ¶ added in v0.4.1
func GatekeeperLiveAddr ¶
func GatekeeperSidechainAddr ¶
func MarketAddr ¶
func OracleUsdAddr ¶
func ProfileRegistryAddr ¶
func SNMSidechainAddr ¶
Types ¶
type API ¶ added in v0.4.1
type API interface {
ProfileRegistry() ProfileRegistryAPI
Events() EventsAPI
Market() MarketAPI
Blacklist() BlacklistAPI
LiveToken() TokenAPI
SideToken() TokenAPI
TestToken() TestTokenAPI
OracleUSD() OracleAPI
MasterchainGate() SimpleGatekeeperAPI
SidechainGate() SimpleGatekeeperAPI
}
type AddedToBlacklistData ¶ added in v0.4.1
type BasicAPI ¶ added in v0.4.1
type BasicAPI struct {
// contains filtered or unexported fields
}
func (*BasicAPI) Blacklist ¶ added in v0.4.1
func (api *BasicAPI) Blacklist() BlacklistAPI
func (*BasicAPI) MasterchainGate ¶ added in v0.4.1
func (api *BasicAPI) MasterchainGate() SimpleGatekeeperAPI
func (*BasicAPI) ProfileRegistry ¶ added in v0.4.1
func (api *BasicAPI) ProfileRegistry() ProfileRegistryAPI
func (*BasicAPI) SidechainGate ¶ added in v0.4.1
func (api *BasicAPI) SidechainGate() SimpleGatekeeperAPI
func (*BasicAPI) TestToken ¶ added in v0.4.1
func (api *BasicAPI) TestToken() TestTokenAPI
type BasicBlacklistAPI ¶ added in v0.4.1
type BasicBlacklistAPI struct {
// contains filtered or unexported fields
}
func (*BasicBlacklistAPI) Add ¶ added in v0.4.1
func (api *BasicBlacklistAPI) Add(ctx context.Context, key *ecdsa.PrivateKey, who, whom common.Address) (*types.Transaction, error)
func (*BasicBlacklistAPI) AddMaster ¶ added in v0.4.1
func (api *BasicBlacklistAPI) AddMaster(ctx context.Context, key *ecdsa.PrivateKey, root common.Address) (*types.Transaction, error)
func (*BasicBlacklistAPI) Remove ¶ added in v0.4.1
func (api *BasicBlacklistAPI) Remove(ctx context.Context, key *ecdsa.PrivateKey, whom common.Address) error
func (*BasicBlacklistAPI) RemoveMaster ¶ added in v0.4.1
func (api *BasicBlacklistAPI) RemoveMaster(ctx context.Context, key *ecdsa.PrivateKey, root common.Address) (*types.Transaction, error)
func (*BasicBlacklistAPI) SetMarketAddress ¶ added in v0.4.1
func (api *BasicBlacklistAPI) SetMarketAddress(ctx context.Context, key *ecdsa.PrivateKey, market common.Address) (*types.Transaction, error)
type BasicEventsAPI ¶ added in v0.4.1
type BasicEventsAPI struct {
// contains filtered or unexported fields
}
func (*BasicEventsAPI) GetLastBlock ¶ added in v0.4.1
func (api *BasicEventsAPI) GetLastBlock(ctx context.Context) (uint64, error)
type BasicMarketAPI ¶ added in v0.4.1
type BasicMarketAPI struct {
// contains filtered or unexported fields
}
func (*BasicMarketAPI) Bill ¶ added in v0.4.1
func (api *BasicMarketAPI) Bill(ctx context.Context, key *ecdsa.PrivateKey, dealID *big.Int) <-chan error
func (*BasicMarketAPI) CancelChangeRequest ¶ added in v0.4.1
func (api *BasicMarketAPI) CancelChangeRequest(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) error
func (*BasicMarketAPI) CancelOrder ¶ added in v0.4.1
func (api *BasicMarketAPI) CancelOrder(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) <-chan error
func (*BasicMarketAPI) CloseDeal ¶ added in v0.4.1
func (api *BasicMarketAPI) CloseDeal(ctx context.Context, key *ecdsa.PrivateKey, dealID *big.Int, blacklisted bool) <-chan error
func (*BasicMarketAPI) ConfirmWorker ¶ added in v0.4.1
func (api *BasicMarketAPI) ConfirmWorker(ctx context.Context, key *ecdsa.PrivateKey, slave common.Address) <-chan error
func (*BasicMarketAPI) CreateChangeRequest ¶ added in v0.4.1
func (api *BasicMarketAPI) CreateChangeRequest(ctx context.Context, key *ecdsa.PrivateKey, req *pb.DealChangeRequest) (*big.Int, error)
func (*BasicMarketAPI) GetDealChangeRequestInfo ¶ added in v0.4.1
func (api *BasicMarketAPI) GetDealChangeRequestInfo(ctx context.Context, changeRequestID *big.Int) (*pb.DealChangeRequest, error)
func (*BasicMarketAPI) GetDealInfo ¶ added in v0.4.1
func (*BasicMarketAPI) GetDealsAmount ¶ added in v0.4.1
func (*BasicMarketAPI) GetNumBenchmarks ¶ added in v0.4.1
func (api *BasicMarketAPI) GetNumBenchmarks(ctx context.Context) (uint64, error)
func (*BasicMarketAPI) GetOrderInfo ¶ added in v0.4.1
func (*BasicMarketAPI) GetOrdersAmount ¶ added in v0.4.1
func (*BasicMarketAPI) OpenDeal ¶ added in v0.4.1
func (api *BasicMarketAPI) OpenDeal(ctx context.Context, key *ecdsa.PrivateKey, askID, bidID *big.Int) <-chan DealOrError
func (*BasicMarketAPI) PlaceOrder ¶ added in v0.4.1
func (api *BasicMarketAPI) PlaceOrder(ctx context.Context, key *ecdsa.PrivateKey, order *pb.Order) <-chan OrderOrError
func (*BasicMarketAPI) QuickBuy ¶ added in v0.4.1
func (api *BasicMarketAPI) QuickBuy(ctx context.Context, key *ecdsa.PrivateKey, askId *big.Int) (*types.Transaction, error)
func (*BasicMarketAPI) RegisterWorker ¶ added in v0.4.1
func (api *BasicMarketAPI) RegisterWorker(ctx context.Context, key *ecdsa.PrivateKey, master common.Address) <-chan error
func (*BasicMarketAPI) RemoveWorker ¶ added in v0.4.1
func (api *BasicMarketAPI) RemoveWorker(ctx context.Context, key *ecdsa.PrivateKey, master, slave common.Address) <-chan error
type BasicSimpleGatekeeper ¶ added in v0.4.1
type BasicSimpleGatekeeper struct {
// contains filtered or unexported fields
}
func (*BasicSimpleGatekeeper) Kill ¶ added in v0.4.1
func (api *BasicSimpleGatekeeper) Kill(ctx context.Context, key *ecdsa.PrivateKey) (*types.Transaction, error)
func (*BasicSimpleGatekeeper) PayIn ¶ added in v0.4.1
func (api *BasicSimpleGatekeeper) PayIn(ctx context.Context, key *ecdsa.PrivateKey, value *big.Int) (*types.Transaction, error)
type BilledData ¶ added in v0.4.1
type BlacklistAPI ¶ added in v0.4.1
type BlacklistAPI interface {
Check(ctx context.Context, who, whom common.Address) (bool, error)
Add(ctx context.Context, key *ecdsa.PrivateKey, who, whom common.Address) (*types.Transaction, error)
Remove(ctx context.Context, key *ecdsa.PrivateKey, whom common.Address) error
AddMaster(ctx context.Context, key *ecdsa.PrivateKey, root common.Address) (*types.Transaction, error)
RemoveMaster(ctx context.Context, key *ecdsa.PrivateKey, root common.Address) (*types.Transaction, error)
SetMarketAddress(ctx context.Context, key *ecdsa.PrivateKey, market common.Address) (*types.Transaction, error)
}
func NewBasicBlacklist ¶ added in v0.4.1
func NewBasicBlacklist(address common.Address, opts *chainOpts) (BlacklistAPI, error)
type CertificateCreatedData ¶ added in v0.4.1
type Config ¶ added in v0.4.1
Config represents SONM blockchain configuration structure that can act as a building block for more complex configs.
func (*Config) UnmarshalYAML ¶ added in v0.4.1
type CustomClient ¶ added in v0.4.1
func (*CustomClient) GetLastBlock ¶ added in v0.4.1
func (*CustomClient) GetTransactionReceipt ¶ added in v0.4.1
type CustomEthereumClient ¶ added in v0.4.1
type CustomEthereumClient interface {
EthereumClientBackend
// GetLastBlock returns number of last mined block
GetLastBlock(ctx context.Context) (*big.Int, error)
// GetTransactionReceipt returns receipt of mined transaction or notFound if tx not mined
GetTransactionReceipt(ctx context.Context, txHash common.Hash) (*Receipt, error)
}
CustomEthereumClient extends EthereumClientBackend
func NewClient ¶ added in v0.4.1
func NewClient(endpoint string) (CustomEthereumClient, error)
type DealChangeRequestSentData ¶ added in v0.4.1
type DealChangeRequestUpdatedData ¶ added in v0.4.1
type DealOpenedData ¶ added in v0.4.1
type DealOrError ¶
type DealUpdatedData ¶ added in v0.4.1
type EthereumClientBackend ¶ added in v0.4.1
type EthereumClientBackend interface {
bind.ContractBackend
ethereum.ChainReader
ethereum.TransactionReader
}
EthereumClientBackend release all methods to execute interaction with Ethereum Blockchain
type EventsAPI ¶ added in v0.4.1
type MarketAPI ¶ added in v0.4.1
type MarketAPI interface {
QuickBuy(ctx context.Context, key *ecdsa.PrivateKey, askId *big.Int) (*types.Transaction, error)
OpenDeal(ctx context.Context, key *ecdsa.PrivateKey, askID, bigID *big.Int) <-chan DealOrError
CloseDeal(ctx context.Context, key *ecdsa.PrivateKey, dealID *big.Int, blacklisted bool) <-chan error
GetDealInfo(ctx context.Context, dealID *big.Int) (*pb.Deal, error)
GetDealsAmount(ctx context.Context) (*big.Int, error)
PlaceOrder(ctx context.Context, key *ecdsa.PrivateKey, order *pb.Order) <-chan OrderOrError
CancelOrder(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) <-chan error
GetOrderInfo(ctx context.Context, orderID *big.Int) (*pb.Order, error)
GetOrdersAmount(ctx context.Context) (*big.Int, error)
Bill(ctx context.Context, key *ecdsa.PrivateKey, dealID *big.Int) <-chan error
RegisterWorker(ctx context.Context, key *ecdsa.PrivateKey, master common.Address) <-chan error
ConfirmWorker(ctx context.Context, key *ecdsa.PrivateKey, slave common.Address) <-chan error
RemoveWorker(ctx context.Context, key *ecdsa.PrivateKey, master, slave common.Address) <-chan error
GetMaster(ctx context.Context, slave common.Address) (common.Address, error)
GetDealChangeRequestInfo(ctx context.Context, id *big.Int) (*pb.DealChangeRequest, error)
CreateChangeRequest(ctx context.Context, key *ecdsa.PrivateKey, request *pb.DealChangeRequest) (*big.Int, error)
CancelChangeRequest(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) error
GetNumBenchmarks(ctx context.Context) (uint64, error)
}
type Option ¶ added in v0.4.1
type Option func(options *options)
func WithBlockConfirmations ¶ added in v0.4.1
func WithConfig ¶ added in v0.4.1
func WithMasterchainClient ¶ added in v0.4.1
func WithMasterchainClient(c CustomEthereumClient) Option
func WithMasterchainEndpoint ¶ added in v0.4.1
func WithMasterchainGasPrice ¶ added in v0.4.1
func WithSidechainClient ¶ added in v0.4.1
func WithSidechainClient(c CustomEthereumClient) Option
func WithSidechainEndpoint ¶ added in v0.4.1
func WithSidechainGasPrice ¶ added in v0.4.1
func WithTimeout ¶ added in v0.4.1
type OracleAPI ¶ added in v0.4.1
type OracleAPI interface {
// SetCurrentPrice sets current price relation between some currency and SONM token
SetCurrentPrice(ctx context.Context, key *ecdsa.PrivateKey, price *big.Int) (*types.Transaction, error)
// GetCurrentPrice returns current price relation between some currency and SONM token
GetCurrentPrice(ctx context.Context) (*big.Int, error)
}
OracleAPI manage price relation between some currency and SNM token
type OracleUSDAPI ¶ added in v0.4.1
type OracleUSDAPI struct {
// contains filtered or unexported fields
}
func (*OracleUSDAPI) GetCurrentPrice ¶ added in v0.4.1
func (*OracleUSDAPI) SetCurrentPrice ¶ added in v0.4.1
func (api *OracleUSDAPI) SetCurrentPrice(ctx context.Context, key *ecdsa.PrivateKey, price *big.Int) (*types.Transaction, error)
type OrderOrError ¶
type OrderPlacedData ¶ added in v0.4.1
type OrderUpdatedData ¶ added in v0.4.1
type ProfileRegistry ¶ added in v0.4.1
type ProfileRegistry struct {
// contains filtered or unexported fields
}
func (*ProfileRegistry) AddValidator ¶ added in v0.4.1
func (api *ProfileRegistry) AddValidator(ctx context.Context, key *ecdsa.PrivateKey, validator common.Address, level int8) (*types.Transaction, error)
func (*ProfileRegistry) CreateCertificate ¶ added in v0.4.1
func (api *ProfileRegistry) CreateCertificate(ctx context.Context, key *ecdsa.PrivateKey, owner common.Address, attributeType *big.Int, value []byte) (*types.Transaction, error)
func (*ProfileRegistry) GetAttributeCount ¶ added in v0.4.1
func (*ProfileRegistry) GetAttributeValue ¶ added in v0.4.1
func (*ProfileRegistry) GetCertificate ¶ added in v0.4.1
func (api *ProfileRegistry) GetCertificate(ctx context.Context, certificateID *big.Int) (*pb.Certificate, error)
func (*ProfileRegistry) GetValidator ¶ added in v0.4.1
func (*ProfileRegistry) RemoveCertificate ¶ added in v0.4.1
func (api *ProfileRegistry) RemoveCertificate(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) (*types.Transaction, error)
func (*ProfileRegistry) RemoveValidator ¶ added in v0.4.1
func (api *ProfileRegistry) RemoveValidator(ctx context.Context, key *ecdsa.PrivateKey, validator common.Address) (*types.Transaction, error)
type ProfileRegistryAPI ¶ added in v0.4.1
type ProfileRegistryAPI interface {
AddValidator(ctx context.Context, key *ecdsa.PrivateKey, validator common.Address, level int8) (*types.Transaction, error)
RemoveValidator(ctx context.Context, key *ecdsa.PrivateKey, validator common.Address) (*types.Transaction, error)
GetValidator(ctx context.Context, validatorID common.Address) (*pb.Validator, error)
CreateCertificate(ctx context.Context, key *ecdsa.PrivateKey, owner common.Address, attributeType *big.Int, value []byte) (*types.Transaction, error)
RemoveCertificate(ctx context.Context, key *ecdsa.PrivateKey, id *big.Int) (*types.Transaction, error)
GetCertificate(ctx context.Context, certificateID *big.Int) (*pb.Certificate, error)
GetAttributeCount(ctx context.Context, owner common.Address, attributeType *big.Int) (*big.Int, error)
GetAttributeValue(ctx context.Context, owner common.Address, attributeType *big.Int) ([]byte, error)
}
func NewProfileRegistry ¶ added in v0.4.1
func NewProfileRegistry(address common.Address, opts *chainOpts) (ProfileRegistryAPI, error)
type Receipt ¶ added in v0.4.1
Receipt extends transaction receipt with block number on which this transaction was mined.
func WaitTransactionReceipt ¶ added in v0.4.1
func WaitTransactionReceipt(ctx context.Context, client CustomEthereumClient, confirmations int64, logParsePeriod time.Duration, tx *types.Transaction) (*Receipt, error)
func (*Receipt) UnmarshalJSON ¶ added in v0.4.1
UnmarshalJSON calls parent unmarshaller for Receipt and also unmarshall block number and associate it with the struct.
type RemovedFromBlacklistData ¶ added in v0.4.1
type SimpleGatekeeperAPI ¶ added in v0.4.1
type SimpleGatekeeperAPI interface {
// PayIn grab sender tokens and signal gate to transfer it to mirrored chain.
// On Masterchain ally as `Deposit`
// On Sidecain ally as `Withdraw`
PayIn(ctx context.Context, key *ecdsa.PrivateKey, value *big.Int) (*types.Transaction, error)
// PayOut release payout transaction from mirrored chain.
// Accessible only by owner.
Payout(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, value *big.Int, txNumber *big.Int) (*types.Transaction, error)
// Kill calls contract to suicide, all ether and tokens funds transfer to owner.
// Accessible only by owner.
Kill(ctx context.Context, key *ecdsa.PrivateKey) (*types.Transaction, error)
}
SimpleGatekeeperAPI facade to interact with deposit/withdraw functions through gates
func NewSimpleGatekeeper ¶ added in v0.4.1
func NewSimpleGatekeeper(address common.Address, opts *chainOpts) (SimpleGatekeeperAPI, error)
type StandardTokenApi ¶ added in v0.4.1
type StandardTokenApi struct {
// contains filtered or unexported fields
}
func (*StandardTokenApi) AllowanceOf ¶ added in v0.4.1
func (*StandardTokenApi) Approve ¶ added in v0.4.1
func (api *StandardTokenApi) Approve(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, amount *big.Int) (*types.Transaction, error)
func (*StandardTokenApi) TotalSupply ¶ added in v0.4.1
func (*StandardTokenApi) Transfer ¶ added in v0.4.1
func (api *StandardTokenApi) Transfer(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, amount *big.Int) (*types.Transaction, error)
func (*StandardTokenApi) TransferFrom ¶ added in v0.4.1
func (api *StandardTokenApi) TransferFrom(ctx context.Context, key *ecdsa.PrivateKey, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error)
type TestTokenAPI ¶ added in v0.4.1
type TestTokenAPI interface {
// GetTokens - send 100 SNMT token for message caller
// this function added for MVP purposes and has been deleted later
GetTokens(ctx context.Context, key *ecdsa.PrivateKey) (*types.Transaction, error)
}
func NewTestToken ¶ added in v0.4.1
func NewTestToken(address common.Address, opts *chainOpts) (TestTokenAPI, error)
type TestTokenApi ¶ added in v0.4.1
type TestTokenApi struct {
// contains filtered or unexported fields
}
func (*TestTokenApi) GetTokens ¶ added in v0.4.1
func (api *TestTokenApi) GetTokens(ctx context.Context, key *ecdsa.PrivateKey) (*types.Transaction, error)
type TokenAPI ¶ added in v0.4.1
type TokenAPI interface {
// Approve - add allowance from caller to other contract to spend tokens
Approve(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, amount *big.Int) (*types.Transaction, error)
// Transfer token from caller
Transfer(ctx context.Context, key *ecdsa.PrivateKey, to common.Address, amount *big.Int) (*types.Transaction, error)
// TransferFrom fallback function for contracts to transfer you allowance
TransferFrom(ctx context.Context, key *ecdsa.PrivateKey, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error)
// BalanceOf returns balance of given address
BalanceOf(ctx context.Context, address common.Address) (*big.Int, error)
// AllowanceOf returns allowance of given address to spender account
AllowanceOf(ctx context.Context, from, to common.Address) (*big.Int, error)
// TotalSupply - all amount of emitted token
TotalSupply(ctx context.Context) (*big.Int, error)
}
TokenAPI is a go implementation of ERC20-compatibility token with full functionality high-level interface standard description with placed: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md