A type that can be encoded to a UR (Uniform Resource).
Types implementing this interface should be able to convert themselves to CBOR data and associate that with a UR type identifier.
class MyType implements UREncodable { toCBOR(): CBOR { // Convert to CBOR } ur(): UR { const cbor = this.toCBOR(); return UR.new('mytype', cbor); }} Copy
class MyType implements UREncodable { toCBOR(): CBOR { // Convert to CBOR } ur(): UR { const cbor = this.toCBOR(); return UR.new('mytype', cbor); }}
Returns the UR representation of the object.
Returns the UR string representation of the object.
A type that can be encoded to a UR (Uniform Resource).
Types implementing this interface should be able to convert themselves to CBOR data and associate that with a UR type identifier.
Example