-
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
1 parent
dbe0dd2
commit 9cbb47c
Showing
39 changed files
with
369 additions
and
12 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
model/client/admin/can_delete_request.go → ...l/client/admin/data/can_delete_request.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
import ( | ||
"encoding/json" | ||
|
2 changes: 1 addition & 1 deletion
2
model/client/admin/can_delete_response.go → .../client/admin/data/can_delete_response.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
type CanDeleteResponse struct { | ||
CanDelete int `json:"can_delete"` | ||
|
2 changes: 1 addition & 1 deletion
2
model/client/admin/crawl_shards_request.go → ...client/admin/data/crawl_shards_request.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
type CrawlShardsRequest struct { | ||
PublicKey bool `json:"public_key,omitempty"` | ||
|
2 changes: 1 addition & 1 deletion
2
model/client/admin/crawl_shards_response.go → ...lient/admin/data/crawl_shards_response.go
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
2 changes: 1 addition & 1 deletion
2
model/client/admin/download_shard_request.go → ...ient/admin/data/download_shard_request.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
import "github.com/xyield/xrpl-go/model/client/common" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...l/client/admin/download_shard_response.go → ...ent/admin/data/download_shard_response.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
type DownloadShardResponse struct { | ||
Message string `json:"message"` | ||
|
2 changes: 1 addition & 1 deletion
2
model/client/admin/ledger_cleaner_request.go → ...ient/admin/data/ledger_cleaner_request.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
import "github.com/xyield/xrpl-go/model/client/common" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...l/client/admin/ledger_cleaner_response.go → ...ent/admin/data/ledger_cleaner_response.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package data | ||
|
||
type LedgerCleanerResponse struct { | ||
Message string `json:"message"` | ||
|
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,12 @@ | ||
package data | ||
|
||
import "github.com/xyield/xrpl-go/model/client/common" | ||
|
||
type LedgerRequestRequest struct { | ||
LedgerIndex common.LedgerIndex `json:"ledger_index,omitempty"` | ||
LedgerHash common.LedgerHash `json:"ledger_hash,omitempty"` | ||
} | ||
|
||
func (*LedgerRequest) Method() string { | ||
return "ledger_request" | ||
} |
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,20 @@ | ||
package data | ||
|
||
import ( | ||
"github.com/xyield/xrpl-go/model/client/common" | ||
"github.com/xyield/xrpl-go/model/client/ledger" | ||
) | ||
|
||
type LedgerRequestResponse struct { | ||
ledger.LedgerHeader | ||
LedgerRequest | ||
Acquiring LedgerRequest `json:"acquiring"` | ||
} | ||
|
||
type LedgerRequest struct { | ||
Hash common.LedgerHash `json:"hash,omitempty"` | ||
HaveHeader bool `json:"have_header"` | ||
HaveState bool `json:"have_state,omitempty"` | ||
HaveTransactions bool `json:"have_transactions,omitempty"` | ||
NeededStateHashes []string `json:"needed_state_hashes,omitempty"` | ||
} |
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,6 @@ | ||
package data | ||
|
||
type LogLevelRequest struct { | ||
Severity string `json:"severity,omitempty"` | ||
Partition string `json:"partition,omitempty"` | ||
} |
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,5 @@ | ||
package data | ||
|
||
type LogLevelResponse struct { | ||
Levels map[string]string `json:"levels,omitempty"` | ||
} |
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,8 @@ | ||
package data | ||
|
||
type LogrotateRequest struct { | ||
} | ||
|
||
func (*LogrotateRequest) Method() string { | ||
return "logrotate" | ||
} |
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,5 @@ | ||
package data | ||
|
||
type LogrotateResponse struct { | ||
Message string `json:"message"` | ||
} |
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,5 @@ | ||
package data | ||
|
||
type NodeToShardRequest struct { | ||
Action string `json:"action"` | ||
} |
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,5 @@ | ||
package data | ||
|
||
type NodeToShardResponse struct { | ||
Message string `json:"message"` | ||
} |
2 changes: 1 addition & 1 deletion
2
...client/admin/validation_create_request.go → ...nt/admin/key/validation_create_request.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package key | ||
|
||
type ValidationCreateRequest struct { | ||
Secret string `json:"secret,omitempty"` | ||
|
2 changes: 1 addition & 1 deletion
2
...lient/admin/validation_create_response.go → ...t/admin/key/validation_create_response.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package key | ||
|
||
type ValidationCreateResponse struct { | ||
ValidationKey string `json:"validation_key"` | ||
|
2 changes: 1 addition & 1 deletion
2
model/client/admin/wallet_propose_request.go → ...lient/admin/key/wallet_propose_request.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package key | ||
|
||
type WalletProposeRequest struct { | ||
KeyType string `json:"key_type"` | ||
|
2 changes: 1 addition & 1 deletion
2
...l/client/admin/wallet_propose_response.go → ...ient/admin/key/wallet_propose_response.go
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package admin | ||
package key | ||
|
||
import "github.com/xyield/xrpl-go/model/transactions/types" | ||
|
||
|
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,6 @@ | ||
package peer | ||
|
||
type ConnectRequest struct { | ||
IP string `json:"ip"` | ||
Port int `json:"port,omitempty"` | ||
} |
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,5 @@ | ||
package peer | ||
|
||
type ConnectResponse struct { | ||
Message string `json:"message"` | ||
} |
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,6 @@ | ||
package peer | ||
|
||
type PeerReservation struct { | ||
Node string `json:"node"` | ||
Description string `json:"description,omitempty"` | ||
} |
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,10 @@ | ||
package peer | ||
|
||
type PeerReservationAddRequest struct { | ||
PublicKey string `json:"public_key"` | ||
Description string `json:"description,omitempty"` | ||
} | ||
|
||
func (*PeerReservationAddRequest) Method() string { | ||
return "peer_reservations_add" | ||
} |
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,5 @@ | ||
package peer | ||
|
||
type PeerReservationsAddResponse struct { | ||
Previous *PeerReservation `json:"previous,omitempty"` | ||
} |
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,9 @@ | ||
package peer | ||
|
||
type PeerReservationDelRequest struct { | ||
PublicKey string `json:"public_key"` | ||
} | ||
|
||
func (*PeerReservationDelRequest) Method() string { | ||
return "peer_reservations_del" | ||
} |
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,5 @@ | ||
package peer | ||
|
||
type PeerReservationsDelResponse struct { | ||
Previous PeerReservation `json:"previous"` | ||
} |
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,8 @@ | ||
package peer | ||
|
||
type PeerReservationsListRequest struct { | ||
} | ||
|
||
func (*PeerReservationsListRequest) Method() string { | ||
return "peer_reservations_list" | ||
} |
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,5 @@ | ||
package peer | ||
|
||
type PeerReservationsListResponse struct { | ||
Reservations []PeerReservation `json:"reservations"` | ||
} |
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,8 @@ | ||
package peer | ||
|
||
type PeersRequest struct { | ||
} | ||
|
||
func (*PeersRequest) Method() string { | ||
return "peers" | ||
} |
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,36 @@ | ||
package peer | ||
|
||
type PeersResponse struct { | ||
Cluster Cluster `json:"cluster"` | ||
Peers []Peer `json:"peers"` | ||
} | ||
|
||
type Cluster struct { | ||
Tag string `json:"tag,omitempty"` | ||
Fee int `json:"fee,omitempty"` | ||
Age int `json:"age,omitempty"` | ||
} | ||
|
||
type Peer struct { | ||
Address string `json:"address"` | ||
Cluster bool `json:"cluster,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
CompleteLedgers string `json:"complete_ledgers"` | ||
Inbound bool `json:"inbound,omitempty"` | ||
Latency int `json:"latency"` | ||
Ledger string `json:"ledger"` | ||
Load int `json:"load"` | ||
Metrics Metrics `json:"metrics"` | ||
PublicKey string `json:"public_key,omitempty"` | ||
Sanity string `json:"sanity,omitempty"` | ||
Status string `json:"status,omitempty"` | ||
Uptime uint `json:"uptime"` | ||
Version string `json:"version"` | ||
} | ||
|
||
type Metrics struct { | ||
AvgBpsRecv string `json:"avg_bps_recv"` | ||
AvgBpsSent string `json:"avg_bps_sent"` | ||
TotalBytesRecv string `json:"total_bytes_recv"` | ||
TotalBytesSent string `json:"total_bytes_sent"` | ||
} |
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,8 @@ | ||
package server | ||
|
||
type LedgerAcceptRequest struct { | ||
} | ||
|
||
func (*LedgerAcceptRequest) Method() string { | ||
return "leder_accept" | ||
} |
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,7 @@ | ||
package server | ||
|
||
import "github.com/xyield/xrpl-go/model/client/common" | ||
|
||
type LedgerAcceptResponse struct { | ||
LedgerCurrentIndex common.LedgerIndex `json:"ledger_current_index"` | ||
} |
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,8 @@ | ||
package server | ||
|
||
type StopRequest struct { | ||
} | ||
|
||
func (*StopRequest) Method() string { | ||
return "stop" | ||
} |
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,5 @@ | ||
package server | ||
|
||
type StopResponse struct { | ||
Message string `json:"message"` | ||
} |
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,49 @@ | ||
package signing | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/xyield/xrpl-go/model/transactions" | ||
"github.com/xyield/xrpl-go/model/transactions/types" | ||
) | ||
|
||
type SignForRequest struct { | ||
Account types.Address `json:"account"` | ||
TxJson transactions.Tx `json:"tx_json"` | ||
Secret string `json:"secret,omitempty"` | ||
Seed string `json:"seed,omitempty"` | ||
SeedHex string `json:"seed_hex,omitempty"` | ||
Passphrase string `json:"passphrase,omitempty"` | ||
KeyType string `json:"key_type,omitempty"` | ||
} | ||
|
||
func (*SignForRequest) Method() string { | ||
return "sign" | ||
} | ||
|
||
func (r *SignForRequest) UnmarshalJSON(data []byte) error { | ||
type srHelper struct { | ||
Account types.Address `json:"account"` | ||
TxJson json.RawMessage `json:"tx_json"` | ||
Secret string `json:"secret,omitempty"` | ||
Seed string `json:"seed,omitempty"` | ||
SeedHex string `json:"seed_hex,omitempty"` | ||
Passphrase string `json:"passphrase,omitempty"` | ||
KeyType string `json:"key_type,omitempty"` | ||
} | ||
var h srHelper | ||
err := json.Unmarshal(data, &h) | ||
*r = SignForRequest{ | ||
Account: h.Account, | ||
Secret: h.Secret, | ||
Seed: h.Seed, | ||
SeedHex: h.SeedHex, | ||
Passphrase: h.Passphrase, | ||
KeyType: h.KeyType, | ||
} | ||
if err != nil { | ||
return err | ||
} | ||
r.TxJson, err = transactions.UnmarshalTx(h.TxJson) | ||
return err | ||
} |
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 signing | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/xyield/xrpl-go/model/transactions" | ||
) | ||
|
||
type SignForResponse struct { | ||
TxBlob string `json:"tx_blob"` | ||
TxJson transactions.Tx `json:"tx_json"` | ||
} | ||
|
||
func (r *SignForResponse) UnmarshalJSON(data []byte) error { | ||
type srHelper struct { | ||
TxBlob string `json:"tx_blob"` | ||
TxJson json.RawMessage `json:"tx_json"` | ||
} | ||
var h srHelper | ||
err := json.Unmarshal(data, &h) | ||
if err != nil { | ||
return nil | ||
} | ||
r.TxBlob = h.TxBlob | ||
r.TxJson, err = transactions.UnmarshalTx(h.TxJson) | ||
return err | ||
} |
Oops, something went wrong.