Skip to content
XRPLFPublic
forked from xyield/xrpl-go

About

The xrpl-go library provides a Go implementation for interacting with the XRP Ledger.

Topics

Resources

Contributing

Stars

25 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

2,631 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XRPL-GO

A Go SDK for building applications on the XRP Ledger. Query the ledger, manage wallets, and sign and submit transactions with typed Go models.

Go Reference Go Report Card Core release

Documentation · API reference · Examples · Contributing

Quick start

Requires Go 1.26.11 or later. The core SDK is pure Go and does not require a C/C++ toolchain.

From your application's Go module, install the SDK:

go get github.com/Peersyst/xrpl-go@latest

For a new application, run go mod init example.com/my-xrpl-app first.

Save this as main.go to query a Testnet server. No wallet or funds are needed.

package main

import (
	"fmt"
	"log"

	"github.com/Peersyst/xrpl-go/xrpl/queries/server"
	"github.com/Peersyst/xrpl-go/xrpl/rpc"
)

func main() {
	cfg, err := rpc.NewClientConfig("https://s.altnet.rippletest.net:51234/")
	if err != nil {
		log.Fatal(err)
	}
	client := rpc.NewClient(cfg)

	info, err := client.GetServerInfo(&server.InfoRequest{})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Printf("Connected to Testnet. Server version: %s\n", info.Info.ServerVersion())
}

Resolve its dependencies and run it:

go mod tidy
go run .

With network access, it prints the server's software version. To send your first payment, follow the Testnet payment example.

What you can build

Sending transactions

The usual transaction flow is:

  1. Build a typed transaction and call Flatten().
  2. Call client.Autofill() to set network fields such as the fee and sequence.
  3. Sign locally with wallet.Sign().
  4. Submit with client.SubmitTxBlobAndWait().

For the combined flow, use client.SubmitTxAndWait() with SubmitOptions.Wallet and explicit Autofill: true to autofill, sign, submit, and wait in one call. Autofill is disabled by default. For offline signing, keep autofill and signing separate: autofill needs network access, signing does not.

See the payment example for the complete flow and the examples directory for more use cases.

Optional confidential helpers

Most applications only need the core SDK. For confidential MPT encryption, balance decryption, commitments, proofs, and transaction builders, use the separate github.com/Peersyst/xrpl-go/confidential module.

Core already includes the transaction models and ledger fields. It can encode, sign, and submit confidential transactions when your application supplies the ciphertexts and proofs. The optional module generates these fields and decrypts balances.

The helpers require a native C/C++ toolchain and cgo for cryptographic operations on Linux or macOS with amd64 or arm64. Both modules require Go 1.26.11 or later. They are versioned independently, and core does not depend on the optional module.

See the confidential README for release availability, installation, migration, and platform requirements, or start with the confidential examples.

Documentation and support

Found a bug or a documentation gap? Open an issue.

Security and audits

The signing functionality in this repository has not been independently audited. Test on Testnet or Devnet first, and review signing behavior before using it to control production funds.

Never print, log, commit, or send real seeds, private keys, or mnemonics to telemetry. Anyone with those values can control the account.

Contributing

See CONTRIBUTING.md for development setup, tests, and pull request guidance. To work on both modules, follow the confidential development setup. Root go test ./... only tests core.

License

MIT.

About

The xrpl-go library provides a Go implementation for interacting with the XRP Ledger.

Topics

Resources

Contributing

Stars

25 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages