Documentation
¶
Index ¶
- Constants
- type AddressRight
- type BatchTxResponse
- type ExecutorRequest
- type ExecutorResponse
- type Fee
- type IndustrialMetadata
- type Ledgerdeprecated
- func (l *Ledger) GetPending(token string, txID ...string)deprecated
- func (l *Ledger) GetStub(name string) *stub.Stubdeprecated
- func (l *Ledger) GetStubByKey(key string) *stub.Stubdeprecated
- func (l *Ledger) IndustrialMetadata(ch string) *IndustrialMetadatadeprecated
- func (l *Ledger) Metadata(ch string) *Metadatadeprecated
- func (l *Ledger) NewCC(name string, bci core.BaseContractInterface, config string, ...) stringdeprecated
- func (l *Ledger) NewCCArgsArr(name string, bci core.BaseContractInterface, initArgs []string, ...) string
- func (l *Ledger) NewMultisigWallet(n int) *Multisigdeprecated
- func (l *Ledger) NewWallet() *Walletdeprecated
- func (l *Ledger) NewWalletFromHexKey(key string) *Walletdeprecated
- func (l *Ledger) NewWalletFromKey(key string) *Walletdeprecated
- func (l *Ledger) SetACL(aclStub *stub.Stub)deprecated
- func (l *Ledger) UpdateStubTxID(stubName string, newTxID string)deprecated
- func (l *Ledger) WaitChTransferTo(name string, id string, timeout time.Duration)deprecated
- func (l *Ledger) WaitMultiSwapAnswer(name string, id string, timeout time.Duration)
- func (l *Ledger) WaitSwapAnswer(name string, id string, timeout time.Duration)deprecated
- type Metadata
- type MetadataGroup
- type MetadataRate
- type Multisigdeprecated
- func (w *Multisig) Address() stringdeprecated
- func (w *Multisig) AddressType() *types.Addressdeprecated
- func (w *Multisig) ChangeKeysFor(index int, sKey ed25519.PrivateKey) errordeprecated
- func (w *Multisig) PubKeys() []ed25519.PublicKeydeprecated
- func (w *Multisig) RawSignedInvoke(signCnt int, ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)deprecated
- func (w *Multisig) SecretKeys() []ed25519.PrivateKeydeprecated
- type Right
- type TxResponse
- type Walletdeprecated
- func (w *Wallet) AddAccountRight(right *Right) errordeprecated
- func (w *Wallet) AddAddressRightForNominee(right *AddressRight) errordeprecated
- func (w *Wallet) AddAllowedBalance(ch string, token string, amount uint64)
- func (w *Wallet) AddBalance(ch string, amount uint64)
- func (w *Wallet) AddGivenBalance(ch string, givenBalanceChannel string, amount uint64)
- func (w *Wallet) AddTokenBalance(ch string, token string, amount uint64)
- func (w *Wallet) Address() stringdeprecated
- func (w *Wallet) AddressType() *types.Address
- func (w *Wallet) AllowedBalanceShouldBe(ch string, token string, expected uint64)
- func (w *Wallet) BalanceShouldBe(ch string, expected uint64)
- func (w *Wallet) BatchedInvoke(ch, fn string, args ...string) (string, TxResponse)
- func (w *Wallet) ChangeKeys(sKey ed25519.PrivateKey) errordeprecated
- func (w *Wallet) CheckGivenBalanceShouldBe(ch string, token string, expectedBalance uint64)
- func (w *Wallet) DoBatch(ch string, txID ...string) BatchTxResponse
- func (w *Wallet) ExecuteNoSignedInvoke(ch string, fn string, args ...string) ([]byte, error)deprecated
- func (w *Wallet) ExecuteSignedInvoke(ch string, fn string, args ...string) ([]byte, error)deprecated
- func (w *Wallet) GivenBalanceShouldBe(ch string, token string, expected uint64)
- func (w *Wallet) GroupBalanceShouldBe(ch, group string, expected uint64)
- func (w *Wallet) IndustrialBalanceShouldBe(ch, group string, expected uint64)
- func (w *Wallet) Invoke(ch, fn string, args ...string) string
- func (w *Wallet) InvokeReturnsTxID(ch, fn string, args ...string) string
- func (w *Wallet) InvokeTraced(ctx context.Context, ch, fn string, args ...string) stringdeprecated
- func (w *Wallet) InvokeWithError(ch, fn string, args ...string) error
- func (w *Wallet) InvokeWithPeerResponse(ch, fn string, args ...string) (peer.Response, error)
- func (w *Wallet) Ledger() *Ledger
- func (w *Wallet) NbInvoke(ch string, fn string, args ...string) (string, string)
- func (w *Wallet) NbInvokeTraced(ctx context.Context, ch string, fn string, args ...string) (string, string)deprecated
- func (w *Wallet) OtfBalanceShouldBe(ch string, token string, expected uint64)
- func (w *Wallet) OtfNbInvoke(ch string, fn string, args ...string) (string, string)deprecated
- func (w *Wallet) PubKey() []bytedeprecated
- func (w *Wallet) RawChTransferInvoke(ch, fn string, args ...string) (string, TxResponse, error)
- func (w *Wallet) RawChTransferInvokeWithBatch(ch string, fn string, args ...string) (string, TxResponse, error)
- func (w *Wallet) RawSignedInvoke(ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)
- func (w *Wallet) RawSignedInvokeTraced(ctx context.Context, ch, fn string, args ...string) (string, TxResponse, []*proto.Swap)deprecated
- func (w *Wallet) RawSignedInvokeTracedWithErrorReturned(ctx context.Context, ch, fn string, args ...string) errordeprecated
- func (w *Wallet) RawSignedInvokeWithErrorReturned(ch, fn string, args ...string) error
- func (w *Wallet) RawSignedMultiSwapInvoke(ch, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)
- func (w *Wallet) RawSignedMultiSwapInvokeTraced(ctx context.Context, ch, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)deprecated
- func (w *Wallet) RemoveAccountRight(right *Right) errordeprecated
- func (w *Wallet) RemoveAddressRightFromNominee(right *AddressRight) errordeprecated
- func (w *Wallet) SecretKey() []byte
- func (w *Wallet) SetPubKey(pk ed25519.PublicKey)
- func (w *Wallet) SignArgs(ch, fn string, args ...string) []string
- func (w *Wallet) SignedInvoke(ch string, fn string, args ...string) string
- func (w *Wallet) SignedInvokeTraced(ctx context.Context, ch, fn string, args ...string) stringdeprecated
- func (w *Wallet) SignedMultiSwapsInvoke(ch string, fn string, args ...string) string
- func (w *Wallet) TaskExecutorRequest(channel string, requests ...ExecutorRequest) ([]ExecutorResponse, error)deprecated
- func (w *Wallet) TasksExecutor(channel string, tasks []*proto.Task) (*proto.BatchResponse, error)deprecated
- func (w *Wallet) UseGOSTKey()deprecated
- func (w *Wallet) UseSecp256k1Key()deprecated
- func (w *Wallet) WithNonceSignArgs(ch, fn string, nonce string, args ...string) []string
Constants ¶
const ( ErrRightNotSet = "right is not set" ErrChannelNotSet = "right is broken, channel is not set" ErrChaincodeNotSet = "right is broken, chaincode is not set" ErrRoleNotSet = "right is broken, role is not set" ErrAddressNotSet = "right is broken, address is not set" ErrNomineeAddressNotSet = "right is broken, nominee address is not set" ErrPrincipalAddressNotSet = "right is broken, principal address is not set" )
Errors
const ( // FnAddRights adds a right to the access matrix FnAddRights operation = "addRights" // FnRemoveRights removes a right from the access matrix FnRemoveRights operation = "removeRights" // FnAddAddressRightForNominee adds right to access matrix FnAddAddressRightForNominee operation = "addAddressRightForNominee" // FnRemoveAddressRightFromNominee adds right to access matrix FnRemoveAddressRightFromNominee operation = "removeAddressRightFromNominee" )
Function names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressRight ¶ added in v0.0.8
type AddressRight struct {
Channel string
Chaincode string
NomineeAddress string
PrincipalAddress string
}
AddressRight defines address right for nominee in access matrix
func (AddressRight) IsValid ¶ added in v0.0.8
func (ar AddressRight) IsValid() error
type BatchTxResponse ¶
type BatchTxResponse map[string]*proto.TxResponse
BatchTxResponse is a batch transaction response
func (BatchTxResponse) TxHasNoError ¶
func (br BatchTxResponse) TxHasNoError(t *testing.T, txID ...string)
TxHasNoError checks if the transaction has no error
type ExecutorRequest ¶ added in v0.0.2
func NewExecutorRequest ¶ added in v0.0.2
func NewExecutorRequest(ch string, fn string, args []string, isSignedInvoke bool) ExecutorRequest
type ExecutorResponse ¶ added in v0.0.2
type ExecutorResponse struct {
TxResponse *proto.TxResponse
BatchTxEvent *proto.BatchTxEvent
}
type Fee ¶
type Fee struct {
Currency string `json:"currency"`
Fee *big.Int `json:"fee"`
Floor *big.Int `json:"floor"`
Cap *big.Int `json:"cap"`
}
Fee struct
type IndustrialMetadata ¶
type IndustrialMetadata struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals uint `json:"decimals"`
UnderlyingAsset string `json:"underlying_asset"` //nolint:tagliatelle
DeliveryForm string `json:"deliveryForm"`
UnitOfMeasure string `json:"unitOfMeasure"`
TokensForUnit string `json:"tokensForUnit"`
PaymentTerms string `json:"paymentTerms"`
Price string `json:"price"`
Issuer string `json:"issuer"`
Methods []string `json:"methods"`
Groups []MetadataGroup `json:"groups"`
Fee *Fee `json:"fee"`
Rates []*MetadataRate `json:"rates"`
}
IndustrialMetadata struct
type Ledger
deprecated
type Ledger struct {
// contains filtered or unexported fields
}
Deprecated: use package ../mocks instead
func (*Ledger) GetPending
deprecated
func (*Ledger) GetStubByKey
deprecated
func (*Ledger) IndustrialMetadata
deprecated
func (l *Ledger) IndustrialMetadata(ch string) *IndustrialMetadata
Deprecated: use package ../mocks instead IndustrialMetadata returns metadata for industrial token
func (*Ledger) NewCC
deprecated
func (l *Ledger) NewCC( name string, bci core.BaseContractInterface, config string, opts ...core.ChaincodeOption, ) string
Deprecated: use package ../mocks instead
func (*Ledger) NewCCArgsArr ¶
func (l *Ledger) NewCCArgsArr( name string, bci core.BaseContractInterface, initArgs []string, opts ...core.ChaincodeOption, ) string
NewCCArgsArr Deprecated: added only for backward compatibility.
func (*Ledger) NewMultisigWallet
deprecated
func (*Ledger) NewWalletFromHexKey
deprecated
func (*Ledger) NewWalletFromKey
deprecated
func (*Ledger) UpdateStubTxID
deprecated
func (*Ledger) WaitMultiSwapAnswer ¶
WaitMultiSwapAnswer waits for multi swap answer
type Metadata ¶
type Metadata struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals uint `json:"decimals"`
UnderlyingAsset string `json:"underlyingAsset"`
Issuer string `json:"issuer"`
Methods []string `json:"methods"`
TotalEmission *big.Int `json:"total_emission"` //nolint:tagliatelle
Fee *Fee `json:"fee"`
Rates []*MetadataRate `json:"rates"`
}
Metadata struct
func (Metadata) MethodExists ¶
MethodExists checks if method exists
type MetadataGroup ¶
type MetadataGroup struct {
Name string `json:"name"`
Amount *big.Int `json:"amount"`
MaturityDate time.Time `json:"maturityDate"`
Note string `json:"note"`
}
MetadataGroup struct
type MetadataRate ¶
type MetadataRate struct {
DealType string `json:"deal_type"` //nolint:tagliatelle
Currency string `json:"currency"`
Rate *big.Int `json:"rate"`
Min *big.Int `json:"min"`
Max *big.Int `json:"max"`
}
MetadataRate struct
type Multisig
deprecated
type Multisig struct {
Wallet
// contains filtered or unexported fields
}
Deprecated: use package ../mocks instead Multisig is a mock for multisig wallet
func (*Multisig) AddressType
deprecated
func (*Multisig) ChangeKeysFor
deprecated
func (w *Multisig) ChangeKeysFor(index int, sKey ed25519.PrivateKey) error
Deprecated: use package ../mocks instead ChangeKeysFor changes private and public keys for Multisig member with specific index
func (*Multisig) RawSignedInvoke
deprecated
func (*Multisig) SecretKeys
deprecated
func (w *Multisig) SecretKeys() []ed25519.PrivateKey
Deprecated: use package ../mocks instead SecretKeys returns private keys of multisig wallet
type TxResponse ¶
type TxResponse struct {
Method string `json:"method"`
Error string `json:"error,omitempty"`
Result string `json:"result"`
Events map[string][]byte `json:"events,omitempty"`
Accounting []*proto.AccountingRecord `json:"accounting"`
}
TxResponse returns txResponse event
type Wallet
deprecated
Deprecated: use package ../mocks instead Wallet is a wallet
func (*Wallet) AddAccountRight
deprecated
func (*Wallet) AddAddressRightForNominee
deprecated
added in
v0.0.8
func (w *Wallet) AddAddressRightForNominee(right *AddressRight) error
Deprecated: use package ../mocks instead AddAddressRightForNominee adds right to transfer from specified principal address for nominee
func (*Wallet) AddAllowedBalance ¶
AddAllowedBalance adds allowed balance to the wallet
func (*Wallet) AddBalance ¶
AddBalance adds balance to the wallet
func (*Wallet) AddGivenBalance ¶
AddGivenBalance adds given balance to the wallet
func (*Wallet) AddTokenBalance ¶
AddTokenBalance adds token balance to the wallet
func (*Wallet) AddressType ¶
AddressType returns the address type of the wallet
func (*Wallet) AllowedBalanceShouldBe ¶
AllowedBalanceShouldBe checks the allowed balance of the wallet
func (*Wallet) BalanceShouldBe ¶
BalanceShouldBe checks the balance of the wallet
func (*Wallet) BatchedInvoke ¶
func (w *Wallet) BatchedInvoke(ch, fn string, args ...string) (string, TxResponse)
BatchedInvoke invokes a function on the ledger
func (*Wallet) ChangeKeys
deprecated
func (w *Wallet) ChangeKeys(sKey ed25519.PrivateKey) error
Deprecated: use package ../mocks instead ChangeKeys change private key, then public key will be derived and changed too
func (*Wallet) CheckGivenBalanceShouldBe ¶
CheckGivenBalanceShouldBe checks the balance of the wallet
func (*Wallet) DoBatch ¶
func (w *Wallet) DoBatch(ch string, txID ...string) BatchTxResponse
DoBatch does a batch transaction
func (*Wallet) GivenBalanceShouldBe ¶ added in v0.0.6
GivenBalanceShouldBe checks the given balance of the channel
func (*Wallet) GroupBalanceShouldBe ¶
GroupBalanceShouldBe checks the group balance of the wallet
func (*Wallet) IndustrialBalanceShouldBe ¶
IndustrialBalanceShouldBe checks the industrial balance of the wallet
func (*Wallet) InvokeReturnsTxID ¶
InvokeReturnsTxID invokes a function on the ledger and returns the transaction ID
func (*Wallet) InvokeWithError ¶
InvokeWithError invokes a function on the ledger and returns an error
func (*Wallet) InvokeWithPeerResponse ¶
func (*Wallet) OtfBalanceShouldBe ¶
OtfBalanceShouldBe checks the otf balance of the wallet
func (*Wallet) RawChTransferInvoke ¶
RawChTransferInvoke invokes a function on the ledger
func (*Wallet) RawChTransferInvokeWithBatch ¶
func (w *Wallet) RawChTransferInvokeWithBatch(ch string, fn string, args ...string) (string, TxResponse, error)
RawChTransferInvokeWithBatch invokes a function on the ledger
func (*Wallet) RawSignedInvoke ¶
func (w *Wallet) RawSignedInvoke(ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)
RawSignedInvoke invokes a function on the ledger
func (*Wallet) RawSignedInvokeTraced
deprecated
func (*Wallet) RawSignedInvokeWithErrorReturned ¶
RawSignedInvokeWithErrorReturned invokes a function on the ledger
func (*Wallet) RawSignedMultiSwapInvoke ¶
func (w *Wallet) RawSignedMultiSwapInvoke(ch, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)
RawSignedMultiSwapInvoke invokes a function on the ledger
func (*Wallet) RemoveAccountRight
deprecated
func (*Wallet) RemoveAddressRightFromNominee
deprecated
added in
v0.0.8
func (w *Wallet) RemoveAddressRightFromNominee(right *AddressRight) error
Deprecated: use package ../mocks instead RemoveAddressRightFromNominee removes right to transfer from specified principal address from nominee
func (*Wallet) SignedInvoke ¶
SignedInvoke invokes a function on the ledger
func (*Wallet) SignedMultiSwapsInvoke ¶
SignedMultiSwapsInvoke invokes a function on the ledger
func (*Wallet) TaskExecutorRequest
deprecated
added in
v0.0.5
func (w *Wallet) TaskExecutorRequest(channel string, requests ...ExecutorRequest) ([]ExecutorResponse, error)
Deprecated: use package ../mocks instead
func (*Wallet) TasksExecutor
deprecated
added in
v0.0.5
func (*Wallet) UseGOSTKey
deprecated
added in
v0.0.2
func (w *Wallet) UseGOSTKey()
Deprecated: use package ../mocks instead
func (*Wallet) UseSecp256k1Key
deprecated
added in
v0.0.2
func (w *Wallet) UseSecp256k1Key()
Deprecated: use package ../mocks instead