Skip to content

Commit 20d43c8

Browse files
Merge pull request #152 from Peersyst/feat/docs/update-xrpl-content
[TA-5118] Update Docs with Batch tx
2 parents a9be8d0 + 2f27b45 commit 20d43c8

File tree

10 files changed

+141
-97
lines changed

10 files changed

+141
-97
lines changed

docs/docs/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 1
44

55
# Getting Started
66

7-
This documentation englobes the `xrpl-go` project, a Go SDK for interacting with the XRP Ledger.
7+
This documentation covers the `xrpl-go` project, a Go SDK for interacting with the XRP Ledger.
88

99
## What is the XRP Ledger?
1010

docs/docs/keypairs.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
sidebar_position: 5
3+
pagination_next: xrpl/currency
34
---
45

56
# keypairs
67

7-
## Introduction
8+
## Introduction
89

910
The keypairs package provides a set of functions for generating and managing cryptographic keypairs. It includes functionality for creating new keypairs, deriving public keys from private keys, and verifying signatures.
1011

@@ -27,9 +28,9 @@ Cryptographic algorithms supported by this package are:
2728
- ed25519
2829
- secp256k1
2930

30-
Every function in the package that requires a cryptographic algorithm will accept any type that satisfies the `KeypairCryptoAlg` interface. So, if desired, you can implement your own algorithm and use it in this package.
31+
Every function in the package that requires a cryptographic algorithm will accept any type that satisfies the `KeypairCryptoAlg` interface. So, if desired, you can implement your own algorithm and use it in this package.
3132

32-
However, the library already exports both algorithm getters that satisfy the `KeypairCryptoAlg` and `NodeDerivationCryptoAlg` interfaces. They're available under the package `github.com/Peersyst/xrpl-go/pkg/crypto`, which exports both algorithm getters that satisfy the `KeypairCryptoAlg`, `NodeDerivationCryptoAlg` interfaces.
33+
However, the library already exports both algorithm getters that satisfy the `KeypairCryptoAlg` and `NodeDerivationCryptoAlg` interfaces. They're available under the package `github.com/Peersyst/xrpl-go/pkg/crypto`, which exports both algorithm getters that satisfy the `KeypairCryptoAlg`, `NodeDerivationCryptoAlg` interfaces.
3334

3435
### crypto package
3536

@@ -73,7 +74,7 @@ They can be split into two groups:
7374
func GenerateSeed(entropy string, alg interfaces.KeypairCryptoAlg, r interfaces.Randomizer) (string, error)
7475
```
7576

76-
Generate a seed that can be used to generate keypairs. You can specify the entropy of the seed or let the function generate a random one (by passing an empty string as entropy and providing a randomizer) and use one of the supported algorithms to generate the seed. The result is a base58-encoded seed, which starts with the character `s`.
77+
Generate a seed that can be used to generate keypairs. You can specify the entropy of the seed or let the function generate a random one (by passing an empty string as entropy and providing a randomizer) and use one of the supported algorithms to generate the seed. The result is a base58-encoded seed, which starts with the character `s`.
7778

7879
:::info
7980

@@ -89,7 +90,6 @@ func DeriveKeypair(seed string, validator bool) (private, public string, err err
8990

9091
Derives a keypair (private and public keys) from a seed. If the `validator` parameter is `true`, the keypair will be a validator keypair; otherwise, it will be a user keypair. The result for both the private and public keys is a 33-byte hexadecimal string.
9192

92-
9393
#### DeriveClassicAddress
9494

9595
```go
@@ -165,7 +165,6 @@ func main() {
165165
}
166166
```
167167

168-
169168
### How to generate a new keypair from entropy
170169

171170
This example generates a new keypair using the `ED25519` algorithm and a provided entropy. Then, it derives the keypair and the address as the previous example.
@@ -199,4 +198,4 @@ func main() {
199198
fmt.Println("Public Key: ", pubK)
200199
fmt.Println("Address: ", addr)
201200
}
202-
```
201+
```

docs/docs/xrpl/currency.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
pagination_prev: keypairs
3+
---
4+
15
# currency
26

37
## Overview
@@ -32,4 +36,5 @@ func DropsToXrp(value string) (string, error)
3236

3337
// Non-standard currency codes conversions
3438
func ConvertStringToHex(input string) string
35-
func ConvertHexToString(input string) (string, error)
39+
func ConvertHexToString(input string) (string, error)
40+
```

docs/docs/xrpl/hash.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
## Overview
44

5-
The `hash` package contains functions and types related to the XRPL hash types. Currently, it only contains the function `SignTxBlob` that hashes a signed transaction blob, which is mainly used for multisigning.
5+
The `hash` package contains functions for hashing XRPL transactions.
6+
7+
- `SignTxBlob`: Hashes a signed transaction blob. It accepts a signed transaction blob as input and returns the transaction's hash. This is mainly used for verifying transaction integrity, including multisigned transactions.
8+
9+
- `SignTx`: Hashes a signed transaction provided as a decoded map object. Primarily used internally for batch transactions within the wallet.
610

711
## Usage
812

@@ -14,6 +18,18 @@ import "github.com/Peersyst/xrpl-go/xrpl/hash"
1418

1519
## API
1620

21+
### SignTxBlob
22+
23+
```go
24+
func SignTxBlob(txBlob string) ([]byte, error)
25+
```
26+
27+
Hashes a signed transaction blob and returns the transaction hash or an error if the blob is invalid.
28+
29+
### SignTx
30+
1731
```go
18-
func SignTxBlob(blob []byte, secret string) ([]byte, error)
19-
```
32+
func SignTx(tx map[string]interface{}) (string, error)
33+
```
34+
35+
Hashes a signed transaction provided as a decoded map and returns the transaction hash or an error if the transaction object is invalid.

docs/docs/xrpl/ledger-entry-types.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ The `ledger-entry-types` package contains types and functions to handle ledger o
77
- [`AccountRoot`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/accountroot)
88
- [`Amendments`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/amendments)
99
- [`AMM`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/amm)
10+
- [`Credential`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/credential)
11+
- `Delegate`
1012
- [`Bridge`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/bridge)
1113
- [`Check`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/check)
1214
- [`DepositPreauth`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/depositpreauth)
@@ -21,6 +23,7 @@ The `ledger-entry-types` package contains types and functions to handle ledger o
2123
- [`Offer`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/offer)
2224
- [`Oracle`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/oracle)
2325
- [`PayChannel`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/paychannel)
26+
- [`PermissionedDomain`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/permissioneddomain)
2427
- [`RippleState`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ripplestate)
2528
- [`SignerList`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/signerlist)
2629
- [`Ticket`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ticket)
@@ -33,4 +36,4 @@ To import the package, you can use the following code:
3336

3437
```go
3538
import "github.com/Peersyst/xrpl-go/xrpl/ledger-entry-types"
36-
```
39+
```

0 commit comments

Comments
 (0)