Documentation ¶
Index ¶
- type WalletClient
- func (w *WalletClient) CreatePOE(header http.Header, body *wallet.POEBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) GetWalletBalance(header http.Header, id did.Identifier) (result *wallet.WalletBalance, err error)
- func (w *WalletClient) GetWalletInfo(header http.Header, id did.Identifier) (result *wallet.WalletInfo, err error)
- func (w *WalletClient) IndexGet(header http.Header, body *wallet.IndexGetPayload) (IDs []string, err error)
- func (w *WalletClient) IndexSet(header http.Header, body *wallet.IndexSetPayload) (txIDs []string, err error)
- func (w *WalletClient) IssueAsset(header http.Header, body *wallet.IssueAssetBody, ...) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) IssueCToken(header http.Header, body *wallet.IssueBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) ProcessTx(header http.Header, txs []*pw.TX) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) QueryPOE(header http.Header, id did.Identifier) (result *wallet.POEPayload, err error)
- func (w *WalletClient) QueryTransactionLogs(header http.Header, id did.Identifier, txType string, num, page int32) (result []*pw.UTXO, err error)
- func (w *WalletClient) QueryTransactionSTXO(header http.Header, id did.Identifier, num, page int32) (result []*pw.UTXO, err error)
- func (w *WalletClient) QueryTransactionUTXO(header http.Header, id did.Identifier, num, page int32) (result []*pw.UTXO, err error)
- func (w *WalletClient) Register(header http.Header, body *wallet.RegisterWalletBody) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) RegisterSubWallet(header http.Header, body *wallet.RegisterSubWalletBody) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) SendIssueAssetProposal(header http.Header, body *wallet.IssueAssetBody) (result []*pw.TX, err error)
- func (w *WalletClient) SendIssueCTokenProposal(header http.Header, body *wallet.IssueBody) (issueRsp *wallet.IssueCTokenPrepareResponse, err error)
- func (w *WalletClient) SendTransferAssetProposal(header http.Header, body *wallet.TransferAssetBody) (result []*pw.TX, err error)
- func (w *WalletClient) SendTransferCTokenProposal(header http.Header, body *wallet.TransferCTokenBody) (result []*pw.TX, err error)
- func (w *WalletClient) SignTx(tx *pw.TX, signParams *pki.SignatureParam) (err error)
- func (w *WalletClient) SignTxs(txs []*pw.TX, signParams *pki.SignatureParam) (err error)
- func (w *WalletClient) TransferAsset(header http.Header, body *wallet.TransferAssetBody, ...) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) TransferCToken(header http.Header, body *wallet.TransferCTokenBody, ...) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) UpdatePOE(header http.Header, body *wallet.POEBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
- func (w *WalletClient) UploadPOEFile(header http.Header, poeID string, poeFile string, readOnly bool) (result *wallet.UploadResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WalletClient ¶
type WalletClient struct {
// contains filtered or unexported fields
}
WalletClient is a http agent to wallet service.
func NewWalletClient ¶
func NewWalletClient(config *restapi.Config) (*WalletClient, error)
NewWalletClient returns a WalletClient instance.
func (*WalletClient) CreatePOE ¶
func (w *WalletClient) CreatePOE(header http.Header, body *wallet.POEBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
CreatePOE is used to create POE digital asset.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) GetWalletBalance ¶
func (w *WalletClient) GetWalletBalance(header http.Header, id did.Identifier) (result *wallet.WalletBalance, err error)
GetWalletBalance is used to get wallet balances.
func (*WalletClient) GetWalletInfo ¶
func (w *WalletClient) GetWalletInfo(header http.Header, id did.Identifier) (result *wallet.WalletInfo, err error)
GetWalletInfo is used to get wallet base information.
func (*WalletClient) IndexGet ¶
func (w *WalletClient) IndexGet(header http.Header, body *wallet.IndexGetPayload) (IDs []string, err error)
IndexGet is used to query object-id via indexs
func (*WalletClient) IndexSet ¶
func (w *WalletClient) IndexSet(header http.Header, body *wallet.IndexSetPayload) (txIDs []string, err error)
IndexSet is used to create indexs for object-id
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
func (*WalletClient) IssueAsset ¶
func (w *WalletClient) IssueAsset(header http.Header, body *wallet.IssueAssetBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
IssueAsset is used to issue digital asset.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) IssueCToken ¶
func (w *WalletClient) IssueCToken(header http.Header, body *wallet.IssueBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
IssueCToken is used to issue colored token.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) ProcessTx ¶
func (w *WalletClient) ProcessTx(header http.Header, txs []*pw.TX) (result *wallet.WalletResponse, err error)
ProcessTx is used to transfer formally with signature TX
func (*WalletClient) QueryPOE ¶
func (w *WalletClient) QueryPOE(header http.Header, id did.Identifier) (result *wallet.POEPayload, err error)
QueryPOE is used to query POE digital asset.
func (*WalletClient) QueryTransactionLogs ¶
func (w *WalletClient) QueryTransactionLogs(header http.Header, id did.Identifier, txType string, num, page int32) (result []*pw.UTXO, err error)
QueryTransactionLogs is used to query transaction logs.
txType: in: query income type transaction out: query spending type transaction other: in && out num, page: count and page to be returned
func (*WalletClient) QueryTransactionSTXO ¶
func (w *WalletClient) QueryTransactionSTXO(header http.Header, id did.Identifier, num, page int32) (result []*pw.UTXO, err error)
QueryTransactionSTXO is used to query transaction UTXO logs.
num, page: count and page to be returned
func (*WalletClient) QueryTransactionUTXO ¶
func (w *WalletClient) QueryTransactionUTXO(header http.Header, id did.Identifier, num, page int32) (result []*pw.UTXO, err error)
QueryTransactionUTXO is used to query transaction UTXO logs.
num, page: count and page to be returned
func (*WalletClient) Register ¶
func (w *WalletClient) Register(header http.Header, body *wallet.RegisterWalletBody) (result *wallet.WalletResponse, err error)
Register is used to register user wallet.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will return the key pair. If you want to trust the key pair, it will return the security code.
func (*WalletClient) RegisterSubWallet ¶
func (w *WalletClient) RegisterSubWallet(header http.Header, body *wallet.RegisterSubWalletBody) (result *wallet.WalletResponse, err error)
RegisterSubWallet is used to register user subwallet.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will return the key pair. If you want to trust the key pair, it will return the security code.
func (*WalletClient) SendIssueAssetProposal ¶
func (w *WalletClient) SendIssueAssetProposal(header http.Header, body *wallet.IssueAssetBody) (result []*pw.TX, err error)
SendIssueAssetProposal is used to send issue asset proposal to get wallet.Tx to be signed.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) SendIssueCTokenProposal ¶
func (w *WalletClient) SendIssueCTokenProposal(header http.Header, body *wallet.IssueBody) (issueRsp *wallet.IssueCTokenPrepareResponse, err error)
SendIssueCTokenProposal is used to send issue ctoken proposal to get wallet.Tx to be signed.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) SendTransferAssetProposal ¶
func (w *WalletClient) SendTransferAssetProposal(header http.Header, body *wallet.TransferAssetBody) (result []*pw.TX, err error)
SendTransferAssetProposal is used to send transfer asset proposal to get wallet.Tx to be signed.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) SendTransferCTokenProposal ¶
func (w *WalletClient) SendTransferCTokenProposal(header http.Header, body *wallet.TransferCTokenBody) (result []*pw.TX, err error)
SendTransferCTokenProposal is used to send transfer colored tokens proposal to get wallet.Tx to be signed.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) SignTx ¶
func (w *WalletClient) SignTx(tx *pw.TX, signParams *pki.SignatureParam) (err error)
SignTx is used to sign single UTXO
func (*WalletClient) SignTxs ¶
func (w *WalletClient) SignTxs(txs []*pw.TX, signParams *pki.SignatureParam) (err error)
SignTxs is used to sign multiple UTXOs
func (*WalletClient) TransferAsset ¶
func (w *WalletClient) TransferAsset(header http.Header, body *wallet.TransferAssetBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
TransferAsset is used to transfer assets from one user to another.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) TransferCToken ¶
func (w *WalletClient) TransferCToken(header http.Header, body *wallet.TransferCTokenBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
TransferCToken is used to transfer colored tokens from one user to another.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
If you want to switch to synchronous invoking mode, set 'BC-Invoke-Mode' header to 'sync' value. In synchronous mode, it will not return until the blockchain transaction is confirmed.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) UpdatePOE ¶
func (w *WalletClient) UpdatePOE(header http.Header, body *wallet.POEBody, signParams *pki.SignatureParam) (result *wallet.WalletResponse, err error)
UpdatePOE is used to update POE digital asset.
The default invoking mode is asynchronous, it will return without waiting for blockchain transaction confirmation.
The default key pair trust mode does not trust, it will required key pair. If you had trust the key pair, it will required security code.
func (*WalletClient) UploadPOEFile ¶
func (w *WalletClient) UploadPOEFile(header http.Header, poeID string, poeFile string, readOnly bool) (result *wallet.UploadResponse, err error)
UploadPOEFile is used to upload file for specified POE digital asset
poeID parameter is the POE digital asset ID pre-created using CreatePOE API.
poeFile parameter is the path to file to be uploaded.