This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@nfid/wallet
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Installation

npm i @nfid/wallet

Signature and types

requestTranser is an asynchronous method which opens the NFID window and asks the user to consent a token transfer.

requestTransfer(params: RequestTransferParams, options?: NFIDProviderConf): Promise<RequestTransferResult>

RequestTransferParams

interface RequestTransferParams {
  to: string; // wallet address to transfer to
  amount: number; // amount of tokens to transfer
}

Optional: NFIDProviderConf

interface NFIDProviderConf {
  windowFeatures?: WindowFeatures;
  provider?: URL;
}

Client example

import { requestTransfer, RequestTransferParams } from '@nfid/wallet';

const APPLICATION_LOGO_URL = 'https://nfid.one/icons/favicon-96x96.png';
const APP_META = `applicationName=RequestTransfer&applicationLogo=${APPLICATION_LOGO_URL}`;
const NFID_ORIGIN = 'https://nfid.one';
const REQ_TRANSFER = 'wallet/request-transfer';

const PROVIDER_URL = new URL(`${NFID_ORIGIN}/${REQ_TRANSFER}?${APP_META}`);

const result = await requestTransfer(
  { to, amount },
  {
    provider: PROVIDER_URL,
  }
);

Return types

export declare type RequestTransferResult =
  | {
      status: 'SUCCESS';
      height: number;
    }
  | {
      status: 'REJECTED';
      message: string;
    }
  | {
      status: 'ERROR';
      message: string;
    };

Package Sidebar

Install

npm i @nfid/wallet

Weekly Downloads

55

Version

1.1.0

License

ISC

Unpacked Size

11.9 kB

Total Files

26

Last publish

Collaborators

  • olsemeno
  • litzidentity
  • jorgennfid
  • dostro
  • jorgenbuilder