github.com/quantosnetwork/Quantos@v0.0.0-20220306172517-e20b28c5a29a/sdk/sdk.go (about) 1 package sdk 2 3 import ( 4 "github.com/quantosnetwork/Quantos/address" 5 "github.com/quantosnetwork/Quantos/crypto" 6 "go.dedis.ch/kyber/v3" 7 "go.dedis.ch/kyber/v3/suites" 8 "net" 9 ) 10 11 const SDKVERSION = 1 12 13 type QuantosSDK interface { 14 Version() int 15 KeyManager() KeyManager 16 AccountManager() AccountManager 17 Protocol() Protocol 18 BlockchainManager() 19 Wire() 20 GetChainConfig() map[string]string 21 } 22 23 type KeyManager interface { 24 GenerateKeyPair() *crypto.HardenedKeys 25 SignItem(item []byte) []byte 26 ValidateSignedItem(item []byte, sig []byte) (bool, error) 27 GetPublicKey() kyber.Point 28 GetPrivateKey() kyber.Scalar 29 GetCurrentSuite() suites.Suite 30 ExchangeSecrets() bool 31 Encrypt() 32 Decrypt() 33 } 34 type AccountManager interface { 35 CreateNewAccount() *address.Account 36 GetAddressFromAccount() address.Address 37 GetAccountFromAddress(addr address.Address) *address.Account 38 Wallet() 39 Keys() KeyManager 40 Authenticate(args ...[]byte) bool 41 } 42 type Protocol interface { 43 P2P() 44 KeyExchangeProtocol() 45 } 46 47 type VM interface { 48 } 49 50 type API interface { 51 Connection() net.Conn 52 Auth() 53 Synchronize() 54 GetEndpoints() map[string]string 55 Disconnect() 56 Close() 57 Send(dataType string, value interface{}) 58 SendTo(uri string, dataType string, value interface{}) 59 Subscribe(topic string) chan interface{} 60 Info() 61 Stats() 62 Metrics() 63 }