Notable Pottery Manufacturer

    @astrox/connection

    0.0.40 • Public • Published

    @astrox/connection

    Connection packages for DApps


    Installation

    Using Connection:

    npm i --save @astrox/connection
    

    In the browser:

    import { IC } from "@astrox/connection";
    import { PermissionsType } from "@astrox/connection/lib/cjs/types";
    
    (async () => {
        await IC.connect({
          appId: process.env.CANISTER_ID!, // your canister ID, optional
          identityProvider: 'https://identity.ic0.app/#authorize', // identity provider, by default to AstroX Me
          permissions: [PermissionsType.identity, PermissionsType.wallet], // PermissionsType with identity or wallet, or both
          onAuthenticated: async (thisIc) => {
            console.log(window.ic.wallet);
            console.log(await window.ic.queryBalance());
            console.log(window.ic.identity);
          },
          onError:(err)=>{
              console.log(err);
          }
        }))();

    Install

    npm i @astrox/connection

    DownloadsWeekly Downloads

    73

    Version

    0.0.40

    License

    Apache-2.0

    Unpacked Size

    658 kB

    Total Files

    125

    Last publish

    Collaborators

    • ghostcorn