Skip to content

Commit 7c8817b

Browse files
Merge branch 'v0.1.x'
2 parents d343550 + 6ac436c commit 7c8817b

32 files changed

+2725
-120
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@ 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]
9+
10+
### Added
11+
12+
#### xrpl
13+
14+
- Added `BalanceChanges` to the `Transaction` type.
15+
16+
### Changed
17+
18+
#### xrpl
19+
20+
- Updated `AffectedNode` type fields to be a pointer to allow nil values.
21+
22+
### Added
23+
24+
#### xrpl
25+
26+
- Added support for all the Credential transaction types:
27+
- CredentialCreate
28+
- CredentialAccept
29+
- CredentialDelete
30+
31+
### Fixed
32+
33+
#### xrpl
34+
35+
- 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.
36+
837
## [v0.1.7]
938

1039
### Added
@@ -33,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3362
- `WalletLocator`
3463
- `WalletSize`
3564
- `TransferRate`
65+
3666
- Adds more tests for setting some `asf` flags in `AccountSet`.
3767
- Fixed `Transaction` field in `account_tx` response.
3868
- Fixed `Ledger` field in `ledger` response. LedgerIndex is now an uint32 instead of a string.

binary-codec/definitions/definitions.json

Lines changed: 147 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,35 @@
3030
"Metadata": 10004
3131
},
3232
"LEDGER_ENTRY_TYPES": {
33-
"Invalid": -1,
3433
"AccountRoot": 97,
35-
"DirectoryNode": 100,
36-
"RippleState": 114,
37-
"Ticket": 84,
38-
"SignerList": 83,
39-
"Offer": 111,
40-
"Bridge": 105,
41-
"LedgerHashes": 104,
4234
"Amendments": 102,
43-
"XChainOwnedClaimID": 113,
44-
"XChainOwnedCreateAccountClaimID": 116,
45-
"FeeSettings": 115,
46-
"Escrow": 117,
47-
"PayChannel": 120,
35+
"AMM": 121,
36+
"Any": -3,
37+
"Bridge": 105,
4838
"Check": 67,
39+
"Child": -2,
40+
"Contract": 99,
41+
"Credential": 129,
4942
"DepositPreauth": 112,
43+
"DID": 73,
44+
"DirectoryNode": 100,
45+
"Escrow": 117,
46+
"FeeSettings": 115,
47+
"GeneratorMap": 103,
48+
"Invalid": -1,
49+
"LedgerHashes": 104,
5050
"NegativeUNL": 78,
51-
"NFTokenPage": 80,
5251
"NFTokenOffer": 55,
53-
"AMM": 121,
54-
"DID": 73,
55-
"Oracle": 128,
56-
"Any": -3,
57-
"Child": -2,
52+
"NFTokenPage": 80,
5853
"Nickname": 110,
59-
"Contract": 99,
60-
"GeneratorMap": 103
54+
"Offer": 111,
55+
"Oracle": 128,
56+
"PayChannel": 120,
57+
"RippleState": 114,
58+
"SignerList": 83,
59+
"Ticket": 84,
60+
"XChainOwnedClaimID": 113,
61+
"XChainOwnedCreateAccountClaimID": 116
6162
},
6263
"FIELDS": [
6364
[
@@ -1070,6 +1071,16 @@
10701071
"type": "UInt64"
10711072
}
10721073
],
1074+
[
1075+
"SubjectNode",
1076+
{
1077+
"nth": 28,
1078+
"isVLEncoded": false,
1079+
"isSerialized": true,
1080+
"isSigningField": true,
1081+
"type": "UInt64"
1082+
}
1083+
],
10731084
[
10741085
"EmailHash",
10751086
{
@@ -1980,6 +1991,16 @@
19801991
"type": "Blob"
19811992
}
19821993
],
1994+
[
1995+
"CredentialType",
1996+
{
1997+
"nth": 31,
1998+
"isVLEncoded": true,
1999+
"isSerialized": true,
2000+
"isSigningField": true,
2001+
"type": "Blob"
2002+
}
2003+
],
19832004
[
19842005
"Account",
19852006
{
@@ -2180,6 +2201,16 @@
21802201
"type": "Vector256"
21812202
}
21822203
],
2204+
[
2205+
"CredentialIDs",
2206+
{
2207+
"nth": 5,
2208+
"isVLEncoded": true,
2209+
"isSerialized": true,
2210+
"isSigningField": true,
2211+
"type": "Vector256"
2212+
}
2213+
],
21832214
[
21842215
"Paths",
21852216
{
@@ -2260,6 +2291,16 @@
22602291
"type": "XChainBridge"
22612292
}
22622293
],
2294+
[
2295+
"Subject",
2296+
{
2297+
"nth": 24,
2298+
"isVLEncoded": true,
2299+
"isSerialized": true,
2300+
"isSigningField": true,
2301+
"type": "AccountID"
2302+
}
2303+
],
22632304
[
22642305
"TransactionMetaData",
22652306
{
@@ -2550,6 +2591,16 @@
25502591
"type": "STObject"
25512592
}
25522593
],
2594+
[
2595+
"Credential",
2596+
{
2597+
"nth": 33,
2598+
"isVLEncoded": false,
2599+
"isSerialized": true,
2600+
"isSigningField": true,
2601+
"type": "STObject"
2602+
}
2603+
],
25532604
[
25542605
"Signers",
25552606
{
@@ -2739,6 +2790,36 @@
27392790
"isSigningField": true,
27402791
"type": "STArray"
27412792
}
2793+
],
2794+
[
2795+
"AuthorizeCredentials",
2796+
{
2797+
"nth": 26,
2798+
"isVLEncoded": false,
2799+
"isSerialized": true,
2800+
"isSigningField": true,
2801+
"type": "STArray"
2802+
}
2803+
],
2804+
[
2805+
"UnauthorizeCredentials",
2806+
{
2807+
"nth": 27,
2808+
"isVLEncoded": false,
2809+
"isSerialized": true,
2810+
"isSigningField": true,
2811+
"type": "STArray"
2812+
}
2813+
],
2814+
[
2815+
"AcceptedCredentials",
2816+
{
2817+
"nth": 28,
2818+
"isVLEncoded": false,
2819+
"isSerialized": true,
2820+
"isSigningField": true,
2821+
"type": "STArray"
2822+
}
27422823
]
27432824
],
27442825
"TRANSACTION_RESULTS": {
@@ -2847,6 +2928,7 @@
28472928

28482929
"tesSUCCESS": 0,
28492930

2931+
"tecBAD_CREDENTIALS": 193,
28502932
"tecCLAIM": 100,
28512933
"tecPATH_PARTIAL": 101,
28522934
"tecUNFUNDED_ADD": 102,
@@ -2926,56 +3008,59 @@
29263008
"tecARRAY_TOO_LARGE": 191
29273009
},
29283010
"TRANSACTION_TYPES": {
2929-
"Invalid": -1,
2930-
"Payment": 0,
2931-
"EscrowCreate": 1,
2932-
"EscrowFinish": 2,
3011+
"AccountDelete": 21,
29333012
"AccountSet": 3,
3013+
"AMMBid": 39,
3014+
"AMMCreate": 35,
3015+
"AMMDelete": 40,
3016+
"AMMDeposit": 36,
3017+
"AMMVote": 38,
3018+
"AMMWithdraw": 37,
3019+
"CheckCancel": 18,
3020+
"CheckCash": 17,
3021+
"CheckCreate": 16,
3022+
"Clawback": 30,
3023+
"Contract": 9,
3024+
"CredentialAccept": 59,
3025+
"CredentialCreate": 58,
3026+
"CredentialDelete": 60,
3027+
"DepositPreauth": 19,
3028+
"DIDDelete": 50,
3029+
"DIDSet": 49,
3030+
"EnableAmendment": 100,
29343031
"EscrowCancel": 4,
2935-
"SetRegularKey": 5,
3032+
"EscrowCreate": 1,
3033+
"EscrowFinish": 2,
3034+
"Invalid": -1,
3035+
"NFTokenAcceptOffer": 29,
3036+
"NFTokenBurn": 26,
3037+
"NFTokenCancelOffer": 28,
3038+
"NFTokenCreateOffer": 27,
3039+
"NFTokenMint": 25,
29363040
"NickNameSet": 6,
2937-
"OfferCreate": 7,
29383041
"OfferCancel": 8,
2939-
"Contract": 9,
2940-
"TicketCreate": 10,
2941-
"TicketCancel": 11,
2942-
"SignerListSet": 12,
3042+
"OfferCreate": 7,
3043+
"OracleDelete": 52,
3044+
"OracleSet": 51,
3045+
"Payment": 0,
3046+
"PaymentChannelClaim": 15,
29433047
"PaymentChannelCreate": 13,
29443048
"PaymentChannelFund": 14,
2945-
"PaymentChannelClaim": 15,
2946-
"CheckCreate": 16,
2947-
"CheckCash": 17,
2948-
"CheckCancel": 18,
2949-
"DepositPreauth": 19,
2950-
"TrustSet": 20,
2951-
"AccountDelete": 21,
3049+
"SetFee": 101,
29523050
"SetHook": 22,
2953-
"NFTokenMint": 25,
2954-
"NFTokenBurn": 26,
2955-
"NFTokenCreateOffer": 27,
2956-
"NFTokenCancelOffer": 28,
2957-
"NFTokenAcceptOffer": 29,
2958-
"Clawback": 30,
2959-
"AMMCreate": 35,
2960-
"AMMDeposit": 36,
2961-
"AMMWithdraw": 37,
2962-
"AMMVote": 38,
2963-
"AMMBid": 39,
2964-
"AMMDelete": 40,
2965-
"XChainCreateClaimID": 41,
2966-
"XChainCommit": 42,
2967-
"XChainClaim": 43,
3051+
"SetRegularKey": 5,
3052+
"SignerListSet": 12,
3053+
"TicketCancel": 11,
3054+
"TicketCreate": 10,
3055+
"TrustSet": 20,
3056+
"UNLModify": 102,
29683057
"XChainAccountCreateCommit": 44,
2969-
"XChainAddClaimAttestation": 45,
29703058
"XChainAddAccountCreateAttestation": 46,
2971-
"XChainModifyBridge": 47,
3059+
"XChainAddClaimAttestation": 45,
3060+
"XChainClaim": 43,
3061+
"XChainCommit": 42,
29723062
"XChainCreateBridge": 48,
2973-
"DIDSet": 49,
2974-
"DIDDelete": 50,
2975-
"OracleSet": 51,
2976-
"OracleDelete": 52,
2977-
"EnableAmendment": 100,
2978-
"SetFee": 101,
2979-
"UNLModify": 102
3063+
"XChainCreateClaimID": 41,
3064+
"XChainModifyBridge": 47
29803065
}
29813066
}

examples/clients/clients.go

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package clients
2+
3+
import (
4+
"github.com/Peersyst/xrpl-go/xrpl/faucet"
5+
"github.com/Peersyst/xrpl-go/xrpl/rpc"
6+
"github.com/Peersyst/xrpl-go/xrpl/websocket"
7+
)
8+
9+
// GetDevnetRpcClient returns a new rpc client for the devnet
10+
func GetDevnetRpcClient() *rpc.Client {
11+
cfg, err := rpc.NewClientConfig(
12+
"https://s.devnet.rippletest.net:51234",
13+
rpc.WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
14+
)
15+
if err != nil {
16+
panic(err)
17+
}
18+
19+
return rpc.NewClient(cfg)
20+
}
21+
22+
// GetTestnetRpcClient returns a new rpc client for the testnet
23+
func GetTestnetRpcClient() *rpc.Client {
24+
cfg, err := rpc.NewClientConfig(
25+
"https://s.altnet.rippletest.net:51234",
26+
rpc.WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
27+
)
28+
if err != nil {
29+
panic(err)
30+
}
31+
32+
return rpc.NewClient(cfg)
33+
}
34+
35+
// GetDevnetWebsocketClient returns a new websocket client for the devnet
36+
func GetDevnetWebsocketClient() *websocket.Client {
37+
client := websocket.NewClient(
38+
websocket.NewClientConfig().
39+
WithHost("wss://s.devnet.rippletest.net:51233").
40+
WithFaucetProvider(faucet.NewDevnetFaucetProvider()),
41+
)
42+
43+
return client
44+
}
45+
46+
// GetTestnetWebsocketClient returns a new websocket client for the testnet
47+
func GetTestnetWebsocketClient() *websocket.Client {
48+
client := websocket.NewClient(
49+
websocket.NewClientConfig().
50+
WithHost("wss://s.altnet.rippletest.net:51233").
51+
WithFaucetProvider(faucet.NewTestnetFaucetProvider()),
52+
)
53+
54+
return client
55+
}

0 commit comments

Comments
 (0)