Giter Site home page Giter Site logo

debridge-validator-signatures-sdk's Introduction

debridge-validator-signatures-sdk

SDK for finding all signatures by submission ID in the Arweave network (stored by Bunldr) or in debridge api if not exists in arweave and performing web3 erecover() for validating the signatures. The SDK supports searching only for transactions that were created by specific addresses. The same for searching new assets by tokenName, deployId, debridgeId.

How to use

const client = new DebridgeValidatorSignaturesClient();
await client.init({
  arweaveNode: 'https://arweave.net', //default https://arweave.net
  arweaveTxOwners: undefined, //default addreses from https://raw.githubusercontent.com/debridge-finance/list-validators/main/validators.json
  debridgeApi: 'https://api.debridge.finance', default, //default https://api.debridge.finance
});

Example of receiving arweaveTxOwners from git:

const gitResponse = await fetch('https://raw.githubusercontent.com/debridge-finance/list-validators/main/validators.json');
const arweaveTxOwners = (await gitResponse.json()).map(item => item.arweave);

For using a sdk you should have a context that contains logger(see types).

Get signatures by submission id:

client.getSubmissionConfirmations('0xcaa800ead1e369cae024dda4b46716674f88807416e7581a939d4f05db4002f4', context)

Returns

signature: string;
validator: string;
submissionId: string;
txHash?: string;
chainIdFrom?: string;
nonce?: string;
chainIdTo?: string;
bundlrTransactionId?: string;
validatorName?: string;

txHash, chainIdFrom, nonce, chainIdTo, bundlrTransactionId, validatorName are not presented in records from debridge api.

Get signatures by debridgeId:

client.getNewAssetConfirmationsByDebridgeId('0x15db45753160f76964dfa867510c9ede0ac87ac9ce24771de7efa0dab8251c1a', context)

Returns

signature: string;
validator: string;
deployId: string;
debridgeId: string;
nativeChainId: string;
tokenDecimals: string;
tokenName: string;
tokenSymbol: string;
tokenAddress: string;
validatorName?: string;
bundlrTransactionId?: string;

bundlrTransactionId, validatorName are not presented in records from debridge api.

debridge-validator-signatures-sdk's People

Contributors

mncdg avatar

Watchers

Alex Phenom avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.