Documentation ¶
Index ¶
Constants ¶
const StateABIJSON = "" /* 3702-byte string literal not displayed */
StateABIJSON is JSON ABI of state contract
Variables ¶
var StateABI abi.ABI
StateABI is an ABI of State contarct
Functions ¶
This section is empty.
Types ¶
type BlockchainCaller ¶
type BlockchainCaller interface { // CallContract cals smart contract. For read operation with single bigInt param CallContract(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error) }
BlockchainCaller is an interface for smart contract call
type ETHResolver ¶
ETHResolver resolver for eth blockchains
func (ETHResolver) Resolve ¶
func (r ETHResolver) Resolve(ctx context.Context, id, state *big.Int) (*ResolvedState, error)
Resolve returns Resolved state from blockchain
type ExtendedVerificationsOptions ¶
type ExtendedVerificationsOptions struct { VerificationOptions OnlyLatestStates bool AcceptedStateTransitionDelay time.Duration }
ExtendedVerificationsOptions allows to set additional options
type ResolvedState ¶
type ResolvedState struct { State string `json:"state"` Latest bool `json:"latest"` TransitionTimestamp int64 `json:"transition_timestamp"` }
ResolvedState can be the state verification result
func Resolve ¶
func Resolve(ctx context.Context, c BlockchainCaller, contractAddress string, id, state *big.Int) (*ResolvedState, error)
Resolve is used to resolve identity state rpcURL - url to connect to the blockchain contractAddress is an address of state contract id is base58 identifier e.g. id:11A2HgCZ1pUcY8HoNDMjNWEBQXZdUnL3YVnVCUvR5s state is bigint string representation of identity state
type TransitionInfo ¶
type TransitionInfo struct { ReplacedAtTimestamp *big.Int CreatedAtTimestamp *big.Int ReplacedAtBlock uint64 CreatedAtBlock uint64 ID *big.Int ReplacedBy *big.Int }
TransitionInfo is information about state transition
func (*TransitionInfo) Unmarshal ¶
func (ti *TransitionInfo) Unmarshal(data []interface{}) error
Unmarshal returns contract call result as TransitionInfo structure
type Unmarshaler ¶
type Unmarshaler interface {
Unmarshal([]interface{}) error
}
Unmarshaler is used for contract call result parser
type VerificationOptions ¶
VerificationOptions is options for state verification