Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some small fix #5

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d2d1624
Add files via upload
biter777 May 23, 2023
ca13344
Add files via upload
biter777 May 23, 2023
75e02c4
Add files via upload
biter777 May 23, 2023
c48bb5b
Update go.mod
biter777 May 28, 2023
c641bd9
Add files via upload
biter777 May 28, 2023
6e12bec
Add files via upload
biter777 May 28, 2023
f27012f
Add files via upload
biter777 May 28, 2023
0b00f64
Add files via upload
biter777 May 28, 2023
094978d
Add files via upload
biter777 May 28, 2023
05c82fc
Add files via upload
biter777 May 28, 2023
dc1b0c4
Add files via upload
biter777 May 28, 2023
5f2db82
Add files via upload
biter777 May 28, 2023
6f5d8e9
Add files via upload
biter777 May 28, 2023
9e7c460
Add files via upload
biter777 May 28, 2023
13463d1
Add files via upload
biter777 May 28, 2023
01e6928
Add files via upload
biter777 May 28, 2023
b383820
Add files via upload
biter777 May 28, 2023
2b17590
Add files via upload
biter777 May 28, 2023
d6512c9
Update README.md
biter777 May 28, 2023
fcf130c
Update go.mod
biter777 May 28, 2023
3b7ca4d
Update go.sum
biter777 May 28, 2023
2589859
Update go.mod
biter777 May 28, 2023
af73456
Update go.mod
biter777 May 28, 2023
b3b4cb5
Update go.mod
biter777 May 28, 2023
f165e49
Update go.mod
biter777 May 28, 2023
7287795
Update go.mod
biter777 May 28, 2023
789b40d
Update go.mod
biter777 May 28, 2023
45025f5
Update go.mod
biter777 May 28, 2023
fa61951
Update go.mod
biter777 May 28, 2023
a8cc225
Update go.sum
biter777 May 28, 2023
f037502
Update go.sum
biter777 May 28, 2023
12b2342
Update go.mod
biter777 May 28, 2023
3eacbed
Update go.mod
biter777 May 28, 2023
f4bf2bd
Update go.mod
biter777 May 28, 2023
ec6e35c
Update go.mod
biter777 May 28, 2023
877622e
Update go.mod
biter777 May 28, 2023
1cd45dd
Update go.mod
biter777 May 28, 2023
aa802ac
Update go.mod
biter777 May 28, 2023
e8fb104
Update go.mod
biter777 May 28, 2023
edac228
Update go.mod
biter777 May 28, 2023
aa9d8ac
Update go.mod
biter777 May 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# VIZ-Blockchain/viz-go-lib
# viz-go-lib

[![GoDoc](https://godoc.org/github.com/VIZ-Blockchain/viz-go-lib?status.svg)](https://godoc.org/github.com/VIZ-Blockchain/viz-go-lib)
[![Go Report Card](https://goreportcard.com/badge/github.com/VIZ-Blockchain/viz-go-lib)](https://goreportcard.com/report/github.com/VIZ-Blockchain/viz-go-lib)
Expand All @@ -8,7 +8,7 @@ Golang RPC client library for [Viz](https://viz.world).
## Usage

```go
import "github.com/VIZ-Blockchain/viz-go-lib"
import "github.com/biter777/viz-go-lib"
```


Expand Down
8 changes: 4 additions & 4 deletions api/account_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"encoding/json"
"errors"

"github.com/VIZ-Blockchain/viz-go-lib/operations"
"github.com/biter777/viz-go-lib/operations"
)

//account_history

//GetAccountHistory the history of all user actions on the network in the form of transactions.
//If from = -1, the last {limit + 1} elements of the history will be shown.
//The limit parameter must not exceed from (exception from = -1), since the previous {from} elements of the history are displayed.
// GetAccountHistory the history of all user actions on the network in the form of transactions.
// If from = -1, the last {limit + 1} elements of the history will be shown.
// The limit parameter must not exceed from (exception from = -1), since the previous {from} elements of the history are displayed.
func (api *API) GetAccountHistory(account string, from uint64, limit uint32) ([]*operations.OperationObject, error) {
if limit > 1000 {
return nil, errors.New("account_history: get_account_history -> limit must not exceed 1000")
Expand Down
6 changes: 3 additions & 3 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package api
import (
"encoding/json"

"github.com/VIZ-Blockchain/viz-go-lib/transports"
"github.com/biter777/viz-go-lib/transports"
)

//API plug-in structure
// API plug-in structure
type API struct {
caller transports.Caller
}
Expand All @@ -15,7 +15,7 @@ var (
EmptyParams = []struct{}{}
)

//NewAPI plug-in initialization
// NewAPI plug-in initialization
func NewAPI(caller transports.Caller) *API {
return &API{caller}
}
Expand Down
56 changes: 28 additions & 28 deletions api/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package api
import (
"encoding/json"

"github.com/VIZ-Blockchain/viz-go-lib/operations"
"github.com/VIZ-Blockchain/viz-go-lib/types"
"github.com/biter777/viz-go-lib/operations"
"github.com/biter777/viz-go-lib/types"
)

//Account structure for the GetAccounts and LookupAccountNames function
// Account structure for the GetAccounts and LookupAccountNames function
type Account struct {
ID types.Int `json:"id"`
Name string `json:"name"`
Expand Down Expand Up @@ -62,14 +62,14 @@ type Account struct {
SubaccountOnSale bool `json:"subaccount_on_sale"`
}

//Block structure for the GetBlock function
// Block structure for the GetBlock function
type Block struct {
BlockHeader
WitnessSignature string `json:"witness_signature"`
Transactions []operations.Transaction `json:"transactions"`
}

//BlockHeader structure for the GetBlockHeader function
// BlockHeader structure for the GetBlockHeader function
type BlockHeader struct {
Number uint32 `json:"-"`
Timestamp types.Time `json:"timestamp"`
Expand All @@ -79,7 +79,7 @@ type BlockHeader struct {
Extensions []interface{} `json:"extensions"`
}

//Config structure for the GetConfig function.
// Config structure for the GetConfig function.
type Config struct {
Percent100 uint16 `json:"CHAIN_100_PERCENT"`
Percent1 uint16 `json:"CHAIN_1_PERCENT"`
Expand Down Expand Up @@ -139,7 +139,7 @@ type Config struct {
PendingTransactionExecutionLimit uint32 `json:"CHAIN_PENDING_TRANSACTION_EXECUTION_LIMIT"`
}

//DatabaseInfo structure for the GetDatabaseInfo function.
// DatabaseInfo structure for the GetDatabaseInfo function.
type DatabaseInfo struct {
TotalSize string `json:"total_size"`
FreeSize uint64 `json:"free_size"`
Expand All @@ -148,13 +148,13 @@ type DatabaseInfo struct {
IndexList []DatabaseInfoIndex `json:"index_list"`
}

//DatabaseInfoIndex additional structure for the function GetDatabaseInfo.
// DatabaseInfoIndex additional structure for the function GetDatabaseInfo.
type DatabaseInfoIndex struct {
Name string `json:"name"`
RecordCount uint64 `json:"record_count"`
}

//DynamicGlobalProperties structure for the GetDynamicGlobalProperties function.
// DynamicGlobalProperties structure for the GetDynamicGlobalProperties function.
type DynamicGlobalProperties struct {
ID types.Int `json:"id"`
HeadBlockNumber uint32 `json:"head_block_number"`
Expand Down Expand Up @@ -184,29 +184,29 @@ type DynamicGlobalProperties struct {
BandwidthReserveCandidates uint32 `json:"bandwidth_reserve_candidates"`
}

//VestingDelegationExpiration structure for the GetExpiringVestingDelegations function.
// VestingDelegationExpiration structure for the GetExpiringVestingDelegations function.
type VestingDelegationExpiration struct {
ID types.Int `json:"id"`
Delegator string `json:"delegator"`
VestingShares types.Asset `json:"vesting_shares"`
Expiration types.Time `json:"expiration"`
}

//NextScheduledHardfork structure for the GetNextScheduledHardfork function.
// NextScheduledHardfork structure for the GetNextScheduledHardfork function.
type NextScheduledHardfork struct {
HfVersion string `json:"hf_version"`
LiveTime types.Time `json:"live_time"`
}

//MasterHistory structure for the GetMasterHistory function.
// MasterHistory structure for the GetMasterHistory function.
type MasterHistory struct {
ID types.Int `json:"id"`
Account string `json:"account"`
PreviousMasterAuthority types.Authority `json:"previous_master_authority"`
LastValidTime string `json:"last_valid_time"`
}

//ProposalObject structure for the GetProposedTransaction function.
// ProposalObject structure for the GetProposedTransaction function.
type ProposalObject struct {
Author string `json:"author"`
Title string `json:"title"`
Expand All @@ -223,7 +223,7 @@ type ProposalObject struct {
AvailableKeyApprovals []string `json:"available_key_approvals"`
}

//VestingDelegation structure for the GetVestingDelegations function.
// VestingDelegation structure for the GetVestingDelegations function.
type VestingDelegation struct {
ID types.Int `json:"id"`
Delegator string `json:"delegator"`
Expand All @@ -232,29 +232,29 @@ type VestingDelegation struct {
MinDelegationTime types.Time `json:"min_delegation_time"`
}

//WithdrawVestingRoutes structure for the GetWithdrawRoutes function.
// WithdrawVestingRoutes structure for the GetWithdrawRoutes function.
type WithdrawVestingRoutes struct {
FromAccount string `json:"from_account"`
ToAccount string `json:"to_account"`
Percent uint16 `json:"percent"`
AutoVest bool `json:"auto_vest"`
}

//AccountOnSale structure for the GetAccountsOnSale function.
// AccountOnSale structure for the GetAccountsOnSale function.
type AccountOnSale struct {
Account string `json:"account"`
AccountSeller string `json:"account_seller"`
AccountOfferPrice types.Asset `json:"account_offer_price"`
}

//SubAccountOnSale structure for the GetSubAccountsOnSale function.
// SubAccountOnSale structure for the GetSubAccountsOnSale function.
type SubAccountOnSale struct {
Account string `json:"account"`
AccountSeller string `json:"account_seller"`
AccountOfferPrice types.Asset `json:"account_offer_price"`
}

//PaidSubscription structure for the GetPaidSubscriptions function.
// PaidSubscription structure for the GetPaidSubscriptions function.
type PaidSubscription struct {
ID types.Int `json:"id"`
Creator string `json:"creator"`
Expand All @@ -265,7 +265,7 @@ type PaidSubscription struct {
UpdateTime types.Time `json:"update_time"`
}

//PaidSubscriptionState structure for the GetPaidSubscriptionOptions function.
// PaidSubscriptionState structure for the GetPaidSubscriptionOptions function.
type PaidSubscriptionState struct {
ID types.Int `json:"id"`
Creator string `json:"creator"`
Expand All @@ -282,7 +282,7 @@ type PaidSubscriptionState struct {
ActiveSubscribersWithAutoRenewalSummaryAmount int64 `json:"active_subscribers_with_auto_renewal_summary_amount"`
}

//PaidSubscribeState structure for the GetPaidSubscriptions function.
// PaidSubscribeState structure for the GetPaidSubscriptions function.
type PaidSubscribeState struct {
ID types.Int `json:"id"`
Subscriber string `json:"subscriber"`
Expand All @@ -297,7 +297,7 @@ type PaidSubscribeState struct {
AutoRenewal bool `json:"auto_renewal"`
}

//InviteObject structure for the GetInviteById and GetInviteByKey function.
// InviteObject structure for the GetInviteById and GetInviteByKey function.
type InviteObject struct {
ID types.Int `json:"id"`
Creator string `json:"creator"`
Expand All @@ -311,7 +311,7 @@ type InviteObject struct {
Status uint16 `json:"status"`
}

//CommitteeObject structure for the GetCommitteeRequest function.
// CommitteeObject structure for the GetCommitteeRequest function.
type CommitteeObject struct {
ID types.Int `json:"id"`
RequestID uint32 `json:"request_id"`
Expand All @@ -334,14 +334,14 @@ type CommitteeObject struct {
Votes []CommitteeVoteState `json:"votes"`
}

//CommitteeVoteState structure for the GetCommitteeRequest function.
// CommitteeVoteState structure for the GetCommitteeRequest function.
type CommitteeVoteState struct {
Voter string `json:"voter"`
VotePercent int16 `json:"vote_percent"`
LastUpdate types.Time `json:"last_update"`
}

//Escrow structure for the GetEscrow function.
// Escrow structure for the GetEscrow function.
type Escrow struct {
ID types.Int `json:"id"`
EscrowID uint32 `json:"escrow_id"`
Expand All @@ -358,23 +358,23 @@ type Escrow struct {
IsApproved bool `json:"is_approved"`
}

//AccountRecoveryRequest structure for the GetRecoveryRequest function.
// AccountRecoveryRequest structure for the GetRecoveryRequest function.
type AccountRecoveryRequest struct {
ID types.Int `json:"id"`
AccountToRecover string `json:"account_to_recover"`
NewMasterAuthority types.Authority `json:"new_master_authority"`
Expires types.Time `json:"expires"`
}

//BroadcastResponse structure for the BroadcastTransactionSynchronous function
// BroadcastResponse structure for the BroadcastTransactionSynchronous function
type BroadcastResponse struct {
ID string `json:"id"`
BlockNum int32 `json:"block_num"`
TrxNum int32 `json:"trx_num"`
Expired bool `json:"expired"`
}

//WitnessSchedule structure for the GetWitnessSchedule function.
// WitnessSchedule structure for the GetWitnessSchedule function.
type WitnessSchedule struct {
ID types.Int `json:"id"`
CurrentVirtualTime string `json:"current_virtual_time"`
Expand All @@ -385,7 +385,7 @@ type WitnessSchedule struct {
MajorityVersion string `json:"majority_version"`
}

//Witness structure for the GetWitnessByAccount, GetWitnesses and GetWitnessByVote function.
// Witness structure for the GetWitnessByAccount, GetWitnesses and GetWitnessByVote function.
type Witness struct {
ID types.Int `json:"id"`
Owner string `json:"owner"`
Expand Down
Loading