项目作者: etherspot

项目描述 :
Etherspot SDK
高级语言: TypeScript
项目地址: git://github.com/etherspot/etherspot-sdk.git
创建时间: 2020-08-11T11:07:48Z
项目社区:https://github.com/etherspot/etherspot-sdk

开源协议:MIT License

下载


Etherspot SDK

Deprecation Notice (PLEASE READ)

[!WARNING]
This is the OLD version of the Etherspot SDK.

ERC4337 is the new standard for Account Abstraction on Ethereum.
Any Account Abstraction development done on EVM based networks going forward should be done using this standard.

This SDK is pre 4337 and not being updated anymore.

Please refer to the links below and use Etherspot Prime going forward:


NPM version
MIT licensed



Etherspot is a blockchain development framework for EVM-compatible chains that creates direct state channel bridges to provide a seamless user experience across chains and wallets.

With just one deposit you’re able to onboard your users to the entire multichain world.

Developers can use the Buidler and TransactionKit tools to easily include Etherspot features into their dapps.

For more powerful but complex uses, developers can dive deeper into the SDK and explore a number of custom use cases.

More information at etherspot.io

Resources

Installation

  1. $ npm i ethers@^5.5.2 reflect-metadata@^0.1.13 rxjs@^6.6.2 -S
  2. $ npm i etherspot -S
  3. $ npm i ws -s # node.js only

Usage

  1. import { Sdk, randomPrivateKey } from 'etherspot';
  2. const PRIVATE_KEY = randomPrivateKey();
  3. async function main() {
  4. const sdk = new Sdk(PRIVATE_KEY);
  5. sdk.notifications$.subscribe(notification => console.log('notification:', notification));
  6. await sdk.computeContractAccount();
  7. const { account } = sdk.state;
  8. console.log('contract account:', account);
  9. // top-up contract account (account.address)
  10. // add transaction to gateway batch
  11. await sdk.batchExecuteAccountTransaction({
  12. to: '0xEEb4801FBc9781EEF20801853C1Cb25faB8A7a3b',
  13. value: 100, // 100 wei
  14. });
  15. console.log('gateway batch estimation:', await sdk.estimateGatewayBatch());
  16. console.log('submitted gateway batch:', await sdk.submitGatewayBatch());
  17. }
  18. main().catch(console.error);

Notification of transactions

notification of transactions is not available for fuse

Transaction History on Klaytn

History of transactions would be incomplete only on Klaytn Network due to lack of resources for fetching the required data

License

MIT