0.0.14 • Published 4 months ago

xsigners-sdk-test v0.0.14

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

xSigners SDK classes

This classes provides an interface to interact with the Xsigners ink contract on the substrate ecosystem.

Installation

  • with npm:
npm i xsigners-sdk
  • with yarn:
yarn add xsigners-sdk

Usage

1. Setup

  • Importing the class
import { ApiPromise, WsProvider } from '@polkadot/api';
import { MultisigFactory } from "xsigners-sdk/dist/xsigners_sdk/src";
  • Initialize the Polkadot API
const wsProvider = new WsProvider('wss://your-node-url');
const api = await ApiPromise.create({ provider: wsProvider });
  • Create the instance
const multisigFactory = new MultisigFactory(api, 'chainId');

2. Interact with the contract

  • Get a contract ContractPromise

With the builder ready, you can now create a ContractPromise for a specific chain:

const chainId = 'shibuya-testnet'; // Replace with your desired chain ID
const contract = multisigFactory.buildContractPromise(chainId); // If not supplied, the instance will be used.
  • Interact with the Contract
const result = await contract.query.methodName(accountAddress, /* method parameters */);
console.log(result.output?.toHuman());
const tx = contract.tx.methodName({ value, gasLimit }, /* method parameters */);
const result = await tx.signAndSend(accountAddress);

Note

Ensure that the chainId you provide is supported. If it's not, the MultisigFactory will throw an error.

0.0.14

4 months ago

0.0.13

7 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago