From 767d13aa4a9df3e38a9b5ca72341a2b458aab5c2 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Mon, 11 Mar 2019 23:15:54 +0800 Subject: [PATCH 01/17] Add generate --- composer.json | 30 + composer.lock | 1936 ++++++++++++++++++++++++++++++++++++++ phpunit.xml | 22 + src/Wallet.php | 186 ++++ test/TestCase.php | 22 + test/unit/WalletTest.php | 26 + 6 files changed, 2222 insertions(+) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 phpunit.xml create mode 100644 src/Wallet.php create mode 100644 test/TestCase.php create mode 100644 test/unit/WalletTest.php diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..c8d098b --- /dev/null +++ b/composer.json @@ -0,0 +1,30 @@ +{ + "name": "web3p/ethereum-wallet", + "description": "Ethereum wallet library in PHP.", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "sc0Vu", + "email": "alk03073135@gmail.com" + } + ], + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "autoload": { + "psr-4": { + "Web3p\\EthereumWallet\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Test\\": "test/" + } + }, + "require": { + "bitwasp/bitcoin-lib": "1.0.*", + "PHP": "^7.1", + "web3p/ethereum-util": "0.1" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..c169c1a --- /dev/null +++ b/composer.lock @@ -0,0 +1,1936 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c6a7e6824a15279258438edf23c036c3", + "packages": [ + { + "name": "bitwasp/bitcoin-lib", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/Bit-Wasp/bitcoin-lib-php.git", + "reference": "2fa3fd3ab9d3d474c3c65426f6c550c581ab9f15" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bit-Wasp/bitcoin-lib-php/zipball/2fa3fd3ab9d3d474c3c65426f6c550c581ab9f15", + "reference": "2fa3fd3ab9d3d474c3c65426f6c550c581ab9f15", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "mdanter/ecc": "0.2.0", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7", + "squizlabs/php_codesniffer": "~1.5" + }, + "suggest": { + "ext-intl": "Required for BIP39 Mnemonic Seeds with UTF-8 passphrases" + }, + "type": "library", + "autoload": { + "psr-4": { + "BitWasp\\BitcoinLib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Unlicense" + ], + "authors": [ + { + "name": "Thomas Kerin", + "email": "thomas.kerin@gmail.com" + } + ], + "description": "Implementation of raw transactions in bitcoin, HD wallets, Electrum wallets, and other fun stuff.", + "keywords": [ + "HD wallet", + "bip32", + "bitcoin", + "btc", + "cryptocurrency", + "ecc", + "electrum", + "php", + "transactions" + ], + "time": "2014-12-11T17:48:09+00:00" + }, + { + "name": "kornrunner/keccak", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/kornrunner/php-keccak.git", + "reference": "ad761f528f4d1e3ce378b8a0841e5f82c9973535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kornrunner/php-keccak/zipball/ad761f528f4d1e3ce378b8a0841e5f82c9973535", + "reference": "ad761f528f4d1e3ce378b8a0841e5f82c9973535", + "shasum": "" + }, + "require": { + "php": ">=7.1.0", + "symfony/polyfill-mbstring": "^1.8" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "~7" + }, + "type": "library", + "autoload": { + "psr-4": { + "kornrunner\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Boris Momcilovic", + "homepage": "https://github.com/kornrunner/php-keccak" + } + ], + "description": "Pure PHP implementation of Keccak", + "keywords": [ + "keccak", + "sha-3", + "sha3-256" + ], + "time": "2018-07-30T22:16:23+00:00" + }, + { + "name": "mdanter/ecc", + "version": "0.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpecc/phpecc.git", + "reference": "ca9d127114e087bdeac24ada488631f18ae80d3f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpecc/phpecc/zipball/ca9d127114e087bdeac24ada488631f18ae80d3f", + "reference": "ca9d127114e087bdeac24ada488631f18ae80d3f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.1", + "squizlabs/php_codesniffer": "~1.5" + }, + "suggest": { + "ext-bcmath": "Required if GMP is not installed.", + "ext-gmp": "Improves drastically ECDSA library performance" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mdanter\\Ecc\\Tests\\": "tests/unit", + "Mdanter\\Ecc\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matyas Danter", + "homepage": "http://matejdanter.com/", + "role": "Author" + }, + { + "name": "Thibaud Fabre", + "email": "thibaud@aztech.io", + "homepage": "http://aztech.io", + "role": "Maintainer" + }, + { + "name": "Drak", + "email": "drak@zikula.org", + "homepage": "http://zikula.org", + "role": "Maintainer" + } + ], + "description": "PHP Elliptic Curve Cryptography library", + "homepage": "https://github.com/mdanter/phpecc", + "time": "2014-07-07T12:44:15+00:00" + }, + { + "name": "simplito/bigint-wrapper-php", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/simplito/bigint-wrapper-php.git", + "reference": "cf21ec76d33f103add487b3eadbd9f5033a25930" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/simplito/bigint-wrapper-php/zipball/cf21ec76d33f103add487b3eadbd9f5033a25930", + "reference": "cf21ec76d33f103add487b3eadbd9f5033a25930", + "shasum": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "BI\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Simplito Team", + "email": "s.smyczynski@simplito.com", + "homepage": "https://simplito.com" + } + ], + "description": "Common interface for php_gmp and php_bcmath modules", + "time": "2018-02-27T12:38:08+00:00" + }, + { + "name": "simplito/bn-php", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/simplito/bn-php.git", + "reference": "e852fcd27e4acbc32459606d7606e45a85e42465" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/simplito/bn-php/zipball/e852fcd27e4acbc32459606d7606e45a85e42465", + "reference": "e852fcd27e4acbc32459606d7606e45a85e42465", + "shasum": "" + }, + "require": { + "simplito/bigint-wrapper-php": "~1.0.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "BN\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Simplito Team", + "email": "s.smyczynski@simplito.com", + "homepage": "https://simplito.com" + } + ], + "description": "Big number implementation compatible with bn.js", + "time": "2018-04-12T11:07:43+00:00" + }, + { + "name": "simplito/elliptic-php", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/simplito/elliptic-php.git", + "reference": "cab829d270dfd6acdff8383d862ed02a12d1f9dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/simplito/elliptic-php/zipball/cab829d270dfd6acdff8383d862ed02a12d1f9dd", + "reference": "cab829d270dfd6acdff8383d862ed02a12d1f9dd", + "shasum": "" + }, + "require": { + "ext-gmp": "*", + "simplito/bn-php": "~1.1.0" + }, + "require-dev": { + "phpbench/phpbench": "@dev", + "phpunit/phpunit": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Elliptic\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Simplito Team", + "email": "s.smyczynski@simplito.com", + "homepage": "https://simplito.com" + } + ], + "description": "Fast elliptic curve cryptography", + "homepage": "https://github.com/simplito/elliptic-php", + "keywords": [ + "Curve25519", + "ECDSA", + "Ed25519", + "EdDSA", + "cryptography", + "curve", + "ecc", + "ecdh", + "elliptic", + "nistp192", + "nistp224", + "nistp256", + "nistp384", + "nistp521", + "secp256k1" + ], + "time": "2018-04-12T11:17:52+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-09-21T13:07:52+00:00" + }, + { + "name": "web3p/ethereum-util", + "version": "0.1", + "source": { + "type": "git", + "url": "https://github.com/web3p/ethereum-util.git", + "reference": "8736ef0c4b40f9e4aa060cf8836a4f24c5072249" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/web3p/ethereum-util/zipball/8736ef0c4b40f9e4aa060cf8836a4f24c5072249", + "reference": "8736ef0c4b40f9e4aa060cf8836a4f24c5072249", + "shasum": "" + }, + "require": { + "kornrunner/keccak": "~1", + "php": "^7.1", + "simplito/elliptic-php": "1.0.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Web3p\\EthereumUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "sc0Vu", + "email": "alk03073135@gmail.com" + } + ], + "description": "A collection of utility functions for Ethereum written in PHP.", + "time": "2018-05-30T20:03:27+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2018-06-11T23:09:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-08-05T17:53:17+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-04-06T15:36:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.14", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.9", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2019-02-01T05:22:47+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.11" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2018-08-09T05:50:03+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "backendtea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-12-25T11:19:39+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.1" + }, + "platform-dev": [] +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..ce596a2 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,22 @@ + + + + + ./test/unit + + + + + ./src + + + \ No newline at end of file diff --git a/src/Wallet.php b/src/Wallet.php new file mode 100644 index 0000000..fbdea43 --- /dev/null +++ b/src/Wallet.php @@ -0,0 +1,186 @@ + + * + * @author Peter Lai + * @license MIT + */ + +namespace Web3p\EthereumWallet; + +use BitWasp\BitcoinLib\BIP39\BIP39; +use BitWasp\BitcoinLib\BIP39\BIP39WordList; +use Web3p\EthereumUtil\Util; + +/** + * TODO: export/import version 1, 2, 3 of wallet + */ +class Wallet +{ + /** + * wordlist + * + * @var \BitWasp\BitcoinLib\BIP39\BIP39WordList + */ + protected $wordlist; + + /** + * util + * + * @var \Web3p\EthereumUtil\Util + */ + protected $util; + + /** + * privateKey + * + * @var string + */ + protected $privateKey; + + /** + * mnemonic + * + * @var string + */ + protected $mnemonic; + + /** + * publicKey + * + * @var string + */ + protected $publicKey; + + /** + * address + * + * @var string + */ + protected $address; + + /** + * construct + * + * @param \BitWasp\BitcoinLib\BIP39\BIP39WordList $wordlist + * @return void + */ + public function __construct(BIP39WordList $wordlist) + { + $this->wordlist = $wordlist; + $this->util = new Util; + } + + /** + * get + * + * @param string $name + * @return mixed + */ + public function __get($name) + { + $method = 'get' . ucfirst($name); + + if (method_exists($this, $method)) { + return call_user_func_array([$this, $method], []); + } + return false; + } + + /** + * set + * + * @param string $name + * @param mixed $value + * @return mixed + */ + public function __set($name, $value) + { + $method = 'set' . ucfirst($name); + + if (method_exists($this, $method)) { + return call_user_func_array([$this, $method], [$value]); + } + return false; + } + + /** + * getMnemonic + * + * @return string + */ + public function getMnemonic() + { + return $this->mnemonic; + } + + /** + * getPrivateKey + * + * @return string + */ + public function getPrivateKey() + { + return $this->privateKey; + } + + /** + * getPublicKey + * + * @return string + */ + public function getPublicKey() + { + return $this->publicKey; + } + + /** + * getAddress + * + * @return string + */ + public function getAddress() + { + return $this->address; + } + + /** + * setWordlist + * + * @param BIP39WordList $wordlist + * @return void + */ + public function setWordlist(BIP39WordList $wordlist) + { + $this->wordlist = $wordlist; + } + + /** + * TODO: fromMnemonic + * + * @return $this + */ + // public function fromMnemonic() {} + + /** + * generate + * + * @return $this + */ + public function generate() + { + $privateKey = BIP39::generateEntropy(256); + $mnemonic = BIP39::entropyToMnemonic($privateKey, $this->wordlist); + $publicKey = $this->util->privateKeyToPublicKey($privateKey); + $address = $this->util->publicKeyToAddress($publicKey); + + $this->privateKey = $privateKey; + $this->publicKey = $publicKey; + $this->mnemonic = $mnemonic; + $this->address = $address; + return $this; + } +} \ No newline at end of file diff --git a/test/TestCase.php b/test/TestCase.php new file mode 100644 index 0000000..e8f40b3 --- /dev/null +++ b/test/TestCase.php @@ -0,0 +1,22 @@ +generate(); + $this->assertEquals(64, strlen($wallet->privateKey)); + $this->assertEquals(42, strlen($wallet->address)); + $mnemonic = preg_split("/\s/", $wallet->mnemonic); + $this->assertEquals(24, count($mnemonic)); + } +} From 81d6f9bd203b5dc4120d91acefe83deb56da5032 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Mon, 11 Mar 2019 23:30:42 +0800 Subject: [PATCH 02/17] Add chinese wordlist --- .../BIP39ChineseSimplifiedWordList.php | 2098 +++++++++++++++++ .../BIP39ChineseTraditionalWordList.php | 2098 +++++++++++++++++ test/unit/WalletTest.php | 19 + 3 files changed, 4215 insertions(+) create mode 100644 src/wordlist/BIP39ChineseSimplifiedWordList.php create mode 100644 src/wordlist/BIP39ChineseTraditionalWordList.php diff --git a/src/wordlist/BIP39ChineseSimplifiedWordList.php b/src/wordlist/BIP39ChineseSimplifiedWordList.php new file mode 100644 index 0000000..2323e78 --- /dev/null +++ b/src/wordlist/BIP39ChineseSimplifiedWordList.php @@ -0,0 +1,2098 @@ + + */ + +namespace Web3p\EthereumWallet\Wordlist; + +use BitWasp\BitcoinLib\BIP39\BIP39WordList; + +class BIP39ChineseSimplifiedWordList extends BIP39WordList +{ + + protected $wordsFlipped; + + public function getWords() + { + return $this->words; + } + + public function getWord($idx) + { + if (!isset($this->words)) { + throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); + } + + return $this->words[$idx]; + } + + public function getIndex($word) + { + // create a flipped word list to speed up the searching of words + if (is_null($this->wordsFlipped)) { + $this->wordsFlipped = array_flip($this->words); + } + + if (!isset($this->wordsFlipped[$word])) { + throw new \Exception(__CLASS__ . " does not contain word [{$word}]"); + } + + return $this->wordsFlipped[$word]; + } + + protected $words = [ + "的", + "一", + "是", + "在", + "不", + "了", + "有", + "和", + "人", + "这", + "中", + "大", + "为", + "上", + "个", + "国", + "我", + "以", + "要", + "他", + "时", + "来", + "用", + "们", + "生", + "到", + "作", + "地", + "于", + "出", + "就", + "分", + "对", + "成", + "会", + "可", + "主", + "发", + "年", + "动", + "同", + "工", + "也", + "能", + "下", + "过", + "子", + "说", + "产", + "种", + "面", + "而", + "方", + "后", + "多", + "定", + "行", + "学", + "法", + "所", + "民", + "得", + "经", + "十", + "三", + "之", + "进", + "着", + "等", + "部", + "度", + "家", + "电", + "力", + "里", + "如", + "水", + "化", + "高", + "自", + "二", + "理", + "起", + "小", + "物", + "现", + "实", + "加", + "量", + "都", + "两", + "体", + "制", + "机", + "当", + "使", + "点", + "从", + "业", + "本", + "去", + "把", + "性", + "好", + "应", + "开", + "它", + "合", + "还", + "因", + "由", + "其", + "些", + "然", + "前", + "外", + "天", + "政", + "四", + "日", + "那", + "社", + "义", + "事", + "平", + "形", + "相", + "全", + "表", + "间", + "样", + "与", + "关", + "各", + "重", + "新", + "线", + "内", + "数", + "正", + "心", + "反", + "你", + "明", + "看", + "原", + "又", + "么", + "利", + "比", + "或", + "但", + "质", + "气", + "第", + "向", + "道", + "命", + "此", + "变", + "条", + "只", + "没", + "结", + "解", + "问", + "意", + "建", + "月", + "公", + "无", + "系", + "军", + "很", + "情", + "者", + "最", + "立", + "代", + "想", + "已", + "通", + "并", + "提", + "直", + "题", + "党", + "程", + "展", + "五", + "果", + "料", + "象", + "员", + "革", + "位", + "入", + "常", + "文", + "总", + "次", + "品", + "式", + "活", + "设", + "及", + "管", + "特", + "件", + "长", + "求", + "老", + "头", + "基", + "资", + "边", + "流", + "路", + "级", + "少", + "图", + "山", + "统", + "接", + "知", + "较", + "将", + "组", + "见", + "计", + "别", + "她", + "手", + "角", + "期", + "根", + "论", + "运", + "农", + "指", + "几", + "九", + "区", + "强", + "放", + "决", + "西", + "被", + "干", + "做", + "必", + "战", + "先", + "回", + "则", + "任", + "取", + "据", + "处", + "队", + "南", + "给", + "色", + "光", + "门", + "即", + "保", + "治", + "北", + "造", + "百", + "规", + "热", + "领", + "七", + "海", + "口", + "东", + "导", + "器", + "压", + "志", + "世", + "金", + "增", + "争", + "济", + "阶", + "油", + "思", + "术", + "极", + "交", + "受", + "联", + "什", + "认", + "六", + "共", + "权", + "收", + "证", + "改", + "清", + "美", + "再", + "采", + "转", + "更", + "单", + "风", + "切", + "打", + "白", + "教", + "速", + "花", + "带", + "安", + "场", + "身", + "车", + "例", + "真", + "务", + "具", + "万", + "每", + "目", + "至", + "达", + "走", + "积", + "示", + "议", + "声", + "报", + "斗", + "完", + "类", + "八", + "离", + "华", + "名", + "确", + "才", + "科", + "张", + "信", + "马", + "节", + "话", + "米", + "整", + "空", + "元", + "况", + "今", + "集", + "温", + "传", + "土", + "许", + "步", + "群", + "广", + "石", + "记", + "需", + "段", + "研", + "界", + "拉", + "林", + "律", + "叫", + "且", + "究", + "观", + "越", + "织", + "装", + "影", + "算", + "低", + "持", + "音", + "众", + "书", + "布", + "复", + "容", + "儿", + "须", + "际", + "商", + "非", + "验", + "连", + "断", + "深", + "难", + "近", + "矿", + "千", + "周", + "委", + "素", + "技", + "备", + "半", + "办", + "青", + "省", + "列", + "习", + "响", + "约", + "支", + "般", + "史", + "感", + "劳", + "便", + "团", + "往", + "酸", + "历", + "市", + "克", + "何", + "除", + "消", + "构", + "府", + "称", + "太", + "准", + "精", + "值", + "号", + "率", + "族", + "维", + "划", + "选", + "标", + "写", + "存", + "候", + "毛", + "亲", + "快", + "效", + "斯", + "院", + "查", + "江", + "型", + "眼", + "王", + "按", + "格", + "养", + "易", + "置", + "派", + "层", + "片", + "始", + "却", + "专", + "状", + "育", + "厂", + "京", + "识", + "适", + "属", + "圆", + "包", + "火", + "住", + "调", + "满", + "县", + "局", + "照", + "参", + "红", + "细", + "引", + "听", + "该", + "铁", + "价", + "严", + "首", + "底", + "液", + "官", + "德", + "随", + "病", + "苏", + "失", + "尔", + "死", + "讲", + "配", + "女", + "黄", + "推", + "显", + "谈", + "罪", + "神", + "艺", + "呢", + "席", + "含", + "企", + "望", + "密", + "批", + "营", + "项", + "防", + "举", + "球", + "英", + "氧", + "势", + "告", + "李", + "台", + "落", + "木", + "帮", + "轮", + "破", + "亚", + "师", + "围", + "注", + "远", + "字", + "材", + "排", + "供", + "河", + "态", + "封", + "另", + "施", + "减", + "树", + "溶", + "怎", + "止", + "案", + "言", + "士", + "均", + "武", + "固", + "叶", + "鱼", + "波", + "视", + "仅", + "费", + "紧", + "爱", + "左", + "章", + "早", + "朝", + "害", + "续", + "轻", + "服", + "试", + "食", + "充", + "兵", + "源", + "判", + "护", + "司", + "足", + "某", + "练", + "差", + "致", + "板", + "田", + "降", + "黑", + "犯", + "负", + "击", + "范", + "继", + "兴", + "似", + "余", + "坚", + "曲", + "输", + "修", + "故", + "城", + "夫", + "够", + "送", + "笔", + "船", + "占", + "右", + "财", + "吃", + "富", + "春", + "职", + "觉", + "汉", + "画", + "功", + "巴", + "跟", + "虽", + "杂", + "飞", + "检", + "吸", + "助", + "升", + "阳", + "互", + "初", + "创", + "抗", + "考", + "投", + "坏", + "策", + "古", + "径", + "换", + "未", + "跑", + "留", + "钢", + "曾", + "端", + "责", + "站", + "简", + "述", + "钱", + "副", + "尽", + "帝", + "射", + "草", + "冲", + "承", + "独", + "令", + "限", + "阿", + "宣", + "环", + "双", + "请", + "超", + "微", + "让", + "控", + "州", + "良", + "轴", + "找", + "否", + "纪", + "益", + "依", + "优", + "顶", + "础", + "载", + "倒", + "房", + "突", + "坐", + "粉", + "敌", + "略", + "客", + "袁", + "冷", + "胜", + "绝", + "析", + "块", + "剂", + "测", + "丝", + "协", + "诉", + "念", + "陈", + "仍", + "罗", + "盐", + "友", + "洋", + "错", + "苦", + "夜", + "刑", + "移", + "频", + "逐", + "靠", + "混", + "母", + "短", + "皮", + "终", + "聚", + "汽", + "村", + "云", + "哪", + "既", + "距", + "卫", + "停", + "烈", + "央", + "察", + "烧", + "迅", + "境", + "若", + "印", + "洲", + "刻", + "括", + "激", + "孔", + "搞", + "甚", + "室", + "待", + "核", + "校", + "散", + "侵", + "吧", + "甲", + "游", + "久", + "菜", + "味", + "旧", + "模", + "湖", + "货", + "损", + "预", + "阻", + "毫", + "普", + "稳", + "乙", + "妈", + "植", + "息", + "扩", + "银", + "语", + "挥", + "酒", + "守", + "拿", + "序", + "纸", + "医", + "缺", + "雨", + "吗", + "针", + "刘", + "啊", + "急", + "唱", + "误", + "训", + "愿", + "审", + "附", + "获", + "茶", + "鲜", + "粮", + "斤", + "孩", + "脱", + "硫", + "肥", + "善", + "龙", + "演", + "父", + "渐", + "血", + "欢", + "械", + "掌", + "歌", + "沙", + "刚", + "攻", + "谓", + "盾", + "讨", + "晚", + "粒", + "乱", + "燃", + "矛", + "乎", + "杀", + "药", + "宁", + "鲁", + "贵", + "钟", + "煤", + "读", + "班", + "伯", + "香", + "介", + "迫", + "句", + "丰", + "培", + "握", + "兰", + "担", + "弦", + "蛋", + "沉", + "假", + "穿", + "执", + "答", + "乐", + "谁", + "顺", + "烟", + "缩", + "征", + "脸", + "喜", + "松", + "脚", + "困", + "异", + "免", + "背", + "星", + "福", + "买", + "染", + "井", + "概", + "慢", + "怕", + "磁", + "倍", + "祖", + "皇", + "促", + "静", + "补", + "评", + "翻", + "肉", + "践", + "尼", + "衣", + "宽", + "扬", + "棉", + "希", + "伤", + "操", + "垂", + "秋", + "宜", + "氢", + "套", + "督", + "振", + "架", + "亮", + "末", + "宪", + "庆", + "编", + "牛", + "触", + "映", + "雷", + "销", + "诗", + "座", + "居", + "抓", + "裂", + "胞", + "呼", + "娘", + "景", + "威", + "绿", + "晶", + "厚", + "盟", + "衡", + "鸡", + "孙", + "延", + "危", + "胶", + "屋", + "乡", + "临", + "陆", + "顾", + "掉", + "呀", + "灯", + "岁", + "措", + "束", + "耐", + "剧", + "玉", + "赵", + "跳", + "哥", + "季", + "课", + "凯", + "胡", + "额", + "款", + "绍", + "卷", + "齐", + "伟", + "蒸", + "殖", + "永", + "宗", + "苗", + "川", + "炉", + "岩", + "弱", + "零", + "杨", + "奏", + "沿", + "露", + "杆", + "探", + "滑", + "镇", + "饭", + "浓", + "航", + "怀", + "赶", + "库", + "夺", + "伊", + "灵", + "税", + "途", + "灭", + "赛", + "归", + "召", + "鼓", + "播", + "盘", + "裁", + "险", + "康", + "唯", + "录", + "菌", + "纯", + "借", + "糖", + "盖", + "横", + "符", + "私", + "努", + "堂", + "域", + "枪", + "润", + "幅", + "哈", + "竟", + "熟", + "虫", + "泽", + "脑", + "壤", + "碳", + "欧", + "遍", + "侧", + "寨", + "敢", + "彻", + "虑", + "斜", + "薄", + "庭", + "纳", + "弹", + "饲", + "伸", + "折", + "麦", + "湿", + "暗", + "荷", + "瓦", + "塞", + "床", + "筑", + "恶", + "户", + "访", + "塔", + "奇", + "透", + "梁", + "刀", + "旋", + "迹", + "卡", + "氯", + "遇", + "份", + "毒", + "泥", + "退", + "洗", + "摆", + "灰", + "彩", + "卖", + "耗", + "夏", + "择", + "忙", + "铜", + "献", + "硬", + "予", + "繁", + "圈", + "雪", + "函", + "亦", + "抽", + "篇", + "阵", + "阴", + "丁", + "尺", + "追", + "堆", + "雄", + "迎", + "泛", + "爸", + "楼", + "避", + "谋", + "吨", + "野", + "猪", + "旗", + "累", + "偏", + "典", + "馆", + "索", + "秦", + "脂", + "潮", + "爷", + "豆", + "忽", + "托", + "惊", + "塑", + "遗", + "愈", + "朱", + "替", + "纤", + "粗", + "倾", + "尚", + "痛", + "楚", + "谢", + "奋", + "购", + "磨", + "君", + "池", + "旁", + "碎", + "骨", + "监", + "捕", + "弟", + "暴", + "割", + "贯", + "殊", + "释", + "词", + "亡", + "壁", + "顿", + "宝", + "午", + "尘", + "闻", + "揭", + "炮", + "残", + "冬", + "桥", + "妇", + "警", + "综", + "招", + "吴", + "付", + "浮", + "遭", + "徐", + "您", + "摇", + "谷", + "赞", + "箱", + "隔", + "订", + "男", + "吹", + "园", + "纷", + "唐", + "败", + "宋", + "玻", + "巨", + "耕", + "坦", + "荣", + "闭", + "湾", + "键", + "凡", + "驻", + "锅", + "救", + "恩", + "剥", + "凝", + "碱", + "齿", + "截", + "炼", + "麻", + "纺", + "禁", + "废", + "盛", + "版", + "缓", + "净", + "睛", + "昌", + "婚", + "涉", + "筒", + "嘴", + "插", + "岸", + "朗", + "庄", + "街", + "藏", + "姑", + "贸", + "腐", + "奴", + "啦", + "惯", + "乘", + "伙", + "恢", + "匀", + "纱", + "扎", + "辩", + "耳", + "彪", + "臣", + "亿", + "璃", + "抵", + "脉", + "秀", + "萨", + "俄", + "网", + "舞", + "店", + "喷", + "纵", + "寸", + "汗", + "挂", + "洪", + "贺", + "闪", + "柬", + "爆", + "烯", + "津", + "稻", + "墙", + "软", + "勇", + "像", + "滚", + "厘", + "蒙", + "芳", + "肯", + "坡", + "柱", + "荡", + "腿", + "仪", + "旅", + "尾", + "轧", + "冰", + "贡", + "登", + "黎", + "削", + "钻", + "勒", + "逃", + "障", + "氨", + "郭", + "峰", + "币", + "港", + "伏", + "轨", + "亩", + "毕", + "擦", + "莫", + "刺", + "浪", + "秘", + "援", + "株", + "健", + "售", + "股", + "岛", + "甘", + "泡", + "睡", + "童", + "铸", + "汤", + "阀", + "休", + "汇", + "舍", + "牧", + "绕", + "炸", + "哲", + "磷", + "绩", + "朋", + "淡", + "尖", + "启", + "陷", + "柴", + "呈", + "徒", + "颜", + "泪", + "稍", + "忘", + "泵", + "蓝", + "拖", + "洞", + "授", + "镜", + "辛", + "壮", + "锋", + "贫", + "虚", + "弯", + "摩", + "泰", + "幼", + "廷", + "尊", + "窗", + "纲", + "弄", + "隶", + "疑", + "氏", + "宫", + "姐", + "震", + "瑞", + "怪", + "尤", + "琴", + "循", + "描", + "膜", + "违", + "夹", + "腰", + "缘", + "珠", + "穷", + "森", + "枝", + "竹", + "沟", + "催", + "绳", + "忆", + "邦", + "剩", + "幸", + "浆", + "栏", + "拥", + "牙", + "贮", + "礼", + "滤", + "钠", + "纹", + "罢", + "拍", + "咱", + "喊", + "袖", + "埃", + "勤", + "罚", + "焦", + "潜", + "伍", + "墨", + "欲", + "缝", + "姓", + "刊", + "饱", + "仿", + "奖", + "铝", + "鬼", + "丽", + "跨", + "默", + "挖", + "链", + "扫", + "喝", + "袋", + "炭", + "污", + "幕", + "诸", + "弧", + "励", + "梅", + "奶", + "洁", + "灾", + "舟", + "鉴", + "苯", + "讼", + "抱", + "毁", + "懂", + "寒", + "智", + "埔", + "寄", + "届", + "跃", + "渡", + "挑", + "丹", + "艰", + "贝", + "碰", + "拔", + "爹", + "戴", + "码", + "梦", + "芽", + "熔", + "赤", + "渔", + "哭", + "敬", + "颗", + "奔", + "铅", + "仲", + "虎", + "稀", + "妹", + "乏", + "珍", + "申", + "桌", + "遵", + "允", + "隆", + "螺", + "仓", + "魏", + "锐", + "晓", + "氮", + "兼", + "隐", + "碍", + "赫", + "拨", + "忠", + "肃", + "缸", + "牵", + "抢", + "博", + "巧", + "壳", + "兄", + "杜", + "讯", + "诚", + "碧", + "祥", + "柯", + "页", + "巡", + "矩", + "悲", + "灌", + "龄", + "伦", + "票", + "寻", + "桂", + "铺", + "圣", + "恐", + "恰", + "郑", + "趣", + "抬", + "荒", + "腾", + "贴", + "柔", + "滴", + "猛", + "阔", + "辆", + "妻", + "填", + "撤", + "储", + "签", + "闹", + "扰", + "紫", + "砂", + "递", + "戏", + "吊", + "陶", + "伐", + "喂", + "疗", + "瓶", + "婆", + "抚", + "臂", + "摸", + "忍", + "虾", + "蜡", + "邻", + "胸", + "巩", + "挤", + "偶", + "弃", + "槽", + "劲", + "乳", + "邓", + "吉", + "仁", + "烂", + "砖", + "租", + "乌", + "舰", + "伴", + "瓜", + "浅", + "丙", + "暂", + "燥", + "橡", + "柳", + "迷", + "暖", + "牌", + "秧", + "胆", + "详", + "簧", + "踏", + "瓷", + "谱", + "呆", + "宾", + "糊", + "洛", + "辉", + "愤", + "竞", + "隙", + "怒", + "粘", + "乃", + "绪", + "肩", + "籍", + "敏", + "涂", + "熙", + "皆", + "侦", + "悬", + "掘", + "享", + "纠", + "醒", + "狂", + "锁", + "淀", + "恨", + "牲", + "霸", + "爬", + "赏", + "逆", + "玩", + "陵", + "祝", + "秒", + "浙", + "貌", + "役", + "彼", + "悉", + "鸭", + "趋", + "凤", + "晨", + "畜", + "辈", + "秩", + "卵", + "署", + "梯", + "炎", + "滩", + "棋", + "驱", + "筛", + "峡", + "冒", + "啥", + "寿", + "译", + "浸", + "泉", + "帽", + "迟", + "硅", + "疆", + "贷", + "漏", + "稿", + "冠", + "嫩", + "胁", + "芯", + "牢", + "叛", + "蚀", + "奥", + "鸣", + "岭", + "羊", + "凭", + "串", + "塘", + "绘", + "酵", + "融", + "盆", + "锡", + "庙", + "筹", + "冻", + "辅", + "摄", + "袭", + "筋", + "拒", + "僚", + "旱", + "钾", + "鸟", + "漆", + "沈", + "眉", + "疏", + "添", + "棒", + "穗", + "硝", + "韩", + "逼", + "扭", + "侨", + "凉", + "挺", + "碗", + "栽", + "炒", + "杯", + "患", + "馏", + "劝", + "豪", + "辽", + "勃", + "鸿", + "旦", + "吏", + "拜", + "狗", + "埋", + "辊", + "掩", + "饮", + "搬", + "骂", + "辞", + "勾", + "扣", + "估", + "蒋", + "绒", + "雾", + "丈", + "朵", + "姆", + "拟", + "宇", + "辑", + "陕", + "雕", + "偿", + "蓄", + "崇", + "剪", + "倡", + "厅", + "咬", + "驶", + "薯", + "刷", + "斥", + "番", + "赋", + "奉", + "佛", + "浇", + "漫", + "曼", + "扇", + "钙", + "桃", + "扶", + "仔", + "返", + "俗", + "亏", + "腔", + "鞋", + "棱", + "覆", + "框", + "悄", + "叔", + "撞", + "骗", + "勘", + "旺", + "沸", + "孤", + "吐", + "孟", + "渠", + "屈", + "疾", + "妙", + "惜", + "仰", + "狠", + "胀", + "谐", + "抛", + "霉", + "桑", + "岗", + "嘛", + "衰", + "盗", + "渗", + "脏", + "赖", + "涌", + "甜", + "曹", + "阅", + "肌", + "哩", + "厉", + "烃", + "纬", + "毅", + "昨", + "伪", + "症", + "煮", + "叹", + "钉", + "搭", + "茎", + "笼", + "酷", + "偷", + "弓", + "锥", + "恒", + "杰", + "坑", + "鼻", + "翼", + "纶", + "叙", + "狱", + "逮", + "罐", + "络", + "棚", + "抑", + "膨", + "蔬", + "寺", + "骤", + "穆", + "冶", + "枯", + "册", + "尸", + "凸", + "绅", + "坯", + "牺", + "焰", + "轰", + "欣", + "晋", + "瘦", + "御", + "锭", + "锦", + "丧", + "旬", + "锻", + "垄", + "搜", + "扑", + "邀", + "亭", + "酯", + "迈", + "舒", + "脆", + "酶", + "闲", + "忧", + "酚", + "顽", + "羽", + "涨", + "卸", + "仗", + "陪", + "辟", + "惩", + "杭", + "姚", + "肚", + "捉", + "飘", + "漂", + "昆", + "欺", + "吾", + "郎", + "烷", + "汁", + "呵", + "饰", + "萧", + "雅", + "邮", + "迁", + "燕", + "撒", + "姻", + "赴", + "宴", + "烦", + "债", + "帐", + "斑", + "铃", + "旨", + "醇", + "董", + "饼", + "雏", + "姿", + "拌", + "傅", + "腹", + "妥", + "揉", + "贤", + "拆", + "歪", + "葡", + "胺", + "丢", + "浩", + "徽", + "昂", + "垫", + "挡", + "览", + "贪", + "慰", + "缴", + "汪", + "慌", + "冯", + "诺", + "姜", + "谊", + "凶", + "劣", + "诬", + "耀", + "昏", + "躺", + "盈", + "骑", + "乔", + "溪", + "丛", + "卢", + "抹", + "闷", + "咨", + "刮", + "驾", + "缆", + "悟", + "摘", + "铒", + "掷", + "颇", + "幻", + "柄", + "惠", + "惨", + "佳", + "仇", + "腊", + "窝", + "涤", + "剑", + "瞧", + "堡", + "泼", + "葱", + "罩", + "霍", + "捞", + "胎", + "苍", + "滨", + "俩", + "捅", + "湘", + "砍", + "霞", + "邵", + "萄", + "疯", + "淮", + "遂", + "熊", + "粪", + "烘", + "宿", + "档", + "戈", + "驳", + "嫂", + "裕", + "徙", + "箭", + "捐", + "肠", + "撑", + "晒", + "辨", + "殿", + "莲", + "摊", + "搅", + "酱", + "屏", + "疫", + "哀", + "蔡", + "堵", + "沫", + "皱", + "畅", + "叠", + "阁", + "莱", + "敲", + "辖", + "钩", + "痕", + "坝", + "巷", + "饿", + "祸", + "丘", + "玄", + "溜", + "曰", + "逻", + "彭", + "尝", + "卿", + "妨", + "艇", + "吞", + "韦", + "怨", + "矮", + "歇" + ]; +} diff --git a/src/wordlist/BIP39ChineseTraditionalWordList.php b/src/wordlist/BIP39ChineseTraditionalWordList.php new file mode 100644 index 0000000..9cb805c --- /dev/null +++ b/src/wordlist/BIP39ChineseTraditionalWordList.php @@ -0,0 +1,2098 @@ + + */ + +namespace Web3p\EthereumWallet\Wordlist; + +use BitWasp\BitcoinLib\BIP39\BIP39WordList; + +class BIP39ChineseTraditionalWordList extends BIP39WordList +{ + + protected $wordsFlipped; + + public function getWords() + { + return $this->words; + } + + public function getWord($idx) + { + if (!isset($this->words)) { + throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); + } + + return $this->words[$idx]; + } + + public function getIndex($word) + { + // create a flipped word list to speed up the searching of words + if (is_null($this->wordsFlipped)) { + $this->wordsFlipped = array_flip($this->words); + } + + if (!isset($this->wordsFlipped[$word])) { + throw new \Exception(__CLASS__ . " does not contain word [{$word}]"); + } + + return $this->wordsFlipped[$word]; + } + + protected $words = [ + "的", + "一", + "是", + "在", + "不", + "了", + "有", + "和", + "人", + "這", + "中", + "大", + "為", + "上", + "個", + "國", + "我", + "以", + "要", + "他", + "時", + "來", + "用", + "們", + "生", + "到", + "作", + "地", + "於", + "出", + "就", + "分", + "對", + "成", + "會", + "可", + "主", + "發", + "年", + "動", + "同", + "工", + "也", + "能", + "下", + "過", + "子", + "說", + "產", + "種", + "面", + "而", + "方", + "後", + "多", + "定", + "行", + "學", + "法", + "所", + "民", + "得", + "經", + "十", + "三", + "之", + "進", + "著", + "等", + "部", + "度", + "家", + "電", + "力", + "裡", + "如", + "水", + "化", + "高", + "自", + "二", + "理", + "起", + "小", + "物", + "現", + "實", + "加", + "量", + "都", + "兩", + "體", + "制", + "機", + "當", + "使", + "點", + "從", + "業", + "本", + "去", + "把", + "性", + "好", + "應", + "開", + "它", + "合", + "還", + "因", + "由", + "其", + "些", + "然", + "前", + "外", + "天", + "政", + "四", + "日", + "那", + "社", + "義", + "事", + "平", + "形", + "相", + "全", + "表", + "間", + "樣", + "與", + "關", + "各", + "重", + "新", + "線", + "內", + "數", + "正", + "心", + "反", + "你", + "明", + "看", + "原", + "又", + "麼", + "利", + "比", + "或", + "但", + "質", + "氣", + "第", + "向", + "道", + "命", + "此", + "變", + "條", + "只", + "沒", + "結", + "解", + "問", + "意", + "建", + "月", + "公", + "無", + "系", + "軍", + "很", + "情", + "者", + "最", + "立", + "代", + "想", + "已", + "通", + "並", + "提", + "直", + "題", + "黨", + "程", + "展", + "五", + "果", + "料", + "象", + "員", + "革", + "位", + "入", + "常", + "文", + "總", + "次", + "品", + "式", + "活", + "設", + "及", + "管", + "特", + "件", + "長", + "求", + "老", + "頭", + "基", + "資", + "邊", + "流", + "路", + "級", + "少", + "圖", + "山", + "統", + "接", + "知", + "較", + "將", + "組", + "見", + "計", + "別", + "她", + "手", + "角", + "期", + "根", + "論", + "運", + "農", + "指", + "幾", + "九", + "區", + "強", + "放", + "決", + "西", + "被", + "幹", + "做", + "必", + "戰", + "先", + "回", + "則", + "任", + "取", + "據", + "處", + "隊", + "南", + "給", + "色", + "光", + "門", + "即", + "保", + "治", + "北", + "造", + "百", + "規", + "熱", + "領", + "七", + "海", + "口", + "東", + "導", + "器", + "壓", + "志", + "世", + "金", + "增", + "爭", + "濟", + "階", + "油", + "思", + "術", + "極", + "交", + "受", + "聯", + "什", + "認", + "六", + "共", + "權", + "收", + "證", + "改", + "清", + "美", + "再", + "採", + "轉", + "更", + "單", + "風", + "切", + "打", + "白", + "教", + "速", + "花", + "帶", + "安", + "場", + "身", + "車", + "例", + "真", + "務", + "具", + "萬", + "每", + "目", + "至", + "達", + "走", + "積", + "示", + "議", + "聲", + "報", + "鬥", + "完", + "類", + "八", + "離", + "華", + "名", + "確", + "才", + "科", + "張", + "信", + "馬", + "節", + "話", + "米", + "整", + "空", + "元", + "況", + "今", + "集", + "溫", + "傳", + "土", + "許", + "步", + "群", + "廣", + "石", + "記", + "需", + "段", + "研", + "界", + "拉", + "林", + "律", + "叫", + "且", + "究", + "觀", + "越", + "織", + "裝", + "影", + "算", + "低", + "持", + "音", + "眾", + "書", + "布", + "复", + "容", + "兒", + "須", + "際", + "商", + "非", + "驗", + "連", + "斷", + "深", + "難", + "近", + "礦", + "千", + "週", + "委", + "素", + "技", + "備", + "半", + "辦", + "青", + "省", + "列", + "習", + "響", + "約", + "支", + "般", + "史", + "感", + "勞", + "便", + "團", + "往", + "酸", + "歷", + "市", + "克", + "何", + "除", + "消", + "構", + "府", + "稱", + "太", + "準", + "精", + "值", + "號", + "率", + "族", + "維", + "劃", + "選", + "標", + "寫", + "存", + "候", + "毛", + "親", + "快", + "效", + "斯", + "院", + "查", + "江", + "型", + "眼", + "王", + "按", + "格", + "養", + "易", + "置", + "派", + "層", + "片", + "始", + "卻", + "專", + "狀", + "育", + "廠", + "京", + "識", + "適", + "屬", + "圓", + "包", + "火", + "住", + "調", + "滿", + "縣", + "局", + "照", + "參", + "紅", + "細", + "引", + "聽", + "該", + "鐵", + "價", + "嚴", + "首", + "底", + "液", + "官", + "德", + "隨", + "病", + "蘇", + "失", + "爾", + "死", + "講", + "配", + "女", + "黃", + "推", + "顯", + "談", + "罪", + "神", + "藝", + "呢", + "席", + "含", + "企", + "望", + "密", + "批", + "營", + "項", + "防", + "舉", + "球", + "英", + "氧", + "勢", + "告", + "李", + "台", + "落", + "木", + "幫", + "輪", + "破", + "亞", + "師", + "圍", + "注", + "遠", + "字", + "材", + "排", + "供", + "河", + "態", + "封", + "另", + "施", + "減", + "樹", + "溶", + "怎", + "止", + "案", + "言", + "士", + "均", + "武", + "固", + "葉", + "魚", + "波", + "視", + "僅", + "費", + "緊", + "愛", + "左", + "章", + "早", + "朝", + "害", + "續", + "輕", + "服", + "試", + "食", + "充", + "兵", + "源", + "判", + "護", + "司", + "足", + "某", + "練", + "差", + "致", + "板", + "田", + "降", + "黑", + "犯", + "負", + "擊", + "范", + "繼", + "興", + "似", + "餘", + "堅", + "曲", + "輸", + "修", + "故", + "城", + "夫", + "夠", + "送", + "筆", + "船", + "佔", + "右", + "財", + "吃", + "富", + "春", + "職", + "覺", + "漢", + "畫", + "功", + "巴", + "跟", + "雖", + "雜", + "飛", + "檢", + "吸", + "助", + "昇", + "陽", + "互", + "初", + "創", + "抗", + "考", + "投", + "壞", + "策", + "古", + "徑", + "換", + "未", + "跑", + "留", + "鋼", + "曾", + "端", + "責", + "站", + "簡", + "述", + "錢", + "副", + "盡", + "帝", + "射", + "草", + "衝", + "承", + "獨", + "令", + "限", + "阿", + "宣", + "環", + "雙", + "請", + "超", + "微", + "讓", + "控", + "州", + "良", + "軸", + "找", + "否", + "紀", + "益", + "依", + "優", + "頂", + "礎", + "載", + "倒", + "房", + "突", + "坐", + "粉", + "敵", + "略", + "客", + "袁", + "冷", + "勝", + "絕", + "析", + "塊", + "劑", + "測", + "絲", + "協", + "訴", + "念", + "陳", + "仍", + "羅", + "鹽", + "友", + "洋", + "錯", + "苦", + "夜", + "刑", + "移", + "頻", + "逐", + "靠", + "混", + "母", + "短", + "皮", + "終", + "聚", + "汽", + "村", + "雲", + "哪", + "既", + "距", + "衛", + "停", + "烈", + "央", + "察", + "燒", + "迅", + "境", + "若", + "印", + "洲", + "刻", + "括", + "激", + "孔", + "搞", + "甚", + "室", + "待", + "核", + "校", + "散", + "侵", + "吧", + "甲", + "遊", + "久", + "菜", + "味", + "舊", + "模", + "湖", + "貨", + "損", + "預", + "阻", + "毫", + "普", + "穩", + "乙", + "媽", + "植", + "息", + "擴", + "銀", + "語", + "揮", + "酒", + "守", + "拿", + "序", + "紙", + "醫", + "缺", + "雨", + "嗎", + "針", + "劉", + "啊", + "急", + "唱", + "誤", + "訓", + "願", + "審", + "附", + "獲", + "茶", + "鮮", + "糧", + "斤", + "孩", + "脫", + "硫", + "肥", + "善", + "龍", + "演", + "父", + "漸", + "血", + "歡", + "械", + "掌", + "歌", + "沙", + "剛", + "攻", + "謂", + "盾", + "討", + "晚", + "粒", + "亂", + "燃", + "矛", + "乎", + "殺", + "藥", + "寧", + "魯", + "貴", + "鐘", + "煤", + "讀", + "班", + "伯", + "香", + "介", + "迫", + "句", + "豐", + "培", + "握", + "蘭", + "擔", + "弦", + "蛋", + "沉", + "假", + "穿", + "執", + "答", + "樂", + "誰", + "順", + "煙", + "縮", + "徵", + "臉", + "喜", + "松", + "腳", + "困", + "異", + "免", + "背", + "星", + "福", + "買", + "染", + "井", + "概", + "慢", + "怕", + "磁", + "倍", + "祖", + "皇", + "促", + "靜", + "補", + "評", + "翻", + "肉", + "踐", + "尼", + "衣", + "寬", + "揚", + "棉", + "希", + "傷", + "操", + "垂", + "秋", + "宜", + "氫", + "套", + "督", + "振", + "架", + "亮", + "末", + "憲", + "慶", + "編", + "牛", + "觸", + "映", + "雷", + "銷", + "詩", + "座", + "居", + "抓", + "裂", + "胞", + "呼", + "娘", + "景", + "威", + "綠", + "晶", + "厚", + "盟", + "衡", + "雞", + "孫", + "延", + "危", + "膠", + "屋", + "鄉", + "臨", + "陸", + "顧", + "掉", + "呀", + "燈", + "歲", + "措", + "束", + "耐", + "劇", + "玉", + "趙", + "跳", + "哥", + "季", + "課", + "凱", + "胡", + "額", + "款", + "紹", + "卷", + "齊", + "偉", + "蒸", + "殖", + "永", + "宗", + "苗", + "川", + "爐", + "岩", + "弱", + "零", + "楊", + "奏", + "沿", + "露", + "桿", + "探", + "滑", + "鎮", + "飯", + "濃", + "航", + "懷", + "趕", + "庫", + "奪", + "伊", + "靈", + "稅", + "途", + "滅", + "賽", + "歸", + "召", + "鼓", + "播", + "盤", + "裁", + "險", + "康", + "唯", + "錄", + "菌", + "純", + "借", + "糖", + "蓋", + "橫", + "符", + "私", + "努", + "堂", + "域", + "槍", + "潤", + "幅", + "哈", + "竟", + "熟", + "蟲", + "澤", + "腦", + "壤", + "碳", + "歐", + "遍", + "側", + "寨", + "敢", + "徹", + "慮", + "斜", + "薄", + "庭", + "納", + "彈", + "飼", + "伸", + "折", + "麥", + "濕", + "暗", + "荷", + "瓦", + "塞", + "床", + "築", + "惡", + "戶", + "訪", + "塔", + "奇", + "透", + "梁", + "刀", + "旋", + "跡", + "卡", + "氯", + "遇", + "份", + "毒", + "泥", + "退", + "洗", + "擺", + "灰", + "彩", + "賣", + "耗", + "夏", + "擇", + "忙", + "銅", + "獻", + "硬", + "予", + "繁", + "圈", + "雪", + "函", + "亦", + "抽", + "篇", + "陣", + "陰", + "丁", + "尺", + "追", + "堆", + "雄", + "迎", + "泛", + "爸", + "樓", + "避", + "謀", + "噸", + "野", + "豬", + "旗", + "累", + "偏", + "典", + "館", + "索", + "秦", + "脂", + "潮", + "爺", + "豆", + "忽", + "托", + "驚", + "塑", + "遺", + "愈", + "朱", + "替", + "纖", + "粗", + "傾", + "尚", + "痛", + "楚", + "謝", + "奮", + "購", + "磨", + "君", + "池", + "旁", + "碎", + "骨", + "監", + "捕", + "弟", + "暴", + "割", + "貫", + "殊", + "釋", + "詞", + "亡", + "壁", + "頓", + "寶", + "午", + "塵", + "聞", + "揭", + "炮", + "殘", + "冬", + "橋", + "婦", + "警", + "綜", + "招", + "吳", + "付", + "浮", + "遭", + "徐", + "您", + "搖", + "谷", + "贊", + "箱", + "隔", + "訂", + "男", + "吹", + "園", + "紛", + "唐", + "敗", + "宋", + "玻", + "巨", + "耕", + "坦", + "榮", + "閉", + "灣", + "鍵", + "凡", + "駐", + "鍋", + "救", + "恩", + "剝", + "凝", + "鹼", + "齒", + "截", + "煉", + "麻", + "紡", + "禁", + "廢", + "盛", + "版", + "緩", + "淨", + "睛", + "昌", + "婚", + "涉", + "筒", + "嘴", + "插", + "岸", + "朗", + "莊", + "街", + "藏", + "姑", + "貿", + "腐", + "奴", + "啦", + "慣", + "乘", + "夥", + "恢", + "勻", + "紗", + "扎", + "辯", + "耳", + "彪", + "臣", + "億", + "璃", + "抵", + "脈", + "秀", + "薩", + "俄", + "網", + "舞", + "店", + "噴", + "縱", + "寸", + "汗", + "掛", + "洪", + "賀", + "閃", + "柬", + "爆", + "烯", + "津", + "稻", + "牆", + "軟", + "勇", + "像", + "滾", + "厘", + "蒙", + "芳", + "肯", + "坡", + "柱", + "盪", + "腿", + "儀", + "旅", + "尾", + "軋", + "冰", + "貢", + "登", + "黎", + "削", + "鑽", + "勒", + "逃", + "障", + "氨", + "郭", + "峰", + "幣", + "港", + "伏", + "軌", + "畝", + "畢", + "擦", + "莫", + "刺", + "浪", + "秘", + "援", + "株", + "健", + "售", + "股", + "島", + "甘", + "泡", + "睡", + "童", + "鑄", + "湯", + "閥", + "休", + "匯", + "舍", + "牧", + "繞", + "炸", + "哲", + "磷", + "績", + "朋", + "淡", + "尖", + "啟", + "陷", + "柴", + "呈", + "徒", + "顏", + "淚", + "稍", + "忘", + "泵", + "藍", + "拖", + "洞", + "授", + "鏡", + "辛", + "壯", + "鋒", + "貧", + "虛", + "彎", + "摩", + "泰", + "幼", + "廷", + "尊", + "窗", + "綱", + "弄", + "隸", + "疑", + "氏", + "宮", + "姐", + "震", + "瑞", + "怪", + "尤", + "琴", + "循", + "描", + "膜", + "違", + "夾", + "腰", + "緣", + "珠", + "窮", + "森", + "枝", + "竹", + "溝", + "催", + "繩", + "憶", + "邦", + "剩", + "幸", + "漿", + "欄", + "擁", + "牙", + "貯", + "禮", + "濾", + "鈉", + "紋", + "罷", + "拍", + "咱", + "喊", + "袖", + "埃", + "勤", + "罰", + "焦", + "潛", + "伍", + "墨", + "欲", + "縫", + "姓", + "刊", + "飽", + "仿", + "獎", + "鋁", + "鬼", + "麗", + "跨", + "默", + "挖", + "鏈", + "掃", + "喝", + "袋", + "炭", + "污", + "幕", + "諸", + "弧", + "勵", + "梅", + "奶", + "潔", + "災", + "舟", + "鑑", + "苯", + "訟", + "抱", + "毀", + "懂", + "寒", + "智", + "埔", + "寄", + "屆", + "躍", + "渡", + "挑", + "丹", + "艱", + "貝", + "碰", + "拔", + "爹", + "戴", + "碼", + "夢", + "芽", + "熔", + "赤", + "漁", + "哭", + "敬", + "顆", + "奔", + "鉛", + "仲", + "虎", + "稀", + "妹", + "乏", + "珍", + "申", + "桌", + "遵", + "允", + "隆", + "螺", + "倉", + "魏", + "銳", + "曉", + "氮", + "兼", + "隱", + "礙", + "赫", + "撥", + "忠", + "肅", + "缸", + "牽", + "搶", + "博", + "巧", + "殼", + "兄", + "杜", + "訊", + "誠", + "碧", + "祥", + "柯", + "頁", + "巡", + "矩", + "悲", + "灌", + "齡", + "倫", + "票", + "尋", + "桂", + "鋪", + "聖", + "恐", + "恰", + "鄭", + "趣", + "抬", + "荒", + "騰", + "貼", + "柔", + "滴", + "猛", + "闊", + "輛", + "妻", + "填", + "撤", + "儲", + "簽", + "鬧", + "擾", + "紫", + "砂", + "遞", + "戲", + "吊", + "陶", + "伐", + "餵", + "療", + "瓶", + "婆", + "撫", + "臂", + "摸", + "忍", + "蝦", + "蠟", + "鄰", + "胸", + "鞏", + "擠", + "偶", + "棄", + "槽", + "勁", + "乳", + "鄧", + "吉", + "仁", + "爛", + "磚", + "租", + "烏", + "艦", + "伴", + "瓜", + "淺", + "丙", + "暫", + "燥", + "橡", + "柳", + "迷", + "暖", + "牌", + "秧", + "膽", + "詳", + "簧", + "踏", + "瓷", + "譜", + "呆", + "賓", + "糊", + "洛", + "輝", + "憤", + "競", + "隙", + "怒", + "粘", + "乃", + "緒", + "肩", + "籍", + "敏", + "塗", + "熙", + "皆", + "偵", + "懸", + "掘", + "享", + "糾", + "醒", + "狂", + "鎖", + "淀", + "恨", + "牲", + "霸", + "爬", + "賞", + "逆", + "玩", + "陵", + "祝", + "秒", + "浙", + "貌", + "役", + "彼", + "悉", + "鴨", + "趨", + "鳳", + "晨", + "畜", + "輩", + "秩", + "卵", + "署", + "梯", + "炎", + "灘", + "棋", + "驅", + "篩", + "峽", + "冒", + "啥", + "壽", + "譯", + "浸", + "泉", + "帽", + "遲", + "矽", + "疆", + "貸", + "漏", + "稿", + "冠", + "嫩", + "脅", + "芯", + "牢", + "叛", + "蝕", + "奧", + "鳴", + "嶺", + "羊", + "憑", + "串", + "塘", + "繪", + "酵", + "融", + "盆", + "錫", + "廟", + "籌", + "凍", + "輔", + "攝", + "襲", + "筋", + "拒", + "僚", + "旱", + "鉀", + "鳥", + "漆", + "沈", + "眉", + "疏", + "添", + "棒", + "穗", + "硝", + "韓", + "逼", + "扭", + "僑", + "涼", + "挺", + "碗", + "栽", + "炒", + "杯", + "患", + "餾", + "勸", + "豪", + "遼", + "勃", + "鴻", + "旦", + "吏", + "拜", + "狗", + "埋", + "輥", + "掩", + "飲", + "搬", + "罵", + "辭", + "勾", + "扣", + "估", + "蔣", + "絨", + "霧", + "丈", + "朵", + "姆", + "擬", + "宇", + "輯", + "陝", + "雕", + "償", + "蓄", + "崇", + "剪", + "倡", + "廳", + "咬", + "駛", + "薯", + "刷", + "斥", + "番", + "賦", + "奉", + "佛", + "澆", + "漫", + "曼", + "扇", + "鈣", + "桃", + "扶", + "仔", + "返", + "俗", + "虧", + "腔", + "鞋", + "棱", + "覆", + "框", + "悄", + "叔", + "撞", + "騙", + "勘", + "旺", + "沸", + "孤", + "吐", + "孟", + "渠", + "屈", + "疾", + "妙", + "惜", + "仰", + "狠", + "脹", + "諧", + "拋", + "黴", + "桑", + "崗", + "嘛", + "衰", + "盜", + "滲", + "臟", + "賴", + "湧", + "甜", + "曹", + "閱", + "肌", + "哩", + "厲", + "烴", + "緯", + "毅", + "昨", + "偽", + "症", + "煮", + "嘆", + "釘", + "搭", + "莖", + "籠", + "酷", + "偷", + "弓", + "錐", + "恆", + "傑", + "坑", + "鼻", + "翼", + "綸", + "敘", + "獄", + "逮", + "罐", + "絡", + "棚", + "抑", + "膨", + "蔬", + "寺", + "驟", + "穆", + "冶", + "枯", + "冊", + "屍", + "凸", + "紳", + "坯", + "犧", + "焰", + "轟", + "欣", + "晉", + "瘦", + "禦", + "錠", + "錦", + "喪", + "旬", + "鍛", + "壟", + "搜", + "撲", + "邀", + "亭", + "酯", + "邁", + "舒", + "脆", + "酶", + "閒", + "憂", + "酚", + "頑", + "羽", + "漲", + "卸", + "仗", + "陪", + "闢", + "懲", + "杭", + "姚", + "肚", + "捉", + "飄", + "漂", + "昆", + "欺", + "吾", + "郎", + "烷", + "汁", + "呵", + "飾", + "蕭", + "雅", + "郵", + "遷", + "燕", + "撒", + "姻", + "赴", + "宴", + "煩", + "債", + "帳", + "斑", + "鈴", + "旨", + "醇", + "董", + "餅", + "雛", + "姿", + "拌", + "傅", + "腹", + "妥", + "揉", + "賢", + "拆", + "歪", + "葡", + "胺", + "丟", + "浩", + "徽", + "昂", + "墊", + "擋", + "覽", + "貪", + "慰", + "繳", + "汪", + "慌", + "馮", + "諾", + "姜", + "誼", + "兇", + "劣", + "誣", + "耀", + "昏", + "躺", + "盈", + "騎", + "喬", + "溪", + "叢", + "盧", + "抹", + "悶", + "諮", + "刮", + "駕", + "纜", + "悟", + "摘", + "鉺", + "擲", + "頗", + "幻", + "柄", + "惠", + "慘", + "佳", + "仇", + "臘", + "窩", + "滌", + "劍", + "瞧", + "堡", + "潑", + "蔥", + "罩", + "霍", + "撈", + "胎", + "蒼", + "濱", + "倆", + "捅", + "湘", + "砍", + "霞", + "邵", + "萄", + "瘋", + "淮", + "遂", + "熊", + "糞", + "烘", + "宿", + "檔", + "戈", + "駁", + "嫂", + "裕", + "徙", + "箭", + "捐", + "腸", + "撐", + "曬", + "辨", + "殿", + "蓮", + "攤", + "攪", + "醬", + "屏", + "疫", + "哀", + "蔡", + "堵", + "沫", + "皺", + "暢", + "疊", + "閣", + "萊", + "敲", + "轄", + "鉤", + "痕", + "壩", + "巷", + "餓", + "禍", + "丘", + "玄", + "溜", + "曰", + "邏", + "彭", + "嘗", + "卿", + "妨", + "艇", + "吞", + "韋", + "怨", + "矮", + "歇" + ]; +} diff --git a/test/unit/WalletTest.php b/test/unit/WalletTest.php index df23784..a7a8089 100644 --- a/test/unit/WalletTest.php +++ b/test/unit/WalletTest.php @@ -5,6 +5,7 @@ use Test\TestCase; use BitWasp\BitcoinLib\BIP39\BIP39EnglishWordList; use Web3p\EthereumWallet\Wallet; +use Web3p\EthereumWallet\Wordlist\BIP39ChineseTraditionalWordList; class WalletTest extends TestCase { @@ -23,4 +24,22 @@ public function testGenerate() $mnemonic = preg_split("/\s/", $wallet->mnemonic); $this->assertEquals(24, count($mnemonic)); } + + /** + * testSetWordlist + * + * @return void + */ + public function testSetWordlist() + { + $wordlist = new BIP39EnglishWordList; + $wallet = new Wallet($wordlist); + $zh_TW_wordlist = new BIP39ChineseTraditionalWordList; + $wallet->wordlist = $zh_TW_wordlist; + $wallet = $wallet->generate(); + $this->assertEquals(64, strlen($wallet->privateKey)); + $this->assertEquals(42, strlen($wallet->address)); + $mnemonic = preg_split("/\s/", $wallet->mnemonic); + $this->assertEquals(24, count($mnemonic)); + } } From 53cbcf326e3ddb5f7e7d5446382115017a9a6eb5 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Tue, 12 Mar 2019 09:54:24 +0800 Subject: [PATCH 03/17] Add fromMnemonic --- src/Wallet.php | 16 ++++++++++++++-- test/unit/WalletTest.php | 19 ++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/Wallet.php b/src/Wallet.php index fbdea43..3ac9383 100644 --- a/src/Wallet.php +++ b/src/Wallet.php @@ -159,11 +159,23 @@ public function setWordlist(BIP39WordList $wordlist) } /** - * TODO: fromMnemonic + * fromMnemonic * + * @param string $mnemonic * @return $this */ - // public function fromMnemonic() {} + public function fromMnemonic(string $mnemonic) + { + $privateKey = BIP39::mnemonicToEntropy($mnemonic); + $publicKey = $this->util->privateKeyToPublicKey($privateKey); + $address = $this->util->publicKeyToAddress($publicKey); + + $this->privateKey = $privateKey; + $this->publicKey = $publicKey; + $this->mnemonic = $mnemonic; + $this->address = $address; + return $this; + } /** * generate diff --git a/test/unit/WalletTest.php b/test/unit/WalletTest.php index a7a8089..61417fd 100644 --- a/test/unit/WalletTest.php +++ b/test/unit/WalletTest.php @@ -21,7 +21,7 @@ public function testGenerate() $wallet = $wallet->generate(); $this->assertEquals(64, strlen($wallet->privateKey)); $this->assertEquals(42, strlen($wallet->address)); - $mnemonic = preg_split("/\s/", $wallet->mnemonic); + $mnemonic = explode(" ", $wallet->mnemonic); $this->assertEquals(24, count($mnemonic)); } @@ -42,4 +42,21 @@ public function testSetWordlist() $mnemonic = preg_split("/\s/", $wallet->mnemonic); $this->assertEquals(24, count($mnemonic)); } + + /** + * testFromMnemonic + * + * @return void + */ + public function testFromMnemonic() + { + $wordlist = new BIP39EnglishWordList; + $wallet = new Wallet($wordlist); + $wallet = $wallet->generate(); + $wallet2 = new Wallet($wordlist); + $wallet2->fromMnemonic($wallet->mnemonic); + $this->assertEquals($wallet->privateKey, $wallet2->privateKey); + $this->assertEquals($wallet->address, $wallet2->address); + $this->assertEquals($wallet->mnemonic, $wallet2->mnemonic); + } } From 44a04206b5a24f38322efa1a595bd4f9b2af8aae Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Tue, 12 Mar 2019 10:02:58 +0800 Subject: [PATCH 04/17] Add travis and codecov --- .travis.yml | 23 +++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 26 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3a4d954 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +sudo: required + +language: php + +php: + - 7.1 + - 7.2 + +install: + - composer install + +notifications: + email: + recipients: + - alk03073135@gmail.com + on_success: always + on_failure: always + +script: + - vendor/bin/phpunit --coverage-clover=coverage.xml + +after_success: + - bash <(curl -s https://codecov.io/bash) -t 1e66a134-6b6a-4963-87c9-0b0e693a04d5 \ No newline at end of file diff --git a/README.md b/README.md index c2b155e..ff48a92 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # ethereum-wallet +[![Build Status](https://travis-ci.org/web3p/ethereum-wallet.svg?branch=master)](https://travis-ci.org/web3p/ethereum-wallet) +[![codecov](https://codecov.io/gh/web3p/ethereum-wallet/branch/master/graph/badge.svg)](https://codecov.io/gh/web3p/ethereum-wallet) + Ethereum wallet. From 8e7ba05f498a110d344e962f2905cac2af4fd0da Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Mon, 22 Apr 2019 23:47:35 +0800 Subject: [PATCH 05/17] Update Wallet.php --- src/Wallet.php | 54 +++++++++++++++++++++++++++++++++++++--- test/unit/WalletTest.php | 10 ++++---- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/Wallet.php b/src/Wallet.php index 3ac9383..347e32d 100644 --- a/src/Wallet.php +++ b/src/Wallet.php @@ -62,6 +62,29 @@ class Wallet */ protected $address; + /** + * allowedMnemonicLength + * + * @var array + */ + protected $allowedMnemonicLength = [ + 12, 15, 18, 21, 24 + ]; + + /** + * masterSeed + * + * @var string + */ + protected $masterSeed = "Bitcoin seed"; + + /** + * chainCode + * + * @var string + */ + protected $chainCode; + /** * construct * @@ -158,6 +181,16 @@ public function setWordlist(BIP39WordList $wordlist) $this->wordlist = $wordlist; } + /** + * getChainCode + * + * @return string + */ + public function getChainCode() + { + return $this->chainCode; + } + /** * fromMnemonic * @@ -166,7 +199,10 @@ public function setWordlist(BIP39WordList $wordlist) */ public function fromMnemonic(string $mnemonic) { - $privateKey = BIP39::mnemonicToEntropy($mnemonic); + $entropy = BIP39::mnemonicToEntropy($mnemonic); + $hash = hash_hmac("sha512", $entropy, $this->masterSeed); + $privateKey = substr($hash, 0, 64); + $chainCode = substr($hash, 64); $publicKey = $this->util->privateKeyToPublicKey($privateKey); $address = $this->util->publicKeyToAddress($publicKey); @@ -174,18 +210,27 @@ public function fromMnemonic(string $mnemonic) $this->publicKey = $publicKey; $this->mnemonic = $mnemonic; $this->address = $address; + $this->chainCode = $chainCode; return $this; } /** * generate * + * @param int $mnemonicLength * @return $this */ - public function generate() + public function generate(int $mnemonicLength) { - $privateKey = BIP39::generateEntropy(256); - $mnemonic = BIP39::entropyToMnemonic($privateKey, $this->wordlist); + if (!in_array($mnemonicLength, $this->allowedMnemonicLength)) { + throw new InvalidArgumentException("The mnemonic length wasn't allowed"); + } + $entropyBitsLength = ($mnemonicLength * 11 * 32) / 33; + $entropy = BIP39::generateEntropy($entropyBitsLength); + $hash = hash_hmac("sha512", $entropy, $this->masterSeed); + $privateKey = substr($hash, 0, 64); + $chainCode = substr($hash, 64); + $mnemonic = BIP39::entropyToMnemonic($entropy, $this->wordlist); $publicKey = $this->util->privateKeyToPublicKey($privateKey); $address = $this->util->publicKeyToAddress($publicKey); @@ -193,6 +238,7 @@ public function generate() $this->publicKey = $publicKey; $this->mnemonic = $mnemonic; $this->address = $address; + $this->chainCode = $chainCode; return $this; } } \ No newline at end of file diff --git a/test/unit/WalletTest.php b/test/unit/WalletTest.php index 61417fd..e4aee77 100644 --- a/test/unit/WalletTest.php +++ b/test/unit/WalletTest.php @@ -18,11 +18,11 @@ public function testGenerate() { $wordlist = new BIP39EnglishWordList; $wallet = new Wallet($wordlist); - $wallet = $wallet->generate(); + $wallet = $wallet->generate(12); $this->assertEquals(64, strlen($wallet->privateKey)); $this->assertEquals(42, strlen($wallet->address)); $mnemonic = explode(" ", $wallet->mnemonic); - $this->assertEquals(24, count($mnemonic)); + $this->assertEquals(12, count($mnemonic)); } /** @@ -36,11 +36,11 @@ public function testSetWordlist() $wallet = new Wallet($wordlist); $zh_TW_wordlist = new BIP39ChineseTraditionalWordList; $wallet->wordlist = $zh_TW_wordlist; - $wallet = $wallet->generate(); + $wallet = $wallet->generate(15); $this->assertEquals(64, strlen($wallet->privateKey)); $this->assertEquals(42, strlen($wallet->address)); $mnemonic = preg_split("/\s/", $wallet->mnemonic); - $this->assertEquals(24, count($mnemonic)); + $this->assertEquals(15, count($mnemonic)); } /** @@ -52,7 +52,7 @@ public function testFromMnemonic() { $wordlist = new BIP39EnglishWordList; $wallet = new Wallet($wordlist); - $wallet = $wallet->generate(); + $wallet = $wallet->generate(15); $wallet2 = new Wallet($wordlist); $wallet2->fromMnemonic($wallet->mnemonic); $this->assertEquals($wallet->privateKey, $wallet2->privateKey); From 0d40f669989016c262e7a1d558290d4e50fc51cb Mon Sep 17 00:00:00 2001 From: sc0vu Date: Wed, 26 Apr 2023 12:38:29 +0800 Subject: [PATCH 06/17] Update packages --- composer.json | 6 +- composer.lock | 1936 --------------------------------------------- phpunit.xml | 3 +- test/TestCase.php | 4 +- 4 files changed, 6 insertions(+), 1943 deletions(-) delete mode 100644 composer.lock diff --git a/composer.json b/composer.json index c8d098b..3a77192 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "~7 | ~8.0" }, "autoload": { "psr-4": { @@ -24,7 +24,7 @@ }, "require": { "bitwasp/bitcoin-lib": "1.0.*", - "PHP": "^7.1", - "web3p/ethereum-util": "0.1" + "PHP": "^7.1 | ^8.0", + "web3p/ethereum-util": "^0.1" } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index c169c1a..0000000 --- a/composer.lock +++ /dev/null @@ -1,1936 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "c6a7e6824a15279258438edf23c036c3", - "packages": [ - { - "name": "bitwasp/bitcoin-lib", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/Bit-Wasp/bitcoin-lib-php.git", - "reference": "2fa3fd3ab9d3d474c3c65426f6c550c581ab9f15" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Bit-Wasp/bitcoin-lib-php/zipball/2fa3fd3ab9d3d474c3c65426f6c550c581ab9f15", - "reference": "2fa3fd3ab9d3d474c3c65426f6c550c581ab9f15", - "shasum": "" - }, - "require": { - "ext-gmp": "*", - "mdanter/ecc": "0.2.0", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~3.7", - "squizlabs/php_codesniffer": "~1.5" - }, - "suggest": { - "ext-intl": "Required for BIP39 Mnemonic Seeds with UTF-8 passphrases" - }, - "type": "library", - "autoload": { - "psr-4": { - "BitWasp\\BitcoinLib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Unlicense" - ], - "authors": [ - { - "name": "Thomas Kerin", - "email": "thomas.kerin@gmail.com" - } - ], - "description": "Implementation of raw transactions in bitcoin, HD wallets, Electrum wallets, and other fun stuff.", - "keywords": [ - "HD wallet", - "bip32", - "bitcoin", - "btc", - "cryptocurrency", - "ecc", - "electrum", - "php", - "transactions" - ], - "time": "2014-12-11T17:48:09+00:00" - }, - { - "name": "kornrunner/keccak", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/kornrunner/php-keccak.git", - "reference": "ad761f528f4d1e3ce378b8a0841e5f82c9973535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kornrunner/php-keccak/zipball/ad761f528f4d1e3ce378b8a0841e5f82c9973535", - "reference": "ad761f528f4d1e3ce378b8a0841e5f82c9973535", - "shasum": "" - }, - "require": { - "php": ">=7.1.0", - "symfony/polyfill-mbstring": "^1.8" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "~7" - }, - "type": "library", - "autoload": { - "psr-4": { - "kornrunner\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Boris Momcilovic", - "homepage": "https://github.com/kornrunner/php-keccak" - } - ], - "description": "Pure PHP implementation of Keccak", - "keywords": [ - "keccak", - "sha-3", - "sha3-256" - ], - "time": "2018-07-30T22:16:23+00:00" - }, - { - "name": "mdanter/ecc", - "version": "0.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpecc/phpecc.git", - "reference": "ca9d127114e087bdeac24ada488631f18ae80d3f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpecc/phpecc/zipball/ca9d127114e087bdeac24ada488631f18ae80d3f", - "reference": "ca9d127114e087bdeac24ada488631f18ae80d3f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.1", - "squizlabs/php_codesniffer": "~1.5" - }, - "suggest": { - "ext-bcmath": "Required if GMP is not installed.", - "ext-gmp": "Improves drastically ECDSA library performance" - }, - "type": "library", - "autoload": { - "psr-4": { - "Mdanter\\Ecc\\Tests\\": "tests/unit", - "Mdanter\\Ecc\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matyas Danter", - "homepage": "http://matejdanter.com/", - "role": "Author" - }, - { - "name": "Thibaud Fabre", - "email": "thibaud@aztech.io", - "homepage": "http://aztech.io", - "role": "Maintainer" - }, - { - "name": "Drak", - "email": "drak@zikula.org", - "homepage": "http://zikula.org", - "role": "Maintainer" - } - ], - "description": "PHP Elliptic Curve Cryptography library", - "homepage": "https://github.com/mdanter/phpecc", - "time": "2014-07-07T12:44:15+00:00" - }, - { - "name": "simplito/bigint-wrapper-php", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/simplito/bigint-wrapper-php.git", - "reference": "cf21ec76d33f103add487b3eadbd9f5033a25930" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplito/bigint-wrapper-php/zipball/cf21ec76d33f103add487b3eadbd9f5033a25930", - "reference": "cf21ec76d33f103add487b3eadbd9f5033a25930", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "BI\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Simplito Team", - "email": "s.smyczynski@simplito.com", - "homepage": "https://simplito.com" - } - ], - "description": "Common interface for php_gmp and php_bcmath modules", - "time": "2018-02-27T12:38:08+00:00" - }, - { - "name": "simplito/bn-php", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/simplito/bn-php.git", - "reference": "e852fcd27e4acbc32459606d7606e45a85e42465" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplito/bn-php/zipball/e852fcd27e4acbc32459606d7606e45a85e42465", - "reference": "e852fcd27e4acbc32459606d7606e45a85e42465", - "shasum": "" - }, - "require": { - "simplito/bigint-wrapper-php": "~1.0.0" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "psr-4": { - "BN\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Simplito Team", - "email": "s.smyczynski@simplito.com", - "homepage": "https://simplito.com" - } - ], - "description": "Big number implementation compatible with bn.js", - "time": "2018-04-12T11:07:43+00:00" - }, - { - "name": "simplito/elliptic-php", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/simplito/elliptic-php.git", - "reference": "cab829d270dfd6acdff8383d862ed02a12d1f9dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplito/elliptic-php/zipball/cab829d270dfd6acdff8383d862ed02a12d1f9dd", - "reference": "cab829d270dfd6acdff8383d862ed02a12d1f9dd", - "shasum": "" - }, - "require": { - "ext-gmp": "*", - "simplito/bn-php": "~1.1.0" - }, - "require-dev": { - "phpbench/phpbench": "@dev", - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "psr-4": { - "Elliptic\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Simplito Team", - "email": "s.smyczynski@simplito.com", - "homepage": "https://simplito.com" - } - ], - "description": "Fast elliptic curve cryptography", - "homepage": "https://github.com/simplito/elliptic-php", - "keywords": [ - "Curve25519", - "ECDSA", - "Ed25519", - "EdDSA", - "cryptography", - "curve", - "ecc", - "ecdh", - "elliptic", - "nistp192", - "nistp224", - "nistp256", - "nistp384", - "nistp521", - "secp256k1" - ], - "time": "2018-04-12T11:17:52+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-09-21T13:07:52+00:00" - }, - { - "name": "web3p/ethereum-util", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/web3p/ethereum-util.git", - "reference": "8736ef0c4b40f9e4aa060cf8836a4f24c5072249" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/web3p/ethereum-util/zipball/8736ef0c4b40f9e4aa060cf8836a4f24c5072249", - "reference": "8736ef0c4b40f9e4aa060cf8836a4f24c5072249", - "shasum": "" - }, - "require": { - "kornrunner/keccak": "~1", - "php": "^7.1", - "simplito/elliptic-php": "1.0.3" - }, - "require-dev": { - "phpunit/phpunit": "^6.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Web3p\\EthereumUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "sc0Vu", - "email": "alk03073135@gmail.com" - } - ], - "description": "A collection of utility functions for Ethereum written in PHP.", - "time": "2018-05-30T20:03:27+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2017-07-22T11:58:36+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.8.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2018-06-11T23:09:50+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" - }, - { - "name": "phar-io/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "~1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.8.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2018-08-05T17:53:17+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "5.3.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-xdebug": "^2.5.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2018-04-06T15:36:58+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-11-27T05:48:46+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "6.5.14", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2019-02-01T05:22:47+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "abandoned": true, - "time": "2018-08-09T05:50:03+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-02-01T13:46:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-08-03T08:09:46+00:00" - }, - { - "name": "sebastian/environment", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2017-07-01T08:51:00+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2017-04-03T13:19:02+00:00" - }, - { - "name": "sebastian/global-state", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "backendtea@gmail.com" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-08-06T14:22:27+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-12-25T11:19:39+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.1" - }, - "platform-dev": [] -} diff --git a/phpunit.xml b/phpunit.xml index ce596a2..7527679 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,8 +7,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> ./test/unit diff --git a/test/TestCase.php b/test/TestCase.php index e8f40b3..aa015fb 100644 --- a/test/TestCase.php +++ b/test/TestCase.php @@ -11,12 +11,12 @@ class TestCase extends BaseTestCase * * @return void */ - public function setUp() {} + public function setUp(): void {} /** * tearDown * * @return void */ - public function tearDown() {} + public function tearDown(): void {} } \ No newline at end of file From 82b9f2fe798dca222dd4dae2b1974e5e7cb43ff0 Mon Sep 17 00:00:00 2001 From: sc0vu Date: Wed, 26 Apr 2023 12:39:15 +0800 Subject: [PATCH 07/17] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a67d42b..dd55f33 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock +composer.lock From c3c0032db239d76a8dbe4dde57160cd56b9b2571 Mon Sep 17 00:00:00 2001 From: sc0vu Date: Wed, 26 Apr 2023 14:11:47 +0800 Subject: [PATCH 08/17] Remove --- src/Wallet.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Wallet.php b/src/Wallet.php index 347e32d..4721287 100644 --- a/src/Wallet.php +++ b/src/Wallet.php @@ -14,6 +14,7 @@ use BitWasp\BitcoinLib\BIP39\BIP39; use BitWasp\BitcoinLib\BIP39\BIP39WordList; use Web3p\EthereumUtil\Util; +use InvalidArgumentException; /** * TODO: export/import version 1, 2, 3 of wallet @@ -62,15 +63,6 @@ class Wallet */ protected $address; - /** - * allowedMnemonicLength - * - * @var array - */ - protected $allowedMnemonicLength = [ - 12, 15, 18, 21, 24 - ]; - /** * masterSeed * @@ -222,7 +214,7 @@ public function fromMnemonic(string $mnemonic) */ public function generate(int $mnemonicLength) { - if (!in_array($mnemonicLength, $this->allowedMnemonicLength)) { + if (($mnemonicLength % 3) !== 0 || $mnemonicLength < 12 || $mnemonicLength > 24) { throw new InvalidArgumentException("The mnemonic length wasn't allowed"); } $entropyBitsLength = ($mnemonicLength * 11 * 32) / 33; From ac18e4a41bf37929dac6d412870f01952ad57ab3 Mon Sep 17 00:00:00 2001 From: sc0vu Date: Thu, 27 Apr 2023 17:36:10 +0800 Subject: [PATCH 09/17] Support HD path --- composer.json | 4 +- src/Wallet.php | 86 ++++++++++--------- .../BIP39ChineseSimplifiedWordList.php | 16 ++-- .../BIP39ChineseTraditionalWordList.php | 16 ++-- test/unit/WalletTest.php | 10 +-- 5 files changed, 74 insertions(+), 58 deletions(-) diff --git a/composer.json b/composer.json index 3a77192..f0532d3 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ } }, "require": { - "bitwasp/bitcoin-lib": "1.0.*", "PHP": "^7.1 | ^8.0", - "web3p/ethereum-util": "^0.1" + "web3p/ethereum-util": "^0.1", + "bitwasp/bitcoin": "^1.0" } } diff --git a/src/Wallet.php b/src/Wallet.php index 4721287..0c7b77e 100644 --- a/src/Wallet.php +++ b/src/Wallet.php @@ -11,8 +11,12 @@ namespace Web3p\EthereumWallet; -use BitWasp\BitcoinLib\BIP39\BIP39; -use BitWasp\BitcoinLib\BIP39\BIP39WordList; +use BitWasp\Bitcoin\Mnemonic\MnemonicFactory; +use BitWasp\Bitcoin\Mnemonic\BIP39\Bip39SeedGenerator; +use BitWasp\Bitcoin\Mnemonic\BIP39\Bip39Mnemonic; +use BitWasp\Bitcoin\Mnemonic\Bip39\Wordlist\EnglishWordList; +use BitWasp\Bitcoin\Mnemonic\WordList; +use BitWasp\Bitcoin\Key\Factory\HierarchicalKeyFactory; use Web3p\EthereumUtil\Util; use InvalidArgumentException; @@ -24,7 +28,7 @@ class Wallet /** * wordlist * - * @var \BitWasp\BitcoinLib\BIP39\BIP39WordList + * @var \BitWasp\Bitcoin\Mnemonic\WordList */ protected $wordlist; @@ -64,27 +68,23 @@ class Wallet protected $address; /** - * masterSeed + * defaultPath * * @var string */ - protected $masterSeed = "Bitcoin seed"; - - /** - * chainCode - * - * @var string - */ - protected $chainCode; + protected $defaultPath = '44\'/60\'/0\'/0/0'; /** * construct * - * @param \BitWasp\BitcoinLib\BIP39\BIP39WordList $wordlist + * @param \BitWasp\Bitcoin\Mnemonic\WordList $wordlist * @return void */ - public function __construct(BIP39WordList $wordlist) + public function __construct(WordList $wordlist = null) { + if (!$wordlist) { + $wordlist = new EnglishWordList; + } $this->wordlist = $wordlist; $this->util = new Util; } @@ -165,36 +165,35 @@ public function getAddress() /** * setWordlist * - * @param BIP39WordList $wordlist + * @param \BitWasp\Bitcoin\Mnemonic\WordList $wordlist * @return void */ - public function setWordlist(BIP39WordList $wordlist) + public function setWordlist(WordList $wordlist) { $this->wordlist = $wordlist; } - /** - * getChainCode - * - * @return string - */ - public function getChainCode() - { - return $this->chainCode; - } - /** * fromMnemonic * - * @param string $mnemonic + * @param string $mnemonic mnemonic string + * @param string $path relative hd path (remove m prefix) * @return $this */ - public function fromMnemonic(string $mnemonic) + public function fromMnemonic(string $mnemonic, string $path = '') { - $entropy = BIP39::mnemonicToEntropy($mnemonic); - $hash = hash_hmac("sha512", $entropy, $this->masterSeed); - $privateKey = substr($hash, 0, 64); - $chainCode = substr($hash, 64); + $factory = MnemonicFactory::bip39($this->wordlist); + $entropy = $factory->mnemonicToEntropy($mnemonic); + $mnemonic = $factory->entropyToMnemonic($entropy); + $generator = new Bip39SeedGenerator(); + $seed = $generator->getSeed($mnemonic); + $hdFactory = new HierarchicalKeyFactory(); + $key = $hdFactory->fromEntropy($seed); + if (strlen($path) == 0) { + $path = $this->defaultPath; + } + $key = $key->derivePath($path); + $privateKey = $key->getPrivateKey()->getBuffer()->getHex(); $publicKey = $this->util->privateKeyToPublicKey($privateKey); $address = $this->util->publicKeyToAddress($publicKey); @@ -202,27 +201,33 @@ public function fromMnemonic(string $mnemonic) $this->publicKey = $publicKey; $this->mnemonic = $mnemonic; $this->address = $address; - $this->chainCode = $chainCode; return $this; } /** * generate * - * @param int $mnemonicLength + * @param int $mnemonicLength mnemonic length + * @param string $path relative hd path (remove m prefix) * @return $this */ - public function generate(int $mnemonicLength) + public function generate(int $mnemonicLength, string $path = '') { if (($mnemonicLength % 3) !== 0 || $mnemonicLength < 12 || $mnemonicLength > 24) { throw new InvalidArgumentException("The mnemonic length wasn't allowed"); } $entropyBitsLength = ($mnemonicLength * 11 * 32) / 33; - $entropy = BIP39::generateEntropy($entropyBitsLength); - $hash = hash_hmac("sha512", $entropy, $this->masterSeed); - $privateKey = substr($hash, 0, 64); - $chainCode = substr($hash, 64); - $mnemonic = BIP39::entropyToMnemonic($entropy, $this->wordlist); + $factory = MnemonicFactory::bip39($this->wordlist); + $mnemonic = $factory->create($entropyBitsLength); + $generator = new Bip39SeedGenerator(); + $seed = $generator->getSeed($mnemonic); + $hdFactory = new HierarchicalKeyFactory(); + $key = $hdFactory->fromEntropy($seed); + if (strlen($path) == 0) { + $path = $this->defaultPath; + } + $key = $key->derivePath($path); + $privateKey = $key->getPrivateKey()->getBuffer()->getHex(); $publicKey = $this->util->privateKeyToPublicKey($privateKey); $address = $this->util->publicKeyToAddress($publicKey); @@ -230,7 +235,6 @@ public function generate(int $mnemonicLength) $this->publicKey = $publicKey; $this->mnemonic = $mnemonic; $this->address = $address; - $this->chainCode = $chainCode; return $this; } } \ No newline at end of file diff --git a/src/wordlist/BIP39ChineseSimplifiedWordList.php b/src/wordlist/BIP39ChineseSimplifiedWordList.php index 2323e78..a7198da 100644 --- a/src/wordlist/BIP39ChineseSimplifiedWordList.php +++ b/src/wordlist/BIP39ChineseSimplifiedWordList.php @@ -10,19 +10,25 @@ namespace Web3p\EthereumWallet\Wordlist; -use BitWasp\BitcoinLib\BIP39\BIP39WordList; +use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface; +use BitWasp\Bitcoin\Mnemonic\WordList; -class BIP39ChineseSimplifiedWordList extends BIP39WordList +class BIP39ChineseSimplifiedWordList extends WordList implements Bip39WordListInterface { protected $wordsFlipped; - public function getWords() + public function count(): int + { + return count($this->getWords()); + } + + public function getWords(): array { return $this->words; } - public function getWord($idx) + public function getWord(int $idx): string { if (!isset($this->words)) { throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); @@ -31,7 +37,7 @@ public function getWord($idx) return $this->words[$idx]; } - public function getIndex($word) + public function getIndex(string $word): int { // create a flipped word list to speed up the searching of words if (is_null($this->wordsFlipped)) { diff --git a/src/wordlist/BIP39ChineseTraditionalWordList.php b/src/wordlist/BIP39ChineseTraditionalWordList.php index 9cb805c..1b5086f 100644 --- a/src/wordlist/BIP39ChineseTraditionalWordList.php +++ b/src/wordlist/BIP39ChineseTraditionalWordList.php @@ -10,19 +10,25 @@ namespace Web3p\EthereumWallet\Wordlist; -use BitWasp\BitcoinLib\BIP39\BIP39WordList; +use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface; +use BitWasp\Bitcoin\Mnemonic\WordList; -class BIP39ChineseTraditionalWordList extends BIP39WordList +class BIP39ChineseTraditionalWordList extends WordList implements Bip39WordListInterface { protected $wordsFlipped; + + public function count(): int + { + return count($this->getWords()); + } - public function getWords() + public function getWords(): array { return $this->words; } - public function getWord($idx) + public function getWord(int $idx): string { if (!isset($this->words)) { throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); @@ -31,7 +37,7 @@ public function getWord($idx) return $this->words[$idx]; } - public function getIndex($word) + public function getIndex(string $word): int { // create a flipped word list to speed up the searching of words if (is_null($this->wordsFlipped)) { diff --git a/test/unit/WalletTest.php b/test/unit/WalletTest.php index e4aee77..0fcc17f 100644 --- a/test/unit/WalletTest.php +++ b/test/unit/WalletTest.php @@ -3,7 +3,7 @@ namespace Test\Unit; use Test\TestCase; -use BitWasp\BitcoinLib\BIP39\BIP39EnglishWordList; +use BitWasp\Bitcoin\Mnemonic\Bip39\Wordlist\EnglishWordList; use Web3p\EthereumWallet\Wallet; use Web3p\EthereumWallet\Wordlist\BIP39ChineseTraditionalWordList; @@ -16,7 +16,7 @@ class WalletTest extends TestCase */ public function testGenerate() { - $wordlist = new BIP39EnglishWordList; + $wordlist = new EnglishWordList; $wallet = new Wallet($wordlist); $wallet = $wallet->generate(12); $this->assertEquals(64, strlen($wallet->privateKey)); @@ -32,7 +32,7 @@ public function testGenerate() */ public function testSetWordlist() { - $wordlist = new BIP39EnglishWordList; + $wordlist = new EnglishWordList; $wallet = new Wallet($wordlist); $zh_TW_wordlist = new BIP39ChineseTraditionalWordList; $wallet->wordlist = $zh_TW_wordlist; @@ -50,8 +50,8 @@ public function testSetWordlist() */ public function testFromMnemonic() { - $wordlist = new BIP39EnglishWordList; - $wallet = new Wallet($wordlist); + $wordlist = new EnglishWordList; + $wallet = new Wallet(); $wallet = $wallet->generate(15); $wallet2 = new Wallet($wordlist); $wallet2->fromMnemonic($wallet->mnemonic); From b0305f79ad7126b63352c0b25d27cf06cf3a4812 Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 08:23:00 +0800 Subject: [PATCH 10/17] Update github ci --- .github/workflows/php.yml | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..02ba999 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,43 @@ +name: PHP + +on: ["push", "pull_request", "workflow_dispatch"] + +jobs: + build_and_test: + name: Build and test ethereum-wallet with ${{ matrix.php-version }} + strategy: + matrix: + php-version: ["7.3", "7.4", "8.0"] + + runs-on: ubuntu-latest + + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: PHP version + run: | + php --version + + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php-version }}- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Run test suite + run: vebdor/bin/phpunit From 256d9a9f06e443c7baf53e778f4bb8c1dc32389c Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 08:25:44 +0800 Subject: [PATCH 11/17] Update github ci --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 02ba999..44fe547 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -40,4 +40,4 @@ jobs: run: composer install --prefer-dist --no-progress --no-suggest - name: Run test suite - run: vebdor/bin/phpunit + run: vendor/bin/phpunit From 24d3f52b3389f73d4e239b42dc895c2a84778c5b Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 08:38:22 +0800 Subject: [PATCH 12/17] Update github ci --- .github/workflows/php.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 44fe547..71c95b2 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -7,7 +7,8 @@ jobs: name: Build and test ethereum-wallet with ${{ matrix.php-version }} strategy: matrix: - php-version: ["7.3", "7.4", "8.0"] + # bitcoin didn't support 8.0 yet, see: https://github.com/Bit-Wasp/bitcoin-php/pull/898 + php-version: ["7.2", "7.3", "7.4"] runs-on: ubuntu-latest From b23fca2eff00afb5e5ad12f53a926648c8f698df Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 09:26:50 +0800 Subject: [PATCH 13/17] Update import namespace --- src/Wallet.php | 4 +- .../BIP39ChineseSimplifiedWordList.php | 2104 +++++++++++++++++ .../BIP39ChineseTraditionalWordList.php | 2104 +++++++++++++++++ 3 files changed, 4210 insertions(+), 2 deletions(-) create mode 100644 src/Wordlist/BIP39ChineseSimplifiedWordList.php create mode 100644 src/Wordlist/BIP39ChineseTraditionalWordList.php diff --git a/src/Wallet.php b/src/Wallet.php index 0c7b77e..8856152 100644 --- a/src/Wallet.php +++ b/src/Wallet.php @@ -12,8 +12,8 @@ namespace Web3p\EthereumWallet; use BitWasp\Bitcoin\Mnemonic\MnemonicFactory; -use BitWasp\Bitcoin\Mnemonic\BIP39\Bip39SeedGenerator; -use BitWasp\Bitcoin\Mnemonic\BIP39\Bip39Mnemonic; +use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39SeedGenerator; +use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39Mnemonic; use BitWasp\Bitcoin\Mnemonic\Bip39\Wordlist\EnglishWordList; use BitWasp\Bitcoin\Mnemonic\WordList; use BitWasp\Bitcoin\Key\Factory\HierarchicalKeyFactory; diff --git a/src/Wordlist/BIP39ChineseSimplifiedWordList.php b/src/Wordlist/BIP39ChineseSimplifiedWordList.php new file mode 100644 index 0000000..a7198da --- /dev/null +++ b/src/Wordlist/BIP39ChineseSimplifiedWordList.php @@ -0,0 +1,2104 @@ + + */ + +namespace Web3p\EthereumWallet\Wordlist; + +use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface; +use BitWasp\Bitcoin\Mnemonic\WordList; + +class BIP39ChineseSimplifiedWordList extends WordList implements Bip39WordListInterface +{ + + protected $wordsFlipped; + + public function count(): int + { + return count($this->getWords()); + } + + public function getWords(): array + { + return $this->words; + } + + public function getWord(int $idx): string + { + if (!isset($this->words)) { + throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); + } + + return $this->words[$idx]; + } + + public function getIndex(string $word): int + { + // create a flipped word list to speed up the searching of words + if (is_null($this->wordsFlipped)) { + $this->wordsFlipped = array_flip($this->words); + } + + if (!isset($this->wordsFlipped[$word])) { + throw new \Exception(__CLASS__ . " does not contain word [{$word}]"); + } + + return $this->wordsFlipped[$word]; + } + + protected $words = [ + "的", + "一", + "是", + "在", + "不", + "了", + "有", + "和", + "人", + "这", + "中", + "大", + "为", + "上", + "个", + "国", + "我", + "以", + "要", + "他", + "时", + "来", + "用", + "们", + "生", + "到", + "作", + "地", + "于", + "出", + "就", + "分", + "对", + "成", + "会", + "可", + "主", + "发", + "年", + "动", + "同", + "工", + "也", + "能", + "下", + "过", + "子", + "说", + "产", + "种", + "面", + "而", + "方", + "后", + "多", + "定", + "行", + "学", + "法", + "所", + "民", + "得", + "经", + "十", + "三", + "之", + "进", + "着", + "等", + "部", + "度", + "家", + "电", + "力", + "里", + "如", + "水", + "化", + "高", + "自", + "二", + "理", + "起", + "小", + "物", + "现", + "实", + "加", + "量", + "都", + "两", + "体", + "制", + "机", + "当", + "使", + "点", + "从", + "业", + "本", + "去", + "把", + "性", + "好", + "应", + "开", + "它", + "合", + "还", + "因", + "由", + "其", + "些", + "然", + "前", + "外", + "天", + "政", + "四", + "日", + "那", + "社", + "义", + "事", + "平", + "形", + "相", + "全", + "表", + "间", + "样", + "与", + "关", + "各", + "重", + "新", + "线", + "内", + "数", + "正", + "心", + "反", + "你", + "明", + "看", + "原", + "又", + "么", + "利", + "比", + "或", + "但", + "质", + "气", + "第", + "向", + "道", + "命", + "此", + "变", + "条", + "只", + "没", + "结", + "解", + "问", + "意", + "建", + "月", + "公", + "无", + "系", + "军", + "很", + "情", + "者", + "最", + "立", + "代", + "想", + "已", + "通", + "并", + "提", + "直", + "题", + "党", + "程", + "展", + "五", + "果", + "料", + "象", + "员", + "革", + "位", + "入", + "常", + "文", + "总", + "次", + "品", + "式", + "活", + "设", + "及", + "管", + "特", + "件", + "长", + "求", + "老", + "头", + "基", + "资", + "边", + "流", + "路", + "级", + "少", + "图", + "山", + "统", + "接", + "知", + "较", + "将", + "组", + "见", + "计", + "别", + "她", + "手", + "角", + "期", + "根", + "论", + "运", + "农", + "指", + "几", + "九", + "区", + "强", + "放", + "决", + "西", + "被", + "干", + "做", + "必", + "战", + "先", + "回", + "则", + "任", + "取", + "据", + "处", + "队", + "南", + "给", + "色", + "光", + "门", + "即", + "保", + "治", + "北", + "造", + "百", + "规", + "热", + "领", + "七", + "海", + "口", + "东", + "导", + "器", + "压", + "志", + "世", + "金", + "增", + "争", + "济", + "阶", + "油", + "思", + "术", + "极", + "交", + "受", + "联", + "什", + "认", + "六", + "共", + "权", + "收", + "证", + "改", + "清", + "美", + "再", + "采", + "转", + "更", + "单", + "风", + "切", + "打", + "白", + "教", + "速", + "花", + "带", + "安", + "场", + "身", + "车", + "例", + "真", + "务", + "具", + "万", + "每", + "目", + "至", + "达", + "走", + "积", + "示", + "议", + "声", + "报", + "斗", + "完", + "类", + "八", + "离", + "华", + "名", + "确", + "才", + "科", + "张", + "信", + "马", + "节", + "话", + "米", + "整", + "空", + "元", + "况", + "今", + "集", + "温", + "传", + "土", + "许", + "步", + "群", + "广", + "石", + "记", + "需", + "段", + "研", + "界", + "拉", + "林", + "律", + "叫", + "且", + "究", + "观", + "越", + "织", + "装", + "影", + "算", + "低", + "持", + "音", + "众", + "书", + "布", + "复", + "容", + "儿", + "须", + "际", + "商", + "非", + "验", + "连", + "断", + "深", + "难", + "近", + "矿", + "千", + "周", + "委", + "素", + "技", + "备", + "半", + "办", + "青", + "省", + "列", + "习", + "响", + "约", + "支", + "般", + "史", + "感", + "劳", + "便", + "团", + "往", + "酸", + "历", + "市", + "克", + "何", + "除", + "消", + "构", + "府", + "称", + "太", + "准", + "精", + "值", + "号", + "率", + "族", + "维", + "划", + "选", + "标", + "写", + "存", + "候", + "毛", + "亲", + "快", + "效", + "斯", + "院", + "查", + "江", + "型", + "眼", + "王", + "按", + "格", + "养", + "易", + "置", + "派", + "层", + "片", + "始", + "却", + "专", + "状", + "育", + "厂", + "京", + "识", + "适", + "属", + "圆", + "包", + "火", + "住", + "调", + "满", + "县", + "局", + "照", + "参", + "红", + "细", + "引", + "听", + "该", + "铁", + "价", + "严", + "首", + "底", + "液", + "官", + "德", + "随", + "病", + "苏", + "失", + "尔", + "死", + "讲", + "配", + "女", + "黄", + "推", + "显", + "谈", + "罪", + "神", + "艺", + "呢", + "席", + "含", + "企", + "望", + "密", + "批", + "营", + "项", + "防", + "举", + "球", + "英", + "氧", + "势", + "告", + "李", + "台", + "落", + "木", + "帮", + "轮", + "破", + "亚", + "师", + "围", + "注", + "远", + "字", + "材", + "排", + "供", + "河", + "态", + "封", + "另", + "施", + "减", + "树", + "溶", + "怎", + "止", + "案", + "言", + "士", + "均", + "武", + "固", + "叶", + "鱼", + "波", + "视", + "仅", + "费", + "紧", + "爱", + "左", + "章", + "早", + "朝", + "害", + "续", + "轻", + "服", + "试", + "食", + "充", + "兵", + "源", + "判", + "护", + "司", + "足", + "某", + "练", + "差", + "致", + "板", + "田", + "降", + "黑", + "犯", + "负", + "击", + "范", + "继", + "兴", + "似", + "余", + "坚", + "曲", + "输", + "修", + "故", + "城", + "夫", + "够", + "送", + "笔", + "船", + "占", + "右", + "财", + "吃", + "富", + "春", + "职", + "觉", + "汉", + "画", + "功", + "巴", + "跟", + "虽", + "杂", + "飞", + "检", + "吸", + "助", + "升", + "阳", + "互", + "初", + "创", + "抗", + "考", + "投", + "坏", + "策", + "古", + "径", + "换", + "未", + "跑", + "留", + "钢", + "曾", + "端", + "责", + "站", + "简", + "述", + "钱", + "副", + "尽", + "帝", + "射", + "草", + "冲", + "承", + "独", + "令", + "限", + "阿", + "宣", + "环", + "双", + "请", + "超", + "微", + "让", + "控", + "州", + "良", + "轴", + "找", + "否", + "纪", + "益", + "依", + "优", + "顶", + "础", + "载", + "倒", + "房", + "突", + "坐", + "粉", + "敌", + "略", + "客", + "袁", + "冷", + "胜", + "绝", + "析", + "块", + "剂", + "测", + "丝", + "协", + "诉", + "念", + "陈", + "仍", + "罗", + "盐", + "友", + "洋", + "错", + "苦", + "夜", + "刑", + "移", + "频", + "逐", + "靠", + "混", + "母", + "短", + "皮", + "终", + "聚", + "汽", + "村", + "云", + "哪", + "既", + "距", + "卫", + "停", + "烈", + "央", + "察", + "烧", + "迅", + "境", + "若", + "印", + "洲", + "刻", + "括", + "激", + "孔", + "搞", + "甚", + "室", + "待", + "核", + "校", + "散", + "侵", + "吧", + "甲", + "游", + "久", + "菜", + "味", + "旧", + "模", + "湖", + "货", + "损", + "预", + "阻", + "毫", + "普", + "稳", + "乙", + "妈", + "植", + "息", + "扩", + "银", + "语", + "挥", + "酒", + "守", + "拿", + "序", + "纸", + "医", + "缺", + "雨", + "吗", + "针", + "刘", + "啊", + "急", + "唱", + "误", + "训", + "愿", + "审", + "附", + "获", + "茶", + "鲜", + "粮", + "斤", + "孩", + "脱", + "硫", + "肥", + "善", + "龙", + "演", + "父", + "渐", + "血", + "欢", + "械", + "掌", + "歌", + "沙", + "刚", + "攻", + "谓", + "盾", + "讨", + "晚", + "粒", + "乱", + "燃", + "矛", + "乎", + "杀", + "药", + "宁", + "鲁", + "贵", + "钟", + "煤", + "读", + "班", + "伯", + "香", + "介", + "迫", + "句", + "丰", + "培", + "握", + "兰", + "担", + "弦", + "蛋", + "沉", + "假", + "穿", + "执", + "答", + "乐", + "谁", + "顺", + "烟", + "缩", + "征", + "脸", + "喜", + "松", + "脚", + "困", + "异", + "免", + "背", + "星", + "福", + "买", + "染", + "井", + "概", + "慢", + "怕", + "磁", + "倍", + "祖", + "皇", + "促", + "静", + "补", + "评", + "翻", + "肉", + "践", + "尼", + "衣", + "宽", + "扬", + "棉", + "希", + "伤", + "操", + "垂", + "秋", + "宜", + "氢", + "套", + "督", + "振", + "架", + "亮", + "末", + "宪", + "庆", + "编", + "牛", + "触", + "映", + "雷", + "销", + "诗", + "座", + "居", + "抓", + "裂", + "胞", + "呼", + "娘", + "景", + "威", + "绿", + "晶", + "厚", + "盟", + "衡", + "鸡", + "孙", + "延", + "危", + "胶", + "屋", + "乡", + "临", + "陆", + "顾", + "掉", + "呀", + "灯", + "岁", + "措", + "束", + "耐", + "剧", + "玉", + "赵", + "跳", + "哥", + "季", + "课", + "凯", + "胡", + "额", + "款", + "绍", + "卷", + "齐", + "伟", + "蒸", + "殖", + "永", + "宗", + "苗", + "川", + "炉", + "岩", + "弱", + "零", + "杨", + "奏", + "沿", + "露", + "杆", + "探", + "滑", + "镇", + "饭", + "浓", + "航", + "怀", + "赶", + "库", + "夺", + "伊", + "灵", + "税", + "途", + "灭", + "赛", + "归", + "召", + "鼓", + "播", + "盘", + "裁", + "险", + "康", + "唯", + "录", + "菌", + "纯", + "借", + "糖", + "盖", + "横", + "符", + "私", + "努", + "堂", + "域", + "枪", + "润", + "幅", + "哈", + "竟", + "熟", + "虫", + "泽", + "脑", + "壤", + "碳", + "欧", + "遍", + "侧", + "寨", + "敢", + "彻", + "虑", + "斜", + "薄", + "庭", + "纳", + "弹", + "饲", + "伸", + "折", + "麦", + "湿", + "暗", + "荷", + "瓦", + "塞", + "床", + "筑", + "恶", + "户", + "访", + "塔", + "奇", + "透", + "梁", + "刀", + "旋", + "迹", + "卡", + "氯", + "遇", + "份", + "毒", + "泥", + "退", + "洗", + "摆", + "灰", + "彩", + "卖", + "耗", + "夏", + "择", + "忙", + "铜", + "献", + "硬", + "予", + "繁", + "圈", + "雪", + "函", + "亦", + "抽", + "篇", + "阵", + "阴", + "丁", + "尺", + "追", + "堆", + "雄", + "迎", + "泛", + "爸", + "楼", + "避", + "谋", + "吨", + "野", + "猪", + "旗", + "累", + "偏", + "典", + "馆", + "索", + "秦", + "脂", + "潮", + "爷", + "豆", + "忽", + "托", + "惊", + "塑", + "遗", + "愈", + "朱", + "替", + "纤", + "粗", + "倾", + "尚", + "痛", + "楚", + "谢", + "奋", + "购", + "磨", + "君", + "池", + "旁", + "碎", + "骨", + "监", + "捕", + "弟", + "暴", + "割", + "贯", + "殊", + "释", + "词", + "亡", + "壁", + "顿", + "宝", + "午", + "尘", + "闻", + "揭", + "炮", + "残", + "冬", + "桥", + "妇", + "警", + "综", + "招", + "吴", + "付", + "浮", + "遭", + "徐", + "您", + "摇", + "谷", + "赞", + "箱", + "隔", + "订", + "男", + "吹", + "园", + "纷", + "唐", + "败", + "宋", + "玻", + "巨", + "耕", + "坦", + "荣", + "闭", + "湾", + "键", + "凡", + "驻", + "锅", + "救", + "恩", + "剥", + "凝", + "碱", + "齿", + "截", + "炼", + "麻", + "纺", + "禁", + "废", + "盛", + "版", + "缓", + "净", + "睛", + "昌", + "婚", + "涉", + "筒", + "嘴", + "插", + "岸", + "朗", + "庄", + "街", + "藏", + "姑", + "贸", + "腐", + "奴", + "啦", + "惯", + "乘", + "伙", + "恢", + "匀", + "纱", + "扎", + "辩", + "耳", + "彪", + "臣", + "亿", + "璃", + "抵", + "脉", + "秀", + "萨", + "俄", + "网", + "舞", + "店", + "喷", + "纵", + "寸", + "汗", + "挂", + "洪", + "贺", + "闪", + "柬", + "爆", + "烯", + "津", + "稻", + "墙", + "软", + "勇", + "像", + "滚", + "厘", + "蒙", + "芳", + "肯", + "坡", + "柱", + "荡", + "腿", + "仪", + "旅", + "尾", + "轧", + "冰", + "贡", + "登", + "黎", + "削", + "钻", + "勒", + "逃", + "障", + "氨", + "郭", + "峰", + "币", + "港", + "伏", + "轨", + "亩", + "毕", + "擦", + "莫", + "刺", + "浪", + "秘", + "援", + "株", + "健", + "售", + "股", + "岛", + "甘", + "泡", + "睡", + "童", + "铸", + "汤", + "阀", + "休", + "汇", + "舍", + "牧", + "绕", + "炸", + "哲", + "磷", + "绩", + "朋", + "淡", + "尖", + "启", + "陷", + "柴", + "呈", + "徒", + "颜", + "泪", + "稍", + "忘", + "泵", + "蓝", + "拖", + "洞", + "授", + "镜", + "辛", + "壮", + "锋", + "贫", + "虚", + "弯", + "摩", + "泰", + "幼", + "廷", + "尊", + "窗", + "纲", + "弄", + "隶", + "疑", + "氏", + "宫", + "姐", + "震", + "瑞", + "怪", + "尤", + "琴", + "循", + "描", + "膜", + "违", + "夹", + "腰", + "缘", + "珠", + "穷", + "森", + "枝", + "竹", + "沟", + "催", + "绳", + "忆", + "邦", + "剩", + "幸", + "浆", + "栏", + "拥", + "牙", + "贮", + "礼", + "滤", + "钠", + "纹", + "罢", + "拍", + "咱", + "喊", + "袖", + "埃", + "勤", + "罚", + "焦", + "潜", + "伍", + "墨", + "欲", + "缝", + "姓", + "刊", + "饱", + "仿", + "奖", + "铝", + "鬼", + "丽", + "跨", + "默", + "挖", + "链", + "扫", + "喝", + "袋", + "炭", + "污", + "幕", + "诸", + "弧", + "励", + "梅", + "奶", + "洁", + "灾", + "舟", + "鉴", + "苯", + "讼", + "抱", + "毁", + "懂", + "寒", + "智", + "埔", + "寄", + "届", + "跃", + "渡", + "挑", + "丹", + "艰", + "贝", + "碰", + "拔", + "爹", + "戴", + "码", + "梦", + "芽", + "熔", + "赤", + "渔", + "哭", + "敬", + "颗", + "奔", + "铅", + "仲", + "虎", + "稀", + "妹", + "乏", + "珍", + "申", + "桌", + "遵", + "允", + "隆", + "螺", + "仓", + "魏", + "锐", + "晓", + "氮", + "兼", + "隐", + "碍", + "赫", + "拨", + "忠", + "肃", + "缸", + "牵", + "抢", + "博", + "巧", + "壳", + "兄", + "杜", + "讯", + "诚", + "碧", + "祥", + "柯", + "页", + "巡", + "矩", + "悲", + "灌", + "龄", + "伦", + "票", + "寻", + "桂", + "铺", + "圣", + "恐", + "恰", + "郑", + "趣", + "抬", + "荒", + "腾", + "贴", + "柔", + "滴", + "猛", + "阔", + "辆", + "妻", + "填", + "撤", + "储", + "签", + "闹", + "扰", + "紫", + "砂", + "递", + "戏", + "吊", + "陶", + "伐", + "喂", + "疗", + "瓶", + "婆", + "抚", + "臂", + "摸", + "忍", + "虾", + "蜡", + "邻", + "胸", + "巩", + "挤", + "偶", + "弃", + "槽", + "劲", + "乳", + "邓", + "吉", + "仁", + "烂", + "砖", + "租", + "乌", + "舰", + "伴", + "瓜", + "浅", + "丙", + "暂", + "燥", + "橡", + "柳", + "迷", + "暖", + "牌", + "秧", + "胆", + "详", + "簧", + "踏", + "瓷", + "谱", + "呆", + "宾", + "糊", + "洛", + "辉", + "愤", + "竞", + "隙", + "怒", + "粘", + "乃", + "绪", + "肩", + "籍", + "敏", + "涂", + "熙", + "皆", + "侦", + "悬", + "掘", + "享", + "纠", + "醒", + "狂", + "锁", + "淀", + "恨", + "牲", + "霸", + "爬", + "赏", + "逆", + "玩", + "陵", + "祝", + "秒", + "浙", + "貌", + "役", + "彼", + "悉", + "鸭", + "趋", + "凤", + "晨", + "畜", + "辈", + "秩", + "卵", + "署", + "梯", + "炎", + "滩", + "棋", + "驱", + "筛", + "峡", + "冒", + "啥", + "寿", + "译", + "浸", + "泉", + "帽", + "迟", + "硅", + "疆", + "贷", + "漏", + "稿", + "冠", + "嫩", + "胁", + "芯", + "牢", + "叛", + "蚀", + "奥", + "鸣", + "岭", + "羊", + "凭", + "串", + "塘", + "绘", + "酵", + "融", + "盆", + "锡", + "庙", + "筹", + "冻", + "辅", + "摄", + "袭", + "筋", + "拒", + "僚", + "旱", + "钾", + "鸟", + "漆", + "沈", + "眉", + "疏", + "添", + "棒", + "穗", + "硝", + "韩", + "逼", + "扭", + "侨", + "凉", + "挺", + "碗", + "栽", + "炒", + "杯", + "患", + "馏", + "劝", + "豪", + "辽", + "勃", + "鸿", + "旦", + "吏", + "拜", + "狗", + "埋", + "辊", + "掩", + "饮", + "搬", + "骂", + "辞", + "勾", + "扣", + "估", + "蒋", + "绒", + "雾", + "丈", + "朵", + "姆", + "拟", + "宇", + "辑", + "陕", + "雕", + "偿", + "蓄", + "崇", + "剪", + "倡", + "厅", + "咬", + "驶", + "薯", + "刷", + "斥", + "番", + "赋", + "奉", + "佛", + "浇", + "漫", + "曼", + "扇", + "钙", + "桃", + "扶", + "仔", + "返", + "俗", + "亏", + "腔", + "鞋", + "棱", + "覆", + "框", + "悄", + "叔", + "撞", + "骗", + "勘", + "旺", + "沸", + "孤", + "吐", + "孟", + "渠", + "屈", + "疾", + "妙", + "惜", + "仰", + "狠", + "胀", + "谐", + "抛", + "霉", + "桑", + "岗", + "嘛", + "衰", + "盗", + "渗", + "脏", + "赖", + "涌", + "甜", + "曹", + "阅", + "肌", + "哩", + "厉", + "烃", + "纬", + "毅", + "昨", + "伪", + "症", + "煮", + "叹", + "钉", + "搭", + "茎", + "笼", + "酷", + "偷", + "弓", + "锥", + "恒", + "杰", + "坑", + "鼻", + "翼", + "纶", + "叙", + "狱", + "逮", + "罐", + "络", + "棚", + "抑", + "膨", + "蔬", + "寺", + "骤", + "穆", + "冶", + "枯", + "册", + "尸", + "凸", + "绅", + "坯", + "牺", + "焰", + "轰", + "欣", + "晋", + "瘦", + "御", + "锭", + "锦", + "丧", + "旬", + "锻", + "垄", + "搜", + "扑", + "邀", + "亭", + "酯", + "迈", + "舒", + "脆", + "酶", + "闲", + "忧", + "酚", + "顽", + "羽", + "涨", + "卸", + "仗", + "陪", + "辟", + "惩", + "杭", + "姚", + "肚", + "捉", + "飘", + "漂", + "昆", + "欺", + "吾", + "郎", + "烷", + "汁", + "呵", + "饰", + "萧", + "雅", + "邮", + "迁", + "燕", + "撒", + "姻", + "赴", + "宴", + "烦", + "债", + "帐", + "斑", + "铃", + "旨", + "醇", + "董", + "饼", + "雏", + "姿", + "拌", + "傅", + "腹", + "妥", + "揉", + "贤", + "拆", + "歪", + "葡", + "胺", + "丢", + "浩", + "徽", + "昂", + "垫", + "挡", + "览", + "贪", + "慰", + "缴", + "汪", + "慌", + "冯", + "诺", + "姜", + "谊", + "凶", + "劣", + "诬", + "耀", + "昏", + "躺", + "盈", + "骑", + "乔", + "溪", + "丛", + "卢", + "抹", + "闷", + "咨", + "刮", + "驾", + "缆", + "悟", + "摘", + "铒", + "掷", + "颇", + "幻", + "柄", + "惠", + "惨", + "佳", + "仇", + "腊", + "窝", + "涤", + "剑", + "瞧", + "堡", + "泼", + "葱", + "罩", + "霍", + "捞", + "胎", + "苍", + "滨", + "俩", + "捅", + "湘", + "砍", + "霞", + "邵", + "萄", + "疯", + "淮", + "遂", + "熊", + "粪", + "烘", + "宿", + "档", + "戈", + "驳", + "嫂", + "裕", + "徙", + "箭", + "捐", + "肠", + "撑", + "晒", + "辨", + "殿", + "莲", + "摊", + "搅", + "酱", + "屏", + "疫", + "哀", + "蔡", + "堵", + "沫", + "皱", + "畅", + "叠", + "阁", + "莱", + "敲", + "辖", + "钩", + "痕", + "坝", + "巷", + "饿", + "祸", + "丘", + "玄", + "溜", + "曰", + "逻", + "彭", + "尝", + "卿", + "妨", + "艇", + "吞", + "韦", + "怨", + "矮", + "歇" + ]; +} diff --git a/src/Wordlist/BIP39ChineseTraditionalWordList.php b/src/Wordlist/BIP39ChineseTraditionalWordList.php new file mode 100644 index 0000000..1b5086f --- /dev/null +++ b/src/Wordlist/BIP39ChineseTraditionalWordList.php @@ -0,0 +1,2104 @@ + + */ + +namespace Web3p\EthereumWallet\Wordlist; + +use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface; +use BitWasp\Bitcoin\Mnemonic\WordList; + +class BIP39ChineseTraditionalWordList extends WordList implements Bip39WordListInterface +{ + + protected $wordsFlipped; + + public function count(): int + { + return count($this->getWords()); + } + + public function getWords(): array + { + return $this->words; + } + + public function getWord(int $idx): string + { + if (!isset($this->words)) { + throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); + } + + return $this->words[$idx]; + } + + public function getIndex(string $word): int + { + // create a flipped word list to speed up the searching of words + if (is_null($this->wordsFlipped)) { + $this->wordsFlipped = array_flip($this->words); + } + + if (!isset($this->wordsFlipped[$word])) { + throw new \Exception(__CLASS__ . " does not contain word [{$word}]"); + } + + return $this->wordsFlipped[$word]; + } + + protected $words = [ + "的", + "一", + "是", + "在", + "不", + "了", + "有", + "和", + "人", + "這", + "中", + "大", + "為", + "上", + "個", + "國", + "我", + "以", + "要", + "他", + "時", + "來", + "用", + "們", + "生", + "到", + "作", + "地", + "於", + "出", + "就", + "分", + "對", + "成", + "會", + "可", + "主", + "發", + "年", + "動", + "同", + "工", + "也", + "能", + "下", + "過", + "子", + "說", + "產", + "種", + "面", + "而", + "方", + "後", + "多", + "定", + "行", + "學", + "法", + "所", + "民", + "得", + "經", + "十", + "三", + "之", + "進", + "著", + "等", + "部", + "度", + "家", + "電", + "力", + "裡", + "如", + "水", + "化", + "高", + "自", + "二", + "理", + "起", + "小", + "物", + "現", + "實", + "加", + "量", + "都", + "兩", + "體", + "制", + "機", + "當", + "使", + "點", + "從", + "業", + "本", + "去", + "把", + "性", + "好", + "應", + "開", + "它", + "合", + "還", + "因", + "由", + "其", + "些", + "然", + "前", + "外", + "天", + "政", + "四", + "日", + "那", + "社", + "義", + "事", + "平", + "形", + "相", + "全", + "表", + "間", + "樣", + "與", + "關", + "各", + "重", + "新", + "線", + "內", + "數", + "正", + "心", + "反", + "你", + "明", + "看", + "原", + "又", + "麼", + "利", + "比", + "或", + "但", + "質", + "氣", + "第", + "向", + "道", + "命", + "此", + "變", + "條", + "只", + "沒", + "結", + "解", + "問", + "意", + "建", + "月", + "公", + "無", + "系", + "軍", + "很", + "情", + "者", + "最", + "立", + "代", + "想", + "已", + "通", + "並", + "提", + "直", + "題", + "黨", + "程", + "展", + "五", + "果", + "料", + "象", + "員", + "革", + "位", + "入", + "常", + "文", + "總", + "次", + "品", + "式", + "活", + "設", + "及", + "管", + "特", + "件", + "長", + "求", + "老", + "頭", + "基", + "資", + "邊", + "流", + "路", + "級", + "少", + "圖", + "山", + "統", + "接", + "知", + "較", + "將", + "組", + "見", + "計", + "別", + "她", + "手", + "角", + "期", + "根", + "論", + "運", + "農", + "指", + "幾", + "九", + "區", + "強", + "放", + "決", + "西", + "被", + "幹", + "做", + "必", + "戰", + "先", + "回", + "則", + "任", + "取", + "據", + "處", + "隊", + "南", + "給", + "色", + "光", + "門", + "即", + "保", + "治", + "北", + "造", + "百", + "規", + "熱", + "領", + "七", + "海", + "口", + "東", + "導", + "器", + "壓", + "志", + "世", + "金", + "增", + "爭", + "濟", + "階", + "油", + "思", + "術", + "極", + "交", + "受", + "聯", + "什", + "認", + "六", + "共", + "權", + "收", + "證", + "改", + "清", + "美", + "再", + "採", + "轉", + "更", + "單", + "風", + "切", + "打", + "白", + "教", + "速", + "花", + "帶", + "安", + "場", + "身", + "車", + "例", + "真", + "務", + "具", + "萬", + "每", + "目", + "至", + "達", + "走", + "積", + "示", + "議", + "聲", + "報", + "鬥", + "完", + "類", + "八", + "離", + "華", + "名", + "確", + "才", + "科", + "張", + "信", + "馬", + "節", + "話", + "米", + "整", + "空", + "元", + "況", + "今", + "集", + "溫", + "傳", + "土", + "許", + "步", + "群", + "廣", + "石", + "記", + "需", + "段", + "研", + "界", + "拉", + "林", + "律", + "叫", + "且", + "究", + "觀", + "越", + "織", + "裝", + "影", + "算", + "低", + "持", + "音", + "眾", + "書", + "布", + "复", + "容", + "兒", + "須", + "際", + "商", + "非", + "驗", + "連", + "斷", + "深", + "難", + "近", + "礦", + "千", + "週", + "委", + "素", + "技", + "備", + "半", + "辦", + "青", + "省", + "列", + "習", + "響", + "約", + "支", + "般", + "史", + "感", + "勞", + "便", + "團", + "往", + "酸", + "歷", + "市", + "克", + "何", + "除", + "消", + "構", + "府", + "稱", + "太", + "準", + "精", + "值", + "號", + "率", + "族", + "維", + "劃", + "選", + "標", + "寫", + "存", + "候", + "毛", + "親", + "快", + "效", + "斯", + "院", + "查", + "江", + "型", + "眼", + "王", + "按", + "格", + "養", + "易", + "置", + "派", + "層", + "片", + "始", + "卻", + "專", + "狀", + "育", + "廠", + "京", + "識", + "適", + "屬", + "圓", + "包", + "火", + "住", + "調", + "滿", + "縣", + "局", + "照", + "參", + "紅", + "細", + "引", + "聽", + "該", + "鐵", + "價", + "嚴", + "首", + "底", + "液", + "官", + "德", + "隨", + "病", + "蘇", + "失", + "爾", + "死", + "講", + "配", + "女", + "黃", + "推", + "顯", + "談", + "罪", + "神", + "藝", + "呢", + "席", + "含", + "企", + "望", + "密", + "批", + "營", + "項", + "防", + "舉", + "球", + "英", + "氧", + "勢", + "告", + "李", + "台", + "落", + "木", + "幫", + "輪", + "破", + "亞", + "師", + "圍", + "注", + "遠", + "字", + "材", + "排", + "供", + "河", + "態", + "封", + "另", + "施", + "減", + "樹", + "溶", + "怎", + "止", + "案", + "言", + "士", + "均", + "武", + "固", + "葉", + "魚", + "波", + "視", + "僅", + "費", + "緊", + "愛", + "左", + "章", + "早", + "朝", + "害", + "續", + "輕", + "服", + "試", + "食", + "充", + "兵", + "源", + "判", + "護", + "司", + "足", + "某", + "練", + "差", + "致", + "板", + "田", + "降", + "黑", + "犯", + "負", + "擊", + "范", + "繼", + "興", + "似", + "餘", + "堅", + "曲", + "輸", + "修", + "故", + "城", + "夫", + "夠", + "送", + "筆", + "船", + "佔", + "右", + "財", + "吃", + "富", + "春", + "職", + "覺", + "漢", + "畫", + "功", + "巴", + "跟", + "雖", + "雜", + "飛", + "檢", + "吸", + "助", + "昇", + "陽", + "互", + "初", + "創", + "抗", + "考", + "投", + "壞", + "策", + "古", + "徑", + "換", + "未", + "跑", + "留", + "鋼", + "曾", + "端", + "責", + "站", + "簡", + "述", + "錢", + "副", + "盡", + "帝", + "射", + "草", + "衝", + "承", + "獨", + "令", + "限", + "阿", + "宣", + "環", + "雙", + "請", + "超", + "微", + "讓", + "控", + "州", + "良", + "軸", + "找", + "否", + "紀", + "益", + "依", + "優", + "頂", + "礎", + "載", + "倒", + "房", + "突", + "坐", + "粉", + "敵", + "略", + "客", + "袁", + "冷", + "勝", + "絕", + "析", + "塊", + "劑", + "測", + "絲", + "協", + "訴", + "念", + "陳", + "仍", + "羅", + "鹽", + "友", + "洋", + "錯", + "苦", + "夜", + "刑", + "移", + "頻", + "逐", + "靠", + "混", + "母", + "短", + "皮", + "終", + "聚", + "汽", + "村", + "雲", + "哪", + "既", + "距", + "衛", + "停", + "烈", + "央", + "察", + "燒", + "迅", + "境", + "若", + "印", + "洲", + "刻", + "括", + "激", + "孔", + "搞", + "甚", + "室", + "待", + "核", + "校", + "散", + "侵", + "吧", + "甲", + "遊", + "久", + "菜", + "味", + "舊", + "模", + "湖", + "貨", + "損", + "預", + "阻", + "毫", + "普", + "穩", + "乙", + "媽", + "植", + "息", + "擴", + "銀", + "語", + "揮", + "酒", + "守", + "拿", + "序", + "紙", + "醫", + "缺", + "雨", + "嗎", + "針", + "劉", + "啊", + "急", + "唱", + "誤", + "訓", + "願", + "審", + "附", + "獲", + "茶", + "鮮", + "糧", + "斤", + "孩", + "脫", + "硫", + "肥", + "善", + "龍", + "演", + "父", + "漸", + "血", + "歡", + "械", + "掌", + "歌", + "沙", + "剛", + "攻", + "謂", + "盾", + "討", + "晚", + "粒", + "亂", + "燃", + "矛", + "乎", + "殺", + "藥", + "寧", + "魯", + "貴", + "鐘", + "煤", + "讀", + "班", + "伯", + "香", + "介", + "迫", + "句", + "豐", + "培", + "握", + "蘭", + "擔", + "弦", + "蛋", + "沉", + "假", + "穿", + "執", + "答", + "樂", + "誰", + "順", + "煙", + "縮", + "徵", + "臉", + "喜", + "松", + "腳", + "困", + "異", + "免", + "背", + "星", + "福", + "買", + "染", + "井", + "概", + "慢", + "怕", + "磁", + "倍", + "祖", + "皇", + "促", + "靜", + "補", + "評", + "翻", + "肉", + "踐", + "尼", + "衣", + "寬", + "揚", + "棉", + "希", + "傷", + "操", + "垂", + "秋", + "宜", + "氫", + "套", + "督", + "振", + "架", + "亮", + "末", + "憲", + "慶", + "編", + "牛", + "觸", + "映", + "雷", + "銷", + "詩", + "座", + "居", + "抓", + "裂", + "胞", + "呼", + "娘", + "景", + "威", + "綠", + "晶", + "厚", + "盟", + "衡", + "雞", + "孫", + "延", + "危", + "膠", + "屋", + "鄉", + "臨", + "陸", + "顧", + "掉", + "呀", + "燈", + "歲", + "措", + "束", + "耐", + "劇", + "玉", + "趙", + "跳", + "哥", + "季", + "課", + "凱", + "胡", + "額", + "款", + "紹", + "卷", + "齊", + "偉", + "蒸", + "殖", + "永", + "宗", + "苗", + "川", + "爐", + "岩", + "弱", + "零", + "楊", + "奏", + "沿", + "露", + "桿", + "探", + "滑", + "鎮", + "飯", + "濃", + "航", + "懷", + "趕", + "庫", + "奪", + "伊", + "靈", + "稅", + "途", + "滅", + "賽", + "歸", + "召", + "鼓", + "播", + "盤", + "裁", + "險", + "康", + "唯", + "錄", + "菌", + "純", + "借", + "糖", + "蓋", + "橫", + "符", + "私", + "努", + "堂", + "域", + "槍", + "潤", + "幅", + "哈", + "竟", + "熟", + "蟲", + "澤", + "腦", + "壤", + "碳", + "歐", + "遍", + "側", + "寨", + "敢", + "徹", + "慮", + "斜", + "薄", + "庭", + "納", + "彈", + "飼", + "伸", + "折", + "麥", + "濕", + "暗", + "荷", + "瓦", + "塞", + "床", + "築", + "惡", + "戶", + "訪", + "塔", + "奇", + "透", + "梁", + "刀", + "旋", + "跡", + "卡", + "氯", + "遇", + "份", + "毒", + "泥", + "退", + "洗", + "擺", + "灰", + "彩", + "賣", + "耗", + "夏", + "擇", + "忙", + "銅", + "獻", + "硬", + "予", + "繁", + "圈", + "雪", + "函", + "亦", + "抽", + "篇", + "陣", + "陰", + "丁", + "尺", + "追", + "堆", + "雄", + "迎", + "泛", + "爸", + "樓", + "避", + "謀", + "噸", + "野", + "豬", + "旗", + "累", + "偏", + "典", + "館", + "索", + "秦", + "脂", + "潮", + "爺", + "豆", + "忽", + "托", + "驚", + "塑", + "遺", + "愈", + "朱", + "替", + "纖", + "粗", + "傾", + "尚", + "痛", + "楚", + "謝", + "奮", + "購", + "磨", + "君", + "池", + "旁", + "碎", + "骨", + "監", + "捕", + "弟", + "暴", + "割", + "貫", + "殊", + "釋", + "詞", + "亡", + "壁", + "頓", + "寶", + "午", + "塵", + "聞", + "揭", + "炮", + "殘", + "冬", + "橋", + "婦", + "警", + "綜", + "招", + "吳", + "付", + "浮", + "遭", + "徐", + "您", + "搖", + "谷", + "贊", + "箱", + "隔", + "訂", + "男", + "吹", + "園", + "紛", + "唐", + "敗", + "宋", + "玻", + "巨", + "耕", + "坦", + "榮", + "閉", + "灣", + "鍵", + "凡", + "駐", + "鍋", + "救", + "恩", + "剝", + "凝", + "鹼", + "齒", + "截", + "煉", + "麻", + "紡", + "禁", + "廢", + "盛", + "版", + "緩", + "淨", + "睛", + "昌", + "婚", + "涉", + "筒", + "嘴", + "插", + "岸", + "朗", + "莊", + "街", + "藏", + "姑", + "貿", + "腐", + "奴", + "啦", + "慣", + "乘", + "夥", + "恢", + "勻", + "紗", + "扎", + "辯", + "耳", + "彪", + "臣", + "億", + "璃", + "抵", + "脈", + "秀", + "薩", + "俄", + "網", + "舞", + "店", + "噴", + "縱", + "寸", + "汗", + "掛", + "洪", + "賀", + "閃", + "柬", + "爆", + "烯", + "津", + "稻", + "牆", + "軟", + "勇", + "像", + "滾", + "厘", + "蒙", + "芳", + "肯", + "坡", + "柱", + "盪", + "腿", + "儀", + "旅", + "尾", + "軋", + "冰", + "貢", + "登", + "黎", + "削", + "鑽", + "勒", + "逃", + "障", + "氨", + "郭", + "峰", + "幣", + "港", + "伏", + "軌", + "畝", + "畢", + "擦", + "莫", + "刺", + "浪", + "秘", + "援", + "株", + "健", + "售", + "股", + "島", + "甘", + "泡", + "睡", + "童", + "鑄", + "湯", + "閥", + "休", + "匯", + "舍", + "牧", + "繞", + "炸", + "哲", + "磷", + "績", + "朋", + "淡", + "尖", + "啟", + "陷", + "柴", + "呈", + "徒", + "顏", + "淚", + "稍", + "忘", + "泵", + "藍", + "拖", + "洞", + "授", + "鏡", + "辛", + "壯", + "鋒", + "貧", + "虛", + "彎", + "摩", + "泰", + "幼", + "廷", + "尊", + "窗", + "綱", + "弄", + "隸", + "疑", + "氏", + "宮", + "姐", + "震", + "瑞", + "怪", + "尤", + "琴", + "循", + "描", + "膜", + "違", + "夾", + "腰", + "緣", + "珠", + "窮", + "森", + "枝", + "竹", + "溝", + "催", + "繩", + "憶", + "邦", + "剩", + "幸", + "漿", + "欄", + "擁", + "牙", + "貯", + "禮", + "濾", + "鈉", + "紋", + "罷", + "拍", + "咱", + "喊", + "袖", + "埃", + "勤", + "罰", + "焦", + "潛", + "伍", + "墨", + "欲", + "縫", + "姓", + "刊", + "飽", + "仿", + "獎", + "鋁", + "鬼", + "麗", + "跨", + "默", + "挖", + "鏈", + "掃", + "喝", + "袋", + "炭", + "污", + "幕", + "諸", + "弧", + "勵", + "梅", + "奶", + "潔", + "災", + "舟", + "鑑", + "苯", + "訟", + "抱", + "毀", + "懂", + "寒", + "智", + "埔", + "寄", + "屆", + "躍", + "渡", + "挑", + "丹", + "艱", + "貝", + "碰", + "拔", + "爹", + "戴", + "碼", + "夢", + "芽", + "熔", + "赤", + "漁", + "哭", + "敬", + "顆", + "奔", + "鉛", + "仲", + "虎", + "稀", + "妹", + "乏", + "珍", + "申", + "桌", + "遵", + "允", + "隆", + "螺", + "倉", + "魏", + "銳", + "曉", + "氮", + "兼", + "隱", + "礙", + "赫", + "撥", + "忠", + "肅", + "缸", + "牽", + "搶", + "博", + "巧", + "殼", + "兄", + "杜", + "訊", + "誠", + "碧", + "祥", + "柯", + "頁", + "巡", + "矩", + "悲", + "灌", + "齡", + "倫", + "票", + "尋", + "桂", + "鋪", + "聖", + "恐", + "恰", + "鄭", + "趣", + "抬", + "荒", + "騰", + "貼", + "柔", + "滴", + "猛", + "闊", + "輛", + "妻", + "填", + "撤", + "儲", + "簽", + "鬧", + "擾", + "紫", + "砂", + "遞", + "戲", + "吊", + "陶", + "伐", + "餵", + "療", + "瓶", + "婆", + "撫", + "臂", + "摸", + "忍", + "蝦", + "蠟", + "鄰", + "胸", + "鞏", + "擠", + "偶", + "棄", + "槽", + "勁", + "乳", + "鄧", + "吉", + "仁", + "爛", + "磚", + "租", + "烏", + "艦", + "伴", + "瓜", + "淺", + "丙", + "暫", + "燥", + "橡", + "柳", + "迷", + "暖", + "牌", + "秧", + "膽", + "詳", + "簧", + "踏", + "瓷", + "譜", + "呆", + "賓", + "糊", + "洛", + "輝", + "憤", + "競", + "隙", + "怒", + "粘", + "乃", + "緒", + "肩", + "籍", + "敏", + "塗", + "熙", + "皆", + "偵", + "懸", + "掘", + "享", + "糾", + "醒", + "狂", + "鎖", + "淀", + "恨", + "牲", + "霸", + "爬", + "賞", + "逆", + "玩", + "陵", + "祝", + "秒", + "浙", + "貌", + "役", + "彼", + "悉", + "鴨", + "趨", + "鳳", + "晨", + "畜", + "輩", + "秩", + "卵", + "署", + "梯", + "炎", + "灘", + "棋", + "驅", + "篩", + "峽", + "冒", + "啥", + "壽", + "譯", + "浸", + "泉", + "帽", + "遲", + "矽", + "疆", + "貸", + "漏", + "稿", + "冠", + "嫩", + "脅", + "芯", + "牢", + "叛", + "蝕", + "奧", + "鳴", + "嶺", + "羊", + "憑", + "串", + "塘", + "繪", + "酵", + "融", + "盆", + "錫", + "廟", + "籌", + "凍", + "輔", + "攝", + "襲", + "筋", + "拒", + "僚", + "旱", + "鉀", + "鳥", + "漆", + "沈", + "眉", + "疏", + "添", + "棒", + "穗", + "硝", + "韓", + "逼", + "扭", + "僑", + "涼", + "挺", + "碗", + "栽", + "炒", + "杯", + "患", + "餾", + "勸", + "豪", + "遼", + "勃", + "鴻", + "旦", + "吏", + "拜", + "狗", + "埋", + "輥", + "掩", + "飲", + "搬", + "罵", + "辭", + "勾", + "扣", + "估", + "蔣", + "絨", + "霧", + "丈", + "朵", + "姆", + "擬", + "宇", + "輯", + "陝", + "雕", + "償", + "蓄", + "崇", + "剪", + "倡", + "廳", + "咬", + "駛", + "薯", + "刷", + "斥", + "番", + "賦", + "奉", + "佛", + "澆", + "漫", + "曼", + "扇", + "鈣", + "桃", + "扶", + "仔", + "返", + "俗", + "虧", + "腔", + "鞋", + "棱", + "覆", + "框", + "悄", + "叔", + "撞", + "騙", + "勘", + "旺", + "沸", + "孤", + "吐", + "孟", + "渠", + "屈", + "疾", + "妙", + "惜", + "仰", + "狠", + "脹", + "諧", + "拋", + "黴", + "桑", + "崗", + "嘛", + "衰", + "盜", + "滲", + "臟", + "賴", + "湧", + "甜", + "曹", + "閱", + "肌", + "哩", + "厲", + "烴", + "緯", + "毅", + "昨", + "偽", + "症", + "煮", + "嘆", + "釘", + "搭", + "莖", + "籠", + "酷", + "偷", + "弓", + "錐", + "恆", + "傑", + "坑", + "鼻", + "翼", + "綸", + "敘", + "獄", + "逮", + "罐", + "絡", + "棚", + "抑", + "膨", + "蔬", + "寺", + "驟", + "穆", + "冶", + "枯", + "冊", + "屍", + "凸", + "紳", + "坯", + "犧", + "焰", + "轟", + "欣", + "晉", + "瘦", + "禦", + "錠", + "錦", + "喪", + "旬", + "鍛", + "壟", + "搜", + "撲", + "邀", + "亭", + "酯", + "邁", + "舒", + "脆", + "酶", + "閒", + "憂", + "酚", + "頑", + "羽", + "漲", + "卸", + "仗", + "陪", + "闢", + "懲", + "杭", + "姚", + "肚", + "捉", + "飄", + "漂", + "昆", + "欺", + "吾", + "郎", + "烷", + "汁", + "呵", + "飾", + "蕭", + "雅", + "郵", + "遷", + "燕", + "撒", + "姻", + "赴", + "宴", + "煩", + "債", + "帳", + "斑", + "鈴", + "旨", + "醇", + "董", + "餅", + "雛", + "姿", + "拌", + "傅", + "腹", + "妥", + "揉", + "賢", + "拆", + "歪", + "葡", + "胺", + "丟", + "浩", + "徽", + "昂", + "墊", + "擋", + "覽", + "貪", + "慰", + "繳", + "汪", + "慌", + "馮", + "諾", + "姜", + "誼", + "兇", + "劣", + "誣", + "耀", + "昏", + "躺", + "盈", + "騎", + "喬", + "溪", + "叢", + "盧", + "抹", + "悶", + "諮", + "刮", + "駕", + "纜", + "悟", + "摘", + "鉺", + "擲", + "頗", + "幻", + "柄", + "惠", + "慘", + "佳", + "仇", + "臘", + "窩", + "滌", + "劍", + "瞧", + "堡", + "潑", + "蔥", + "罩", + "霍", + "撈", + "胎", + "蒼", + "濱", + "倆", + "捅", + "湘", + "砍", + "霞", + "邵", + "萄", + "瘋", + "淮", + "遂", + "熊", + "糞", + "烘", + "宿", + "檔", + "戈", + "駁", + "嫂", + "裕", + "徙", + "箭", + "捐", + "腸", + "撐", + "曬", + "辨", + "殿", + "蓮", + "攤", + "攪", + "醬", + "屏", + "疫", + "哀", + "蔡", + "堵", + "沫", + "皺", + "暢", + "疊", + "閣", + "萊", + "敲", + "轄", + "鉤", + "痕", + "壩", + "巷", + "餓", + "禍", + "丘", + "玄", + "溜", + "曰", + "邏", + "彭", + "嘗", + "卿", + "妨", + "艇", + "吞", + "韋", + "怨", + "矮", + "歇" + ]; +} From 957f7455580d05f6b98bde651ad9cf8c6cd1f66b Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 09:28:34 +0800 Subject: [PATCH 14/17] Remove .travis.yml --- .travis.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3a4d954..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -sudo: required - -language: php - -php: - - 7.1 - - 7.2 - -install: - - composer install - -notifications: - email: - recipients: - - alk03073135@gmail.com - on_success: always - on_failure: always - -script: - - vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) -t 1e66a134-6b6a-4963-87c9-0b0e693a04d5 \ No newline at end of file From 27e002f155c49d0e84a5149fa1ad3d5eaef3a199 Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 09:36:04 +0800 Subject: [PATCH 15/17] Add codecov --- .github/workflows/php.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 71c95b2..244af7b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -41,4 +41,8 @@ jobs: run: composer install --prefer-dist --no-progress --no-suggest - name: Run test suite - run: vendor/bin/phpunit + run: vendor/bin/phpunit --coverage-clover=coverage.xml + + - uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From f8f5e1f19709281abd1f206851f5f7ae6f914b49 Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 09:50:20 +0800 Subject: [PATCH 16/17] Update README.md --- README.md | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 105 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff48a92..09d7121 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,109 @@ # ethereum-wallet -[![Build Status](https://travis-ci.org/web3p/ethereum-wallet.svg?branch=master)](https://travis-ci.org/web3p/ethereum-wallet) +[![PHP](https://github.com/web3p/ethereum-wallet/actions/workflows/php.yml/badge.svg)](https://github.com/web3p/ethereum-wallet/actions/workflows/php.yml) [![codecov](https://codecov.io/gh/web3p/ethereum-wallet/branch/master/graph/badge.svg)](https://codecov.io/gh/web3p/ethereum-wallet) +[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/web3p/ethereum-wallet/blob/master/LICENSE) Ethereum wallet. + +# Install + +``` +composer require web3p/ethereum-wallet +``` + +# Usage + +Generate a new wallet: + +```php +use Web3p\EthereumWallet\Wallet; + +$wallet = new Wallet(); +$mnemonicLength = 15; +$wallet->generate($mnemonicLength); + +// $wallet->address; +// danger zone, if the data was leaked, money would be stolen +// $wallet->privateKey; +// $wallet->mnemonic; +``` + +Recover wallet from mnemonic: + +```php +use Web3p\EthereumWallet\Wallet; + +$wallet = new Wallet(); +$mnemonic = '..........'; +$wallet->fromMnemonic($mnemonic); + +// $wallet->address; +// danger zone, if the data was leaked, money would be stolen +// $wallet->privateKey; +// $wallet->mnemonic; +``` + +# API + +### Web3p\EthereumWallet\Wallet + +#### setWordlist + +Set different mnemonic wordlist, the default is english. + +`setWordlist(WordList $wordlist)` + +wordList - \BitWasp\Bitcoin\Mnemonic\WordList + +###### Example + +```php +use Web3p\EthereumWallet\Wallet; +use Web3p\EthereumWallet\Wordlist\BIP39ChineseTraditionalWordList; + +$wallet = new Wallet(); +$zh_TW_wordlist = new BIP39ChineseTraditionalWordList; +$wallet->wordlist = $zh_TW_wordlist; +``` + +#### generate + +Returns a new wallet for the given mnemonic length. + +`generate(int $mnemonicLength)` + +mnemonicLength - integer. + +###### Example + +* Generate a new wallet with 12 mnemonic. + +```php +use Web3p\EthereumWallet\Wallet; + +$wallet = new Wallet(); +$wallet->generate(12); +``` + +#### fromMnemonic + +Returns a wallet recover from the mnemonic. + +`fromMnemonic(string $mnemonic)` + +mnemonic - string. + +###### Example + +* Recover from a wallet. + +```php +use Web3p\EthereumWallet\Wallet; + +$wallet = new Wallet(); +$mnemonic = '..........'; +$wallet->fromMnemonic($mnemonic); +``` + +# License +MIT From c6ab461688dd217d648d9927bf4cfc7210347fbe Mon Sep 17 00:00:00 2001 From: sc0vu Date: Fri, 28 Apr 2023 09:57:29 +0800 Subject: [PATCH 17/17] Remove src/wordlist --- .../BIP39ChineseSimplifiedWordList.php | 2104 ----------------- .../BIP39ChineseTraditionalWordList.php | 2104 ----------------- 2 files changed, 4208 deletions(-) delete mode 100644 src/wordlist/BIP39ChineseSimplifiedWordList.php delete mode 100644 src/wordlist/BIP39ChineseTraditionalWordList.php diff --git a/src/wordlist/BIP39ChineseSimplifiedWordList.php b/src/wordlist/BIP39ChineseSimplifiedWordList.php deleted file mode 100644 index a7198da..0000000 --- a/src/wordlist/BIP39ChineseSimplifiedWordList.php +++ /dev/null @@ -1,2104 +0,0 @@ - - */ - -namespace Web3p\EthereumWallet\Wordlist; - -use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface; -use BitWasp\Bitcoin\Mnemonic\WordList; - -class BIP39ChineseSimplifiedWordList extends WordList implements Bip39WordListInterface -{ - - protected $wordsFlipped; - - public function count(): int - { - return count($this->getWords()); - } - - public function getWords(): array - { - return $this->words; - } - - public function getWord(int $idx): string - { - if (!isset($this->words)) { - throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); - } - - return $this->words[$idx]; - } - - public function getIndex(string $word): int - { - // create a flipped word list to speed up the searching of words - if (is_null($this->wordsFlipped)) { - $this->wordsFlipped = array_flip($this->words); - } - - if (!isset($this->wordsFlipped[$word])) { - throw new \Exception(__CLASS__ . " does not contain word [{$word}]"); - } - - return $this->wordsFlipped[$word]; - } - - protected $words = [ - "的", - "一", - "是", - "在", - "不", - "了", - "有", - "和", - "人", - "这", - "中", - "大", - "为", - "上", - "个", - "国", - "我", - "以", - "要", - "他", - "时", - "来", - "用", - "们", - "生", - "到", - "作", - "地", - "于", - "出", - "就", - "分", - "对", - "成", - "会", - "可", - "主", - "发", - "年", - "动", - "同", - "工", - "也", - "能", - "下", - "过", - "子", - "说", - "产", - "种", - "面", - "而", - "方", - "后", - "多", - "定", - "行", - "学", - "法", - "所", - "民", - "得", - "经", - "十", - "三", - "之", - "进", - "着", - "等", - "部", - "度", - "家", - "电", - "力", - "里", - "如", - "水", - "化", - "高", - "自", - "二", - "理", - "起", - "小", - "物", - "现", - "实", - "加", - "量", - "都", - "两", - "体", - "制", - "机", - "当", - "使", - "点", - "从", - "业", - "本", - "去", - "把", - "性", - "好", - "应", - "开", - "它", - "合", - "还", - "因", - "由", - "其", - "些", - "然", - "前", - "外", - "天", - "政", - "四", - "日", - "那", - "社", - "义", - "事", - "平", - "形", - "相", - "全", - "表", - "间", - "样", - "与", - "关", - "各", - "重", - "新", - "线", - "内", - "数", - "正", - "心", - "反", - "你", - "明", - "看", - "原", - "又", - "么", - "利", - "比", - "或", - "但", - "质", - "气", - "第", - "向", - "道", - "命", - "此", - "变", - "条", - "只", - "没", - "结", - "解", - "问", - "意", - "建", - "月", - "公", - "无", - "系", - "军", - "很", - "情", - "者", - "最", - "立", - "代", - "想", - "已", - "通", - "并", - "提", - "直", - "题", - "党", - "程", - "展", - "五", - "果", - "料", - "象", - "员", - "革", - "位", - "入", - "常", - "文", - "总", - "次", - "品", - "式", - "活", - "设", - "及", - "管", - "特", - "件", - "长", - "求", - "老", - "头", - "基", - "资", - "边", - "流", - "路", - "级", - "少", - "图", - "山", - "统", - "接", - "知", - "较", - "将", - "组", - "见", - "计", - "别", - "她", - "手", - "角", - "期", - "根", - "论", - "运", - "农", - "指", - "几", - "九", - "区", - "强", - "放", - "决", - "西", - "被", - "干", - "做", - "必", - "战", - "先", - "回", - "则", - "任", - "取", - "据", - "处", - "队", - "南", - "给", - "色", - "光", - "门", - "即", - "保", - "治", - "北", - "造", - "百", - "规", - "热", - "领", - "七", - "海", - "口", - "东", - "导", - "器", - "压", - "志", - "世", - "金", - "增", - "争", - "济", - "阶", - "油", - "思", - "术", - "极", - "交", - "受", - "联", - "什", - "认", - "六", - "共", - "权", - "收", - "证", - "改", - "清", - "美", - "再", - "采", - "转", - "更", - "单", - "风", - "切", - "打", - "白", - "教", - "速", - "花", - "带", - "安", - "场", - "身", - "车", - "例", - "真", - "务", - "具", - "万", - "每", - "目", - "至", - "达", - "走", - "积", - "示", - "议", - "声", - "报", - "斗", - "完", - "类", - "八", - "离", - "华", - "名", - "确", - "才", - "科", - "张", - "信", - "马", - "节", - "话", - "米", - "整", - "空", - "元", - "况", - "今", - "集", - "温", - "传", - "土", - "许", - "步", - "群", - "广", - "石", - "记", - "需", - "段", - "研", - "界", - "拉", - "林", - "律", - "叫", - "且", - "究", - "观", - "越", - "织", - "装", - "影", - "算", - "低", - "持", - "音", - "众", - "书", - "布", - "复", - "容", - "儿", - "须", - "际", - "商", - "非", - "验", - "连", - "断", - "深", - "难", - "近", - "矿", - "千", - "周", - "委", - "素", - "技", - "备", - "半", - "办", - "青", - "省", - "列", - "习", - "响", - "约", - "支", - "般", - "史", - "感", - "劳", - "便", - "团", - "往", - "酸", - "历", - "市", - "克", - "何", - "除", - "消", - "构", - "府", - "称", - "太", - "准", - "精", - "值", - "号", - "率", - "族", - "维", - "划", - "选", - "标", - "写", - "存", - "候", - "毛", - "亲", - "快", - "效", - "斯", - "院", - "查", - "江", - "型", - "眼", - "王", - "按", - "格", - "养", - "易", - "置", - "派", - "层", - "片", - "始", - "却", - "专", - "状", - "育", - "厂", - "京", - "识", - "适", - "属", - "圆", - "包", - "火", - "住", - "调", - "满", - "县", - "局", - "照", - "参", - "红", - "细", - "引", - "听", - "该", - "铁", - "价", - "严", - "首", - "底", - "液", - "官", - "德", - "随", - "病", - "苏", - "失", - "尔", - "死", - "讲", - "配", - "女", - "黄", - "推", - "显", - "谈", - "罪", - "神", - "艺", - "呢", - "席", - "含", - "企", - "望", - "密", - "批", - "营", - "项", - "防", - "举", - "球", - "英", - "氧", - "势", - "告", - "李", - "台", - "落", - "木", - "帮", - "轮", - "破", - "亚", - "师", - "围", - "注", - "远", - "字", - "材", - "排", - "供", - "河", - "态", - "封", - "另", - "施", - "减", - "树", - "溶", - "怎", - "止", - "案", - "言", - "士", - "均", - "武", - "固", - "叶", - "鱼", - "波", - "视", - "仅", - "费", - "紧", - "爱", - "左", - "章", - "早", - "朝", - "害", - "续", - "轻", - "服", - "试", - "食", - "充", - "兵", - "源", - "判", - "护", - "司", - "足", - "某", - "练", - "差", - "致", - "板", - "田", - "降", - "黑", - "犯", - "负", - "击", - "范", - "继", - "兴", - "似", - "余", - "坚", - "曲", - "输", - "修", - "故", - "城", - "夫", - "够", - "送", - "笔", - "船", - "占", - "右", - "财", - "吃", - "富", - "春", - "职", - "觉", - "汉", - "画", - "功", - "巴", - "跟", - "虽", - "杂", - "飞", - "检", - "吸", - "助", - "升", - "阳", - "互", - "初", - "创", - "抗", - "考", - "投", - "坏", - "策", - "古", - "径", - "换", - "未", - "跑", - "留", - "钢", - "曾", - "端", - "责", - "站", - "简", - "述", - "钱", - "副", - "尽", - "帝", - "射", - "草", - "冲", - "承", - "独", - "令", - "限", - "阿", - "宣", - "环", - "双", - "请", - "超", - "微", - "让", - "控", - "州", - "良", - "轴", - "找", - "否", - "纪", - "益", - "依", - "优", - "顶", - "础", - "载", - "倒", - "房", - "突", - "坐", - "粉", - "敌", - "略", - "客", - "袁", - "冷", - "胜", - "绝", - "析", - "块", - "剂", - "测", - "丝", - "协", - "诉", - "念", - "陈", - "仍", - "罗", - "盐", - "友", - "洋", - "错", - "苦", - "夜", - "刑", - "移", - "频", - "逐", - "靠", - "混", - "母", - "短", - "皮", - "终", - "聚", - "汽", - "村", - "云", - "哪", - "既", - "距", - "卫", - "停", - "烈", - "央", - "察", - "烧", - "迅", - "境", - "若", - "印", - "洲", - "刻", - "括", - "激", - "孔", - "搞", - "甚", - "室", - "待", - "核", - "校", - "散", - "侵", - "吧", - "甲", - "游", - "久", - "菜", - "味", - "旧", - "模", - "湖", - "货", - "损", - "预", - "阻", - "毫", - "普", - "稳", - "乙", - "妈", - "植", - "息", - "扩", - "银", - "语", - "挥", - "酒", - "守", - "拿", - "序", - "纸", - "医", - "缺", - "雨", - "吗", - "针", - "刘", - "啊", - "急", - "唱", - "误", - "训", - "愿", - "审", - "附", - "获", - "茶", - "鲜", - "粮", - "斤", - "孩", - "脱", - "硫", - "肥", - "善", - "龙", - "演", - "父", - "渐", - "血", - "欢", - "械", - "掌", - "歌", - "沙", - "刚", - "攻", - "谓", - "盾", - "讨", - "晚", - "粒", - "乱", - "燃", - "矛", - "乎", - "杀", - "药", - "宁", - "鲁", - "贵", - "钟", - "煤", - "读", - "班", - "伯", - "香", - "介", - "迫", - "句", - "丰", - "培", - "握", - "兰", - "担", - "弦", - "蛋", - "沉", - "假", - "穿", - "执", - "答", - "乐", - "谁", - "顺", - "烟", - "缩", - "征", - "脸", - "喜", - "松", - "脚", - "困", - "异", - "免", - "背", - "星", - "福", - "买", - "染", - "井", - "概", - "慢", - "怕", - "磁", - "倍", - "祖", - "皇", - "促", - "静", - "补", - "评", - "翻", - "肉", - "践", - "尼", - "衣", - "宽", - "扬", - "棉", - "希", - "伤", - "操", - "垂", - "秋", - "宜", - "氢", - "套", - "督", - "振", - "架", - "亮", - "末", - "宪", - "庆", - "编", - "牛", - "触", - "映", - "雷", - "销", - "诗", - "座", - "居", - "抓", - "裂", - "胞", - "呼", - "娘", - "景", - "威", - "绿", - "晶", - "厚", - "盟", - "衡", - "鸡", - "孙", - "延", - "危", - "胶", - "屋", - "乡", - "临", - "陆", - "顾", - "掉", - "呀", - "灯", - "岁", - "措", - "束", - "耐", - "剧", - "玉", - "赵", - "跳", - "哥", - "季", - "课", - "凯", - "胡", - "额", - "款", - "绍", - "卷", - "齐", - "伟", - "蒸", - "殖", - "永", - "宗", - "苗", - "川", - "炉", - "岩", - "弱", - "零", - "杨", - "奏", - "沿", - "露", - "杆", - "探", - "滑", - "镇", - "饭", - "浓", - "航", - "怀", - "赶", - "库", - "夺", - "伊", - "灵", - "税", - "途", - "灭", - "赛", - "归", - "召", - "鼓", - "播", - "盘", - "裁", - "险", - "康", - "唯", - "录", - "菌", - "纯", - "借", - "糖", - "盖", - "横", - "符", - "私", - "努", - "堂", - "域", - "枪", - "润", - "幅", - "哈", - "竟", - "熟", - "虫", - "泽", - "脑", - "壤", - "碳", - "欧", - "遍", - "侧", - "寨", - "敢", - "彻", - "虑", - "斜", - "薄", - "庭", - "纳", - "弹", - "饲", - "伸", - "折", - "麦", - "湿", - "暗", - "荷", - "瓦", - "塞", - "床", - "筑", - "恶", - "户", - "访", - "塔", - "奇", - "透", - "梁", - "刀", - "旋", - "迹", - "卡", - "氯", - "遇", - "份", - "毒", - "泥", - "退", - "洗", - "摆", - "灰", - "彩", - "卖", - "耗", - "夏", - "择", - "忙", - "铜", - "献", - "硬", - "予", - "繁", - "圈", - "雪", - "函", - "亦", - "抽", - "篇", - "阵", - "阴", - "丁", - "尺", - "追", - "堆", - "雄", - "迎", - "泛", - "爸", - "楼", - "避", - "谋", - "吨", - "野", - "猪", - "旗", - "累", - "偏", - "典", - "馆", - "索", - "秦", - "脂", - "潮", - "爷", - "豆", - "忽", - "托", - "惊", - "塑", - "遗", - "愈", - "朱", - "替", - "纤", - "粗", - "倾", - "尚", - "痛", - "楚", - "谢", - "奋", - "购", - "磨", - "君", - "池", - "旁", - "碎", - "骨", - "监", - "捕", - "弟", - "暴", - "割", - "贯", - "殊", - "释", - "词", - "亡", - "壁", - "顿", - "宝", - "午", - "尘", - "闻", - "揭", - "炮", - "残", - "冬", - "桥", - "妇", - "警", - "综", - "招", - "吴", - "付", - "浮", - "遭", - "徐", - "您", - "摇", - "谷", - "赞", - "箱", - "隔", - "订", - "男", - "吹", - "园", - "纷", - "唐", - "败", - "宋", - "玻", - "巨", - "耕", - "坦", - "荣", - "闭", - "湾", - "键", - "凡", - "驻", - "锅", - "救", - "恩", - "剥", - "凝", - "碱", - "齿", - "截", - "炼", - "麻", - "纺", - "禁", - "废", - "盛", - "版", - "缓", - "净", - "睛", - "昌", - "婚", - "涉", - "筒", - "嘴", - "插", - "岸", - "朗", - "庄", - "街", - "藏", - "姑", - "贸", - "腐", - "奴", - "啦", - "惯", - "乘", - "伙", - "恢", - "匀", - "纱", - "扎", - "辩", - "耳", - "彪", - "臣", - "亿", - "璃", - "抵", - "脉", - "秀", - "萨", - "俄", - "网", - "舞", - "店", - "喷", - "纵", - "寸", - "汗", - "挂", - "洪", - "贺", - "闪", - "柬", - "爆", - "烯", - "津", - "稻", - "墙", - "软", - "勇", - "像", - "滚", - "厘", - "蒙", - "芳", - "肯", - "坡", - "柱", - "荡", - "腿", - "仪", - "旅", - "尾", - "轧", - "冰", - "贡", - "登", - "黎", - "削", - "钻", - "勒", - "逃", - "障", - "氨", - "郭", - "峰", - "币", - "港", - "伏", - "轨", - "亩", - "毕", - "擦", - "莫", - "刺", - "浪", - "秘", - "援", - "株", - "健", - "售", - "股", - "岛", - "甘", - "泡", - "睡", - "童", - "铸", - "汤", - "阀", - "休", - "汇", - "舍", - "牧", - "绕", - "炸", - "哲", - "磷", - "绩", - "朋", - "淡", - "尖", - "启", - "陷", - "柴", - "呈", - "徒", - "颜", - "泪", - "稍", - "忘", - "泵", - "蓝", - "拖", - "洞", - "授", - "镜", - "辛", - "壮", - "锋", - "贫", - "虚", - "弯", - "摩", - "泰", - "幼", - "廷", - "尊", - "窗", - "纲", - "弄", - "隶", - "疑", - "氏", - "宫", - "姐", - "震", - "瑞", - "怪", - "尤", - "琴", - "循", - "描", - "膜", - "违", - "夹", - "腰", - "缘", - "珠", - "穷", - "森", - "枝", - "竹", - "沟", - "催", - "绳", - "忆", - "邦", - "剩", - "幸", - "浆", - "栏", - "拥", - "牙", - "贮", - "礼", - "滤", - "钠", - "纹", - "罢", - "拍", - "咱", - "喊", - "袖", - "埃", - "勤", - "罚", - "焦", - "潜", - "伍", - "墨", - "欲", - "缝", - "姓", - "刊", - "饱", - "仿", - "奖", - "铝", - "鬼", - "丽", - "跨", - "默", - "挖", - "链", - "扫", - "喝", - "袋", - "炭", - "污", - "幕", - "诸", - "弧", - "励", - "梅", - "奶", - "洁", - "灾", - "舟", - "鉴", - "苯", - "讼", - "抱", - "毁", - "懂", - "寒", - "智", - "埔", - "寄", - "届", - "跃", - "渡", - "挑", - "丹", - "艰", - "贝", - "碰", - "拔", - "爹", - "戴", - "码", - "梦", - "芽", - "熔", - "赤", - "渔", - "哭", - "敬", - "颗", - "奔", - "铅", - "仲", - "虎", - "稀", - "妹", - "乏", - "珍", - "申", - "桌", - "遵", - "允", - "隆", - "螺", - "仓", - "魏", - "锐", - "晓", - "氮", - "兼", - "隐", - "碍", - "赫", - "拨", - "忠", - "肃", - "缸", - "牵", - "抢", - "博", - "巧", - "壳", - "兄", - "杜", - "讯", - "诚", - "碧", - "祥", - "柯", - "页", - "巡", - "矩", - "悲", - "灌", - "龄", - "伦", - "票", - "寻", - "桂", - "铺", - "圣", - "恐", - "恰", - "郑", - "趣", - "抬", - "荒", - "腾", - "贴", - "柔", - "滴", - "猛", - "阔", - "辆", - "妻", - "填", - "撤", - "储", - "签", - "闹", - "扰", - "紫", - "砂", - "递", - "戏", - "吊", - "陶", - "伐", - "喂", - "疗", - "瓶", - "婆", - "抚", - "臂", - "摸", - "忍", - "虾", - "蜡", - "邻", - "胸", - "巩", - "挤", - "偶", - "弃", - "槽", - "劲", - "乳", - "邓", - "吉", - "仁", - "烂", - "砖", - "租", - "乌", - "舰", - "伴", - "瓜", - "浅", - "丙", - "暂", - "燥", - "橡", - "柳", - "迷", - "暖", - "牌", - "秧", - "胆", - "详", - "簧", - "踏", - "瓷", - "谱", - "呆", - "宾", - "糊", - "洛", - "辉", - "愤", - "竞", - "隙", - "怒", - "粘", - "乃", - "绪", - "肩", - "籍", - "敏", - "涂", - "熙", - "皆", - "侦", - "悬", - "掘", - "享", - "纠", - "醒", - "狂", - "锁", - "淀", - "恨", - "牲", - "霸", - "爬", - "赏", - "逆", - "玩", - "陵", - "祝", - "秒", - "浙", - "貌", - "役", - "彼", - "悉", - "鸭", - "趋", - "凤", - "晨", - "畜", - "辈", - "秩", - "卵", - "署", - "梯", - "炎", - "滩", - "棋", - "驱", - "筛", - "峡", - "冒", - "啥", - "寿", - "译", - "浸", - "泉", - "帽", - "迟", - "硅", - "疆", - "贷", - "漏", - "稿", - "冠", - "嫩", - "胁", - "芯", - "牢", - "叛", - "蚀", - "奥", - "鸣", - "岭", - "羊", - "凭", - "串", - "塘", - "绘", - "酵", - "融", - "盆", - "锡", - "庙", - "筹", - "冻", - "辅", - "摄", - "袭", - "筋", - "拒", - "僚", - "旱", - "钾", - "鸟", - "漆", - "沈", - "眉", - "疏", - "添", - "棒", - "穗", - "硝", - "韩", - "逼", - "扭", - "侨", - "凉", - "挺", - "碗", - "栽", - "炒", - "杯", - "患", - "馏", - "劝", - "豪", - "辽", - "勃", - "鸿", - "旦", - "吏", - "拜", - "狗", - "埋", - "辊", - "掩", - "饮", - "搬", - "骂", - "辞", - "勾", - "扣", - "估", - "蒋", - "绒", - "雾", - "丈", - "朵", - "姆", - "拟", - "宇", - "辑", - "陕", - "雕", - "偿", - "蓄", - "崇", - "剪", - "倡", - "厅", - "咬", - "驶", - "薯", - "刷", - "斥", - "番", - "赋", - "奉", - "佛", - "浇", - "漫", - "曼", - "扇", - "钙", - "桃", - "扶", - "仔", - "返", - "俗", - "亏", - "腔", - "鞋", - "棱", - "覆", - "框", - "悄", - "叔", - "撞", - "骗", - "勘", - "旺", - "沸", - "孤", - "吐", - "孟", - "渠", - "屈", - "疾", - "妙", - "惜", - "仰", - "狠", - "胀", - "谐", - "抛", - "霉", - "桑", - "岗", - "嘛", - "衰", - "盗", - "渗", - "脏", - "赖", - "涌", - "甜", - "曹", - "阅", - "肌", - "哩", - "厉", - "烃", - "纬", - "毅", - "昨", - "伪", - "症", - "煮", - "叹", - "钉", - "搭", - "茎", - "笼", - "酷", - "偷", - "弓", - "锥", - "恒", - "杰", - "坑", - "鼻", - "翼", - "纶", - "叙", - "狱", - "逮", - "罐", - "络", - "棚", - "抑", - "膨", - "蔬", - "寺", - "骤", - "穆", - "冶", - "枯", - "册", - "尸", - "凸", - "绅", - "坯", - "牺", - "焰", - "轰", - "欣", - "晋", - "瘦", - "御", - "锭", - "锦", - "丧", - "旬", - "锻", - "垄", - "搜", - "扑", - "邀", - "亭", - "酯", - "迈", - "舒", - "脆", - "酶", - "闲", - "忧", - "酚", - "顽", - "羽", - "涨", - "卸", - "仗", - "陪", - "辟", - "惩", - "杭", - "姚", - "肚", - "捉", - "飘", - "漂", - "昆", - "欺", - "吾", - "郎", - "烷", - "汁", - "呵", - "饰", - "萧", - "雅", - "邮", - "迁", - "燕", - "撒", - "姻", - "赴", - "宴", - "烦", - "债", - "帐", - "斑", - "铃", - "旨", - "醇", - "董", - "饼", - "雏", - "姿", - "拌", - "傅", - "腹", - "妥", - "揉", - "贤", - "拆", - "歪", - "葡", - "胺", - "丢", - "浩", - "徽", - "昂", - "垫", - "挡", - "览", - "贪", - "慰", - "缴", - "汪", - "慌", - "冯", - "诺", - "姜", - "谊", - "凶", - "劣", - "诬", - "耀", - "昏", - "躺", - "盈", - "骑", - "乔", - "溪", - "丛", - "卢", - "抹", - "闷", - "咨", - "刮", - "驾", - "缆", - "悟", - "摘", - "铒", - "掷", - "颇", - "幻", - "柄", - "惠", - "惨", - "佳", - "仇", - "腊", - "窝", - "涤", - "剑", - "瞧", - "堡", - "泼", - "葱", - "罩", - "霍", - "捞", - "胎", - "苍", - "滨", - "俩", - "捅", - "湘", - "砍", - "霞", - "邵", - "萄", - "疯", - "淮", - "遂", - "熊", - "粪", - "烘", - "宿", - "档", - "戈", - "驳", - "嫂", - "裕", - "徙", - "箭", - "捐", - "肠", - "撑", - "晒", - "辨", - "殿", - "莲", - "摊", - "搅", - "酱", - "屏", - "疫", - "哀", - "蔡", - "堵", - "沫", - "皱", - "畅", - "叠", - "阁", - "莱", - "敲", - "辖", - "钩", - "痕", - "坝", - "巷", - "饿", - "祸", - "丘", - "玄", - "溜", - "曰", - "逻", - "彭", - "尝", - "卿", - "妨", - "艇", - "吞", - "韦", - "怨", - "矮", - "歇" - ]; -} diff --git a/src/wordlist/BIP39ChineseTraditionalWordList.php b/src/wordlist/BIP39ChineseTraditionalWordList.php deleted file mode 100644 index 1b5086f..0000000 --- a/src/wordlist/BIP39ChineseTraditionalWordList.php +++ /dev/null @@ -1,2104 +0,0 @@ - - */ - -namespace Web3p\EthereumWallet\Wordlist; - -use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39WordListInterface; -use BitWasp\Bitcoin\Mnemonic\WordList; - -class BIP39ChineseTraditionalWordList extends WordList implements Bip39WordListInterface -{ - - protected $wordsFlipped; - - public function count(): int - { - return count($this->getWords()); - } - - public function getWords(): array - { - return $this->words; - } - - public function getWord(int $idx): string - { - if (!isset($this->words)) { - throw new \Exception(__CLASS__ . " does not contain a word for index [{$idx}]"); - } - - return $this->words[$idx]; - } - - public function getIndex(string $word): int - { - // create a flipped word list to speed up the searching of words - if (is_null($this->wordsFlipped)) { - $this->wordsFlipped = array_flip($this->words); - } - - if (!isset($this->wordsFlipped[$word])) { - throw new \Exception(__CLASS__ . " does not contain word [{$word}]"); - } - - return $this->wordsFlipped[$word]; - } - - protected $words = [ - "的", - "一", - "是", - "在", - "不", - "了", - "有", - "和", - "人", - "這", - "中", - "大", - "為", - "上", - "個", - "國", - "我", - "以", - "要", - "他", - "時", - "來", - "用", - "們", - "生", - "到", - "作", - "地", - "於", - "出", - "就", - "分", - "對", - "成", - "會", - "可", - "主", - "發", - "年", - "動", - "同", - "工", - "也", - "能", - "下", - "過", - "子", - "說", - "產", - "種", - "面", - "而", - "方", - "後", - "多", - "定", - "行", - "學", - "法", - "所", - "民", - "得", - "經", - "十", - "三", - "之", - "進", - "著", - "等", - "部", - "度", - "家", - "電", - "力", - "裡", - "如", - "水", - "化", - "高", - "自", - "二", - "理", - "起", - "小", - "物", - "現", - "實", - "加", - "量", - "都", - "兩", - "體", - "制", - "機", - "當", - "使", - "點", - "從", - "業", - "本", - "去", - "把", - "性", - "好", - "應", - "開", - "它", - "合", - "還", - "因", - "由", - "其", - "些", - "然", - "前", - "外", - "天", - "政", - "四", - "日", - "那", - "社", - "義", - "事", - "平", - "形", - "相", - "全", - "表", - "間", - "樣", - "與", - "關", - "各", - "重", - "新", - "線", - "內", - "數", - "正", - "心", - "反", - "你", - "明", - "看", - "原", - "又", - "麼", - "利", - "比", - "或", - "但", - "質", - "氣", - "第", - "向", - "道", - "命", - "此", - "變", - "條", - "只", - "沒", - "結", - "解", - "問", - "意", - "建", - "月", - "公", - "無", - "系", - "軍", - "很", - "情", - "者", - "最", - "立", - "代", - "想", - "已", - "通", - "並", - "提", - "直", - "題", - "黨", - "程", - "展", - "五", - "果", - "料", - "象", - "員", - "革", - "位", - "入", - "常", - "文", - "總", - "次", - "品", - "式", - "活", - "設", - "及", - "管", - "特", - "件", - "長", - "求", - "老", - "頭", - "基", - "資", - "邊", - "流", - "路", - "級", - "少", - "圖", - "山", - "統", - "接", - "知", - "較", - "將", - "組", - "見", - "計", - "別", - "她", - "手", - "角", - "期", - "根", - "論", - "運", - "農", - "指", - "幾", - "九", - "區", - "強", - "放", - "決", - "西", - "被", - "幹", - "做", - "必", - "戰", - "先", - "回", - "則", - "任", - "取", - "據", - "處", - "隊", - "南", - "給", - "色", - "光", - "門", - "即", - "保", - "治", - "北", - "造", - "百", - "規", - "熱", - "領", - "七", - "海", - "口", - "東", - "導", - "器", - "壓", - "志", - "世", - "金", - "增", - "爭", - "濟", - "階", - "油", - "思", - "術", - "極", - "交", - "受", - "聯", - "什", - "認", - "六", - "共", - "權", - "收", - "證", - "改", - "清", - "美", - "再", - "採", - "轉", - "更", - "單", - "風", - "切", - "打", - "白", - "教", - "速", - "花", - "帶", - "安", - "場", - "身", - "車", - "例", - "真", - "務", - "具", - "萬", - "每", - "目", - "至", - "達", - "走", - "積", - "示", - "議", - "聲", - "報", - "鬥", - "完", - "類", - "八", - "離", - "華", - "名", - "確", - "才", - "科", - "張", - "信", - "馬", - "節", - "話", - "米", - "整", - "空", - "元", - "況", - "今", - "集", - "溫", - "傳", - "土", - "許", - "步", - "群", - "廣", - "石", - "記", - "需", - "段", - "研", - "界", - "拉", - "林", - "律", - "叫", - "且", - "究", - "觀", - "越", - "織", - "裝", - "影", - "算", - "低", - "持", - "音", - "眾", - "書", - "布", - "复", - "容", - "兒", - "須", - "際", - "商", - "非", - "驗", - "連", - "斷", - "深", - "難", - "近", - "礦", - "千", - "週", - "委", - "素", - "技", - "備", - "半", - "辦", - "青", - "省", - "列", - "習", - "響", - "約", - "支", - "般", - "史", - "感", - "勞", - "便", - "團", - "往", - "酸", - "歷", - "市", - "克", - "何", - "除", - "消", - "構", - "府", - "稱", - "太", - "準", - "精", - "值", - "號", - "率", - "族", - "維", - "劃", - "選", - "標", - "寫", - "存", - "候", - "毛", - "親", - "快", - "效", - "斯", - "院", - "查", - "江", - "型", - "眼", - "王", - "按", - "格", - "養", - "易", - "置", - "派", - "層", - "片", - "始", - "卻", - "專", - "狀", - "育", - "廠", - "京", - "識", - "適", - "屬", - "圓", - "包", - "火", - "住", - "調", - "滿", - "縣", - "局", - "照", - "參", - "紅", - "細", - "引", - "聽", - "該", - "鐵", - "價", - "嚴", - "首", - "底", - "液", - "官", - "德", - "隨", - "病", - "蘇", - "失", - "爾", - "死", - "講", - "配", - "女", - "黃", - "推", - "顯", - "談", - "罪", - "神", - "藝", - "呢", - "席", - "含", - "企", - "望", - "密", - "批", - "營", - "項", - "防", - "舉", - "球", - "英", - "氧", - "勢", - "告", - "李", - "台", - "落", - "木", - "幫", - "輪", - "破", - "亞", - "師", - "圍", - "注", - "遠", - "字", - "材", - "排", - "供", - "河", - "態", - "封", - "另", - "施", - "減", - "樹", - "溶", - "怎", - "止", - "案", - "言", - "士", - "均", - "武", - "固", - "葉", - "魚", - "波", - "視", - "僅", - "費", - "緊", - "愛", - "左", - "章", - "早", - "朝", - "害", - "續", - "輕", - "服", - "試", - "食", - "充", - "兵", - "源", - "判", - "護", - "司", - "足", - "某", - "練", - "差", - "致", - "板", - "田", - "降", - "黑", - "犯", - "負", - "擊", - "范", - "繼", - "興", - "似", - "餘", - "堅", - "曲", - "輸", - "修", - "故", - "城", - "夫", - "夠", - "送", - "筆", - "船", - "佔", - "右", - "財", - "吃", - "富", - "春", - "職", - "覺", - "漢", - "畫", - "功", - "巴", - "跟", - "雖", - "雜", - "飛", - "檢", - "吸", - "助", - "昇", - "陽", - "互", - "初", - "創", - "抗", - "考", - "投", - "壞", - "策", - "古", - "徑", - "換", - "未", - "跑", - "留", - "鋼", - "曾", - "端", - "責", - "站", - "簡", - "述", - "錢", - "副", - "盡", - "帝", - "射", - "草", - "衝", - "承", - "獨", - "令", - "限", - "阿", - "宣", - "環", - "雙", - "請", - "超", - "微", - "讓", - "控", - "州", - "良", - "軸", - "找", - "否", - "紀", - "益", - "依", - "優", - "頂", - "礎", - "載", - "倒", - "房", - "突", - "坐", - "粉", - "敵", - "略", - "客", - "袁", - "冷", - "勝", - "絕", - "析", - "塊", - "劑", - "測", - "絲", - "協", - "訴", - "念", - "陳", - "仍", - "羅", - "鹽", - "友", - "洋", - "錯", - "苦", - "夜", - "刑", - "移", - "頻", - "逐", - "靠", - "混", - "母", - "短", - "皮", - "終", - "聚", - "汽", - "村", - "雲", - "哪", - "既", - "距", - "衛", - "停", - "烈", - "央", - "察", - "燒", - "迅", - "境", - "若", - "印", - "洲", - "刻", - "括", - "激", - "孔", - "搞", - "甚", - "室", - "待", - "核", - "校", - "散", - "侵", - "吧", - "甲", - "遊", - "久", - "菜", - "味", - "舊", - "模", - "湖", - "貨", - "損", - "預", - "阻", - "毫", - "普", - "穩", - "乙", - "媽", - "植", - "息", - "擴", - "銀", - "語", - "揮", - "酒", - "守", - "拿", - "序", - "紙", - "醫", - "缺", - "雨", - "嗎", - "針", - "劉", - "啊", - "急", - "唱", - "誤", - "訓", - "願", - "審", - "附", - "獲", - "茶", - "鮮", - "糧", - "斤", - "孩", - "脫", - "硫", - "肥", - "善", - "龍", - "演", - "父", - "漸", - "血", - "歡", - "械", - "掌", - "歌", - "沙", - "剛", - "攻", - "謂", - "盾", - "討", - "晚", - "粒", - "亂", - "燃", - "矛", - "乎", - "殺", - "藥", - "寧", - "魯", - "貴", - "鐘", - "煤", - "讀", - "班", - "伯", - "香", - "介", - "迫", - "句", - "豐", - "培", - "握", - "蘭", - "擔", - "弦", - "蛋", - "沉", - "假", - "穿", - "執", - "答", - "樂", - "誰", - "順", - "煙", - "縮", - "徵", - "臉", - "喜", - "松", - "腳", - "困", - "異", - "免", - "背", - "星", - "福", - "買", - "染", - "井", - "概", - "慢", - "怕", - "磁", - "倍", - "祖", - "皇", - "促", - "靜", - "補", - "評", - "翻", - "肉", - "踐", - "尼", - "衣", - "寬", - "揚", - "棉", - "希", - "傷", - "操", - "垂", - "秋", - "宜", - "氫", - "套", - "督", - "振", - "架", - "亮", - "末", - "憲", - "慶", - "編", - "牛", - "觸", - "映", - "雷", - "銷", - "詩", - "座", - "居", - "抓", - "裂", - "胞", - "呼", - "娘", - "景", - "威", - "綠", - "晶", - "厚", - "盟", - "衡", - "雞", - "孫", - "延", - "危", - "膠", - "屋", - "鄉", - "臨", - "陸", - "顧", - "掉", - "呀", - "燈", - "歲", - "措", - "束", - "耐", - "劇", - "玉", - "趙", - "跳", - "哥", - "季", - "課", - "凱", - "胡", - "額", - "款", - "紹", - "卷", - "齊", - "偉", - "蒸", - "殖", - "永", - "宗", - "苗", - "川", - "爐", - "岩", - "弱", - "零", - "楊", - "奏", - "沿", - "露", - "桿", - "探", - "滑", - "鎮", - "飯", - "濃", - "航", - "懷", - "趕", - "庫", - "奪", - "伊", - "靈", - "稅", - "途", - "滅", - "賽", - "歸", - "召", - "鼓", - "播", - "盤", - "裁", - "險", - "康", - "唯", - "錄", - "菌", - "純", - "借", - "糖", - "蓋", - "橫", - "符", - "私", - "努", - "堂", - "域", - "槍", - "潤", - "幅", - "哈", - "竟", - "熟", - "蟲", - "澤", - "腦", - "壤", - "碳", - "歐", - "遍", - "側", - "寨", - "敢", - "徹", - "慮", - "斜", - "薄", - "庭", - "納", - "彈", - "飼", - "伸", - "折", - "麥", - "濕", - "暗", - "荷", - "瓦", - "塞", - "床", - "築", - "惡", - "戶", - "訪", - "塔", - "奇", - "透", - "梁", - "刀", - "旋", - "跡", - "卡", - "氯", - "遇", - "份", - "毒", - "泥", - "退", - "洗", - "擺", - "灰", - "彩", - "賣", - "耗", - "夏", - "擇", - "忙", - "銅", - "獻", - "硬", - "予", - "繁", - "圈", - "雪", - "函", - "亦", - "抽", - "篇", - "陣", - "陰", - "丁", - "尺", - "追", - "堆", - "雄", - "迎", - "泛", - "爸", - "樓", - "避", - "謀", - "噸", - "野", - "豬", - "旗", - "累", - "偏", - "典", - "館", - "索", - "秦", - "脂", - "潮", - "爺", - "豆", - "忽", - "托", - "驚", - "塑", - "遺", - "愈", - "朱", - "替", - "纖", - "粗", - "傾", - "尚", - "痛", - "楚", - "謝", - "奮", - "購", - "磨", - "君", - "池", - "旁", - "碎", - "骨", - "監", - "捕", - "弟", - "暴", - "割", - "貫", - "殊", - "釋", - "詞", - "亡", - "壁", - "頓", - "寶", - "午", - "塵", - "聞", - "揭", - "炮", - "殘", - "冬", - "橋", - "婦", - "警", - "綜", - "招", - "吳", - "付", - "浮", - "遭", - "徐", - "您", - "搖", - "谷", - "贊", - "箱", - "隔", - "訂", - "男", - "吹", - "園", - "紛", - "唐", - "敗", - "宋", - "玻", - "巨", - "耕", - "坦", - "榮", - "閉", - "灣", - "鍵", - "凡", - "駐", - "鍋", - "救", - "恩", - "剝", - "凝", - "鹼", - "齒", - "截", - "煉", - "麻", - "紡", - "禁", - "廢", - "盛", - "版", - "緩", - "淨", - "睛", - "昌", - "婚", - "涉", - "筒", - "嘴", - "插", - "岸", - "朗", - "莊", - "街", - "藏", - "姑", - "貿", - "腐", - "奴", - "啦", - "慣", - "乘", - "夥", - "恢", - "勻", - "紗", - "扎", - "辯", - "耳", - "彪", - "臣", - "億", - "璃", - "抵", - "脈", - "秀", - "薩", - "俄", - "網", - "舞", - "店", - "噴", - "縱", - "寸", - "汗", - "掛", - "洪", - "賀", - "閃", - "柬", - "爆", - "烯", - "津", - "稻", - "牆", - "軟", - "勇", - "像", - "滾", - "厘", - "蒙", - "芳", - "肯", - "坡", - "柱", - "盪", - "腿", - "儀", - "旅", - "尾", - "軋", - "冰", - "貢", - "登", - "黎", - "削", - "鑽", - "勒", - "逃", - "障", - "氨", - "郭", - "峰", - "幣", - "港", - "伏", - "軌", - "畝", - "畢", - "擦", - "莫", - "刺", - "浪", - "秘", - "援", - "株", - "健", - "售", - "股", - "島", - "甘", - "泡", - "睡", - "童", - "鑄", - "湯", - "閥", - "休", - "匯", - "舍", - "牧", - "繞", - "炸", - "哲", - "磷", - "績", - "朋", - "淡", - "尖", - "啟", - "陷", - "柴", - "呈", - "徒", - "顏", - "淚", - "稍", - "忘", - "泵", - "藍", - "拖", - "洞", - "授", - "鏡", - "辛", - "壯", - "鋒", - "貧", - "虛", - "彎", - "摩", - "泰", - "幼", - "廷", - "尊", - "窗", - "綱", - "弄", - "隸", - "疑", - "氏", - "宮", - "姐", - "震", - "瑞", - "怪", - "尤", - "琴", - "循", - "描", - "膜", - "違", - "夾", - "腰", - "緣", - "珠", - "窮", - "森", - "枝", - "竹", - "溝", - "催", - "繩", - "憶", - "邦", - "剩", - "幸", - "漿", - "欄", - "擁", - "牙", - "貯", - "禮", - "濾", - "鈉", - "紋", - "罷", - "拍", - "咱", - "喊", - "袖", - "埃", - "勤", - "罰", - "焦", - "潛", - "伍", - "墨", - "欲", - "縫", - "姓", - "刊", - "飽", - "仿", - "獎", - "鋁", - "鬼", - "麗", - "跨", - "默", - "挖", - "鏈", - "掃", - "喝", - "袋", - "炭", - "污", - "幕", - "諸", - "弧", - "勵", - "梅", - "奶", - "潔", - "災", - "舟", - "鑑", - "苯", - "訟", - "抱", - "毀", - "懂", - "寒", - "智", - "埔", - "寄", - "屆", - "躍", - "渡", - "挑", - "丹", - "艱", - "貝", - "碰", - "拔", - "爹", - "戴", - "碼", - "夢", - "芽", - "熔", - "赤", - "漁", - "哭", - "敬", - "顆", - "奔", - "鉛", - "仲", - "虎", - "稀", - "妹", - "乏", - "珍", - "申", - "桌", - "遵", - "允", - "隆", - "螺", - "倉", - "魏", - "銳", - "曉", - "氮", - "兼", - "隱", - "礙", - "赫", - "撥", - "忠", - "肅", - "缸", - "牽", - "搶", - "博", - "巧", - "殼", - "兄", - "杜", - "訊", - "誠", - "碧", - "祥", - "柯", - "頁", - "巡", - "矩", - "悲", - "灌", - "齡", - "倫", - "票", - "尋", - "桂", - "鋪", - "聖", - "恐", - "恰", - "鄭", - "趣", - "抬", - "荒", - "騰", - "貼", - "柔", - "滴", - "猛", - "闊", - "輛", - "妻", - "填", - "撤", - "儲", - "簽", - "鬧", - "擾", - "紫", - "砂", - "遞", - "戲", - "吊", - "陶", - "伐", - "餵", - "療", - "瓶", - "婆", - "撫", - "臂", - "摸", - "忍", - "蝦", - "蠟", - "鄰", - "胸", - "鞏", - "擠", - "偶", - "棄", - "槽", - "勁", - "乳", - "鄧", - "吉", - "仁", - "爛", - "磚", - "租", - "烏", - "艦", - "伴", - "瓜", - "淺", - "丙", - "暫", - "燥", - "橡", - "柳", - "迷", - "暖", - "牌", - "秧", - "膽", - "詳", - "簧", - "踏", - "瓷", - "譜", - "呆", - "賓", - "糊", - "洛", - "輝", - "憤", - "競", - "隙", - "怒", - "粘", - "乃", - "緒", - "肩", - "籍", - "敏", - "塗", - "熙", - "皆", - "偵", - "懸", - "掘", - "享", - "糾", - "醒", - "狂", - "鎖", - "淀", - "恨", - "牲", - "霸", - "爬", - "賞", - "逆", - "玩", - "陵", - "祝", - "秒", - "浙", - "貌", - "役", - "彼", - "悉", - "鴨", - "趨", - "鳳", - "晨", - "畜", - "輩", - "秩", - "卵", - "署", - "梯", - "炎", - "灘", - "棋", - "驅", - "篩", - "峽", - "冒", - "啥", - "壽", - "譯", - "浸", - "泉", - "帽", - "遲", - "矽", - "疆", - "貸", - "漏", - "稿", - "冠", - "嫩", - "脅", - "芯", - "牢", - "叛", - "蝕", - "奧", - "鳴", - "嶺", - "羊", - "憑", - "串", - "塘", - "繪", - "酵", - "融", - "盆", - "錫", - "廟", - "籌", - "凍", - "輔", - "攝", - "襲", - "筋", - "拒", - "僚", - "旱", - "鉀", - "鳥", - "漆", - "沈", - "眉", - "疏", - "添", - "棒", - "穗", - "硝", - "韓", - "逼", - "扭", - "僑", - "涼", - "挺", - "碗", - "栽", - "炒", - "杯", - "患", - "餾", - "勸", - "豪", - "遼", - "勃", - "鴻", - "旦", - "吏", - "拜", - "狗", - "埋", - "輥", - "掩", - "飲", - "搬", - "罵", - "辭", - "勾", - "扣", - "估", - "蔣", - "絨", - "霧", - "丈", - "朵", - "姆", - "擬", - "宇", - "輯", - "陝", - "雕", - "償", - "蓄", - "崇", - "剪", - "倡", - "廳", - "咬", - "駛", - "薯", - "刷", - "斥", - "番", - "賦", - "奉", - "佛", - "澆", - "漫", - "曼", - "扇", - "鈣", - "桃", - "扶", - "仔", - "返", - "俗", - "虧", - "腔", - "鞋", - "棱", - "覆", - "框", - "悄", - "叔", - "撞", - "騙", - "勘", - "旺", - "沸", - "孤", - "吐", - "孟", - "渠", - "屈", - "疾", - "妙", - "惜", - "仰", - "狠", - "脹", - "諧", - "拋", - "黴", - "桑", - "崗", - "嘛", - "衰", - "盜", - "滲", - "臟", - "賴", - "湧", - "甜", - "曹", - "閱", - "肌", - "哩", - "厲", - "烴", - "緯", - "毅", - "昨", - "偽", - "症", - "煮", - "嘆", - "釘", - "搭", - "莖", - "籠", - "酷", - "偷", - "弓", - "錐", - "恆", - "傑", - "坑", - "鼻", - "翼", - "綸", - "敘", - "獄", - "逮", - "罐", - "絡", - "棚", - "抑", - "膨", - "蔬", - "寺", - "驟", - "穆", - "冶", - "枯", - "冊", - "屍", - "凸", - "紳", - "坯", - "犧", - "焰", - "轟", - "欣", - "晉", - "瘦", - "禦", - "錠", - "錦", - "喪", - "旬", - "鍛", - "壟", - "搜", - "撲", - "邀", - "亭", - "酯", - "邁", - "舒", - "脆", - "酶", - "閒", - "憂", - "酚", - "頑", - "羽", - "漲", - "卸", - "仗", - "陪", - "闢", - "懲", - "杭", - "姚", - "肚", - "捉", - "飄", - "漂", - "昆", - "欺", - "吾", - "郎", - "烷", - "汁", - "呵", - "飾", - "蕭", - "雅", - "郵", - "遷", - "燕", - "撒", - "姻", - "赴", - "宴", - "煩", - "債", - "帳", - "斑", - "鈴", - "旨", - "醇", - "董", - "餅", - "雛", - "姿", - "拌", - "傅", - "腹", - "妥", - "揉", - "賢", - "拆", - "歪", - "葡", - "胺", - "丟", - "浩", - "徽", - "昂", - "墊", - "擋", - "覽", - "貪", - "慰", - "繳", - "汪", - "慌", - "馮", - "諾", - "姜", - "誼", - "兇", - "劣", - "誣", - "耀", - "昏", - "躺", - "盈", - "騎", - "喬", - "溪", - "叢", - "盧", - "抹", - "悶", - "諮", - "刮", - "駕", - "纜", - "悟", - "摘", - "鉺", - "擲", - "頗", - "幻", - "柄", - "惠", - "慘", - "佳", - "仇", - "臘", - "窩", - "滌", - "劍", - "瞧", - "堡", - "潑", - "蔥", - "罩", - "霍", - "撈", - "胎", - "蒼", - "濱", - "倆", - "捅", - "湘", - "砍", - "霞", - "邵", - "萄", - "瘋", - "淮", - "遂", - "熊", - "糞", - "烘", - "宿", - "檔", - "戈", - "駁", - "嫂", - "裕", - "徙", - "箭", - "捐", - "腸", - "撐", - "曬", - "辨", - "殿", - "蓮", - "攤", - "攪", - "醬", - "屏", - "疫", - "哀", - "蔡", - "堵", - "沫", - "皺", - "暢", - "疊", - "閣", - "萊", - "敲", - "轄", - "鉤", - "痕", - "壩", - "巷", - "餓", - "禍", - "丘", - "玄", - "溜", - "曰", - "邏", - "彭", - "嘗", - "卿", - "妨", - "艇", - "吞", - "韋", - "怨", - "矮", - "歇" - ]; -}