Skip to content

Commit 819d7c9

Browse files
Merge branch 'v0.1.x'
2 parents 078c4b1 + 8d02757 commit 819d7c9

File tree

78 files changed

+3693
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3693
-242
lines changed

CHANGELOG.md

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,49 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [v0.1.8]
8+
# [Unreleased]
99

10-
### Added
10+
## Breaking changes
1111

12-
#### xrpl
12+
### xrpl
1313

14-
- Added `BalanceChanges` to the `Transaction` type.
14+
- `Submit` client method is renamed to `SubmitTxBlob` in both clients.
15+
- `SubmitAndWait` client method is renamed to `SubmitTxBlobAndWait` in both clients.
1516

16-
### Changed
17+
## Changed
1718

18-
#### xrpl
19+
### xrpl
1920

20-
- Updated `AffectedNode` type fields to be a pointer to allow nil values.
21+
- Added `SubmitTx` and `SubmitTxAndWait` client methods to both clients.
22+
23+
## Added
24+
25+
### xrpl
26+
27+
- Added support for the Credential fields in the following transaction types:
28+
- Payment
29+
- DepositPreauth
30+
- AccountDelete
31+
- PaymentChannelClaim
32+
- EscrowFinish
33+
- Added the `credential` ledger entry for the `account_objects` request.
34+
- Added tec/tef/tel/tem/ter TxResult codes.
35+
- Replaced string declaration with constant/object references.
36+
- Added `XLS-80d` support with `PermissionedDomain` transaction types:
37+
- `PermissionedDomainSet`
38+
- `PermissionedDomainDelete`
39+
40+
## Fixed
41+
42+
### binary-codec
43+
44+
- Added native `uint8` type support for `Uint8` type.
45+
46+
### big-decimal
47+
48+
- Fixed `BigDecimal` precision.
49+
50+
## [v0.1.9]
2151

2252
### Added
2353

@@ -30,8 +60,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3060

3161
### Fixed
3262

63+
#### big-decimal
64+
65+
- Amounts transcoding fix for large values.
66+
67+
## [v0.1.8]
68+
69+
### Added
70+
3371
#### xrpl
3472

73+
- Added `BalanceChanges` to the `Transaction` type.
74+
75+
### Changed
76+
77+
#### xrpl
78+
79+
- Updated `AffectedNode` type fields to be a pointer to allow nil values.
3580
- Fixed `BaseLedger` field in `ledger` response (v1 and v2). BaseLedger.Transactions is now an array of interfaces instead of a slice of `FlatTransaction` due to `Expand` field in the request.
3681

3782
## [v0.1.7]
@@ -192,7 +237,7 @@ Support for the XLS-77d (deep freeze)
192237
- New `Multisign` wallet method.
193238
- Ripple time conversion utility functions.
194239
- Added query methods for websocket and rpc clients.
195-
- New `SubmitMultisigned`, `AutofillMultisigned` and `SubmitAndWait` methods for both clients.
240+
- New `SubmitMultisigned`, `AutofillMultisigned` and `SubmitTxBlobAndWait` methods for both clients.
196241
- Added `Autofill` method for rpc client.
197242
- New `MaxRetries` and `RetryDelay` config options for both clients.
198243

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN go mod download
77
COPY . .
88

99
FROM install AS lint
10-
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
10+
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8
1111
RUN make lint
1212

1313
FROM lint AS test

binary-codec/definitions/definitions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"Offer": 111,
5555
"Oracle": 128,
5656
"PayChannel": 120,
57+
"PermissionedDomain": 130,
5758
"RippleState": 114,
5859
"SignerList": 83,
5960
"Ticket": 84,
@@ -1441,6 +1442,16 @@
14411442
"type": "Hash256"
14421443
}
14431444
],
1445+
[
1446+
"DomainID",
1447+
{
1448+
"isSerialized": true,
1449+
"isSigningField": true,
1450+
"isVLEncoded": false,
1451+
"nth": 34,
1452+
"type": "Hash256"
1453+
}
1454+
],
14441455
[
14451456
"Amount",
14461457
{
@@ -3046,6 +3057,8 @@
30463057
"PaymentChannelClaim": 15,
30473058
"PaymentChannelCreate": 13,
30483059
"PaymentChannelFund": 14,
3060+
"PermissionedDomainDelete": 63,
3061+
"PermissionedDomainSet": 62,
30493062
"SetFee": 101,
30503063
"SetHook": 22,
30513064
"SetRegularKey": 5,

binary-codec/types/st_array.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ var ErrNotSTObjectInSTArray = errors.New("not STObject in STArray. Array fields
2424
// of an STObject, appending the resulting byte slice to a "sink" slice.
2525
// The method returns an error if the JSON value is not a slice.
2626
func (t *STArray) FromJSON(json any) ([]byte, error) {
27-
if _, ok := json.([]any); !ok {
27+
switch v := json.(type) {
28+
case []any:
29+
json = v
30+
case []map[string]any:
31+
json = make([]any, len(v))
32+
for i, m := range v {
33+
json.([]any)[i] = m
34+
}
35+
default:
2836
return nil, ErrNotSTObjectInSTArray
2937
}
3038

binary-codec/types/uint8.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ func (u *UInt8) FromJSON(value any) ([]byte, error) {
3030
intValue = v
3131
case int32:
3232
intValue = int(v)
33+
case uint8:
34+
intValue = int(v)
3335
}
3436

3537
buf := new(bytes.Buffer)

docs/docs/xrpl/rpc.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `rpc` package provides the RPC client for interacting with the XRPL network
77
- Send requests to query the ledger state.
88
- Submit transactions to the network.
99
- Receive responses and handle errors.
10-
- Manage the connections configuration.
10+
- Manage the connections configuration.
1111

1212
## Client
1313

@@ -82,7 +82,7 @@ func (c *Client) Request(reqParams XRPLRequest) (XRPLResponse, error)
8282
The `Submit` method is used to submit a transaction to the XRPL network. It returns a `TxResponse` struct containing the transaction result for the blob submitted. `txBlob` must be signed. There's also a `SubmitMultisigned` method that works the same way but for multisigned transactions.
8383

8484
```go
85-
func (c *Client) Submit(txBlob string, failHard bool) (*requests.TxResponse, error)
85+
func (c *Client) SubmitTxBlob(txBlob string, failHard bool) (*requests.TxResponse, error)
8686
func (c *Client) SubmitMultisigned(txBlob string, failHard bool) (*requests.SubmitMultisignedResponse, error)
8787
```
8888

@@ -95,12 +95,12 @@ func (c *Client) Autofill(tx *transaction.FlatTransaction) error
9595
func (c *Client) AutofillMultisigned(tx *transaction.FlatTransaction, nSigners uint64) error
9696
```
9797

98-
### SubmitAndWait
98+
### SubmitTxBlobAndWait
9999

100-
The `SubmitAndWait` method is used to submit a transaction to the XRPL network and wait for it to be included in a ledger. It returns a `TxResponse` struct containing the transaction result for the blob submitted.
100+
The `SubmitTxBlobAndWait` method is used to submit a transaction to the XRPL network and wait for it to be included in a ledger. It returns a `TxResponse` struct containing the transaction result for the blob submitted.
101101

102102
```go
103-
func (c *Client) SubmitAndWait(txBlob string, failHard bool) (*requests.TxResponse, error)
103+
func (c *Client) SubmitTxBlobAndWait(txBlob string, failHard bool) (*requests.TxResponse, error)
104104
```
105105

106106
## Queries
@@ -204,10 +204,10 @@ func main() {
204204
}
205205

206206
// Submit the transaction to the network and wait for it to be included in a ledger
207-
res, err := client.SubmitAndWait(txBlob, false)
207+
res, err := client.SubmitTxBlobAndWait(txBlob, false)
208208
if err != nil {
209209
fmt.Println(err)
210210
return
211211
}
212212
}
213-
```
213+
```

docs/docs/xrpl/websocket.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ func (c *Client) IsConnected() bool
7979
func (c *Client) Conn() *websocket.Conn
8080
```
8181

82-
8382
So, for example, if you want to connect to the `devnet` ledger, you can do it this way:
8483

8584
```go
@@ -122,16 +121,16 @@ func (c *Client) AutofillMultisigned(tx *transaction.FlatTransaction, nSigners u
122121
The `Submit` method is used to submit a transaction to the XRPL network. It returns a `TxResponse` struct containing the transaction result for the blob submitted. `txBlob` must be signed. There's also a `SubmitMultisigned` method that works the same way but for multisigned transactions.
123122

124123
```go
125-
func (c *Client) Submit(txBlob string, failHard bool) (*requests.SubmitResponse, error)
124+
func (c *Client) SubmitTxBlob(txBlob string, failHard bool) (*requests.SubmitResponse, error)
126125
func (c *Client) SubmitMultisigned(txBlob string, failHard bool) (*requests.SubmitMultisignedResponse, error)
127126
```
128127

129-
### SubmitAndWait
128+
### SubmitTxBlobAndWait
130129

131-
The `SubmitAndWait` method is used to submit a transaction to the XRPL network and wait for it to be included in a ledger. It returns a `TxResponse` struct containing the transaction result for the blob submitted.
130+
The `SubmitTxBlobAndWait` method is used to submit a transaction to the XRPL network and wait for it to be included in a ledger. It returns a `TxResponse` struct containing the transaction result for the blob submitted.
132131

133132
```go
134-
func (c *Client) SubmitAndWait(txBlob string, failHard bool) (*requests.TxResponse, error)
133+
func (c *Client) SubmitTxBlobAndWait(txBlob string, failHard bool) (*requests.TxResponse, error)
135134
```
136135

137136
## Queries
@@ -232,7 +231,7 @@ func main() {
232231
}
233232

234233
// Submit the transaction to the network and wait for it to be included in a ledge
235-
res, err := client.SubmitAndWait(txBlob, false)
234+
res, err := client.SubmitTxBlobAndWait(txBlob, false)
236235
if err != nil {
237236
fmt.Println(err)
238237
return

docs/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5190,9 +5190,9 @@ ignore@^5.2.0, ignore@^5.2.4:
51905190
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
51915191

51925192
image-size@^1.0.2:
5193-
version "1.2.0"
5194-
resolved "https://registry.yarnpkg.com/image-size/-/image-size-1.2.0.tgz#312af27a2ff4ff58595ad00b9344dd684c910df6"
5195-
integrity sha512-4S8fwbO6w3GeCVN6OPtA9I5IGKkcDMPcKndtUlpJuCwu7JLjtj7JZpwqLuyY2nrmQT3AWsCJLSKPsc2mPBSl3w==
5193+
version "1.2.1"
5194+
resolved "https://registry.yarnpkg.com/image-size/-/image-size-1.2.1.tgz#ee118aedfe666db1a6ee12bed5821cde3740276d"
5195+
integrity sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==
51965196
dependencies:
51975197
queue "6.0.2"
51985198

examples/checks/rpc/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func main() {
7878
return
7979
}
8080

81-
res, err := client.SubmitAndWait(blob, false)
81+
res, err := client.SubmitTxBlobAndWait(blob, false)
8282
if err != nil {
8383
fmt.Println(err)
8484
return
@@ -150,7 +150,7 @@ func main() {
150150
return
151151
}
152152

153-
res, err = client.SubmitAndWait(blob, false)
153+
res, err = client.SubmitTxBlobAndWait(blob, false)
154154
if err != nil {
155155
fmt.Println(err)
156156
return

examples/checks/ws/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func main() {
8989
return
9090
}
9191

92-
res, err := client.SubmitAndWait(blob, false)
92+
res, err := client.SubmitTxBlobAndWait(blob, false)
9393
if err != nil {
9494
fmt.Println(err)
9595
return
@@ -161,7 +161,7 @@ func main() {
161161
return
162162
}
163163

164-
res, err = client.SubmitAndWait(blob, false)
164+
res, err = client.SubmitTxBlobAndWait(blob, false)
165165
if err != nil {
166166
fmt.Println(err)
167167
return

0 commit comments

Comments
 (0)