Show / Hide Table of Contents

Class X402Base64Json

Serializes and deserializes x402 wire objects as Base64-encoded UTF-8 JSON, matching the encoding used in the PAYMENT-REQUIRED, PAYMENT-SIGNATURE, and PAYMENT-RESPONSE HTTP headers.

Inheritance
object
X402Base64Json
Namespace: Xrpl.X402.Wire
Assembly: Xrpl.X402.dll
Syntax
public static class X402Base64Json

Methods

| Edit this page View Source

Decode<T>(string)

Decodes a Base64-encoded UTF-8 JSON string and deserializes it to T.

Declaration
public static T Decode<T>(string base64)
Parameters
Type Name Description
string base64

Base64 string to decode and deserialize.

Returns
Type Description
T

The deserialized object.

Type Parameters
Name Description
T

Type to deserialize into.

Exceptions
Type Condition
FormatException

Thrown when the JSON cannot be deserialized to T.

| Edit this page View Source

Encode<T>(T)

Serializes value to JSON and returns a Base64-encoded UTF-8 string.

Declaration
public static string Encode<T>(T value)
Parameters
Type Name Description
T value

The object to encode.

Returns
Type Description
string

Base64 string containing the UTF-8 JSON representation of value.

Type Parameters
Name Description
T

Type of the value to serialize.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX