Versions in this module Expand all Collapse all v0 v0.6.5 Oct 7, 2019 Changes in this version + var ErrDecryptedSecretKeyIsInvalid = errors.New("decrypted data secret key is invalid, it's safe to dispute") + var ErrExchangeHasNotExpired = errors.New("exchange has not expired") + var ErrExchangeIsExpiredOrWillBeExpiredVerySoon = errors.New("exchange is expired or will be expired very soon") + var ErrExchangeMustBeAccepted = errors.New("private data exchange must be in Accepted state") + var ErrExchangeMustBeClosedOrAccepted = errors.New("private data exchange must be in Closed or Accepted state") + var ErrExchangeMustBeProposed = errors.New("private data exchange must be in Proposed state") + var ErrInvalidExchangeKey = errors.New("invalid exchange key") + var ErrInvalidPassportOwnerKey = errors.New("facts: passport owner key is invalid") + var ErrInvalidSecretKey = errors.New("facts: secret key to decrypt data is invalid") + var ErrIsNotAllowedFactProvider = errors.New("facts: not allowed fact provider") + var ErrOnlyDataRequesterAllowedToCall = errors.New("only the data requester allowed to call") + var ErrOnlyExchangeParticipantsAreAllowedToCall = errors.New("only data requester or passport owner are allowed to call") + var ErrOutOfInt256Range = errors.New("facts: out of int256 range") + var ErrOutOfUint256Range = errors.New("facts: out of uint256 range") + var ErrOwnerMustClaimOwnership = errors.New("facts: owner must claim ownership of the passport") + type Change struct + ChangeType change.Type + DataType data.Type + FactProvider common.Address + Key [32]byte + Raw types.Log + type ChangeIterator struct + Change *Change + func (it *ChangeIterator) Close() error + func (it *ChangeIterator) Error() error + func (it *ChangeIterator) Next() bool + func (it *ChangeIterator) ToSlice() (ps []*Change, err error) + type ChangesFilterOpts struct + ChangeType []change.Type + Context context.Context + DataType []data.Type + End *uint64 + FactProvider []common.Address + Key [][32]byte + Start uint64 + type Clock interface + Now func() time.Time + type DisputePrivateDataExchangeResult struct + Cheater common.Address + Successful bool + type DisputePrivateDataExchangeResultNoWait struct + ExchangeIdx *big.Int + TxHash common.Hash + type ExchangeAcceptor struct + func NewExchangeAcceptor(e *eth.Eth, passportOwnerKey *ecdsa.PrivateKey, fs *ipfs.IPFS, clock Clock) *ExchangeAcceptor + func (a *ExchangeAcceptor) AcceptPrivateDataExchange(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) error + func (a *ExchangeAcceptor) AcceptPrivateDataExchangeNoWait(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) (common.Hash, error) + type ExchangeDataReader struct + func NewExchangeDataReader(e *eth.Eth, fs *ipfs.IPFS) *ExchangeDataReader + func (r *ExchangeDataReader) ReadPrivateData(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int, ...) ([]byte, error) + type ExchangeDisputer struct + func NewExchangeDisputer(s *eth.Session, clock Clock) *ExchangeDisputer + func (f *ExchangeDisputer) DisputePrivateDataExchange(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int, ...) (*DisputePrivateDataExchangeResult, error) + func (f *ExchangeDisputer) DisputePrivateDataExchangeNoWait(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int, ...) (*DisputePrivateDataExchangeResultNoWait, error) + func (f *ExchangeDisputer) GetDisputePrivateDataExchangeResult(ctx context.Context, noWaitResult *DisputePrivateDataExchangeResultNoWait) (*DisputePrivateDataExchangeResult, error) + type ExchangeFinisher struct + func NewExchangeFinisher(s *eth.Session, clock Clock) *ExchangeFinisher + func (f *ExchangeFinisher) FinishPrivateDataExchange(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) error + func (f *ExchangeFinisher) FinishPrivateDataExchangeNoWait(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) (common.Hash, error) + type ExchangeProposer eth.Session + func NewExchangeProposer(s *eth.Session) *ExchangeProposer + func (e *ExchangeProposer) GetProposePrivateDataExchangeResult(ctx context.Context, noWaitResult *ProposePrivateDataExchangeResultNoWait) (*ProposePrivateDataExchangeResult, error) + func (e *ExchangeProposer) ProposePrivateDataExchange(ctx context.Context, passportAddress common.Address, ...) (*ProposePrivateDataExchangeResult, error) + func (e *ExchangeProposer) ProposePrivateDataExchangeNoWait(ctx context.Context, passportAddress common.Address, ...) (*ProposePrivateDataExchangeResultNoWait, error) + type ExchangeStatusGetter eth.Eth + func NewExchangeStatusGetter(e *eth.Eth) *ExchangeStatusGetter + func (g *ExchangeStatusGetter) GetPrivateDataExchangeStatus(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) (*PrivateDataExchangeStatus, error) + type ExchangeTimeouter struct + func NewExchangeTimeouter(s *eth.Session, clock Clock) *ExchangeTimeouter + func (f *ExchangeTimeouter) TimeoutPrivateDataExchange(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) error + func (f *ExchangeTimeouter) TimeoutPrivateDataExchangeNoWait(ctx context.Context, passportAddress common.Address, exchangeIdx *big.Int) (common.Hash, error) + type Historian eth.Eth + func NewHistorian(e *eth.Eth) *Historian + func (h *Historian) FilterChanges(opts *ChangesFilterOpts, passportAddress common.Address) (*ChangeIterator, error) + func (h *Historian) GetHistoryItemOfWriteAddress(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteAddressHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteBool(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteBoolHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteBytes(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteBytesHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteIPFSHash(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteIPFSHashHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteInt(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteIntHistoryItem, error) + func (h *Historian) GetHistoryItemOfWritePrivateDataHashes(ctx context.Context, passport common.Address, txHash common.Hash) (*WritePrivateDataHashesHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteString(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteStringHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteTxData(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteTxDataHistoryItem, error) + func (h *Historian) GetHistoryItemOfWriteUint(ctx context.Context, passport common.Address, txHash common.Hash) (*WriteUintHistoryItem, error) + type IPFSDataReader struct + func NewIPFSDataReader(e *eth.Eth, fs *ipfs.IPFS) *IPFSDataReader + func (p *IPFSDataReader) ReadHistoryIPFSData(ctx context.Context, passportAddress common.Address, txHash common.Hash) (io.ReadCloser, error) + func (p *IPFSDataReader) ReadIPFSData(ctx context.Context, passportAddress common.Address, ...) (io.ReadCloser, error) + type IPFSDataWriter struct + func NewIPFSDataWriter(s *eth.Session, fs *ipfs.IPFS) *IPFSDataWriter + func (p *IPFSDataWriter) WriteIPFSData(ctx context.Context, passportAddress common.Address, factKey [32]byte, ...) (*WriteIPFSDataResult, error) + type PrivateDataExchangeStatus struct + DataIPFSHash string + DataKeyHash common.Hash + DataRequester common.Address + DataRequesterStaked *big.Int + EncryptedDataKey [32]byte + EncryptedExchangeKey []byte + ExchangeKeyHash common.Hash + FactKey [32]byte + FactProvider common.Address + PassportOwner common.Address + PassportOwnerStaked *big.Int + State exchange.StateType + StateExpirationTime time.Time + type PrivateDataHashes struct + DataIPFSHash string + DataKeyHash [32]byte + type PrivateDataReader struct + func NewPrivateDataReader(e *eth.Eth, fs *ipfs.IPFS) *PrivateDataReader + func (r *PrivateDataReader) DecryptPrivateData(ctx context.Context, dataIPFSHash string, secretKey []byte, ...) ([]byte, error) + func (r *PrivateDataReader) DecryptSecretKey(ctx context.Context, passportOwnerPrivateKey *ecdsa.PrivateKey, ...) ([]byte, error) + func (r *PrivateDataReader) ReadHistoryPrivateData(ctx context.Context, passportOwnerPrivateKey *ecdsa.PrivateKey, ...) ([]byte, error) + func (r *PrivateDataReader) ReadHistoryPrivateDataUsingSecretKey(ctx context.Context, secretKey []byte, passportAddress common.Address, ...) ([]byte, error) + func (r *PrivateDataReader) ReadPrivateData(ctx context.Context, passportOwnerPrivateKey *ecdsa.PrivateKey, ...) ([]byte, error) + func (r *PrivateDataReader) ReadPrivateDataUsingSecretKey(ctx context.Context, secretKey []byte, passportAddress common.Address, ...) ([]byte, error) + func (r *PrivateDataReader) ReadSecretKey(ctx context.Context, passportOwnerPrivateKey *ecdsa.PrivateKey, ...) ([]byte, error) + type PrivateDataWriter struct + func NewPrivateDataWriter(s *eth.Session, fs *ipfs.IPFS) *PrivateDataWriter + func (w *PrivateDataWriter) WritePrivateData(ctx context.Context, passportAddress common.Address, factKey [32]byte, ...) (*WritePrivateDataResult, error) + func (w *PrivateDataWriter) WritePrivateDataNoWait(ctx context.Context, passportAddress common.Address, factKey [32]byte, ...) (*WritePrivateDataResult, error) + type ProposePrivateDataExchangeResult struct + ExchangeIdx *big.Int + ExchangeKey [32]byte + ExchangeKeyHash common.Hash + type ProposePrivateDataExchangeResultNoWait struct + ExchangeKey [32]byte + ExchangeKeyHash common.Hash + TxHash common.Hash + type Provider eth.Session + func NewProvider(s *eth.Session) *Provider + func (p *Provider) DeleteAddress(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteAddressNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteBool(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteBoolNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteBytes(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteBytesNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteIPFSHash(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteIPFSHashNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteInt(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteIntNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeletePrivateDataHashes(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeletePrivateDataHashesNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteString(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteStringNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteTxData(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteTxDataNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteUint(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) DeleteUintNoWait(ctx context.Context, passportAddress common.Address, key [32]byte) (common.Hash, error) + func (p *Provider) WriteAddress(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WriteAddressNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WriteBool(ctx context.Context, passportAddress common.Address, key [32]byte, data bool) (common.Hash, error) + func (p *Provider) WriteBoolNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, data bool) (common.Hash, error) + func (p *Provider) WriteBytes(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error) + func (p *Provider) WriteBytesNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error) + func (p *Provider) WriteIPFSHash(ctx context.Context, passportAddress common.Address, key [32]byte, hash string) (common.Hash, error) + func (p *Provider) WriteIPFSHashNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, hash string) (common.Hash, error) + func (p *Provider) WriteInt(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WriteIntNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WritePrivateDataHashes(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WritePrivateDataHashesNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WriteString(ctx context.Context, passportAddress common.Address, key [32]byte, data string) (common.Hash, error) + func (p *Provider) WriteStringNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, data string) (common.Hash, error) + func (p *Provider) WriteTxData(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error) + func (p *Provider) WriteTxDataNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, data []byte) (common.Hash, error) + func (p *Provider) WriteUint(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + func (p *Provider) WriteUintNoWait(ctx context.Context, passportAddress common.Address, key [32]byte, ...) (common.Hash, error) + type Reader eth.Eth + func NewReader(e *eth.Eth) *Reader + func (r *Reader) ReadAddress(ctx context.Context, passport common.Address, factProvider common.Address, ...) (common.Address, error) + func (r *Reader) ReadBool(ctx context.Context, passport common.Address, factProvider common.Address, ...) (bool, error) + func (r *Reader) ReadBytes(ctx context.Context, passport common.Address, factProvider common.Address, ...) ([]byte, error) + func (r *Reader) ReadIPFSHash(ctx context.Context, passport common.Address, factProvider common.Address, ...) (string, error) + func (r *Reader) ReadInt(ctx context.Context, passport common.Address, factProvider common.Address, ...) (*big.Int, error) + func (r *Reader) ReadOwnerPublicKey(ctx context.Context, passport common.Address) (pk *ecdsa.PublicKey, err error) + func (r *Reader) ReadPrivateDataHashes(ctx context.Context, passport common.Address, factProvider common.Address, ...) (*PrivateDataHashes, error) + func (r *Reader) ReadString(ctx context.Context, passport common.Address, factProvider common.Address, ...) (string, error) + func (r *Reader) ReadTxData(ctx context.Context, passport common.Address, factProvider common.Address, ...) ([]byte, error) + func (r *Reader) ReadUint(ctx context.Context, passport common.Address, factProvider common.Address, ...) (*big.Int, error) + type WriteAddressHistoryItem struct + Data common.Address + FactProvider common.Address + Key [32]byte + type WriteBoolHistoryItem struct + Data bool + FactProvider common.Address + Key [32]byte + type WriteBytesHistoryItem struct + Data []byte + FactProvider common.Address + Key [32]byte + type WriteIPFSDataResult struct + IPFSHash string + TransactionHash common.Hash + type WriteIPFSHashHistoryItem struct + FactProvider common.Address + Hash string + Key [32]byte + type WriteIntHistoryItem struct + Data *big.Int + FactProvider common.Address + Key [32]byte + type WritePrivateDataHashesHistoryItem struct + DataIPFSHash string + DataKeyHash [32]byte + FactProvider common.Address + Key [32]byte + type WritePrivateDataResult struct + DataIPFSHash string + DataKey []byte + DataKeyHash [32]byte + TransactionHash common.Hash + type WriteStringHistoryItem struct + Data string + FactProvider common.Address + Key [32]byte + type WriteTxDataHistoryItem struct + Data []byte + FactProvider common.Address + Key [32]byte + type WriteUintHistoryItem struct + Data *big.Int + FactProvider common.Address + Key [32]byte