m8b/ethbnd-keystore 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

m8b/ethbnd-keystore

最新稳定版本:v1.0.0-beta

Composer 安装命令:

composer require m8b/ethbnd-keystore

包简介

Library with JSON Keystore implementation, separate from main library due to dependency on scrypt

README 文档

README

This is separated from Ether Binder library addon, due to extension dependency.

This library requires PECL extension scrypt. To install extension:

pecl install scrypt

Installing:

composer require m8b/ethbnd-keystore

Usage

To read the existing json keystore, get the json and password, and drop it to loadFromKeystore function

$keystore = file_get_contents("path/to/key.json");
$wallet   = \M8B\EtherBinder\Wallet\JSONKeystoreWallet::loadFromKeystore($keystore, "password"); 

To encrypt existing key

$key = \M8B\EtherBinder\Crypto\Key::fromHex("0x....");
$wallet = \M8B\EtherBinder\Wallet\JSONKeystoreWallet::wrap($key);
file_put_contents($wallet->export("password"));

To generate new key and immediately wrap it with json keystore

$wallet = \M8B\EtherBinder\Wallet\JSONKeystoreWallet::generate();

License

Mozilla public license 2.0

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MPL-2.0
  • 更新时间: 2023-09-26