-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
88 changed files
with
2,312 additions
and
898 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package walletrpc | ||
|
||
type AddAddressBookRequest struct { | ||
Address string `json:"address"` | ||
PaymentId string `json:"payment_id"` | ||
Description string `json:"description"` | ||
} | ||
|
||
type AddAddressBookResponse struct { | ||
// Index The index of the address book entry. | ||
Index uint64 `json:"index"` | ||
} | ||
|
||
// AddAddressBook Add an entry to the address book. | ||
func (c *Client) AddAddressBook(req *AddAddressBookRequest) (*AddAddressBookResponse, error) { | ||
resp := &AddAddressBookResponse{} | ||
err := c.do("add_address_book", &req, resp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package walletrpc | ||
|
||
type AutoRefreshRequest struct { | ||
// Enable (Optional) Enable or disable automatic refreshing (default = true). | ||
Enable bool `json:"enable"` | ||
|
||
// Period (Optional) The period of the wallet refresh cycle (i.e. time between refreshes) in seconds. | ||
Period uint64 `json:"period"` | ||
} | ||
|
||
// AutoRefresh Set whether and how often to automatically refresh the current wallet. | ||
func (c *Client) AutoRefresh(req *AutoRefreshRequest) error { | ||
err := c.do("auto_refresh", &req, nil) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package walletrpc | ||
|
||
type ChangeWalletPasswordRequest struct { | ||
// OldPassword (Optional) Current wallet password, if defined. | ||
OldPassword string `json:"old_password"` | ||
|
||
// NewPassword (Optional) New wallet password, if not blank. | ||
NewPassword string `json:"new_password"` | ||
} | ||
|
||
// ChangeWalletPassword Change a wallet password. | ||
func (c *Client) ChangeWalletPassword(req *ChangeWalletPasswordRequest) error { | ||
err := c.do("change_wallet_password", &req, nil) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package walletrpc | ||
|
||
type CheckReserveProofRequest struct { | ||
// Address Public address of the wallet. | ||
Address string `json:"address"` | ||
|
||
// Message (Optional) Should be the same message used in get_reserve_proof. | ||
Message string `json:"message"` | ||
|
||
// Signature reserve signature to confirm. | ||
Signature string `json:"signature"` | ||
} | ||
|
||
type CheckReserveProofResponse struct { | ||
// Good States if the inputs proves the reserve. | ||
Good bool `json:"good"` | ||
} | ||
|
||
// CheckReserveProof Proves a wallet has a disposable reserve using a signature. | ||
func (c *Client) CheckReserveProof(req *CheckReserveProofRequest) (*CheckReserveProofResponse, error) { | ||
resp := &CheckReserveProofResponse{} | ||
err := c.do("check_reserve_proof", &req, resp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package walletrpc | ||
|
||
type CheckSpendProofRequest struct { | ||
// Txid transaction id. | ||
Txid string `json:"txid"` | ||
|
||
// Message (Optional) Should be the same message used in get_spend_proof. | ||
Message string `json:"message"` | ||
|
||
// Signature spend signature to confirm. | ||
Signature string `json:"signature"` | ||
} | ||
|
||
type CheckSpendProofResponse struct { | ||
// Good States if the inputs proves the spend. | ||
Good bool `json:"good"` | ||
} | ||
|
||
// CheckSpendProof Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address. | ||
func (c *Client) CheckSpendProof(req *CheckSpendProofRequest) (*CheckSpendProofResponse, error) { | ||
resp := &CheckSpendProofResponse{} | ||
err := c.do("check_spend_proof", &req, resp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package walletrpc | ||
|
||
type CheckTxKeyRequest struct { | ||
// Txid transaction id. | ||
Txid string `json:"txid"` | ||
|
||
// TxKey transaction secret key. | ||
TxKey string `json:"tx_key"` | ||
|
||
// Address destination public address of the transaction. | ||
Address string `json:"address"` | ||
} | ||
|
||
type CheckTxKeyResponse struct { | ||
// Confirmations Number of block mined after the one with the transaction. | ||
Confirmations uint64 `json:"confirmations"` | ||
|
||
// InPool States if the transaction is still in pool or has been added to a block. | ||
InPool bool `json:"in_pool"` | ||
|
||
// Received Amount of the transaction. | ||
Received uint64 `json:"received"` | ||
} | ||
|
||
// CheckTxKey Check a transaction in the blockchain with its secret key. | ||
func (c *Client) CheckTxKey(req *CheckTxKeyRequest) (*CheckTxKeyResponse, error) { | ||
resp := &CheckTxKeyResponse{} | ||
err := c.do("check_tx_key", &req, resp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package walletrpc | ||
|
||
type CheckTxProofRequest struct { | ||
// Txid transaction id. | ||
Txid string `json:"txid"` | ||
|
||
// Address destination public address of the transaction. | ||
Address string `json:"address"` | ||
|
||
// Message (Optional) Should be the same message used in get_tx_proof. | ||
Message string `json:"message"` | ||
|
||
// Signature transaction signature to confirm. | ||
Signature string `json:"signature"` | ||
} | ||
|
||
type CheckTxProofResponse struct { | ||
// Confirmations Number of block mined after the one with the transaction. | ||
Confirmations uint64 `json:"confirmations"` | ||
|
||
// Good States if the inputs proves the transaction. | ||
Good bool `json:"good"` | ||
|
||
// InPool States if the transaction is still in pool or has been added to a block. | ||
InPool bool `json:"in_pool"` | ||
|
||
// Received Amount of the transaction. | ||
Received uint64 `json:"received"` | ||
} | ||
|
||
// CheckTxProof Prove a transaction by checking its signature. | ||
func (c *Client) CheckTxProof(req *CheckTxProofRequest) (*CheckTxProofResponse, error) { | ||
resp := &CheckTxProofResponse{} | ||
err := c.do("check_tx_proof", &req, resp) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
Oops, something went wrong.