@blooo/hw-app-concordium
Version:
Ledger Hardware Wallet Concordium Application API
202 lines • 10.4 kB
TypeScript
import { AccountTransaction, IConfigureBakerTransaction, IConfigureDelegationTransaction, ICredentialDeploymentTransaction, IDeployModuleTransaction, IInitContractTransaction, IPublicInfoForIpTransaction, IRegisterDataTransaction, ISimpleTransferTransaction, ISimpleTransferWithMemoTransaction, ISimpleTransferWithScheduleAndMemoTransaction, ISimpleTransferWithScheduleTransaction, ITransferToPublicTransaction, IUpdateContractTransaction, IUpdateCredentialsTransaction } from "./type";
/**
* Splits a BIP32 path string into an array of numbers.
* @param {string} path - The BIP32 path as a string.
* @returns {number[]} - The path as an array of numbers.
*/
export declare const splitPath: (path: string) => number[];
/**
* Converts a BIP32 path string to a buffer.
* @param {string} originalPath - The BIP32 path as a string.
* @returns {Buffer} - The path as a buffer.
*/
export declare const pathToBuffer: (originalPath: string) => Buffer;
/**
* Serializes transaction payloads without a derivation path.
* @param {Buffer} rawTx - The raw transaction data.
* @returns {Buffer[]} - An array of serialized payload buffers.
*/
export declare const serializeTransactionPayloads: (rawTx: Buffer) => Buffer[];
/**
* Serializes an account transaction with a derivation path.
* @param {AccountTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloads: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeTransaction: (txn: AccountTransaction, path: string) => {
payloads: Buffer[];
};
/**
* Serializes a simple transfer transaction.
* @param {ISimpleTransferTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloads: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeSimpleTransfer: (txn: ISimpleTransferTransaction, path: string) => {
payloads: Buffer[];
};
/**
* Serializes a simple transfer transaction with a memo.
* @param {ISimpleTransferWithMemoTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeaderAddressMemoLength: Buffer[], payloadsMemo: Buffer[], payloadsAmount: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeSimpleTransferWithMemo: (txn: ISimpleTransferWithMemoTransaction, path: string) => {
payloadHeaderAddressMemoLength: Buffer[];
payloadsMemo: Buffer[];
payloadsAmount: Buffer[];
};
/**
* Serializes a transfer transaction with a schedule.
* @param {ISimpleTransferWithScheduleTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeaderAddressScheduleLength: Buffer[], payloadsSchedule: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeTransferWithSchedule: (txn: ISimpleTransferWithScheduleTransaction, path: string) => {
payloadHeaderAddressScheduleLength: Buffer[];
payloadsSchedule: Buffer[];
};
/**
* Serializes a configure delegation transaction.
* @param {IConfigureDelegationTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloads: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeConfigureDelegation: (txn: IConfigureDelegationTransaction, path: string) => {
payloads: Buffer[];
};
/**
* Serializes a configure baker transaction.
* @param {IConfigureBakerTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeaderKindAndBitmap: Buffer, payloadFirstBatch: Buffer, payloadAggregationKeys: Buffer, payloadUrlLength: Buffer, payloadURL: Buffer, payloadCommissionFee: Buffer }} - An object containing serialized payloads.
*/
export declare const serializeConfigureBaker: (txn: IConfigureBakerTransaction, path: string) => {
payloadHeaderKindAndBitmap: Buffer;
payloadFirstBatch: Buffer;
payloadAggregationKeys: Buffer;
payloadUrlLength: Buffer;
payloadURL: Buffer;
payloadCommissionFee: Buffer;
payloadSuspended: Buffer;
};
/**
* Serializes a transfer transaction with a schedule and memo.
* @param {ISimpleTransferWithScheduleAndMemoTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeaderAddressScheduleLengthAndMemoLength: Buffer[], payloadMemo: Buffer[], payloadsSchedule: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeTransferWithScheduleAndMemo: (txn: ISimpleTransferWithScheduleAndMemoTransaction, path: string) => {
payloadHeaderAddressScheduleLengthAndMemoLength: Buffer[];
payloadMemo: Buffer[];
payloadsSchedule: Buffer[];
};
/**
* Serializes a register data transaction.
* @param {IRegisterDataTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeader: Buffer[], payloadsData: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeRegisterData: (txn: IRegisterDataTransaction, path: string) => {
payloadHeader: Buffer[];
payloadsData: Buffer[];
};
/**
* Serializes a transfer to public transaction.
* @param {ITransferToPublicTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeader: Buffer[], payloadsAmountAndProofsLength: Buffer[], payloadsProofs: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeTransferToPublic: (txn: ITransferToPublicTransaction, path: string) => {
payloadHeader: Buffer[];
payloadsAmountRecipientAndProofsLength: Buffer[];
payloadsProofs: Buffer[];
};
/**
* Serializes a deploy module transaction.
* @param {IDeployModuleTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloads: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeDeployModule: (txn: IDeployModuleTransaction, path: string) => {
payloadsHeaderAndVersion: Buffer[];
payloadSource: Buffer;
};
/**
* Serializes an init contract transaction.
* @param {IInitContractTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloads: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeInitContract: (txn: IInitContractTransaction, path: string) => {
payloadsHeaderAndData: Buffer[];
payloadsName: Buffer[];
payloadsParam: Buffer[];
};
/**
* Serializes an update contract transaction.
* @param {IUpdateContractTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloads: Buffer[] }} - An object containing serialized payloads.
*/
export declare const serializeUpdateContract: (txn: IUpdateContractTransaction, path: string) => {
payloadsHeaderAndData: Buffer[];
payloadsName: Buffer[];
payloadsParam: Buffer[];
};
/**
* Serializes a credential deployment transaction.
* @param {ICredentialDeploymentTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadDerivationPath: Buffer, numberOfVerificationKeys: Buffer, keyIndexAndSchemeAndVerificationKey: Buffer, thresholdAndRegIdAndIPIdentity: Buffer, encIdCredPubShareAndKey: Buffer, validToAndCreatedAtAndAttributesLength: Buffer, attributesLength: Buffer, tag: Buffer[], valueLength: Buffer[], value: Buffer[], proofLength: Buffer, proofs: Buffer }} - An object containing serialized payloads.
*/
export declare const serializeCredentialDeployment: (txn: ICredentialDeploymentTransaction, path: string) => {
payloadDerivationPath: Buffer;
numberOfVerificationKeys: Buffer;
keyIndexAndSchemeAndVerificationKey: Buffer;
thresholdAndRegIdAndIPIdentity: Buffer;
encIdCredPubShareAndKey: Buffer;
validToAndCreatedAtAndAttributesLength: Buffer;
attributesLength: Buffer;
tag: Buffer[];
valueLength: Buffer[];
value: Buffer[];
proofLength: Buffer;
proofs: Buffer;
};
/**
* Serializes an update credentials transaction.
* @param {IUpdateCredentialsTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadHeaderKindAndIndexLength: Buffer[], credentialIndex: Buffer[], numberOfVerificationKeys: Buffer[], keyIndexAndSchemeAndVerificationKey: Buffer[], thresholdAndRegIdAndIPIdentity: Buffer[], encIdCredPubShareAndKey: Buffer[], validToAndCreatedAtAndAttributesLength: Buffer[], attributesLength: Buffer[], tag: Buffer[][], valueLength: Buffer[][], value: Buffer[][], proofLength: Buffer[], proofs: Buffer[], credentialIdCount: Buffer, credentialIds: Buffer[], threshold: Buffer }} - An object containing serialized payloads.
*/
export declare const serializeUpdateCredentials: (txn: IUpdateCredentialsTransaction, path: string) => {
payloadHeaderKindAndIndexLength: Buffer[];
credentialIndex: Buffer[];
numberOfVerificationKeys: Buffer[];
keyIndexAndSchemeAndVerificationKey: Buffer[];
thresholdAndRegIdAndIPIdentity: Buffer[];
encIdCredPubShareAndKey: Buffer[];
validToAndCreatedAtAndAttributesLength: Buffer[];
attributesLength: Buffer[];
tag: Buffer[][];
valueLength: Buffer[][];
value: Buffer[][];
proofLength: Buffer[];
proofs: Buffer[];
credentialIdCount: Buffer;
credentialIds: Buffer[];
threshold: Buffer;
};
/**
* Serializes public information for an IP transaction.
* @param {IPublicInfoForIpTransaction} txn - The transaction to serialize.
* @param {string} path - The BIP32 path as a string.
* @returns {{ payloadIdCredPubAndRegIdAndKeysLenght: Buffer, payloadKeys: Buffer[], payloadThreshold: Buffer }} - An object containing serialized payloads.
*/
export declare const serializePublicInfoForIp: (txn: IPublicInfoForIpTransaction, path: string) => {
payloadIdCredPubAndRegIdAndKeysLenght: Buffer;
payloadKeys: Buffer[];
payloadThreshold: Buffer;
};
//# sourceMappingURL=serialization.d.ts.map