bc_ur_dart library
Classes
- AlphSignature
- AlphSignRequest
- BchInput
- BchOutput
- BchSignatureUR
- BchSignRequestUR
- BtcSignature
- CborAdditionalInfo
- Additional Info
- CborBase64
- A CBOR string containing a base 64 value.
- CborBase64Url
- A CBOR string containing a base 64 url safe value.
- CborBigFloat
- A CBOR fraction (m * (2 ** e)).
- CborBigInt
- A CBOR big int.
- CborBool
- A CBOR boolean value.
- CborBytes
- A CBOR byte array.
- CborBytesImpl
- CborCodec
- A CBOR encoder and decoder.
- CborDateTime
- A CBOR datetime.
- CborDateTimeFloat
- A CBOR date time encoded as seconds since epoch in a float.
- CborDateTimeInt
- A CBOR datetieme encoded as seconds since epoch.
- CborDateTimeString
- A CBOR string which encodes a datetime.
- CborDecimalFraction
- A CBOR fraction (m * (10 ** e)).
- CborDecoder
- A CBOR decoder.
- CborEncodeDefiniteLengthBytes
- Use this to force the CborEncoder to encode an definite length byte string.
- CborEncodeDefiniteLengthList
- Use this to force the CborEncoder to encode an definite length list.
- CborEncodeDefiniteLengthMap
- Use this to force the CborEncoder to encode an definite length dictionary.
- CborEncodeDefiniteLengthString
- Use this to force the CborEncoder to encode an definite length string.
- CborEncodeIndefiniteLengthBytes
- Use this to force the CborEncoder to encode an indefinite length byte string.
- CborEncodeIndefiniteLengthList
- Use this to force the CborEncoder to encode an indefinite length list.
- CborEncodeIndefiniteLengthMap
- Use this to force the CborEncoder to encode an indefinite length dictionary.
- CborEncodeIndefiniteLengthString
- Use this to force the CborEncoder to encode an indefinite length string.
- CborEncoder
- A CBOR encoder.
- CborFloat
- A CBOR float.
- CborFloat128BigEndianArray
- float128 big endian
- CborFloat128LittleEndianArray
- float128 little endian
- CborFloat16BigEndianArray
- float16 big endian
- CborFloat16LittleEndianArray
- float16 little endian
- CborFloat32BigEndianArray
- float32 big endian
- CborFloat32LittleEndianArray
- float32 little endian
- CborFloat64BigEndianArray
- float64 big endian
- CborFloat64LittleEndianArray
- float64 little endian
- CborInt
- A CBOR integer or big number.
- CborInt16BigEndianArray
- sint16 big endian
- CborInt16LittleEndianArray
- sint16 little endian
- CborInt32BigEndianArray
- sint32 big endian
- CborInt32LittleEndianArray
- sint32 little endian
- CborInt64BigEndianArray
- sint64 big endian
- CborInt64LittleEndianArray
- sint64 little endian
- CborInt8Array
- sint8
- CborJsonEncoder
- Encodes CBOR into JSON.
- CborList
- A CBOR array.
- CborMajorType
- Jump table for initial byte values can be found here. Maybe useful for code maintainers. Major types
- CborMap
- A CBOR map.
- CborMime
- A CBOR string containing a regular expression.
- CborMultiDimensionalArray
- A CBOR Multi-dimensional Array (RFC 8746).
- CborNull
- A CBOR null value.
- CborRationalNumber
- A CBOR rational number (m / n). https://peteroupc.github.io/CBOR/rational.html
- CborRegex
- A CBOR string containing a regular expression.
- CborSimpleCodec
- A simple codec for CBOR, using CborSimpleEncoder and CborSimpleDecoder.
- CborSimpleDecoder
- A simple decoder for CBOR.
- CborSimpleEncoder
- A simple encoder for CBOR.
- CborSimpleValue
- A CBOR simple value without any additional content.
- CborSmallInt
- A CBOR integer which can be represented losslessly as int.
- CborString
- A CBOR string encoded in UTF-8.
- CborTag
- Hint for the content of something.
- CborTypedArray
- Base class for all Typed Arrays
- CborUint16BigEndianArray
- uint16 big endian
- CborUint16LittleEndianArray
- uint16 little endian
- CborUint32BigEndianArray
- uint32 big endian
- CborUint32LittleEndianArray
- uint32 little endian
- CborUint64BigEndianArray
- uint64 big endian
- CborUint64LittleEndianArray
- uint64 little endian
- CborUint8Array
- uint8
- CborUint8ClampedArray
- uint8 clamped
- CborUndefined
- A CBOR undefined value.
- CborUri
- A CBOR string containing URI.
- CborValue
- A CBOR value.
- CoinType
- CosmosSignature
- CosmosSignRequest
- CryptoAccountUR
- CryptoCoinInfo
- CryptoCoinInfo - field 5: use_info Identifies the cryptocurrency and network for the HD Key
- CryptoHDKeyUR
- CryptoMultiAccountsUR
- CryptoTxEntity
- Eip1559TxData
- Eip7702TxData
- EthSignatureUR
- EthSignRequestUR
- EthTxData
- EthTxDataRaw
- FragmentUR
- Fragment of UR.
- GsplSignatureUR
- GsplSignRequestUR
- KeystoneCosmosSignature
-
Official Keystone-compatible
cosmos-signature. - KeystoneCosmosSignRequest
-
Official Keystone-compatible
cosmos-sign-request. - KeystoneSolSignRequest
- KeystoneTronSignRequest
- KeystoneTronSignResult
- KeystoneTronTokenInfo
- KeystoneXrpAccountBytes
- KeystoneXrpSignatureBytes
- KeystoneXrpSignRequestBytes
- LegacyTxData
- PsbtSignatureUR
- PsbtSignRequestUR
- RegistryType
- ScSignature
- ScSignRequest
- SkippedHDKeyEntry
- A crypto-multi-accounts key entry that failed to decode and was skipped so it could not abort the whole import. index is its position in the CBOR keys list; reason is the decode error (e.g. a corrupt secp256k1 public key).
- SolSignature
- SolSignRequest
- TronSignature
- TronSignRequest
- TxNetwork
- UR
- URSeq
Enums
- AlphSignRequestKeys
- CborFloatPrecision
- Enumeration to allow the user to select which level of precision to use encoding a CBOR float. Defaults to 'automatic'
- CborLengthType
- CosmosDataType
- Official Keystone Cosmos sign data type.
- CosmosSignRequestKeys
- EthSignDataType
- EthTxType
- GsplDataType
- 对应官方 GsplDataType
- ScSignatureKeys
- ScSignRequestKeys
- SignType
- SolSignRequestKeys
- TronSignatureKeys
- TronSignRequestKeys
- TxEntityKeys
- URExceptionType
Extensions
- GsplItemWithCbor on GsplItem
- GsplTxDataWithCbor on GsplTxData
- URType on String
Constants
- BTC_SIGN_REQUEST → const String
- BTC_SIGNATURE → const String
- cbor → const CborCodec
- A constant instance of a CBOR codec, using default parameters.
- ETH_SIGN_REQUEST → const String
- ETH_SIGNATURE → const String
- kCborDefiniteLengthThreshold → const int
- PSBT_SIGN_REQUEST → const String
- PSBT_SIGNATURE → const String
Functions
-
arraysEqual(
List a, List b) → bool -
bigIntToByte(
BigInt value, int? length) → Uint8List -
bigIntToBytes(
String bigIntStr) → Uint8List - 将BigInt的字符串转换为字节数组(Uint8List)
-
bufferXOR(
List< int> a, List<int> b) → List<int> -
bytesToBigIntStr(
Uint8List bytes) → String - 将字节数组(Uint8List)转换为BigInt字符串
-
byteToBigInt(
Uint8List value) → BigInt -
cborDecode(
List< int> value) → CborValue -
Alias for
cbor.decode. -
cborEncode(
CborValue value) → List< int> -
Alias for
cbor.encode. -
cborPathToString(
CborList? pathList) → String - Convert a CborList to a BIP32 path string
-
cborPrettyPrint(
List< int> input, {int indent = CborConstants.prettyPrintIndent}) → String - Pretty print a CBOR input.
-
fromHex(
String data) → Uint8List -
generateUuid(
) → Uint8List -
generateUuidStr(
) → String -
getGsplItemFromCbor(
{required CborMap data}) → GsplItem -
getGsplTxDataFromCbor(
{required CborMap data}) → GsplTxData -
getPath(
String path) → List< CborValue> -
getXfp(
BigInt xfpCode, {bool reverseBytes = false}) → String -
Xfp code to hex.
reverseBytesdecide whether reverse. -
intToByte(
int value, int length) → Uint8List -
parsePath(
String path) → List< Map< String, dynamic> > -
parseTxEntity(
Map< String, dynamic> txEntityMap) → CryptoTxEntity - 从 Map 构建 CryptoTxEntity 用于业务层(如解析交易输出)
-
parseTxOutputs(
List< CryptoTxEntity> ? outputs) → List<Map< String, dynamic> > - CryptoTxEntity → Map,对应热钱包构造时的 parseTxEntity() 逆操作
-
sha256(
List< int> value) → Uint8List -
stringToBytes(
String value) → Uint8List -
toUtf8Bytes(
String str) → Uint8List -
toXfpCode(
String xfp, {bool reverseBytes = false}) → BigInt -
Hex xfp to bigInt xfp.
reverseBytesdecide whether reverse. -
uuidParse(
String uuid) → List< int> -
uuidStringify(
List< int> uuid, {int offset = 0}) → String
Exceptions / Errors
- CborCyclicError
- Raised when object could not be codified due to cyclic references.
- CborMalformedException
- An exception raised when decoding.
- InvalidChecksumURException
- InvalidFormatURException
- InvalidSequenceURException
- URException