@dfinity/oisy-wallet-signer
Version:
A library designed to facilitate communication between a dApp and the OISY Wallet on the Internet Computer.
58 lines (57 loc) • 3.65 kB
TypeScript
import { SignerBuilderFn } from '../types/signer-builders';
/**
* Builds a content message for an ICRC-1 transfer by decoding the arguments for a potential call.
* This is used as a workaround when the targeted canister does not comply with the ICRC-21 standard — i.e. it has not implemented the related endpoints.
*
* The implementation is similar to the Markdown generated by the ICRC ledger implementation.
* @link https://github.com/dfinity/ic/blob/master/packages/icrc-ledger-types/src/icrc21/lib.rs#L153
*
* @param {Object} params - Parameters for building the consent message.
* @param {Uint8Array} params.arg - Encoded arguments for the ICRC-1 transfer.
* @param {Principal} params.owner - Principal ID of the sender (owner) account.
* @param {Object} params.token - Token metadata including symbol, decimals, and fee.
* @param {string} params.token.symbol - The symbol of the token.
* @param {number} params.token.decimals - The number of decimals for the token.
* @param {bigint} params.token.fee - Default fee for the token.
* @returns {Promise<SignerBuildersResult>} - A result containing either the consent message or an error.
*
**/
export declare const buildContentMessageIcrc1Transfer: SignerBuilderFn;
/**
* Builds a content message for an ICRC-2 Approve by decoding the arguments for a potential call.
* This is used as a workaround when the targeted canister does not comply with the ICRC-21 standard — i.e. it has not implemented the related endpoints.
*
* The implementation is similar to the Markdown generated by the ICRC ledger implementation.
* @link https://github.com/dfinity/ic/blob/master/packages/icrc-ledger-types/src/icrc21/lib.rs#L194
*
* @param {Object} params - Parameters for building the consent message.
* @param {Uint8Array} params.arg - Encoded arguments for the ICRC-2 approve.
* @param {Principal} params.owner - Principal ID of the sender (owner) account.
* @param {Object} params.token - Token metadata including symbol, decimals, and fee.
* @param {string} params.token.symbol - The symbol of the token.
* @param {number} params.token.decimals - The number of decimals for the token.
* @param {bigint} params.token.fee - Default fee for the token.
* @returns {Promise<SignerBuildersResult>} - A result containing either the consent message or an error.
*
**/
export declare const buildContentMessageIcrc2Approve: SignerBuilderFn;
/**
* Builds a content message for an ICRC-2 TransferFrom by decoding the arguments for a potential call.
* This is used as a workaround when the targeted canister does not comply with the ICRC-21 standard — i.e. it has not implemented the related endpoints.
*
* The implementation is similar to the Markdown generated by the ICRC ledger implementation.
* @link https://github.com/dfinity/ic/blob/master/packages/icrc-ledger-types/src/icrc21/lib.rs#L287
*
* @param {Object} params - Parameters for building the consent message.
* @param {Uint8Array} params.arg - Encoded arguments for the ICRC-2 transfer from.
* @param {Principal} params.owner - Principal ID of the sender (owner) account.
* @param {Object} params.token - Token metadata including symbol, decimals, and fee.
* @param {string} params.token.symbol - The symbol of the token.
* @param {number} params.token.decimals - The number of decimals for the token.
* @param {bigint} params.token.fee - Default fee for the token.
* @returns {Promise<SignerBuildersResult>} - A result containing either the consent message or an error.
*
**/
export declare const buildContentMessageIcrc2TransferFrom: SignerBuilderFn;
export declare class ArgSizeError extends Error {
}