├── README.md ├── composer.json ├── composer.lock ├── demo ├── DeployContractDemo.php ├── NewAddressDemo.php ├── Trc20Demo.php ├── TrxDemo.php ├── build-contract.sh └── contract │ ├── EzToken.sol │ └── build │ ├── EzToken.abi │ ├── EzToken.addr │ └── EzToken.bin ├── tron.php └── src │ ├── Address.php │ ├── Contract.php │ ├── Credential.php │ ├── ExceptionHandler.php │ ├── NodeClient.php │ ├── Trc20.php │ ├── TronApi.php │ └── TronKit.php └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── LICENSE ├── autoload_classmap.php ├── autoload_files.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php └── installed.json ├── fgrosse └── phpasn1 │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── lib │ ├── ASN1 │ ├── ASNObject.php │ ├── AbstractString.php │ ├── AbstractTime.php │ ├── Base128.php │ ├── Composite │ │ ├── AttributeTypeAndValue.php │ │ ├── RDNString.php │ │ └── RelativeDistinguishedName.php │ ├── Construct.php │ ├── Exception │ │ ├── NotImplementedException.php │ │ └── ParserException.php │ ├── ExplicitlyTaggedObject.php │ ├── Identifier.php │ ├── OID.php │ ├── Parsable.php │ ├── TemplateParser.php │ ├── Universal │ │ ├── BMPString.php │ │ ├── BitString.php │ │ ├── Boolean.php │ │ ├── CharacterString.php │ │ ├── Enumerated.php │ │ ├── GeneralString.php │ │ ├── GeneralizedTime.php │ │ ├── GraphicString.php │ │ ├── IA5String.php │ │ ├── Integer.php │ │ ├── NullObject.php │ │ ├── NumericString.php │ │ ├── ObjectDescriptor.php │ │ ├── ObjectIdentifier.php │ │ ├── OctetString.php │ │ ├── PrintableString.php │ │ ├── RelativeObjectIdentifier.php │ │ ├── Sequence.php │ │ ├── Set.php │ │ ├── T61String.php │ │ ├── UTCTime.php │ │ ├── UTF8String.php │ │ ├── UniversalString.php │ │ └── VisibleString.php │ ├── UnknownConstructedObject.php │ └── UnknownObject.php │ ├── Utility │ ├── BigInteger.php │ ├── BigIntegerBcmath.php │ └── BigIntegerGmp.php │ └── X509 │ ├── AlgorithmIdentifier.php │ ├── CSR │ ├── Attributes.php │ └── CSR.php │ ├── CertificateExtensions.php │ ├── CertificateSubject.php │ ├── PrivateKey.php │ ├── PublicKey.php │ └── SAN │ ├── DNSName.php │ ├── IPAddress.php │ └── SubjectAlternativeNames.php ├── guzzlehttp ├── guzzle │ ├── .php_cs │ ├── CHANGELOG.md │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── UPGRADING.md │ ├── composer.json │ └── src │ │ ├── Client.php │ │ ├── ClientInterface.php │ │ ├── Cookie │ │ ├── CookieJar.php │ │ ├── CookieJarInterface.php │ │ ├── FileCookieJar.php │ │ ├── SessionCookieJar.php │ │ └── SetCookie.php │ │ ├── Exception │ │ ├── BadResponseException.php │ │ ├── ClientException.php │ │ ├── ConnectException.php │ │ ├── GuzzleException.php │ │ ├── InvalidArgumentException.php │ │ ├── RequestException.php │ │ ├── SeekException.php │ │ ├── ServerException.php │ │ ├── TooManyRedirectsException.php │ │ └── TransferException.php │ │ ├── Handler │ │ ├── CurlFactory.php │ │ ├── CurlFactoryInterface.php │ │ ├── CurlHandler.php │ │ ├── CurlMultiHandler.php │ │ ├── EasyHandle.php │ │ ├── MockHandler.php │ │ ├── Proxy.php │ │ └── StreamHandler.php │ │ ├── HandlerStack.php │ │ ├── MessageFormatter.php │ │ ├── Middleware.php │ │ ├── Pool.php │ │ ├── PrepareBodyMiddleware.php │ │ ├── RedirectMiddleware.php │ │ ├── RequestOptions.php │ │ ├── RetryMiddleware.php │ │ ├── TransferStats.php │ │ ├── UriTemplate.php │ │ ├── functions.php │ │ └── functions_include.php ├── promises │ ├── CHANGELOG.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── composer.json │ └── src │ │ ├── AggregateException.php │ │ ├── CancellationException.php │ │ ├── Coroutine.php │ │ ├── EachPromise.php │ │ ├── FulfilledPromise.php │ │ ├── Promise.php │ │ ├── PromiseInterface.php │ │ ├── PromisorInterface.php │ │ ├── RejectedPromise.php │ │ ├── RejectionException.php │ │ ├── TaskQueue.php │ │ ├── TaskQueueInterface.php │ │ ├── functions.php │ │ └── functions_include.php └── psr7 │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ ├── AppendStream.php │ ├── BufferStream.php │ ├── CachingStream.php │ ├── DroppingStream.php │ ├── FnStream.php │ ├── InflateStream.php │ ├── LazyOpenStream.php │ ├── LimitStream.php │ ├── MessageTrait.php │ ├── MultipartStream.php │ ├── NoSeekStream.php │ ├── PumpStream.php │ ├── Request.php │ ├── Response.php │ ├── Rfc7230.php │ ├── ServerRequest.php │ ├── Stream.php │ ├── StreamDecoratorTrait.php │ ├── StreamWrapper.php │ ├── UploadedFile.php │ ├── Uri.php │ ├── UriNormalizer.php │ ├── UriResolver.php │ ├── functions.php │ └── functions_include.php ├── kornrunner ├── keccak │ ├── .coveralls.yml │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── composer.json │ ├── composer.lock │ ├── phpunit.xml.dist │ ├── src │ │ └── Keccak.php │ └── test │ │ └── KeccakTest.php └── secp256k1 │ ├── .coveralls.yml │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── composer.json │ ├── composer.lock │ ├── phpunit.xml.dist │ ├── src │ ├── Secp256k1.php │ ├── Serializer │ │ ├── HexPrivateKeySerializer.php │ │ └── HexSignatureSerializer.php │ └── Signature │ │ ├── Signature.php │ │ ├── SignatureInterface.php │ │ └── Signer.php │ └── test │ ├── TestCase.php │ └── unit │ ├── HexPrivateKeySerializerTest.php │ ├── HexSignatureSerializerTest.php │ ├── Secp256k1Test.php │ ├── SignatureTest.php │ └── SignerTest.php ├── mdanter └── ecc │ ├── .gitattributes │ ├── .gitignore │ ├── .gitmodules │ ├── .scrutinizer.yml │ ├── .travis.yml │ ├── Makefile │ ├── README.md │ ├── composer.json │ ├── phpunit.full.xml │ ├── phpunit.xml │ ├── src │ ├── Crypto │ │ ├── EcDH │ │ │ ├── EcDH.php │ │ │ └── EcDHInterface.php │ │ ├── Key │ │ │ ├── PrivateKey.php │ │ │ ├── PrivateKeyInterface.php │ │ │ ├── PublicKey.php │ │ │ └── PublicKeyInterface.php │ │ └── Signature │ │ │ ├── HasherInterface.php │ │ │ ├── SignHasher.php │ │ │ ├── Signature.php │ │ │ ├── SignatureInterface.php │ │ │ └── Signer.php │ ├── Curves │ │ ├── CurveFactory.php │ │ ├── NamedCurveFp.php │ │ ├── NistCurve.php │ │ └── SecgCurve.php │ ├── EccFactory.php │ ├── Exception │ │ ├── ExchangeException.php │ │ ├── NumberTheoryException.php │ │ ├── PointException.php │ │ ├── PointNotOnCurveException.php │ │ ├── PointRecoveryException.php │ │ ├── PublicKeyException.php │ │ ├── SignatureDecodeException.php │ │ ├── SquareRootException.php │ │ └── UnsupportedCurveException.php │ ├── Math │ │ ├── DebugDecorator.php │ │ ├── GmpMath.php │ │ ├── GmpMathInterface.php │ │ ├── MathAdapterFactory.php │ │ ├── ModularArithmetic.php │ │ └── NumberTheory.php │ ├── Primitives │ │ ├── CurveFp.php │ │ ├── CurveFpInterface.php │ │ ├── CurveParameters.php │ │ ├── GeneratorPoint.php │ │ ├── Point.php │ │ └── PointInterface.php │ ├── Random │ │ ├── DebugDecorator.php │ │ ├── HmacRandomNumberGenerator.php │ │ ├── RandomGeneratorFactory.php │ │ ├── RandomNumberGenerator.php │ │ └── RandomNumberGeneratorInterface.php │ ├── Serializer │ │ ├── Point │ │ │ ├── CompressedPointSerializer.php │ │ │ ├── PointSerializerInterface.php │ │ │ └── UncompressedPointSerializer.php │ │ ├── PrivateKey │ │ │ ├── DerPrivateKeySerializer.php │ │ │ ├── PemPrivateKeySerializer.php │ │ │ └── PrivateKeySerializerInterface.php │ │ ├── PublicKey │ │ │ ├── Der │ │ │ │ ├── Formatter.php │ │ │ │ └── Parser.php │ │ │ ├── DerPublicKeySerializer.php │ │ │ ├── PemPublicKeySerializer.php │ │ │ └── PublicKeySerializerInterface.php │ │ ├── Signature │ │ │ ├── Der │ │ │ │ ├── Formatter.php │ │ │ │ └── Parser.php │ │ │ ├── DerSignatureSerializer.php │ │ │ └── DerSignatureSerializerInterface.php │ │ └── Util │ │ │ └── CurveOidMapper.php │ └── Util │ │ ├── BinaryString.php │ │ └── NumberSize.php │ └── validate_examples.sh ├── phpseclib └── phpseclib │ ├── AUTHORS │ ├── BACKERS.md │ ├── LICENSE │ ├── README.md │ ├── appveyor.yml │ ├── composer.json │ └── phpseclib │ ├── Crypt │ ├── AES.php │ ├── Base.php │ ├── Blowfish.php │ ├── DES.php │ ├── Hash.php │ ├── RC2.php │ ├── RC4.php │ ├── RSA.php │ ├── Random.php │ ├── Rijndael.php │ ├── TripleDES.php │ └── Twofish.php │ ├── File │ ├── ANSI.php │ ├── ASN1.php │ ├── ASN1 │ │ └── Element.php │ └── X509.php │ ├── Math │ └── BigInteger.php │ ├── Net │ ├── SCP.php │ ├── SFTP.php │ ├── SFTP │ │ └── Stream.php │ ├── SSH1.php │ └── SSH2.php │ ├── System │ └── SSH │ │ ├── Agent.php │ │ └── Agent │ │ └── Identity.php │ ├── bootstrap.php │ └── openssl.cnf ├── psr └── http-message │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ ├── MessageInterface.php │ ├── RequestInterface.php │ ├── ResponseInterface.php │ ├── ServerRequestInterface.php │ ├── StreamInterface.php │ ├── UploadedFileInterface.php │ └── UriInterface.php ├── ralouphie └── getallheaders │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ └── getallheaders.php ├── sc0vu └── web3.php │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── composer.json │ ├── docker │ ├── docker-compose.yml │ ├── ganache │ │ └── Dockerfile │ └── php │ │ ├── Dockerfile-71 │ │ ├── Dockerfile-72 │ │ └── composer-setup.php │ ├── examples │ ├── accounts.php │ ├── contractExample.php │ ├── exampleBase.php │ ├── personal.php │ └── sendTransaction.php │ ├── phpunit.xml │ ├── scripts │ └── test.sh │ ├── src │ ├── Contract.php │ ├── Contracts │ │ ├── Ethabi.php │ │ ├── SolidityType.php │ │ └── Types │ │ │ ├── Address.php │ │ │ ├── Boolean.php │ │ │ ├── Bytes.php │ │ │ ├── DynamicBytes.php │ │ │ ├── IType.php │ │ │ ├── Integer.php │ │ │ ├── Str.php │ │ │ └── Uinteger.php │ ├── Eth.php │ ├── Formatters │ │ ├── AddressFormatter.php │ │ ├── BigNumberFormatter.php │ │ ├── BooleanFormatter.php │ │ ├── HexFormatter.php │ │ ├── IFormatter.php │ │ ├── IntegerFormatter.php │ │ ├── NumberFormatter.php │ │ ├── OptionalQuantityFormatter.php │ │ ├── PostFormatter.php │ │ ├── QuantityFormatter.php │ │ ├── StringFormatter.php │ │ └── TransactionFormatter.php │ ├── Methods │ │ ├── Eth │ │ │ ├── Accounts.php │ │ │ ├── BlockNumber.php │ │ │ ├── Call.php │ │ │ ├── Coinbase.php │ │ │ ├── CompileLLL.php │ │ │ ├── CompileSerpent.php │ │ │ ├── CompileSolidity.php │ │ │ ├── EstimateGas.php │ │ │ ├── GasPrice.php │ │ │ ├── GetBalance.php │ │ │ ├── GetBlockByHash.php │ │ │ ├── GetBlockByNumber.php │ │ │ ├── GetBlockTransactionCountByHash.php │ │ │ ├── GetBlockTransactionCountByNumber.php │ │ │ ├── GetCode.php │ │ │ ├── GetCompilers.php │ │ │ ├── GetFilterChanges.php │ │ │ ├── GetFilterLogs.php │ │ │ ├── GetLogs.php │ │ │ ├── GetStorageAt.php │ │ │ ├── GetTransactionByBlockHashAndIndex.php │ │ │ ├── GetTransactionByBlockNumberAndIndex.php │ │ │ ├── GetTransactionByHash.php │ │ │ ├── GetTransactionCount.php │ │ │ ├── GetTransactionReceipt.php │ │ │ ├── GetUncleByBlockHashAndIndex.php │ │ │ ├── GetUncleByBlockNumberAndIndex.php │ │ │ ├── GetUncleCountByBlockHash.php │ │ │ ├── GetUncleCountByBlockNumber.php │ │ │ ├── GetWork.php │ │ │ ├── Hashrate.php │ │ │ ├── Mining.php │ │ │ ├── NewBlockFilter.php │ │ │ ├── NewFilter.php │ │ │ ├── NewPendingTransactionFilter.php │ │ │ ├── ProtocolVersion.php │ │ │ ├── SendRawTransaction.php │ │ │ ├── SendTransaction.php │ │ │ ├── Sign.php │ │ │ ├── SubmitHashrate.php │ │ │ ├── SubmitWork.php │ │ │ ├── Syncing.php │ │ │ └── UninstallFilter.php │ │ ├── EthMethod.php │ │ ├── IMethod.php │ │ ├── IRPC.php │ │ ├── JSONRPC.php │ │ ├── Net │ │ │ ├── Listening.php │ │ │ ├── PeerCount.php │ │ │ └── Version.php │ │ ├── Personal │ │ │ ├── ListAccounts.php │ │ │ ├── NewAccount.php │ │ │ ├── SendTransaction.php │ │ │ └── UnlockAccount.php │ │ ├── Shh │ │ │ ├── AddToGroup.php │ │ │ ├── GetFilterChanges.php │ │ │ ├── GetMessages.php │ │ │ ├── HasIdentity.php │ │ │ ├── NewFilter.php │ │ │ ├── NewGroup.php │ │ │ ├── NewIdentity.php │ │ │ ├── Post.php │ │ │ ├── UninstallFilter.php │ │ │ └── Version.php │ │ └── Web3 │ │ │ ├── ClientVersion.php │ │ │ └── Sha3.php │ ├── Net.php │ ├── Personal.php │ ├── Providers │ │ ├── HttpProvider.php │ │ ├── IProvider.php │ │ └── Provider.php │ ├── RequestManagers │ │ ├── HttpRequestManager.php │ │ ├── IRequestManager.php │ │ └── RequestManager.php │ ├── Shh.php │ ├── Utils.php │ ├── Validators │ │ ├── AddressValidator.php │ │ ├── BlockHashValidator.php │ │ ├── BooleanValidator.php │ │ ├── CallValidator.php │ │ ├── FilterValidator.php │ │ ├── HexValidator.php │ │ ├── IValidator.php │ │ ├── IdentityValidator.php │ │ ├── NonceValidator.php │ │ ├── PostValidator.php │ │ ├── QuantityValidator.php │ │ ├── ShhFilterValidator.php │ │ ├── StringValidator.php │ │ ├── TagValidator.php │ │ └── TransactionValidator.php │ └── Web3.php │ └── test │ ├── TestCase.php │ └── unit │ ├── AddressFormatterTest.php │ ├── AddressTypeTest.php │ ├── AddressValidatorTest.php │ ├── BigNumberFormatterTest.php │ ├── BlockHashValidatorTest.php │ ├── BooleanFormatterTest.php │ ├── BooleanTypeTest.php │ ├── BooleanValidatorTest.php │ ├── BytesTypeTest.php │ ├── CallValidatorTest.php │ ├── ContractTest.php │ ├── DynamicBytesTypeTest.php │ ├── EthApiTest.php │ ├── EthBatchTest.php │ ├── EthTest.php │ ├── EthabiTest.php │ ├── FilterValidatorTest.php │ ├── HexFormatterTest.php │ ├── HexValidatorTest.php │ ├── HttpProviderTest.php │ ├── IdentityValidatorTest.php │ ├── IntegerFormatterTest.php │ ├── IntegerTypeTest.php │ ├── JSONRPCTest.php │ ├── NetApiTest.php │ ├── NetBatchTest.php │ ├── NetTest.php │ ├── NonceValidatorTest.php │ ├── NumberFormatterTest.php │ ├── OptionalQuantityFormatterTest.php │ ├── PersonalApiTest.php │ ├── PersonalBatchTest.php │ ├── PersonalTest.php │ ├── PostFormatterTest.php │ ├── PostValidatorTest.php │ ├── ProviderTest.php │ ├── QuantityFormatterTest.php │ ├── QuantityValidatorTest.php │ ├── RequestManagerTest.php │ ├── ShhApiTest.php │ ├── ShhBatchTest.php │ ├── ShhFilterValidatorTest.php │ ├── ShhTest.php │ ├── SolidityTypeTest.php │ ├── StrTypeTest.php │ ├── StringFormatterTest.php │ ├── StringValidatorTest.php │ ├── TagValidatorTest.php │ ├── TransactionFormatterTest.php │ ├── TransactionValidatorTest.php │ ├── UintegerTypeTest.php │ ├── UtilsTest.php │ ├── Web3ApiTest.php │ ├── Web3BatchTest.php │ └── Web3Test.php ├── simplito ├── bigint-wrapper-php │ ├── LICENSE.md │ ├── README.md │ ├── composer.json │ ├── lib │ │ └── BigInteger.php │ └── test │ │ ├── perf.php │ │ ├── test.php │ │ ├── testbc.php │ │ └── testgmp.php ├── bn-php │ ├── .gitignore │ ├── LICENSE.md │ ├── README.md │ ├── composer.json │ └── lib │ │ ├── BN.php │ │ └── Red.php └── elliptic-php │ ├── .gitignore │ ├── LICENSE.md │ ├── Makefile │ ├── README.md │ ├── benchmarks │ └── EllipticBench.php │ ├── composer.json │ ├── lib │ ├── Curve │ │ ├── BaseCurve.php │ │ ├── BaseCurve │ │ │ └── Point.php │ │ ├── EdwardsCurve.php │ │ ├── EdwardsCurve │ │ │ └── Point.php │ │ ├── MontCurve.php │ │ ├── MontCurve │ │ │ └── Point.php │ │ ├── PresetCurve.php │ │ ├── ShortCurve.php │ │ └── ShortCurve │ │ │ ├── JPoint.php │ │ │ └── Point.php │ ├── Curves.php │ ├── EC.php │ ├── EC │ │ ├── KeyPair.php │ │ └── Signature.php │ ├── EdDSA.php │ ├── EdDSA │ │ ├── KeyPair.php │ │ └── Signature.php │ ├── HmacDRBG.php │ └── Utils.php │ ├── phpbench.json │ ├── phpunit.xml.dist │ └── tests │ ├── ApiTest.php │ ├── CurveTest.php │ ├── ECDHTest.php │ ├── ECDSATest.php │ ├── ED25519Test.php │ ├── HmacDRBGTest.php │ ├── PointCodecTest.php │ └── fixtures │ ├── derivation-fixtures │ ├── hmac-drbg-nist.json │ └── sign.input ├── stephenhill └── base58 │ ├── .gitignore │ ├── .travis.yml │ ├── benchmarks │ ├── Base16Event.php │ ├── Base58BCMathEvent.php │ ├── Base58GMPEvent.php │ └── Base64Event.php │ ├── composer.json │ ├── contributing.md │ ├── docs │ ├── index.md │ └── navbar.md │ ├── license │ ├── phpunit.xml │ ├── readme.md │ ├── src │ ├── BCMathService.php │ ├── Base58.php │ ├── GMPService.php │ └── ServiceInterface.php │ └── tests │ ├── Base58Test.php │ └── bootstrap.php └── symfony └── polyfill-mbstring ├── LICENSE ├── Mbstring.php ├── README.md ├── Resources └── unidata │ ├── lowerCase.php │ ├── titleCaseRegexp.php │ └── upperCase.php ├── bootstrap.php └── composer.json /README.md: -------------------------------------------------------------------------------- 1 | # PHP-Tron-develop 2 | 3 | 4 | ### create address 5 | 6 | > $ php demo/NewAddressDemo.php 7 | 8 | 9 | ### TRX transfer and balance inquiry 10 | 11 | > $ php demo/TrxDemo.php 12 | 13 | 14 | ### Trc20 token transfer, balance query and event monitoring 15 | 16 | > $ php demo/Trc20Demo.php 17 | 18 | ### Tron smart contract deployment 19 | 20 | > $ php demo/DeployContractDemo.php 21 | 22 | 23 | 24 | 25 | ## Contact me 26 | - For more source code, please contact 27 | ``` 28 | wechat: ixinjiei 29 | ``` 30 | - Help 31 | ``` 32 | http://sc.hubwiz.com/codebag/tron-php-lib/ 33 | ``` 34 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "php": "^7.1", 4 | "guzzlehttp/guzzle": "^6.3", 5 | "kornrunner/secp256k1": "^0.1.2", 6 | "sc0vu/web3.php": "^0.1.4", 7 | "simplito/elliptic-php": "^1.0" 8 | 9 | }, 10 | "autoload": { 11 | "psr-4": { 12 | "TronTool\\": "tron.php/src/" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /demo/DeployContractDemo.php: -------------------------------------------------------------------------------- 1 | address()->base58(); 12 | echo 'from address => ' . $from . PHP_EOL; 13 | 14 | echo 'load contract abi and bytecode...' . PHP_EOL; 15 | $abi = file_get_contents('./contract/build/EzToken.abi'); 16 | $bytecode = file_get_contents('./contract/build/EzToken.bin'); 17 | 18 | echo 'deploy contract...' . PHP_EOL; 19 | $inst = $kit->contract($abi)->bytecode($bytecode); 20 | $ret = $inst->deploy(1000000,'HAPPY COIN',0,'HAPY'); 21 | echo 'txid => ' . $ret->tx->txID . PHP_EOL; 22 | echo 'contract address => ' . $ret->tx->contract_address . PHP_EOL; 23 | echo 'result => ' . $ret->result . PHP_EOL; 24 | 25 | -------------------------------------------------------------------------------- /demo/NewAddressDemo.php: -------------------------------------------------------------------------------- 1 | "; 8 | $credential = Credential::create(); 9 | echo 'private key => ' . $credential->privateKey() . PHP_EOL; 10 | echo "
"; 11 | echo 'public key => ' . $credential->publicKey() . PHP_EOL; 12 | echo "
"; 13 | echo 'address => ' . $credential->address() . PHP_EOL; 14 | echo "
"; 15 | echo 'import an existing private key...' . PHP_EOL; 16 | echo "
"; 17 | $credential = Credential::fromPrivateKey('11e086b1ad5cccb6458357e14d2d01037c32a21f331cf5a8ee248a64c02f48a0'); 18 | echo 'private key => ' . $credential->privateKey() . PHP_EOL; 19 | echo "
"; 20 | echo 'public key => ' . $credential->publicKey() . PHP_EOL; 21 | echo "
"; 22 | echo 'address => ' . $credential->address() . PHP_EOL; 23 | echo "
"; 24 | -------------------------------------------------------------------------------- /demo/TrxDemo.php: -------------------------------------------------------------------------------- 1 | address()->base58(); 13 | echo 'from address => ' . $from . PHP_EOL; 14 | $balance = $kit->getTrxBalance($from); 15 | echo 'from adress balance(trx) => ' . $balance . PHP_EOL; 16 | 17 | $to = 'TBujbL5TkgxNg7NyM97LY6tZE7xdF1RhDT'; 18 | echo 'send trx to ' . $to . '...' . PHP_EOL; 19 | $ret = $kit->sendTrx($to,1000,$from); 20 | echo 'txid => ' . $ret->txid . PHP_EOL; 21 | echo 'result => ' . $ret->result . PHP_EOL; 22 | 23 | $balance = $kit->getTrxBalance($from); 24 | echo 'from adress balance(trx) => ' . $balance . PHP_EOL; 25 | -------------------------------------------------------------------------------- /demo/build-contract.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -o pipefail 5 | 6 | srcDir=contract 7 | abiDir=$srcDir/build/ 8 | 9 | if [ ! -e abiDir ];then 10 | mkdir -p $abiDir 11 | fi 12 | 13 | for file in `ls $srcDir/*.sol`; do 14 | target=$(basename $file .sol) 15 | 16 | echo "Compiling Solidity file ${target}.sol" 17 | 18 | solc --bin --abi --optimize --overwrite \ 19 | --allow-paths "$(pwd)" \ 20 | $file -o $abiDir 21 | echo "Complete" 22 | done 23 | -------------------------------------------------------------------------------- /demo/contract/build/EzToken.addr: -------------------------------------------------------------------------------- 1 | 0x604141a1e1b918d686df5ef4ecd817cc8da540b2 -------------------------------------------------------------------------------- /tron.php/src/ExceptionHandler.php: -------------------------------------------------------------------------------- 1 | getMessage() . PHP_EOL; 10 | echo "- File: " . $e->getFile() . PHP_EOL; 11 | echo "- Line: " . $e->getLine() . PHP_EOL; 12 | echo "- Stack Trace: " . PHP_EOL; 13 | foreach($e->getTrace() as $trace){ 14 | $msg = join(' - ',[ 15 | $trace['function'], 16 | $trace['class'], 17 | $trace['line'] 18 | ]); 19 | echo " - " . $msg . PHP_EOL; 20 | } 21 | echo "===============================================================\n".PHP_EOL; 22 | }); 23 | } 24 | } -------------------------------------------------------------------------------- /tron.php/src/NodeClient.php: -------------------------------------------------------------------------------- 1 | $uri 20 | ]; 21 | $this->client = new Client($opts); 22 | } 23 | 24 | function post($api,$payload=[]){ 25 | $opts = [ 26 | 'json' => $payload 27 | ]; 28 | $rsp = $this->client->post($api,$opts); 29 | return $this->handle($rsp); 30 | } 31 | 32 | function get($api,$query=[]){ 33 | $opts = [ 34 | 'query' => $query 35 | ]; 36 | $rsp = $this->client->get($api,$opts); 37 | return $this->handle($rsp); 38 | } 39 | 40 | function handle($rsp){ 41 | $content = $rsp->getBody(); 42 | //echo $content . PHP_EOL; 43 | return json_decode($content); 44 | } 45 | 46 | function version(){ 47 | return '1.0.0'; 48 | } 49 | } -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 10 | 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 11 | 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 12 | '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 13 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 14 | 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', 15 | ); 16 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/phpseclib/phpseclib/phpseclib'), 10 | 'kornrunner\\' => array($vendorDir . '/kornrunner/keccak/src', $vendorDir . '/kornrunner/secp256k1/src'), 11 | 'Web3\\' => array($vendorDir . '/sc0vu/web3.php/src'), 12 | 'TronTool\\' => array($baseDir . '/tron.php/src'), 13 | 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 14 | 'StephenHill\\Benchmarks\\' => array($vendorDir . '/stephenhill/base58/benchmarks'), 15 | 'StephenHill\\' => array($vendorDir . '/stephenhill/base58/src'), 16 | 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 17 | 'Mdanter\\Ecc\\' => array($vendorDir . '/mdanter/ecc/src'), 18 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 19 | 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 20 | 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 21 | 'FG\\' => array($vendorDir . '/fgrosse/phpasn1/lib'), 22 | 'Elliptic\\' => array($vendorDir . '/simplito/elliptic-php/lib'), 23 | 'BN\\' => array($vendorDir . '/simplito/bn-php/lib'), 24 | 'BI\\' => array($vendorDir . '/simplito/bigint-wrapper-php/lib'), 25 | ); 26 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2015 Friedrich Große 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Composite; 12 | 13 | use FG\ASN1\ASNObject; 14 | use FG\ASN1\Universal\Sequence; 15 | use FG\ASN1\Universal\ObjectIdentifier; 16 | 17 | class AttributeTypeAndValue extends Sequence 18 | { 19 | /** 20 | * @param ObjectIdentifier|string $objIdentifier 21 | * @param \FG\ASN1\ASNObject $value 22 | */ 23 | public function __construct($objIdentifier, ASNObject $value) 24 | { 25 | if ($objIdentifier instanceof ObjectIdentifier == false) { 26 | $objIdentifier = new ObjectIdentifier($objIdentifier); 27 | } 28 | parent::__construct($objIdentifier, $value); 29 | } 30 | 31 | public function __toString() 32 | { 33 | return $this->children[0].': '.$this->children[1]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Composite; 12 | 13 | use FG\ASN1\Universal\PrintableString; 14 | use FG\ASN1\Universal\IA5String; 15 | use FG\ASN1\Universal\UTF8String; 16 | 17 | class RDNString extends RelativeDistinguishedName 18 | { 19 | /** 20 | * @param string|\FG\ASN1\Universal\ObjectIdentifier $objectIdentifierString 21 | * @param string|\FG\ASN1\ASNObject $value 22 | */ 23 | public function __construct($objectIdentifierString, $value) 24 | { 25 | if (PrintableString::isValid($value)) { 26 | $value = new PrintableString($value); 27 | } else { 28 | if (IA5String::isValid($value)) { 29 | $value = new IA5String($value); 30 | } else { 31 | $value = new UTF8String($value); 32 | } 33 | } 34 | 35 | parent::__construct($objectIdentifierString, $value); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Exception/NotImplementedException.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Exception; 12 | 13 | class NotImplementedException extends \Exception 14 | { 15 | } 16 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Exception/ParserException.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Exception; 12 | 13 | class ParserException extends \Exception 14 | { 15 | private $errorMessage; 16 | private $offset; 17 | 18 | public function __construct($errorMessage, $offset) 19 | { 20 | $this->errorMessage = $errorMessage; 21 | $this->offset = $offset; 22 | parent::__construct("ASN.1 Parser Exception at offset {$this->offset}: {$this->errorMessage}"); 23 | } 24 | 25 | public function getOffset() 26 | { 27 | return $this->offset; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Parsable.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1; 12 | 13 | use FG\ASN1\Exception\ParserException; 14 | 15 | /** 16 | * The Parsable interface describes classes that can be parsed from their binary DER representation. 17 | */ 18 | interface Parsable 19 | { 20 | /** 21 | * Parse an instance of this class from its binary DER encoded representation. 22 | * 23 | * @param string $binaryData 24 | * @param int $offsetIndex the offset at which parsing of the $binaryData is started. This parameter ill be modified 25 | * to contain the offset index of the next object after this object has been parsed 26 | * 27 | * @throws ParserException if the given binary data is either invalid or not currently supported 28 | * 29 | * @return static 30 | */ 31 | public static function fromBinary(&$binaryData, &$offsetIndex = null); 32 | } 33 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/BMPString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class BMPString extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 BMP String. 20 | * 21 | * BMPString is a subtype of UniversalString that has its own 22 | * unique tag and contains only the characters in the 23 | * Basic Multilingual Plane (those corresponding to the first 24 | * 64K-2 cells, less cells whose encoding is used to address 25 | * characters outside the Basic Multilingual Plane) of ISO/IEC 10646-1. 26 | * 27 | * TODO The encodable characters of this type are not yet checked. 28 | * 29 | * @param string $string 30 | */ 31 | public function __construct($string) 32 | { 33 | $this->value = $string; 34 | $this->allowAll(); 35 | } 36 | 37 | public function getType() 38 | { 39 | return Identifier::BMP_STRING; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/CharacterString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class CharacterString extends AbstractString 17 | { 18 | public function __construct($string) 19 | { 20 | $this->value = $string; 21 | $this->allowAll(); 22 | } 23 | 24 | public function getType() 25 | { 26 | return Identifier::CHARACTER_STRING; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/Enumerated.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\Identifier; 14 | 15 | class Enumerated extends Integer 16 | { 17 | public function getType() 18 | { 19 | return Identifier::ENUMERATED; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/GeneralString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class GeneralString extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 GeneralString. 20 | * TODO The encodable characters of this type are not yet checked. 21 | * 22 | * @param string $string 23 | */ 24 | public function __construct($string) 25 | { 26 | $this->value = $string; 27 | $this->allowAll(); 28 | } 29 | 30 | public function getType() 31 | { 32 | return Identifier::GENERAL_STRING; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/GraphicString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class GraphicString extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 Graphic String. 20 | * TODO The encodable characters of this type are not yet checked. 21 | * 22 | * @param string $string 23 | */ 24 | public function __construct($string) 25 | { 26 | $this->value = $string; 27 | $this->allowAll(); 28 | } 29 | 30 | public function getType() 31 | { 32 | return Identifier::GRAPHIC_STRING; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/IA5String.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | /** 17 | * The International Alphabet No.5 (IA5) references the encoding of the ASCII characters. 18 | * 19 | * Each character in the data is encoded as 1 byte. 20 | */ 21 | class IA5String extends AbstractString 22 | { 23 | public function __construct($string) 24 | { 25 | parent::__construct($string); 26 | for ($i = 1; $i < 128; $i++) { 27 | $this->allowCharacter(chr($i)); 28 | } 29 | } 30 | 31 | public function getType() 32 | { 33 | return Identifier::IA5_STRING; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/NumericString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class NumericString extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 NumericString. 20 | * 21 | * The following characters are permitted: 22 | * Digits 0,1, ... 9 23 | * SPACE (space) 24 | * 25 | * @param string $string 26 | */ 27 | public function __construct($string) 28 | { 29 | $this->value = $string; 30 | $this->allowNumbers(); 31 | $this->allowSpaces(); 32 | } 33 | 34 | public function getType() 35 | { 36 | return Identifier::NUMERIC_STRING; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/ObjectDescriptor.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\Identifier; 14 | 15 | class ObjectDescriptor extends GraphicString 16 | { 17 | public function __construct($objectDescription) 18 | { 19 | parent::__construct($objectDescription); 20 | } 21 | 22 | public function getType() 23 | { 24 | return Identifier::OBJECT_DESCRIPTOR; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/Sequence.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\Construct; 14 | use FG\ASN1\Parsable; 15 | use FG\ASN1\Identifier; 16 | 17 | class Sequence extends Construct implements Parsable 18 | { 19 | public function getType() 20 | { 21 | return Identifier::SEQUENCE; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/Set.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\Identifier; 14 | 15 | class Set extends Sequence 16 | { 17 | public function getType() 18 | { 19 | return Identifier::SET; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/T61String.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class T61String extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 T61 String. 20 | * TODO The encodable characters of this type are not yet checked. 21 | * 22 | * @see http://en.wikipedia.org/wiki/ITU_T.61 23 | * 24 | * @param string $string 25 | */ 26 | public function __construct($string) 27 | { 28 | $this->value = $string; 29 | $this->allowAll(); 30 | } 31 | 32 | public function getType() 33 | { 34 | return Identifier::T61_STRING; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/UTF8String.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class UTF8String extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 Universal String. 20 | * TODO The encodable characters of this type are not yet checked. 21 | * 22 | * @param string $string 23 | */ 24 | public function __construct($string) 25 | { 26 | $this->value = $string; 27 | $this->allowAll(); 28 | } 29 | 30 | public function getType() 31 | { 32 | return Identifier::UTF8_STRING; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/UniversalString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class UniversalString extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 Universal String. 20 | * TODO The encodable characters of this type are not yet checked. 21 | * 22 | * @see http://en.wikipedia.org/wiki/Universal_Character_Set 23 | * 24 | * @param string $string 25 | */ 26 | public function __construct($string) 27 | { 28 | $this->value = $string; 29 | $this->allowAll(); 30 | } 31 | 32 | public function getType() 33 | { 34 | return Identifier::UNIVERSAL_STRING; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/ASN1/Universal/VisibleString.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\ASN1\Universal; 12 | 13 | use FG\ASN1\AbstractString; 14 | use FG\ASN1\Identifier; 15 | 16 | class VisibleString extends AbstractString 17 | { 18 | /** 19 | * Creates a new ASN.1 Visible String. 20 | * TODO The encodable characters of this type are not yet checked. 21 | * 22 | * @param string $string 23 | */ 24 | public function __construct($string) 25 | { 26 | $this->value = $string; 27 | $this->allowAll(); 28 | } 29 | 30 | public function getType() 31 | { 32 | return Identifier::VISIBLE_STRING; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/X509/AlgorithmIdentifier.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\X509; 12 | 13 | use FG\ASN1\Universal\NullObject; 14 | use FG\ASN1\Composite\AttributeTypeAndValue; 15 | 16 | class AlgorithmIdentifier extends AttributeTypeAndValue 17 | { 18 | public function __construct($objectIdentifierString) 19 | { 20 | parent::__construct($objectIdentifierString, new NullObject()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/X509/PrivateKey.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\X509; 12 | 13 | use FG\ASN1\OID; 14 | use FG\ASN1\Universal\NullObject; 15 | use FG\ASN1\Universal\Sequence; 16 | use FG\ASN1\Universal\BitString; 17 | use FG\ASN1\Universal\ObjectIdentifier; 18 | 19 | class PrivateKey extends Sequence 20 | { 21 | /** 22 | * @param string $hexKey 23 | * @param \FG\ASN1\ASNObject|string $algorithmIdentifierString 24 | */ 25 | public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) 26 | { 27 | parent::__construct( 28 | new Sequence( 29 | new ObjectIdentifier($algorithmIdentifierString), 30 | new NullObject() 31 | ), 32 | new BitString($hexKey) 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/X509/PublicKey.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\X509; 12 | 13 | use FG\ASN1\OID; 14 | use FG\ASN1\Universal\NullObject; 15 | use FG\ASN1\Universal\Sequence; 16 | use FG\ASN1\Universal\BitString; 17 | use FG\ASN1\Universal\ObjectIdentifier; 18 | 19 | class PublicKey extends Sequence 20 | { 21 | /** 22 | * @param string $hexKey 23 | * @param \FG\ASN1\ASNObject|string $algorithmIdentifierString 24 | */ 25 | public function __construct($hexKey, $algorithmIdentifierString = OID::RSA_ENCRYPTION) 26 | { 27 | parent::__construct( 28 | new Sequence( 29 | new ObjectIdentifier($algorithmIdentifierString), 30 | new NullObject() 31 | ), 32 | new BitString($hexKey) 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/fgrosse/phpasn1/lib/X509/SAN/DNSName.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace FG\X509\SAN; 12 | 13 | use FG\ASN1\Universal\GeneralString; 14 | 15 | class DNSName extends GeneralString 16 | { 17 | const IDENTIFIER = 0x82; // not sure yet why this is the identifier used in SAN extensions 18 | 19 | public function __construct($dnsNameString) 20 | { 21 | parent::__construct($dnsNameString); 22 | } 23 | 24 | public function getType() 25 | { 26 | return self::IDENTIFIER; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/.php_cs: -------------------------------------------------------------------------------- 1 | setRiskyAllowed(true) 5 | ->setRules([ 6 | '@PSR2' => true, 7 | 'array_syntax' => ['syntax' => 'short'], 8 | 'declare_strict_types' => false, 9 | 'concat_space' => ['spacing'=>'one'], 10 | 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], 11 | 'ordered_imports' => true, 12 | // 'phpdoc_align' => ['align'=>'vertical'], 13 | // 'native_function_invocation' => true, 14 | ]) 15 | ->setFinder( 16 | PhpCsFixer\Finder::create() 17 | ->in(__DIR__.'/src') 18 | ->in(__DIR__.'/tests') 19 | ->name('*.php') 20 | ) 21 | ; 22 | 23 | return $config; 24 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM composer:latest as setup 2 | 3 | RUN mkdir /guzzle 4 | 5 | WORKDIR /guzzle 6 | 7 | RUN set -xe \ 8 | && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár " --no-interaction \ 9 | && composer require guzzlehttp/guzzle 10 | 11 | 12 | FROM php:7.3 13 | 14 | RUN mkdir /guzzle 15 | 16 | WORKDIR /guzzle 17 | 18 | COPY --from=setup /guzzle /guzzle 19 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 16 | $msg = $msg ?: 'Could not seek the stream to position ' . $pos; 17 | parent::__construct($msg); 18 | } 19 | 20 | /** 21 | * @return StreamInterface 22 | */ 23 | public function getStream() 24 | { 25 | return $this->stream; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/ServerException.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/Makefile: -------------------------------------------------------------------------------- 1 | all: clean test 2 | 3 | test: 4 | vendor/bin/phpunit 5 | 6 | coverage: 7 | vendor/bin/phpunit --coverage-html=artifacts/coverage 8 | 9 | view-coverage: 10 | open artifacts/coverage/index.html 11 | 12 | clean: 13 | rm -rf artifacts/* 14 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/promises", 3 | "description": "Guzzle promises library", 4 | "keywords": ["promise"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Michael Dowling", 9 | "email": "mtdowling@gmail.com", 10 | "homepage": "https://github.com/mtdowling" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.5.0" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "^4.0" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "GuzzleHttp\\Promise\\": "src/" 22 | }, 23 | "files": ["src/functions_include.php"] 24 | }, 25 | "scripts": { 26 | "test": "vendor/bin/phpunit", 27 | "test-ci": "vendor/bin/phpunit --coverage-text" 28 | }, 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.4-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/AggregateException.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/DroppingStream.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 23 | $this->maxLength = $maxLength; 24 | } 25 | 26 | public function write($string) 27 | { 28 | $diff = $this->maxLength - $this->stream->getSize(); 29 | 30 | // Begin returning 0 when the underlying stream is too large. 31 | if ($diff <= 0) { 32 | return 0; 33 | } 34 | 35 | // Write the stream or a subset of the stream if needed. 36 | if (strlen($string) < $diff) { 37 | return $this->stream->write($string); 38 | } 39 | 40 | return $this->stream->write(substr($string, 0, $diff)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/LazyOpenStream.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 27 | $this->mode = $mode; 28 | } 29 | 30 | /** 31 | * Creates the underlying stream lazily when required. 32 | * 33 | * @return StreamInterface 34 | */ 35 | protected function createStream() 36 | { 37 | return stream_for(try_fopen($this->filename, $this->mode)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/NoSeekStream.php: -------------------------------------------------------------------------------- 1 | @,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; 17 | const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; 18 | } 19 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/functions_include.php: -------------------------------------------------------------------------------- 1 | =7.1.0", 14 | "symfony/polyfill-mbstring": "^1.8" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "kornrunner\\": "src" 19 | } 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "kornrunner\\": "test" 24 | } 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "~7", 28 | "php-coveralls/php-coveralls": "^2.1" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/kornrunner/keccak/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | test 17 | 18 | 19 | 20 | 21 | 22 | src 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | coverage_clover: build/logs/clover.xml 3 | json_path: coveralls-upload.json 4 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | 4 | # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control 5 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 6 | # composer.lock 7 | nbproject/ 8 | build/ 9 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.1 5 | - 7.2 6 | - 7.3 7 | - nightly 8 | 9 | matrix: 10 | allow_failures: 11 | - php: nightly 12 | 13 | install: 14 | - phpenv config-rm xdebug.ini || true 15 | - travis_retry composer update --prefer-dist -n 16 | 17 | script: 18 | - mkdir -p build/logs 19 | - phpdbg -qrr vendor/bin/phpunit 20 | 21 | after_script: 22 | - travis_retry vendor/bin/php-coveralls -v 23 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Boris Momčilović 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kornrunner/secp256k1", 3 | "description": "Pure PHP secp256k1", 4 | "keywords": ["secp256k1", "elliptic", "curve", "ecc"], 5 | "type": "library", 6 | "require": { 7 | "php": ">=7.1", 8 | "mdanter/ecc": "^0.5" 9 | }, 10 | "require-dev": { 11 | "phpunit/phpunit": "^7", 12 | "php-coveralls/php-coveralls": "^2.1" 13 | }, 14 | "autoload": { 15 | "psr-4": { 16 | "kornrunner\\": "src/" 17 | } 18 | }, 19 | "autoload-dev": { 20 | "psr-4": { 21 | "kornrunner\\": "test" 22 | } 23 | }, 24 | "license": "MIT", 25 | "authors": [ 26 | { 27 | "name": "Boris Momčilović", 28 | "email": "boris.momcilovic@gmail.com" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | test 17 | 18 | 19 | 20 | 21 | 22 | src 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/src/Serializer/HexPrivateKeySerializer.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 15 | } 16 | 17 | public function serialize(PrivateKeyInterface $key): string { 18 | return gmp_strval($key->getSecret(), 16); 19 | } 20 | 21 | public function parse(string $formattedKey): PrivateKeyInterface { 22 | $key = gmp_init($formattedKey, 16); 23 | 24 | return $this->generator->getPrivateKeyFrom($key); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/src/Serializer/HexSignatureSerializer.php: -------------------------------------------------------------------------------- 1 | getR(); 13 | $s = $signature->getS(); 14 | 15 | return str_pad(gmp_strval($r, 16), 64, '0', STR_PAD_LEFT) . str_pad(gmp_strval($s, 16), 64, '0', STR_PAD_LEFT); 16 | } 17 | 18 | public function parse(string $binary): SignatureInterface { 19 | $binary_lower = mb_strtolower($binary); 20 | 21 | if (strpos($binary_lower, '0x') >= 0) { 22 | $count = 1; 23 | $binary_lower = str_replace('0x', '', $binary_lower, $count); 24 | } 25 | if (mb_strlen($binary_lower) !== 128) { 26 | throw new InvalidArgumentException('Binary string was not correct.'); 27 | } 28 | $r = mb_substr($binary_lower, 0, 64); 29 | $s = mb_substr($binary_lower, 64, 64); 30 | 31 | return new Signature( 32 | gmp_init($r, 16), 33 | gmp_init($s, 16) 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/src/Signature/Signature.php: -------------------------------------------------------------------------------- 1 | serializer = new HexSignatureSerializer; 20 | $this->recoveryParam = $recoveryParam; 21 | } 22 | 23 | public function toHex(): string { 24 | return $this->serializer->serialize($this); 25 | } 26 | 27 | public function getRecoveryParam(): int { 28 | return $this->recoveryParam; 29 | } 30 | } -------------------------------------------------------------------------------- /vendor/kornrunner/secp256k1/src/Signature/SignatureInterface.php: -------------------------------------------------------------------------------- 1 | sigSerializer = new HexSignatureSerializer(); 21 | } 22 | 23 | public function tearDown() {} 24 | } -------------------------------------------------------------------------------- /vendor/mdanter/ecc/.gitattributes: -------------------------------------------------------------------------------- 1 | /doc export-ignore 2 | /examples export-ignore 3 | /tests export-ignore 4 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/.gitignore: -------------------------------------------------------------------------------- 1 | tests/output 2 | vendor/ 3 | 4 | composer.lock 5 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests/import/wycheproof"] 2 | path = tests/import/wycheproof 3 | url = https://github.com/google/wycheproof 4 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/phpunit.full.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ./tests/wycheproof 14 | 15 | 16 | ./tests/unit 17 | 18 | 19 | 20 | 22 | 24 | 25 | 26 | 27 | src/ 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ./tests/unit 14 | 15 | 16 | 17 | 19 | 21 | 22 | 23 | 24 | src/ 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Crypto/Signature/HasherInterface.php: -------------------------------------------------------------------------------- 1 | name = $name; 25 | 26 | parent::__construct($parameters, $adapter); 27 | } 28 | 29 | /** 30 | * @return string 31 | */ 32 | public function getName(): string 33 | { 34 | return $this->name; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Exception/ExchangeException.php: -------------------------------------------------------------------------------- 1 | G = $G; 25 | $this->point = $point; 26 | parent::__construct($message, $code, $previous); 27 | } 28 | 29 | public function getGenerator(): GeneratorPoint 30 | { 31 | return $this->G; 32 | } 33 | 34 | public function getPoint(): PointInterface 35 | { 36 | return $this->point; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Exception/SignatureDecodeException.php: -------------------------------------------------------------------------------- 1 | curveName = $curveName; 28 | return $this; 29 | } 30 | 31 | public function setOid(string $oid) 32 | { 33 | $this->oid = $oid; 34 | return $this; 35 | } 36 | 37 | public function hasCurveName(): bool 38 | { 39 | return is_string($this->curveName); 40 | } 41 | 42 | public function hasOid(): bool 43 | { 44 | return is_string($this->oid); 45 | } 46 | 47 | public function getCurveName(): string 48 | { 49 | return $this->curveName; 50 | } 51 | 52 | public function getOid(): string 53 | { 54 | return $this->oid; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Math/MathAdapterFactory.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 25 | $this->generatorName = $name; 26 | } 27 | 28 | /** 29 | * @param \GMP $max 30 | * @return \GMP 31 | */ 32 | public function generate(\GMP $max): \GMP 33 | { 34 | echo $this->generatorName.'::rand() = '; 35 | 36 | $result = $this->generator->generate($max); 37 | 38 | echo gmp_strval($result, 10).PHP_EOL; 39 | 40 | return $result; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Random/RandomNumberGenerator.php: -------------------------------------------------------------------------------- 1 | adapter = $adapter; 23 | } 24 | 25 | /** 26 | * @param \GMP $max 27 | * @return \GMP 28 | */ 29 | public function generate(\GMP $max): \GMP 30 | { 31 | $numBits = NumberSize::bnNumBits($this->adapter, $max); 32 | $numBytes = (int) ceil($numBits / 8); 33 | // Generate an integer of size >= $numBits 34 | $bytes = random_bytes($numBytes); 35 | $value = $this->adapter->stringToInt($bytes); 36 | 37 | $mask = gmp_sub(gmp_pow(2, $numBits), 1); 38 | $integer = gmp_and($value, $mask); 39 | 40 | return $integer; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Random/RandomNumberGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | getR(), 10)), 20 | new Integer(gmp_strval($signature->getS(), 10)) 21 | ); 22 | } 23 | 24 | /** 25 | * @param SignatureInterface $signature 26 | * @return string 27 | */ 28 | public function serialize(SignatureInterface $signature): string 29 | { 30 | return $this->toAsn($signature)->getBinary(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Serializer/Signature/DerSignatureSerializer.php: -------------------------------------------------------------------------------- 1 | parser = new Der\Parser(); 23 | $this->formatter = new Der\Formatter(); 24 | } 25 | 26 | /** 27 | * @param SignatureInterface $signature 28 | * @return string 29 | */ 30 | public function serialize(SignatureInterface $signature): string 31 | { 32 | return $this->formatter->serialize($signature); 33 | } 34 | 35 | /** 36 | * @param string $binary 37 | * @return SignatureInterface 38 | * @throws \FG\ASN1\Exception\ParserException 39 | */ 40 | public function parse(string $binary): SignatureInterface 41 | { 42 | return $this->parser->parse($binary); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/mdanter/ecc/src/Serializer/Signature/DerSignatureSerializerInterface.php: -------------------------------------------------------------------------------- 1 | > php.ini 17 | - echo extension_dir=ext >> php.ini 18 | - echo extension=php_openssl.dll >> php.ini 19 | - echo extension=php_gmp.dll >> php.ini 20 | - cd C:\projects\phpseclib 21 | - SET PATH=C:\tools\php56;%PATH% 22 | - php.exe -r "readfile('http://getcomposer.org/installer');" | php.exe 23 | - php.exe composer.phar install --prefer-source --no-interaction 24 | 25 | test_script: 26 | - cd C:\projects\phpseclib 27 | - vendor\bin\phpunit.bat tests/Windows32Test.php -------------------------------------------------------------------------------- /vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php: -------------------------------------------------------------------------------- 1 | 10 | * @copyright 2012 Jim Wigginton 11 | * @license http://www.opensource.org/licenses/mit-license.html MIT License 12 | * @link http://phpseclib.sourceforge.net 13 | */ 14 | 15 | namespace phpseclib\File\ASN1; 16 | 17 | /** 18 | * ASN.1 Element 19 | * 20 | * Bypass normal encoding rules in phpseclib\File\ASN1::encodeDER() 21 | * 22 | * @package ASN1 23 | * @author Jim Wigginton 24 | * @access public 25 | */ 26 | class Element 27 | { 28 | /** 29 | * Raw element value 30 | * 31 | * @var string 32 | * @access private 33 | */ 34 | var $element; 35 | 36 | /** 37 | * Constructor 38 | * 39 | * @param string $encoded 40 | * @return \phpseclib\File\ASN1\Element 41 | * @access public 42 | */ 43 | function __construct($encoded) 44 | { 45 | $this->element = $encoded; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/phpseclib/phpseclib/phpseclib/bootstrap.php: -------------------------------------------------------------------------------- 1 | =5.3.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Psr\\Http\\Message\\": "src/" 19 | } 20 | }, 21 | "extra": { 22 | "branch-alias": { 23 | "dev-master": "1.0.x-dev" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ralph Khattar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/README.md: -------------------------------------------------------------------------------- 1 | getallheaders 2 | ============= 3 | 4 | PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3. 5 | 6 | [![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) 7 | [![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) 8 | [![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) 9 | [![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) 10 | [![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) 11 | 12 | 13 | This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). 14 | 15 | ## Install 16 | 17 | For PHP version **`>= 5.6`**: 18 | 19 | ``` 20 | composer require ralouphie/getallheaders 21 | ``` 22 | 23 | For PHP version **`< 5.6`**: 24 | 25 | ``` 26 | composer require ralouphie/getallheaders "^2" 27 | ``` 28 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ralouphie/getallheaders", 3 | "description": "A polyfill for getallheaders.", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Ralph Khattar", 8 | "email": "ralph.khattar@gmail.com" 9 | } 10 | ], 11 | "require": { 12 | "php": ">=5.6" 13 | }, 14 | "require-dev": { 15 | "phpunit/phpunit": "^5 || ^6.5", 16 | "php-coveralls/php-coveralls": "^2.1" 17 | }, 18 | "autoload": { 19 | "files": ["src/getallheaders.php"] 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "getallheaders\\Tests\\": "tests/" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | .phpintel/ 4 | 5 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 6 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 7 | composer.lock 8 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | language: php 4 | 5 | php: 6 | - 7.1 7 | - 7.2 8 | 9 | before_install: 10 | - nvm install 8 11 | 12 | install: 13 | - npm install -g ganache-cli 14 | - composer install 15 | 16 | notifications: 17 | email: 18 | recipients: 19 | - alk03073135@gmail.com 20 | on_success: always 21 | on_failure: always 22 | 23 | script: 24 | - scripts/test.sh 25 | 26 | after_success: 27 | - bash <(curl -s https://codecov.io/bash) -t 8436848f-9a99-4b49-be60-629d7ff9a62c -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Kuan-Cheng,Lai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sc0vu/web3.php", 3 | "description": "Ethereum web3 interface.", 4 | "type": "library", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "sc0Vu", 9 | "email": "alk03073135@gmail.com" 10 | } 11 | ], 12 | "require": { 13 | "guzzlehttp/guzzle": "~6.0", 14 | "PHP": "^7.1", 15 | "kornrunner/keccak": "~1.0", 16 | "phpseclib/phpseclib": "~2.0.11" 17 | }, 18 | "require-dev": { 19 | "phpunit/phpunit": "~6.0" 20 | }, 21 | "autoload": { 22 | "psr-4": { 23 | "Web3\\": "src/" 24 | } 25 | }, 26 | "autoload-dev": { 27 | "psr-4": { 28 | "Test\\": "test/" 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | 5 | php: 6 | build: 7 | context: ./php 8 | dockerfile: Dockerfile-72 9 | volumes: 10 | - ./app:/app 11 | tty: true 12 | 13 | ganache: 14 | build: 15 | context: ./ganache 16 | dockerfile: Dockerfile 17 | ports: 18 | - "8545" 19 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/docker/ganache/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:9.11.1-alpine 2 | 3 | MAINTAINER Peter Lai 4 | 5 | RUN npm install -g ganache-cli 6 | 7 | EXPOSE 8545 8 | 9 | CMD ganache-cli -g 0 -l 6000000 --hostname=0.0.0.0 -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/docker/php/Dockerfile-71: -------------------------------------------------------------------------------- 1 | FROM php:7.1.14-alpine 2 | 3 | MAINTAINER Peter Lai 4 | 5 | ADD composer-setup.php composer-setup.php 6 | 7 | RUN apk update && \ 8 | apk add git 9 | 10 | # Install nodejs 11 | # Run apk add --update nodejs nodejs-npm 12 | 13 | # Install composer 14 | RUN php composer-setup.php && \ 15 | php composer-setup.php --install-dir=/usr/bin --filename=composer 16 | 17 | WORKDIR /app -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/docker/php/Dockerfile-72: -------------------------------------------------------------------------------- 1 | FROM php:7.2.2-alpine 2 | 3 | MAINTAINER Peter Lai 4 | 5 | ADD composer-setup.php composer-setup.php 6 | 7 | RUN apk update && \ 8 | apk add git 9 | 10 | # Install nodejs 11 | # Run apk add --update nodejs nodejs-npm 12 | 13 | # Install composer 14 | RUN php composer-setup.php && \ 15 | php composer-setup.php --install-dir=/usr/bin --filename=composer 16 | 17 | WORKDIR /app -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/docker/php/composer-setup.php: -------------------------------------------------------------------------------- 1 | eth; 6 | 7 | echo 'Eth Get Account and Balance' . PHP_EOL; 8 | $eth->accounts(function ($err, $accounts) use ($eth) { 9 | if ($err !== null) { 10 | echo 'Error: ' . $err->getMessage(); 11 | return; 12 | } 13 | foreach ($accounts as $account) { 14 | echo 'Account: ' . $account . PHP_EOL; 15 | 16 | $eth->getBalance($account, function ($err, $balance) { 17 | if ($err !== null) { 18 | echo 'Error: ' . $err->getMessage(); 19 | return; 20 | } 21 | echo 'Balance: ' . $balance . PHP_EOL; 22 | }); 23 | } 24 | }); -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/examples/exampleBase.php: -------------------------------------------------------------------------------- 1 | personal; 6 | $newAccount = ''; 7 | 8 | echo 'Personal Create Account and Unlock Account' . PHP_EOL; 9 | 10 | // create account 11 | $personal->newAccount('123456', function ($err, $account) use (&$newAccount) { 12 | if ($err !== null) { 13 | echo 'Error: ' . $err->getMessage(); 14 | return; 15 | } 16 | $newAccount = $account; 17 | echo 'New account: ' . $account . PHP_EOL; 18 | }); 19 | 20 | $personal->unlockAccount($newAccount, '123456', function ($err, $unlocked) { 21 | if ($err !== null) { 22 | echo 'Error: ' . $err->getMessage(); 23 | return; 24 | } 25 | if ($unlocked) { 26 | echo 'New account is unlocked!' . PHP_EOL; 27 | } else { 28 | echo 'New account isn\'t unlocked' . PHP_EOL; 29 | } 30 | }); 31 | 32 | 33 | // get balance 34 | $web3->eth->getBalance($newAccount, function ($err, $balance) { 35 | if ($err !== null) { 36 | echo 'Error: ' . $err->getMessage(); 37 | return; 38 | } 39 | echo 'Balance: ' . $balance->toString() . PHP_EOL; 40 | }); 41 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./test/unit 15 | 16 | 17 | 18 | 19 | ./src 20 | 21 | 22 | -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ganache-cli -g 0 -l 6000000 > /dev/null & 4 | ganachecli_pid=$! 5 | echo "Start ganache-cli pid: $ganachecli_pid and sleep 3 seconds" 6 | 7 | sleep 3 8 | 9 | vendor/bin/phpunit --coverage-clover=coverage.xml 10 | ret=$? 11 | 12 | kill -9 $ganachecli_pid 13 | echo "Kill ganache-cli" 14 | 15 | exit $ret -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Contracts/Types/IType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Contracts\Types; 13 | 14 | interface IType 15 | { 16 | /** 17 | * isType 18 | * 19 | * @param string $name 20 | * @return bool 21 | */ 22 | public function isType($name); 23 | 24 | /** 25 | * isDynamicType 26 | * 27 | * @return bool 28 | */ 29 | public function isDynamicType(); 30 | 31 | /** 32 | * inputFormat 33 | * 34 | * @param mixed $value 35 | * @param string $name 36 | * @return string 37 | */ 38 | public function inputFormat($value, $name); 39 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/AddressFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | use Web3\Formatters\IntegerFormatter; 18 | 19 | class AddressFormatter implements IFormatter 20 | { 21 | /** 22 | * format 23 | * to do: iban 24 | * 25 | * @param mixed $value 26 | * @return string 27 | */ 28 | public static function format($value) 29 | { 30 | $value = (string) $value; 31 | 32 | if (Utils::isAddress($value)) { 33 | $value = mb_strtolower($value); 34 | 35 | if (Utils::isZeroPrefixed($value)) { 36 | return $value; 37 | } 38 | return '0x' . $value; 39 | } 40 | $value = IntegerFormatter::format($value, 40); 41 | 42 | return '0x' . $value; 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/BigNumberFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class BigNumberFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return string 25 | */ 26 | public static function format($value) 27 | { 28 | $value = Utils::toString($value); 29 | $bn = Utils::toBn($value); 30 | 31 | return $bn; 32 | } 33 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/BooleanFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class BooleanFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return bool 25 | */ 26 | public static function format($value) 27 | { 28 | return (bool) $value; 29 | } 30 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/HexFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class HexFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return string 25 | */ 26 | public static function format($value) 27 | { 28 | $value = Utils::toString($value); 29 | $value = mb_strtolower($value); 30 | 31 | if (Utils::isZeroPrefixed($value)) { 32 | return $value; 33 | } else { 34 | $value = Utils::toHex($value, true); 35 | } 36 | return $value; 37 | } 38 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/IFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | interface IFormatter 15 | { 16 | /** 17 | * format 18 | * 19 | * @param mixed $value 20 | * @return string 21 | */ 22 | public static function format($value); 23 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/IntegerFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class IntegerFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return string 25 | */ 26 | public static function format($value) 27 | { 28 | $value = (string) $value; 29 | $arguments = func_get_args(); 30 | $digit = 64; 31 | 32 | if (isset($arguments[1]) && is_numeric($arguments[1])) { 33 | $digit = intval($arguments[1]); 34 | } 35 | $bn = Utils::toBn($value); 36 | $bnHex = $bn->toHex(true); 37 | $padded = mb_substr($bnHex, 0, 1); 38 | 39 | if ($padded !== 'f') { 40 | $padded = '0'; 41 | } 42 | return implode('', array_fill(0, $digit-mb_strlen($bnHex), $padded)) . $bnHex; 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/NumberFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class NumberFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return int 25 | */ 26 | public static function format($value) 27 | { 28 | $value = Utils::toString($value); 29 | $bn = Utils::toBn($value); 30 | $int = (int) $bn->toString(); 31 | 32 | return $int; 33 | } 34 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/OptionalQuantityFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | use Web3\Validators\TagValidator; 18 | use Web3\Formatters\QuantityFormatter; 19 | 20 | class OptionalQuantityFormatter implements IFormatter 21 | { 22 | /** 23 | * format 24 | * 25 | * @param mixed $value 26 | * @return string 27 | */ 28 | public static function format($value) 29 | { 30 | if (TagValidator::validate($value)) { 31 | return $value; 32 | } 33 | return QuantityFormatter::format($value); 34 | } 35 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/PostFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | use Web3\Formatters\QuantityFormatter; 18 | 19 | class PostFormatter implements IFormatter 20 | { 21 | /** 22 | * format 23 | * 24 | * @param mixed $value 25 | * @return string 26 | */ 27 | public static function format($value) 28 | { 29 | if (isset($value['priority'])) { 30 | $value['priority'] = QuantityFormatter::format($value['priority']); 31 | } 32 | if (isset($value['ttl'])) { 33 | $value['ttl'] = QuantityFormatter::format($value['ttl']); 34 | } 35 | return $value; 36 | } 37 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/QuantityFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class QuantityFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return string 25 | */ 26 | public static function format($value) 27 | { 28 | $value = Utils::toString($value); 29 | 30 | if (Utils::isZeroPrefixed($value)) { 31 | // test hex with zero ahead, hardcode 0x0 32 | if ($value === '0x0' || strpos($value, '0x0') !== 0) { 33 | return $value; 34 | } 35 | $hex = preg_replace('/^0x0+(?!$)/', '', $value); 36 | } else { 37 | $bn = Utils::toBn($value); 38 | $hex = $bn->toHex(true); 39 | } 40 | if (empty($hex)) { 41 | $hex = '0'; 42 | } else { 43 | $hex = preg_replace('/^0+(?!$)/', '', $hex); 44 | } 45 | return '0x' . $hex; 46 | } 47 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/StringFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | 18 | class StringFormatter implements IFormatter 19 | { 20 | /** 21 | * format 22 | * 23 | * @param mixed $value 24 | * @return string 25 | */ 26 | public static function format($value) 27 | { 28 | return Utils::toString($value); 29 | } 30 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Formatters/TransactionFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Formatters; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Utils; 16 | use Web3\Formatters\IFormatter; 17 | use Web3\Formatters\HexFormatter; 18 | use Web3\Formatters\QuantityFormatter; 19 | 20 | class TransactionFormatter implements IFormatter 21 | { 22 | /** 23 | * format 24 | * 25 | * @param mixed $value 26 | * @return string 27 | */ 28 | public static function format($value) 29 | { 30 | if (isset($value['gas'])) { 31 | $value['gas'] = QuantityFormatter::format($value['gas']); 32 | } 33 | if (isset($value['gasPrice'])) { 34 | $value['gasPrice'] = QuantityFormatter::format($value['gasPrice']); 35 | } 36 | if (isset($value['value'])) { 37 | $value['value'] = QuantityFormatter::format($value['value']); 38 | } 39 | if (isset($value['data'])) { 40 | $value['data'] = HexFormatter::format($value['data']); 41 | } 42 | if (isset($value['nonce'])) { 43 | $value['nonce'] = QuantityFormatter::format($value['nonce']); 44 | } 45 | return $value; 46 | } 47 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/Accounts.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Accounts extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/BlockNumber.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\BigNumberFormatter; 17 | 18 | class BlockNumber extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = []; 26 | 27 | /** 28 | * inputFormatters 29 | * 30 | * @var array 31 | */ 32 | protected $inputFormatters = []; 33 | 34 | /** 35 | * outputFormatters 36 | * 37 | * @var array 38 | */ 39 | protected $outputFormatters = [ 40 | BigNumberFormatter::class 41 | ]; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/Coinbase.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Coinbase extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/CompileLLL.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\StringValidator; 17 | use Web3\Formatters\StringFormatter; 18 | 19 | class CompileLLL extends EthMethod 20 | { 21 | /** 22 | * validators 23 | * 24 | * @var array 25 | */ 26 | protected $validators = [ 27 | StringValidator::class 28 | ]; 29 | 30 | /** 31 | * inputFormatters 32 | * 33 | * @var array 34 | */ 35 | protected $inputFormatters = [ 36 | StringFormatter::class 37 | ]; 38 | 39 | /** 40 | * outputFormatters 41 | * 42 | * @var array 43 | */ 44 | protected $outputFormatters = []; 45 | 46 | /** 47 | * defaultValues 48 | * 49 | * @var array 50 | */ 51 | protected $defaultValues = []; 52 | 53 | /** 54 | * construct 55 | * 56 | * @param string $method 57 | * @param array $arguments 58 | * @return void 59 | */ 60 | // public function __construct($method='', $arguments=[]) 61 | // { 62 | // parent::__construct($method, $arguments); 63 | // } 64 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/CompileSerpent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\StringValidator; 17 | use Web3\Formatters\StringFormatter; 18 | 19 | class CompileSerpent extends EthMethod 20 | { 21 | /** 22 | * validators 23 | * 24 | * @var array 25 | */ 26 | protected $validators = [ 27 | StringValidator::class 28 | ]; 29 | 30 | /** 31 | * inputFormatters 32 | * 33 | * @var array 34 | */ 35 | protected $inputFormatters = [ 36 | StringFormatter::class 37 | ]; 38 | 39 | /** 40 | * outputFormatters 41 | * 42 | * @var array 43 | */ 44 | protected $outputFormatters = []; 45 | 46 | /** 47 | * defaultValues 48 | * 49 | * @var array 50 | */ 51 | protected $defaultValues = []; 52 | 53 | /** 54 | * construct 55 | * 56 | * @param string $method 57 | * @param array $arguments 58 | * @return void 59 | */ 60 | // public function __construct($method='', $arguments=[]) 61 | // { 62 | // parent::__construct($method, $arguments); 63 | // } 64 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/GasPrice.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\BigNumberFormatter; 17 | 18 | class GasPrice extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = []; 26 | 27 | /** 28 | * inputFormatters 29 | * 30 | * @var array 31 | */ 32 | protected $inputFormatters = []; 33 | 34 | /** 35 | * outputFormatters 36 | * 37 | * @var array 38 | */ 39 | protected $outputFormatters = [ 40 | BigNumberFormatter::class 41 | ]; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/GetCompilers.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class GetCompilers extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/GetLogs.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\FilterValidator; 17 | 18 | class GetLogs extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = [ 26 | FilterValidator::class 27 | ]; 28 | 29 | /** 30 | * inputFormatters 31 | * 32 | * @var array 33 | */ 34 | protected $inputFormatters = []; 35 | 36 | /** 37 | * outputFormatters 38 | * 39 | * @var array 40 | */ 41 | protected $outputFormatters = []; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/GetWork.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class GetWork extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/Hashrate.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\BigNumberFormatter; 17 | 18 | class Hashrate extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = []; 26 | 27 | /** 28 | * inputFormatters 29 | * 30 | * @var array 31 | */ 32 | protected $inputFormatters = []; 33 | 34 | /** 35 | * outputFormatters 36 | * 37 | * @var array 38 | */ 39 | protected $outputFormatters = [ 40 | BigNumberFormatter::class 41 | ]; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/Mining.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Mining extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/NewFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\FilterValidator; 17 | 18 | class NewFilter extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = [ 26 | FilterValidator::class 27 | ]; 28 | 29 | /** 30 | * inputFormatters 31 | * 32 | * @var array 33 | */ 34 | protected $inputFormatters = []; 35 | 36 | /** 37 | * outputFormatters 38 | * 39 | * @var array 40 | */ 41 | protected $outputFormatters = []; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/NewPendingTransactionFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class NewPendingTransactionFilter extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/ProtocolVersion.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\BigNumberFormatter; 17 | 18 | class ProtocolVersion extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = []; 26 | 27 | /** 28 | * inputFormatters 29 | * 30 | * @var array 31 | */ 32 | protected $inputFormatters = []; 33 | 34 | /** 35 | * outputFormatters 36 | * 37 | * @var array 38 | */ 39 | protected $outputFormatters = [ 40 | BigNumberFormatter::class 41 | ]; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/SendRawTransaction.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\HexValidator; 17 | use Web3\Formatters\HexFormatter; 18 | 19 | class SendRawTransaction extends EthMethod 20 | { 21 | /** 22 | * validators 23 | * 24 | * @var array 25 | */ 26 | protected $validators = [ 27 | HexValidator::class 28 | ]; 29 | 30 | /** 31 | * inputFormatters 32 | * 33 | * @var array 34 | */ 35 | protected $inputFormatters = [ 36 | HexFormatter::class 37 | ]; 38 | 39 | /** 40 | * outputFormatters 41 | * 42 | * @var array 43 | */ 44 | protected $outputFormatters = []; 45 | 46 | /** 47 | * defaultValues 48 | * 49 | * @var array 50 | */ 51 | protected $defaultValues = []; 52 | 53 | /** 54 | * construct 55 | * 56 | * @param string $method 57 | * @param array $arguments 58 | * @return void 59 | */ 60 | // public function __construct($method='', $arguments=[]) 61 | // { 62 | // parent::__construct($method, $arguments); 63 | // } 64 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/SubmitHashrate.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\BlockHashValidator; 17 | 18 | class SubmitHashrate extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = [ 26 | BlockHashValidator::class, BlockHashValidator::class 27 | ]; 28 | 29 | /** 30 | * inputFormatters 31 | * 32 | * @var array 33 | */ 34 | protected $inputFormatters = []; 35 | 36 | /** 37 | * outputFormatters 38 | * 39 | * @var array 40 | */ 41 | protected $outputFormatters = []; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Eth/Syncing.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Eth; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Syncing extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/IMethod.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods; 13 | 14 | interface IMethod 15 | { 16 | /** 17 | * transform 18 | * 19 | * @param array &$data 20 | * @param array $rules 21 | * @return array 22 | */ 23 | public function transform($data, $rules); 24 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/IRPC.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods; 13 | 14 | interface IRPC 15 | { 16 | /** 17 | * __toString 18 | * 19 | * @return array 20 | */ 21 | public function __toString(); 22 | 23 | /** 24 | * toPayload 25 | * 26 | * @return array 27 | */ 28 | public function toPayload(); 29 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Net/Listening.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Net; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Listening extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Net/PeerCount.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Net; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\BigNumberFormatter; 17 | 18 | class PeerCount extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = []; 26 | 27 | /** 28 | * inputFormatters 29 | * 30 | * @var array 31 | */ 32 | protected $inputFormatters = []; 33 | 34 | /** 35 | * outputFormatters 36 | * 37 | * @var array 38 | */ 39 | protected $outputFormatters = [ 40 | BigNumberFormatter::class 41 | ]; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Net/Version.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Net; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Version extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Personal/ListAccounts.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Personal; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class ListAccounts extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/AddToGroup.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\IdentityValidator; 17 | 18 | class AddToGroup extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = [ 26 | IdentityValidator::class 27 | ]; 28 | 29 | /** 30 | * inputFormatters 31 | * 32 | * @var array 33 | */ 34 | protected $inputFormatters = []; 35 | 36 | /** 37 | * outputFormatters 38 | * 39 | * @var array 40 | */ 41 | protected $outputFormatters = []; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/HasIdentity.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\IdentityValidator; 17 | 18 | class HasIdentity extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = [ 26 | IdentityValidator::class 27 | ]; 28 | 29 | /** 30 | * inputFormatters 31 | * 32 | * @var array 33 | */ 34 | protected $inputFormatters = []; 35 | 36 | /** 37 | * outputFormatters 38 | * 39 | * @var array 40 | */ 41 | protected $outputFormatters = []; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/NewFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Validators\ShhFilterValidator; 17 | 18 | class NewFilter extends EthMethod 19 | { 20 | /** 21 | * validators 22 | * 23 | * @var array 24 | */ 25 | protected $validators = [ 26 | ShhFilterValidator::class 27 | ]; 28 | 29 | /** 30 | * inputFormatters 31 | * 32 | * @var array 33 | */ 34 | protected $inputFormatters = []; 35 | 36 | /** 37 | * outputFormatters 38 | * 39 | * @var array 40 | */ 41 | protected $outputFormatters = []; 42 | 43 | /** 44 | * defaultValues 45 | * 46 | * @var array 47 | */ 48 | protected $defaultValues = []; 49 | 50 | /** 51 | * construct 52 | * 53 | * @param string $method 54 | * @param array $arguments 55 | * @return void 56 | */ 57 | // public function __construct($method='', $arguments=[]) 58 | // { 59 | // parent::__construct($method, $arguments); 60 | // } 61 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/NewGroup.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class NewGroup extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/NewIdentity.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class NewIdentity extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/Post.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\PostFormatter; 17 | use Web3\Validators\PostValidator; 18 | 19 | class Post extends EthMethod 20 | { 21 | /** 22 | * validators 23 | * 24 | * @var array 25 | */ 26 | protected $validators = [ 27 | PostValidator::class 28 | ]; 29 | 30 | /** 31 | * inputFormatters 32 | * 33 | * @var array 34 | */ 35 | protected $inputFormatters = [ 36 | PostFormatter::class 37 | ]; 38 | 39 | /** 40 | * outputFormatters 41 | * 42 | * @var array 43 | */ 44 | protected $outputFormatters = []; 45 | 46 | /** 47 | * defaultValues 48 | * 49 | * @var array 50 | */ 51 | protected $defaultValues = []; 52 | 53 | /** 54 | * construct 55 | * 56 | * @param string $method 57 | * @param array $arguments 58 | * @return void 59 | */ 60 | // public function __construct($method='', $arguments=[]) 61 | // { 62 | // parent::__construct($method, $arguments); 63 | // } 64 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Shh/Version.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Shh; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class Version extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Web3/ClientVersion.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Web3; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | 17 | class ClientVersion extends EthMethod 18 | { 19 | /** 20 | * validators 21 | * 22 | * @var array 23 | */ 24 | protected $validators = []; 25 | 26 | /** 27 | * inputFormatters 28 | * 29 | * @var array 30 | */ 31 | protected $inputFormatters = []; 32 | 33 | /** 34 | * outputFormatters 35 | * 36 | * @var array 37 | */ 38 | protected $outputFormatters = []; 39 | 40 | /** 41 | * defaultValues 42 | * 43 | * @var array 44 | */ 45 | protected $defaultValues = []; 46 | 47 | /** 48 | * construct 49 | * 50 | * @param string $method 51 | * @param array $arguments 52 | * @return void 53 | */ 54 | // public function __construct($method='', $arguments=[]) 55 | // { 56 | // parent::__construct($method, $arguments); 57 | // } 58 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Methods/Web3/Sha3.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Methods\Web3; 13 | 14 | use InvalidArgumentException; 15 | use Web3\Methods\EthMethod; 16 | use Web3\Formatters\HexFormatter; 17 | use Web3\Validators\StringValidator; 18 | 19 | class Sha3 extends EthMethod 20 | { 21 | /** 22 | * validators 23 | * 24 | * @var array 25 | */ 26 | protected $validators = [ 27 | StringValidator::class 28 | ]; 29 | 30 | /** 31 | * inputFormatters 32 | * 33 | * @var array 34 | */ 35 | protected $inputFormatters = [ 36 | HexFormatter::class 37 | ]; 38 | 39 | /** 40 | * outputFormatters 41 | * 42 | * @var array 43 | */ 44 | protected $outputFormatters = []; 45 | 46 | /** 47 | * defaultValues 48 | * 49 | * @var array 50 | */ 51 | protected $defaultValues = []; 52 | 53 | /** 54 | * construct 55 | * 56 | * @param string $method 57 | * @param array $arguments 58 | * @return void 59 | */ 60 | // public function __construct($method='', $arguments=[]) 61 | // { 62 | // parent::__construct($method, $arguments); 63 | // } 64 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Providers/IProvider.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Providers; 13 | 14 | interface IProvider 15 | { 16 | /** 17 | * send 18 | * 19 | * @param \Web3\Methods\Method $method 20 | * @param callable $callback 21 | * @return void 22 | */ 23 | public function send($method, $callback); 24 | 25 | /** 26 | * batch 27 | * 28 | * @param bool $status 29 | * @return void 30 | */ 31 | public function batch($status); 32 | 33 | /** 34 | * execute 35 | * 36 | * @param callable $callback 37 | * @return void 38 | */ 39 | public function execute($callback); 40 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/RequestManagers/IRequestManager.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\RequestManagers; 13 | 14 | interface IRequestManager 15 | { 16 | /** 17 | * sendPayload 18 | * 19 | * @param string $payload 20 | * @param callable $callback 21 | * @return void 22 | */ 23 | public function sendPayload($payload, $callback); 24 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/AddressValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class AddressValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param string $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | if (!is_string($value)) { 27 | return false; 28 | } 29 | return (preg_match('/^0x[a-fA-F0-9]{40}$/', $value) >= 1); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/BlockHashValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class BlockHashValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param string $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | if (!is_string($value)) { 27 | return false; 28 | } 29 | return (preg_match('/^0x[a-fA-F0-9]{64}$/', $value) >= 1); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/BooleanValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class BooleanValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param mixed $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | return is_bool($value); 27 | } 28 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/HexValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class HexValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param string $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | if (!is_string($value)) { 27 | return false; 28 | } 29 | return (preg_match('/^0x[a-fA-F0-9]*$/', $value) >= 1); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/IValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | interface IValidator 15 | { 16 | /** 17 | * validate 18 | * 19 | * @param mixed $value 20 | * @return bool 21 | */ 22 | public static function validate($value); 23 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/IdentityValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class IdentityValidator 17 | { 18 | /** 19 | * validate 20 | * To do: check identity length. 21 | * Spec: 60 bytes, see https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_newidentity 22 | * But returned value is 64 bytes. 23 | * 24 | * @param string $value 25 | * @return bool 26 | */ 27 | public static function validate($value) 28 | { 29 | if (!is_string($value)) { 30 | return false; 31 | } 32 | return (preg_match('/^0x[a-fA-F0-9]*$/', $value) >= 1); 33 | } 34 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/NonceValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class NonceValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param string $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | if (!is_string($value)) { 27 | return false; 28 | } 29 | return (preg_match('/^0x[a-fA-F0-9]{16}$/', $value) >= 1); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/QuantityValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class QuantityValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param string $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | // maybe change is_int and is_float and preg_match future 27 | return (is_int($value) || is_float($value) || preg_match('/^0x[a-fA-F0-9]*$/', $value) >= 1); 28 | } 29 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/StringValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | 16 | class StringValidator 17 | { 18 | /** 19 | * validate 20 | * 21 | * @param string $value 22 | * @return bool 23 | */ 24 | public static function validate($value) 25 | { 26 | return is_string($value); 27 | } 28 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/src/Validators/TagValidator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * @author Peter Lai 9 | * @license MIT 10 | */ 11 | 12 | namespace Web3\Validators; 13 | 14 | use Web3\Validators\IValidator; 15 | use Web3\Utils; 16 | 17 | class TagValidator implements IValidator 18 | { 19 | /** 20 | * validate 21 | * 22 | * @param string $value 23 | * @return bool 24 | */ 25 | public static function validate($value) 26 | { 27 | $value = Utils::toString($value); 28 | $tags = [ 29 | 'latest', 'earliest', 'pending' 30 | ]; 31 | 32 | return in_array($value, $tags); 33 | } 34 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/TestCase.php: -------------------------------------------------------------------------------- 1 | testHost); 46 | $this->web3 = $web3; 47 | 48 | $web3->eth->coinbase(function ($err, $coinbase) { 49 | if ($err !== null) { 50 | return $this->fail($err->getMessage()); 51 | } 52 | $this->coinbase = $coinbase; 53 | }); 54 | } 55 | 56 | /** 57 | * tearDown 58 | * 59 | * @return void 60 | */ 61 | public function tearDown() {} 62 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/BigNumberFormatterTest.php: -------------------------------------------------------------------------------- 1 | formatter = new BigNumberFormatter; 27 | } 28 | 29 | /** 30 | * testFormat 31 | * 32 | * @return void 33 | */ 34 | public function testFormat() 35 | { 36 | $formatter = $this->formatter; 37 | 38 | $bigNumber = $formatter->format(1); 39 | $this->assertEquals($bigNumber->toString(), '1'); 40 | $this->assertTrue($bigNumber instanceof BigNumber); 41 | } 42 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/BooleanFormatterTest.php: -------------------------------------------------------------------------------- 1 | formatter = new BooleanFormatter; 27 | } 28 | 29 | /** 30 | * testFormat 31 | * 32 | * @return void 33 | */ 34 | public function testFormat() 35 | { 36 | $formatter = $this->formatter; 37 | 38 | $boolean = $formatter->format(true); 39 | $this->assertEquals($boolean, true); 40 | 41 | $boolean = $formatter->format(1); 42 | $this->assertEquals($boolean, true); 43 | 44 | $boolean = $formatter->format(false); 45 | $this->assertEquals($boolean, false); 46 | 47 | $boolean = $formatter->format(0); 48 | $this->assertEquals($boolean, false); 49 | } 50 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/BooleanValidatorTest.php: -------------------------------------------------------------------------------- 1 | validator = new BooleanValidator; 26 | } 27 | 28 | /** 29 | * testValidate 30 | * 31 | * @return void 32 | */ 33 | public function testValidate() 34 | { 35 | $validator = $this->validator; 36 | 37 | $this->assertEquals(false, $validator->validate('0XCA35B7D915458EF540ADE6068DFE2F44E8FA733C')); 38 | $this->assertEquals(false, $validator->validate(0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C)); 39 | $this->assertEquals(true, $validator->validate(true)); 40 | } 41 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/EthBatchTest.php: -------------------------------------------------------------------------------- 1 | eth = $this->web3->eth; 28 | } 29 | 30 | /** 31 | * testBatch 32 | * 33 | * @return void 34 | */ 35 | public function testBatch() 36 | { 37 | $eth = $this->eth; 38 | 39 | $eth->batch(true); 40 | $eth->protocolVersion(); 41 | $eth->syncing(); 42 | 43 | $eth->provider->execute(function ($err, $data) { 44 | if ($err !== null) { 45 | return $this->fail('Got error!'); 46 | } 47 | $this->assertTrue($data[0] instanceof BigNumber); 48 | $this->assertTrue($data[1] !== null); 49 | }); 50 | } 51 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/HexFormatterTest.php: -------------------------------------------------------------------------------- 1 | formatter = new HexFormatter; 26 | } 27 | 28 | /** 29 | * testFormat 30 | * 31 | * @return void 32 | */ 33 | public function testFormat() 34 | { 35 | $formatter = $this->formatter; 36 | 37 | $hex = $formatter->format('ae'); 38 | $this->assertEquals($hex, '0x6165'); 39 | 40 | $hex = $formatter->format('0xabce'); 41 | $this->assertEquals($hex, '0xabce'); 42 | 43 | $hex = $formatter->format('123'); 44 | $this->assertEquals($hex, '0x7b'); 45 | 46 | $hex = $formatter->format(12); 47 | $this->assertEquals($hex, '0xc'); 48 | } 49 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/NetBatchTest.php: -------------------------------------------------------------------------------- 1 | net = $this->web3->net; 28 | } 29 | 30 | /** 31 | * testBatch 32 | * 33 | * @return void 34 | */ 35 | public function testBatch() 36 | { 37 | $net = $this->net; 38 | 39 | $net->batch(true); 40 | $net->version(); 41 | $net->listening(); 42 | $net->peerCount(); 43 | 44 | $net->provider->execute(function ($err, $data) { 45 | if ($err !== null) { 46 | return $this->fail('Got error!'); 47 | } 48 | $this->assertTrue(is_string($data[0])); 49 | $this->assertTrue(is_bool($data[1])); 50 | $this->assertTrue($data[2] instanceof BigNumber); 51 | }); 52 | } 53 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/NumberFormatterTest.php: -------------------------------------------------------------------------------- 1 | formatter = new NumberFormatter; 26 | } 27 | 28 | /** 29 | * testFormat 30 | * 31 | * @return void 32 | */ 33 | public function testFormat() 34 | { 35 | $formatter = $this->formatter; 36 | 37 | $number= $formatter->format('123'); 38 | $this->assertEquals($number, 123); 39 | } 40 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/ProviderTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($provider->requestManager->host, 'http://localhost:8545'); 22 | 23 | $requestManager = new RequestManager($this->testRinkebyHost); 24 | $provider->requestManager = $requestManager; 25 | 26 | $this->assertEquals($provider->requestManager->host, 'http://localhost:8545'); 27 | } 28 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/RequestManagerTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($requestManager->host, 'http://localhost:8545'); 19 | $this->assertEquals($requestManager->timeout, 0.1); 20 | 21 | $requestManager->host = $this->testRinkebyHost; 22 | $requestManager->timeout = 1; 23 | $this->assertEquals($requestManager->host, 'http://localhost:8545'); 24 | $this->assertEquals($requestManager->timeout, 0.1); 25 | } 26 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/StringFormatterTest.php: -------------------------------------------------------------------------------- 1 | formatter = new StringFormatter; 26 | } 27 | 28 | /** 29 | * testFormat 30 | * 31 | * @return void 32 | */ 33 | public function testFormat() 34 | { 35 | $formatter = $this->formatter; 36 | 37 | $str = $formatter->format(123456); 38 | $this->assertEquals($str, '123456'); 39 | } 40 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/StringValidatorTest.php: -------------------------------------------------------------------------------- 1 | validator = new StringValidator; 26 | } 27 | 28 | /** 29 | * testValidate 30 | * 31 | * @return void 32 | */ 33 | public function testValidate() 34 | { 35 | $validator = $this->validator; 36 | 37 | $this->assertEquals(true, $validator->validate('0Xca35b7d915458ef540ade6068dfe2f44e8fa733c')); 38 | $this->assertEquals(false, $validator->validate(1234)); 39 | $this->assertEquals(false, $validator->validate(0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C)); 40 | } 41 | } -------------------------------------------------------------------------------- /vendor/sc0vu/web3.php/test/unit/TagValidatorTest.php: -------------------------------------------------------------------------------- 1 | validator = new TagValidator; 26 | } 27 | 28 | /** 29 | * testValidate 30 | * 31 | * @return void 32 | */ 33 | public function testValidate() 34 | { 35 | $validator = $this->validator; 36 | 37 | $this->assertEquals(false, $validator->validate(1234)); 38 | $this->assertEquals(false, $validator->validate(0xCA35B7D915458EF540ADE6068DFE2F44E8FA733C)); 39 | $this->assertEquals(false, $validator->validate('hello')); 40 | $this->assertEquals(true, $validator->validate('latest')); 41 | $this->assertEquals(true, $validator->validate('earliest')); 42 | $this->assertEquals(true, $validator->validate('pending')); 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/simplito/bigint-wrapper-php/LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | ## MIT LICENSE 3 | 4 | Copyright (C) 2018 Simplito 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a 7 | copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to permit 11 | persons to whom the Software is furnished to do so, subject to the 12 | following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included 15 | in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 20 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 21 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 22 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 23 | USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/simplito/bigint-wrapper-php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simplito/bigint-wrapper-php", 3 | "description": "Common interface for php_gmp and php_bcmath modules", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Simplito Team", 8 | "email": "s.smyczynski@simplito.com", 9 | "homepage": "https://simplito.com" 10 | } 11 | ], 12 | "autoload": { 13 | "psr-4": { 14 | "BI\\": "lib/" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/simplito/bigint-wrapper-php/test/perf.php: -------------------------------------------------------------------------------- 1 | binaryAnd($b); 20 | //$v->toBytes(); 21 | //BigInteger::getBC($v, 256); 22 | } 23 | $end = microtime(true); 24 | error_log($end - $start); 25 | } 26 | 27 | test($a, $a); 28 | test($b, $b); 29 | //test($bytes, $b); -------------------------------------------------------------------------------- /vendor/simplito/bigint-wrapper-php/test/testbc.php: -------------------------------------------------------------------------------- 1 | a = (new BN($conf["a"], 16))->toRed($this->red); 21 | $this->b = (new BN($conf["b"], 16))->toRed($this->red); 22 | $this->i4 = (new BN(4))->toRed($this->red)->redInvm(); 23 | $this->a24 = $this->i4->redMul($this->a->redAdd($this->two)); 24 | } 25 | 26 | public function validate($point) 27 | { 28 | $x = $point->normalize()->x; 29 | $x2 = $x->redSqr(); 30 | $rhs = $x2->redMul($x)->redAdd($x2->redMul($this->a))->redAdd($x); 31 | $y = $rhs->redSqr(); 32 | 33 | return $y->redSqr()->cmp($rhs) ===0; 34 | } 35 | 36 | public function decodePoint($bytes, $enc = false) { 37 | return $this->point(Utils::toArray($bytes, $enc), 1); 38 | } 39 | 40 | public function point($x, $z) { 41 | return new Point($this, $x, $z); 42 | } 43 | 44 | public function pointFromJSON($obj) { 45 | return Point::fromJSON($this, $obj); 46 | } 47 | } 48 | 49 | ?> 50 | -------------------------------------------------------------------------------- /vendor/simplito/elliptic-php/lib/Curve/PresetCurve.php: -------------------------------------------------------------------------------- 1 | curve = new ShortCurve($options); 16 | elseif ( $options["type"] === "edwards" ) 17 | $this->curve = new EdwardsCurve($options); 18 | else 19 | $this->curve = new MontCurve($options); 20 | 21 | $this->g = $this->curve->g; 22 | $this->n = $this->curve->n; 23 | $this->hash = isset($options["hash"]) ? $options["hash"] : null; 24 | } 25 | } 26 | 27 | ?> 28 | -------------------------------------------------------------------------------- /vendor/simplito/elliptic-php/phpbench.json: -------------------------------------------------------------------------------- 1 | { 2 | "bootstrap": "vendor/autoload.php", 3 | "path": "benchmarks", 4 | "reports": { 5 | "simple": { 6 | "generator": "table", 7 | "cols": ["subject", "mode", "rstdev", "its", "revs"] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /vendor/simplito/elliptic-php/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | tests 13 | 14 | 15 | 16 | 17 | lib/ 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /vendor/simplito/elliptic-php/tests/ApiTest.php: -------------------------------------------------------------------------------- 1 | assertNotNull($ec); 9 | $this->assertInstanceOf(\Elliptic\EC::class, $ec); 10 | } 11 | 12 | 13 | public function test_should_throw_error_with_invalid_curve() { 14 | $this->setExpectedException("Exception"); 15 | $ec = new \Elliptic\EC('nonexistent-curve'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/simplito/elliptic-php/tests/ECDHTest.php: -------------------------------------------------------------------------------- 1 | doTest('secp256k1'); 7 | } 8 | 9 | public function test_should_work_with_p256_curve() { 10 | $this->doTest('p256'); 11 | } 12 | 13 | public function test_should_work_with_curve25519_curve() { 14 | $this->doTest('curve25519'); 15 | } 16 | 17 | public function test_should_work_with_ed25519_curve() { 18 | $this->doTest('ed25519'); 19 | } 20 | 21 | function doTest($name) { 22 | $ecdh = new \Elliptic\EC($name); 23 | $s1 = $ecdh->genKeyPair(); 24 | $s2 = $ecdh->genKeyPair(); 25 | $sh1 = $s1->derive($s2->getPublic()); 26 | $sh2 = $s2->derive($s1->getPublic()); 27 | 28 | $this->assertEquals($sh1->toString(16), $sh2->toString(16)); 29 | 30 | $sh1 = $s1->derive($ecdh->keyFromPublic($s2->getPublic('hex'), 'hex') 31 | ->getPublic()); 32 | $sh2 = $s2->derive($ecdh->keyFromPublic($s1->getPublic('hex'), 'hex') 33 | ->getPublic()); 34 | $this->assertEquals($sh1->toString(16), $sh2->toString(16)); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/stephenhill/base58/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /bin/ 3 | composer.lock 4 | -------------------------------------------------------------------------------- /vendor/stephenhill/base58/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | before_script: 4 | - composer install 5 | 6 | php: 7 | - 5.3 8 | - 5.4 9 | - 5.5 10 | - 5.6 11 | - 7 12 | - 7.1 13 | - hhvm 14 | 15 | script: bin/phpunit 16 | -------------------------------------------------------------------------------- /vendor/stephenhill/base58/benchmarks/Base16Event.php: -------------------------------------------------------------------------------- 1 | base58 = new Base58(null, new BCMathService()); 16 | } 17 | 18 | /** 19 | * @iterations 10000 20 | */ 21 | public function encodeBase58() 22 | { 23 | $this->base58->encode('Hello World'); 24 | } 25 | 26 | /** 27 | * @iterations 10000 28 | */ 29 | public function decodeBase58() 30 | { 31 | $this->base58->decode('JxF12TrwUP45BMd'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/stephenhill/base58/benchmarks/Base58GMPEvent.php: -------------------------------------------------------------------------------- 1 | base58 = new Base58(null, new GMPService()); 16 | } 17 | 18 | /** 19 | * @iterations 10000 20 | */ 21 | public function encodeBase58() 22 | { 23 | $this->base58->encode('Hello World'); 24 | } 25 | 26 | /** 27 | * @iterations 10000 28 | */ 29 | public function decodeBase58() 30 | { 31 | $this->base58->decode('JxF12TrwUP45BMd'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/stephenhill/base58/benchmarks/Base64Event.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/stephenhill/base58/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | ./tests/ 20 | 21 | 22 | 23 | 24 | 25 | src 26 | 27 | vendor 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /vendor/stephenhill/base58/src/ServiceInterface.php: -------------------------------------------------------------------------------- 1 | =5.3.3" 20 | }, 21 | "autoload": { 22 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 23 | "files": [ "bootstrap.php" ] 24 | }, 25 | "suggest": { 26 | "ext-mbstring": "For best performance" 27 | }, 28 | "minimum-stability": "dev", 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.15-dev" 32 | } 33 | } 34 | } 35 | --------------------------------------------------------------------------------