0.1.24 • Published 5 months ago

onescription v0.1.24

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

All-in-One inscription tool

https://npm.im/onescription https://www.npmjs.com/package/onescription

A multi-chain inscription tool that can function as a standalone inscription bot or seamlessly integrate into web applications. The tool also boasts concurrent request handling, secure wallet generation, and a range of other valuable features.

Features

  • Utility

    • inscription bot
    • can be integrated into web application
  • Supported chains

    • Evm-compatible chains
    • Cosmos Hub
  • Highly customizable

    • configurable gas options, with automatic estimation as the default.
    • selectively executed according to customized logic, such as writing execution logic based on block height or unix timestamp. INJS demo
    • configurable transaction type, including contract call or token transfer.
  • Concurrent requests

    • correct way to handle concurrent requests on nodejs, based on async-mutext / semaphore.
    • wait for each request until the user-defined status is reached.
  • Wallet

    • connect an existing signer from private key / mnemonic / secret csv file.
    • create a new wallet and export it to secret file (CSV format).
    • may be a better practice to encrypt the generated secret file using age encryption.

Installation

yarn add onescription@latest

Examples

To use as an inscription bot

Evm:

BNB chain

const configuration: EvmConfig = {
  os: "evm",
  chainId: 56,
  isSelfTransaction: true,
};
const inscriber = Inscriber.from(configuration);
// or
//inscriber.connectSignerFromPrivateKey("YOUR PRIVATE");
inscriber.connectSignerFromMnemonic("YOUR MNEMONIC");
const strategy: Strategy = {
  maxConcurrentRequests: 5,
  statusToWait: "requested",
};
const onescription = new Onescription(inscriber, strategy);
const inscription = `data:,{"p":"bsc-20","op":"mint","tick":"bnbs","amt":"1000"}`;
// or
// const inscription: Inscription = { p: "bsc-20", op: "mint", tick: "bnbs", amt: "1000" };
for (;;) {
  await onescription.inscribe(inscription);
}

Cosmos:

Injective

const configuration: CosmosConfig = {
  os: "cosmos",
  prefix: "inj",
  isSelfTransaction: true,
};
const inscriber = Inscriber.from(configuration);
inscriber.connectSignerFromMnemonic("YOUR MNEMONIC");
const strategy: Strategy = {
  maxConcurrentRequests: 2,
  statusToWait: "submitted",
  // The $INJS introduction is available in this link
  // https://docs.injs.ink/mint-injs
  predicate: async (provider: ChainInfoProvider) => {
    const blockHeight = await provider.getBlockHeight();
    console.log("current block height:", blockHeight);
    const rounds = [
      [55051600, 55053100],
      [55094800, 55096300],
      [55138000, 55139500],
      [55181200, 55182700],
      [55224400, 55225900],
      [55267600, 55269100],
      [55310800, 55312300],
      [55354000, 55355500],
    ];
    return (
      undefined !==
      rounds.find(([start, end]) => start <= blockHeight && blockHeight <= end)
    );
  },
};
const onescription = new Onescription(inscriber, strategy);
const inscription = { p: "injrc-20", op: "mint", tick: "INJS", amt: "1000" };
for (;;) {
  await onescription.inscribe(inscription);
}

To use in web application

const configuration: EvmConfig = {
  os: "evm",
  chainId: 56,
  isSelfTransaction: true,
};
const inscriber = Inscriber.from(configuration);
const signer = new ethers.providers.Web3Provider(window.ethereum).getSigner();
inscriber.connectSigner(signer);
const inp: Inscription = { p: "bsc-20", op: "mint", tick: "bnbs", amt: "1000" };
await inscriber.inscribe(inp);
0.1.24

5 months ago

0.1.23

5 months ago

0.1.22

5 months ago

0.1.21

5 months ago

0.1.20

5 months ago

0.1.19

5 months ago

0.1.18

5 months ago

0.1.17

5 months ago

0.1.16

5 months ago

0.1.15

5 months ago

0.1.14

5 months ago

0.1.13

5 months ago

0.1.12

5 months ago

0.1.11

5 months ago

0.1.10

5 months ago

0.1.9

5 months ago

0.1.8

5 months ago

0.1.7

5 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago