Show / Hide Table of Contents

Class Blob

The Blob type is a length-prefixed field with arbitrary data.
Two common fields that use this type are SigningPubKey and TxnSignature, which contain (respectively) the public key and signature that authorize a transaction to be executed.
Blob fields have no further structure to their contents, so they consist of exactly the amount of bytes indicated in the variable-length encoding, after the Field ID and length prefixes.

Variable length encoded type

Inheritance
object
Blob
Implements
ISerializedType
Namespace: Xrpl.BinaryCodec.Types
Assembly: Xrpl.BinaryCodec.dll
Syntax
public class Blob : ISerializedType

Fields

| Edit this page View Source

Buffer

Declaration
public readonly byte[] Buffer
Field Value
Type Description
byte[]

Methods

| Edit this page View Source

FromAscii(string)

Create a Blob object from a hex-string

Declaration
public static Blob FromAscii(string blob)
Parameters
Type Name Description
string blob

existing hex-string in ASCII

Returns
Type Description
Blob

A Blob object

| Edit this page View Source

FromHex(string)

Declaration
public static Blob FromHex(string value)
Parameters
Type Name Description
string value
Returns
Type Description
Blob
| Edit this page View Source

FromJson(JsonNode)

Defines how to read a Blob from json. Accepts both hex-encoded strings and ASCII strings. If the string is valid hex (even length, all hex chars), it's decoded as hex. Otherwise, it's treated as ASCII and converted to bytes.

Declaration
public static Blob FromJson(JsonNode token)
Parameters
Type Name Description
JsonNode token

json token

Returns
Type Description
Blob

A Blob object

| Edit this page View Source

FromParser(BinaryParser, int?)

Defines how to read a Blob from a BinaryParser

Declaration
public static Blob FromParser(BinaryParser parser, int? hint = null)
Parameters
Type Name Description
BinaryParser parser

The binary parser to read the Blob from

int? hint

The length of the blob, computed by readVariableLengthLength() and passed in

Returns
Type Description
Blob

A Blob object

| Edit this page View Source

FromString(string, Encoding)

Create a Blob object from a hex-string

Declaration
public static Blob FromString(string blob, Encoding encoding)
Parameters
Type Name Description
string blob

existing hex-string

Encoding encoding

string encoding

Returns
Type Description
Blob

A Blob object

| Edit this page View Source

ToBytes(IBytesSink)

to bytes Sink

Declaration
public void ToBytes(IBytesSink sink)
Parameters
Type Name Description
IBytesSink sink

bytes Sink container

| Edit this page View Source

ToJson()

Get the JSON representation of this type

Declaration
public JsonNode ToJson()
Returns
Type Description
JsonNode
| Edit this page View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Operators

| Edit this page View Source

implicit operator Blob(byte[])

Declaration
public static implicit operator Blob(byte[] value)
Parameters
Type Name Description
byte[] value
Returns
Type Description
Blob
| Edit this page View Source

implicit operator Blob(JsonNode)

Declaration
public static implicit operator Blob(JsonNode token)
Parameters
Type Name Description
JsonNode token
Returns
Type Description
Blob

Implements

ISerializedType

Extension Methods

StExtensions.ToDebuggedHex(ISerializedType)
StExtensions.ToHex(ISerializedType)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX