dequanto 0.1.9 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/clients/ClientPool.d.ts +1 -1
- package/lib/cjs/clients/interfaces/IWeb3Client.d.ts +1 -1
- package/lib/cjs/clients/interfaces/IWeb3EndpointOptions.d.ts +1 -1
- package/lib/cjs/config/ConfigProvider.d.ts +11 -2
- package/lib/cjs/config/ConfigProvider.js +75 -2
- package/lib/cjs/config/ConfigProvider.js.map +1 -1
- package/lib/cjs/hardhat/HardhatProvider.d.ts +3 -2
- package/lib/cjs/hardhat/HardhatProvider.js +23 -13
- package/lib/cjs/hardhat/HardhatProvider.js.map +1 -1
- package/lib/cjs/hardhat/HardhatWeb3Client.js.map +1 -1
- package/lib/cjs/json/JsonStoreFs.js +1 -0
- package/lib/cjs/json/JsonStoreFs.js.map +1 -1
- package/lib/cjs/rpc/transports/DeferredTransport.d.ts +14 -0
- package/lib/cjs/rpc/transports/DeferredTransport.js +42 -0
- package/lib/cjs/rpc/transports/DeferredTransport.js.map +1 -0
- package/lib/cjs/rpc/transports/ITransport.d.ts +3 -2
- package/lib/cjs/rpc/transports/ITransport.js.map +1 -1
- package/lib/cjs/rpc/transports/RpcTransport.js +5 -0
- package/lib/cjs/rpc/transports/RpcTransport.js.map +1 -1
- package/lib/cjs/rpc/transports/WsTransport.js +4 -3
- package/lib/cjs/rpc/transports/WsTransport.js.map +1 -1
- package/lib/cjs/rpc/transports/WsTransportIsomorphic.d.ts +4 -1
- package/lib/cjs/rpc/transports/WsTransportIsomorphic.js +12 -4
- package/lib/cjs/rpc/transports/WsTransportIsomorphic.js.map +1 -1
- package/lib/cjs/rpc/transports/compatibility/Web3Transport.js.map +1 -1
- package/lib/cjs/utils/$dependency.d.ts +4 -0
- package/lib/cjs/utils/$dependency.js +45 -0
- package/lib/cjs/utils/$dependency.js.map +1 -0
- package/lib/cjs/utils/$is.d.ts +1 -0
- package/lib/cjs/utils/$is.js +4 -0
- package/lib/cjs/utils/$is.js.map +1 -1
- package/lib/cjs/utils/$logger.d.ts +3 -1
- package/lib/cjs/utils/$logger.js +37 -15
- package/lib/cjs/utils/$logger.js.map +1 -1
- package/lib/cjs/utils/$machine.js +8 -6
- package/lib/cjs/utils/$machine.js.map +1 -1
- package/lib/esm/clients/ClientPool.d.ts +1 -1
- package/lib/esm/clients/interfaces/IWeb3Client.d.ts +1 -1
- package/lib/esm/clients/interfaces/IWeb3EndpointOptions.d.ts +1 -1
- package/lib/esm/config/ConfigProvider.d.ts +11 -2
- package/lib/esm/config/ConfigProvider.js.map +1 -1
- package/lib/esm/config/ConfigProvider.mjs +71 -2
- package/lib/esm/hardhat/HardhatProvider.d.ts +3 -2
- package/lib/esm/hardhat/HardhatProvider.js.map +1 -1
- package/lib/esm/hardhat/HardhatProvider.mjs +23 -13
- package/lib/esm/hardhat/HardhatWeb3Client.js.map +1 -1
- package/lib/esm/json/JsonStoreFs.js.map +1 -1
- package/lib/esm/json/JsonStoreFs.mjs +1 -0
- package/lib/esm/rpc/transports/DeferredTransport.d.ts +14 -0
- package/lib/esm/rpc/transports/DeferredTransport.js.map +1 -0
- package/lib/esm/rpc/transports/DeferredTransport.mjs +35 -0
- package/lib/esm/rpc/transports/ITransport.d.ts +3 -2
- package/lib/esm/rpc/transports/ITransport.js.map +1 -1
- package/lib/esm/rpc/transports/RpcTransport.js.map +1 -1
- package/lib/esm/rpc/transports/RpcTransport.mjs +5 -0
- package/lib/esm/rpc/transports/WsTransport.js.map +1 -1
- package/lib/esm/rpc/transports/WsTransport.mjs +2 -1
- package/lib/esm/rpc/transports/WsTransportIsomorphic.d.ts +4 -1
- package/lib/esm/rpc/transports/WsTransportIsomorphic.js.map +1 -1
- package/lib/esm/rpc/transports/WsTransportIsomorphic.mjs +11 -4
- package/lib/esm/rpc/transports/compatibility/Web3Transport.js.map +1 -1
- package/lib/esm/utils/$dependency.d.ts +4 -0
- package/lib/esm/utils/$dependency.js.map +1 -0
- package/lib/esm/utils/$dependency.mjs +18 -0
- package/lib/esm/utils/$is.d.ts +1 -0
- package/lib/esm/utils/$is.js.map +1 -1
- package/lib/esm/utils/$is.mjs +4 -0
- package/lib/esm/utils/$logger.d.ts +3 -1
- package/lib/esm/utils/$logger.js.map +1 -1
- package/lib/esm/utils/$logger.mjs +37 -15
- package/lib/esm/utils/$machine.js.map +1 -1
- package/lib/esm/utils/$machine.mjs +8 -6
- package/package-bundler.json +6 -4
- package/package.json +8 -8
- package/src/clients/ClientPool.ts +1 -1
- package/src/clients/interfaces/IWeb3Client.ts +1 -1
- package/src/clients/interfaces/IWeb3EndpointOptions.ts +1 -1
- package/src/config/ConfigProvider.ts +88 -2
- package/src/hardhat/HardhatProvider.ts +26 -13
- package/src/hardhat/HardhatWeb3Client.ts +2 -1
- package/src/json/JsonStoreFs.ts +1 -0
- package/src/rpc/transports/DeferredTransport.ts +32 -0
- package/src/rpc/transports/ITransport.ts +3 -2
- package/src/rpc/transports/RpcTransport.ts +5 -0
- package/src/rpc/transports/WsTransport.ts +2 -1
- package/src/rpc/transports/WsTransportIsomorphic.ts +10 -4
- package/src/rpc/transports/compatibility/Web3Transport.ts +0 -4
- package/src/utils/$dependency.ts +19 -0
- package/src/utils/$is.ts +3 -0
- package/src/utils/$logger.ts +37 -13
- package/src/utils/$machine.ts +8 -6
- package/tsconfig-src.json +3 -2
- package/typings/globals/mocha/index.d.ts +8 -0
- package/typings/index.d.ts +0 -1
- package/cache/bsc/abis.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/06b3883a713ccea614891d4e19b1c5691a14226e976e22bbea3502baa4faf3a2.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/079b67422850620a67b4ce05c09ce12f66a9f62116522f1164daf50d5d645bff.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/09a94cce9de0e31ce006f442a739de1b828f7df29d8d37a3a7f2f18931883a3c.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/0ec8f406f3f7059dc605c39ce790a7490b4f98f07da106beaf66c8d4d7bcc0e7.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/113f6c42439780af7b22f0b3027b0d2a25da877bb7b12ee3f68ed6d3149c6887.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/151d7d8ec80fa8f6a9b5abd7693a3a5c762bea8850ee5883381e9bff8cb0a6b6.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/154fa6dbbdcebc4da9664ef04a0b859ac1a74bd6f9f49beae33afaeebfe783fa.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/1815a48da227e2a214e6aeed9872e86a2b26ee5851ae889bd468b435815bcea0.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/1a2cc6dcc4262de566c3ed80a6850b5671642a2f751fa01ecd5177348fd4718f.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/1ab52130bd0bd378333eb240f864ab5028e7d73a5652b71dce17db16c125ba6a.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/20dbdb2f0b07a4639cd6cef1beba29bb361492a146f953ada143cba8f3a1dfae.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/21899185839289857cf96f18d0c97956835aeb2b7e3d7900f78078d656a6b5bf.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/29b8e5ea3401b14d220de4339db70c73f901c4c6d03fa8c8d295b4a51f0bbda3.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/2a47e8af53078526ae65d395976d17f101b6d37428b4967ee762715acebe518a.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/2b7218cd5f9b727d7d8e44de05977de834eb94d1b33f60bbced7c81f1240b398.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/308b8e224402c15995f32cf94a899ac7d3f69fa2dd825f7b4fe33e7caf0fd23c.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/34a6a1202066b1aa35f2184426d5e67e8ff32970240b4916e063bb66a6cfc199.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/34a9de75d0f1a51cdc15ec0c2b76d2ed0298fe3dcb505c1c7e9a8a22b2af0130.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/3626ae119eb0b64767b3e5d17c09815fde6b7f42e5d938b99bfe6eaa163f79d7.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/3cab8ffc9a63bbbb7277a9b864757ae8ccc247d47666a62317a24be11f6a1411.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/3f5ad2b93311bd9b9a7d2714a4e330fa8ba0d1dbbb719479172305675cd6690b.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/41fd308e751cdcb1eb3dd7067762900577caff38c4e10cfcaa06419a7f8b7be8.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/42b00c8ab072ef7ea0e2c8eae031b36a17531d7686074d87299d5a861e768364.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/45d6b5f592cb25c1abb38ea6e5cfb8a3cc4d4e70a2f9540b3973e17ccf89f0c6.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/470301436d8bdf0e9ac28f33a05da66135cd405782cb5ccf32280807f44b0988.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/47583c90cddbebadcbf41201dc531919deab532c559100510f0b05ab06b45430.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/4d086a4e3b7040f41d366912a0a55c67d19fa1a05bc52fff37de4ee2896a21e7.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/4e46989a86be4e648edd4c9b10514f9ec06adb2b6cfb62dc1cd6e00ff5d69ce2.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/51140386ea4671060999a6e823f4598662dec599cd4293e05cbb244ad77f6396.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/56d0d1c1591c3bf3a38d7215d8b63f253973dbb3142c9970b59c453a498c0ad3.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/5cbe44014053d4c9663001112bb2c8a3ea28e803f644d526e58af1b9879fe31f.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/61938c222249acac4bbc25d9bcdfd5ff510acde168804dd74ce04ad6e6566658.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/625a4f0298c9dea7f31bb31d401d77449da967829269f593c7d2786d9ecb0934.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/67df3e0b260580a4fafd9b4d3e4c63bb69b912d5b22d1773613001432e1af77c.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/69a53481cf4fcc9311439e89111e2cfba9a6a56e0a48dfffb597d87d980ce40d.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/6bad2a9a9fa137fe43a9a9ab83849f3fbfc1b78564e615500b809056caf785a3.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/6cb6347b8cdb1ae0215bbb5e93dce4577ca03786631a0c5ca4d43c2ef6c4c59f.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/73827c7b69ffe133353fd0ba8bbc0d974d587257d908a4a96a8c5562a3022831.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/75529d03d2e92f6522294ad893e487812c26cdba3c5f0d27e373aea4a20b8d2a.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/7558bfcb3ab56d098a0d3a36df3cc33b73baceb4de35708c674a1671be7a1ccb.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/77c088a49e34f40799b0d595fb48e3908924a1d3a860bd4f179a8fe63122fbbe.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/77d492f9ae5092e3e4c175b60965766d3c8e60db2ad9ada16dbf108eac499a5b.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/8045eb7990994b374f8ef946306373e225b695c5810ffce4f17e77506665d158.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/817fe74bc9c2182cc105127046893e62b5dd7fa59efacc0bfb3e7d6a43bb8cb3.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/8192bea1a5dfac7a97a222f0078d914aae280b5953dec0994b71423b9df3e7e5.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/8299732babc9534320e778a75f24daddfad8280c514e34964ccd2d8168332b45.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/84d91e0f00bec021b825ab78660b5c5f3874caab246819d605da9d1aa7e84306.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/85fb10ebf27b7803d2a8806d1047459affadef3a62970f6d692678a4591a6498.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/87f6cbfcf204af0f72ac7a215e582f4d9bf1218fad0effc52959cb83163ac2cc.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/8940a4a674082e2af39e4bd4a6d1d36374f10df320e426b56536ed439a383365.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/89e6e12dcc0021530ed238e844134926067b428a5e8414f0beaf886d7962bae0.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/90f938e8ecfcf370ec8da736b2b5ab3341873141efbf8c0f132743bcf3f24089.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/9238431e9c6ed8f126b075d0dd4969ee66338e5b1bc6b1ad4c654966618d3ed7.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/95ea21ac78029bac293ff7286f0f6d89b5e1bc05b9b1dc814913941d9e40deb8.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/973bc296c63de86c49bca7350e3f96679c1e69da10b70fe8bc1431b37519df29.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/9998badf77e39248f459284f0ac11af6745e4007745e79e3a29cb809a84f89b1.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/a26aa034791865f648ff0997e648fa615e8c3edd9566f26d7b3c3f082d0d14f9.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/a4a9f3fd0019c64c9c291ddcf286ab19218c102bf11aaca35b5c7bfa8449a93b.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/a975285deef903789a7dacf314a36c4350d2fb0414fac2c7249948311e515a5b.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/af6e0b65b31e8108f886542ce4fb358d991e2c88e79549ba4c9042f98e8e9145.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/b32274854cd4e585902f93ffef63c422f1957c64839ac710cc8c07ce2d58f74c.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/b6b0bbeebdf99f0bcb3a21eb98dc5d22362c4dceeb9c471fd183528d568042ad.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/b84116063d7cc2ccdfcd94e00a6ac33356d5a4308411f70f6f9eec4d661d32a9.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/b92951142c439cc8ccbe0c667086d84df6276afb19d0002baddaaf075871c1dd.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/c19bb4c50c4afcb1a3e80126ef2d08147e9a4ea86bd9c84d200d0dc08ae19922.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/c268dfa99b07c50f55163f75c4fe9a2787d46edabc24ffae240cad58f6aeacd2.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/c8e88ada9bb106ed08ea76fffeff5242d47a1975c91e599f3d3dd38131f8fd10.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/d3899a459ef27a2d0c61ae8a1ba5f38caac13e7f6a746e1d741a9f87dec106ca.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/d56f13a93a87afb097f2a877cda630a1281d01bf353aca5201410c3c9a1de156.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/d7253417c7aa7bba38ed61d379a5a593c33ede0edd5680ea933db86171e07f1c.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/d8ac38bc679dafbd5f7800c6ff78968bdc0f1ea4979c48c74e99483559678931.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e09e8fa017b1b949ea208f1dd523d09936e98ffea01c79537aeb03454d0a7e96.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e34abf78e64af8214b1135d2ef264a37a22d3c5dcdff8278c4bfed57669d70af.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e471e0ddf62845e63a391dee436aa5556212a33ff395824959472f22575b261b.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e561394820e6d3b8eebc06ebbca7c731b008ecddebc5757ef0a50bb1a67786e5.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e63e8e37369ae69830629bd62fca4c09eb49b5469a6c50902886ee8505689f22.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e6dbb83cda8ce195ea7a6661b51c46803fcbd6d663edba4a04c0a86b4e5ab9c8.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/e7a59e35bb68853d63e5fd121633823ea4983c05c02d45f88f763509eb15f3ef.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/efebf090b661494cd62fd19b1166e6982bf95fcdd61b632ca61da1d61a8d4916.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/f10e759c96a69a4a7eb149cdf5d268307eab562e76b21eb03107abc23a376882.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/f133d50e1ec3b8447bee0316cd6e85e16aad3f434e78351f62fd51477412d200.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/f3060271e1a167a5835ad69a97d89145bf8871272b9b98356054e13353ff4260.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/f51529183ab657ae360e67fff00e38e98d7ef6fec41724a0d42fe993d83d0a51.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/f8251e7f4cc943eaeab53c6f7f7edc7893dafa2820c3b781c67fae659189c0c3.json +0 -1
- package/cache/hardhat-network-fork/rpc_cache/eth.public-rpc.com/1/fe55e62f0b66c738fbaaa61a166a2740ab381502096b797c9c6795778b52d2e6.json +0 -1
- package/cache/poly/abis-source.json +0 -1
- package/cache/poly/abis.json +0 -1
- package/cache/solidity-files-cache.json +0 -4146
- package/lib/cjs/config/ConfigProviderBrowser.d.ts +0 -8
- package/lib/cjs/config/ConfigProviderBrowser.js +0 -20
- package/lib/cjs/config/ConfigProviderBrowser.js.map +0 -1
- package/lib/cjs/config/ConfigProviderIsoPlatform.d.ts +0 -11
- package/lib/cjs/config/ConfigProviderIsoPlatform.js +0 -80
- package/lib/cjs/config/ConfigProviderIsoPlatform.js.map +0 -1
- package/lib/esm/config/ConfigProviderBrowser.d.ts +0 -8
- package/lib/esm/config/ConfigProviderBrowser.js.map +0 -1
- package/lib/esm/config/ConfigProviderBrowser.mjs +0 -13
- package/lib/esm/config/ConfigProviderIsoPlatform.d.ts +0 -11
- package/lib/esm/config/ConfigProviderIsoPlatform.js.map +0 -1
- package/lib/esm/config/ConfigProviderIsoPlatform.mjs +0 -73
- package/src/config/ConfigProviderBrowser.ts +0 -21
- package/src/config/ConfigProviderIsoPlatform.ts +0 -90
|
@@ -1,4 +1,90 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AppConfig from 'appcfg'
|
|
2
|
+
import { Config as Appcfg } from 'appcfg/Config';
|
|
2
3
|
|
|
4
|
+
import { IConfigProvider, TConfigParamsNode } from './AConfigBase';
|
|
5
|
+
import { IConfigData } from './interface/IConfigData';
|
|
6
|
+
import { $cli } from '../utils/$cli';
|
|
7
|
+
import { $secret } from '../utils/$secret';
|
|
8
|
+
import { $require } from '@dequanto/utils/$require';
|
|
9
|
+
import { is_BROWSER } from '@dequanto/utils/$const';
|
|
10
|
+
import { ConfigDefaults } from './ConfigDefaults';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export class ConfigProvider implements IConfigProvider {
|
|
14
|
+
|
|
15
|
+
config: Appcfg<IConfigData>
|
|
16
|
+
|
|
17
|
+
async fetch (parameters?: TConfigParamsNode) {
|
|
18
|
+
|
|
19
|
+
let sources = is_BROWSER
|
|
20
|
+
? await this.getSourcesBrowser(parameters)
|
|
21
|
+
: await this.getSourcesNode(parameters)
|
|
22
|
+
;
|
|
23
|
+
|
|
24
|
+
let cfg = await AppConfig.fetch<IConfigData>(sources);
|
|
25
|
+
|
|
26
|
+
if (this.config != null) {
|
|
27
|
+
this.config.$extend(cfg.toJSON());
|
|
28
|
+
} else {
|
|
29
|
+
this.config = cfg;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return this.config = cfg;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async extend (json: Partial<IConfigData>): Promise<void> {
|
|
36
|
+
$require.notNull(this.config, `Config was not fetched yet. Call fetch() first.`);
|
|
37
|
+
await this.config.$write(json);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
private async getSourcesNode (parameters: TConfigParamsNode) {
|
|
42
|
+
let unlockedAccountsKey = await $secret.getPin(parameters);
|
|
43
|
+
let configPathAccounts = $cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
44
|
+
let configPathGlobal = $cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
45
|
+
|
|
46
|
+
return [
|
|
47
|
+
{
|
|
48
|
+
config: ConfigDefaults,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
path: `./configs/dequanto.yml`,
|
|
52
|
+
optional: true,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
path: configPathGlobal,
|
|
56
|
+
writable: true,
|
|
57
|
+
optional: true,
|
|
58
|
+
extendArrays: false,
|
|
59
|
+
},
|
|
60
|
+
unlockedAccountsKey ? {
|
|
61
|
+
name: 'accounts',
|
|
62
|
+
path: configPathAccounts,
|
|
63
|
+
writable: true,
|
|
64
|
+
optional: true,
|
|
65
|
+
secret: unlockedAccountsKey
|
|
66
|
+
} : null,
|
|
67
|
+
{
|
|
68
|
+
path: 'package.json',
|
|
69
|
+
getterProperty: 'dequanto',
|
|
70
|
+
optional: true,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: 'dequanto.yml',
|
|
74
|
+
optional: true
|
|
75
|
+
},
|
|
76
|
+
parameters?.dotenv ? {
|
|
77
|
+
dotenv: true
|
|
78
|
+
} : null,
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private async getSourcesBrowser (parameters: TConfigParamsNode) {
|
|
83
|
+
return [
|
|
84
|
+
{
|
|
85
|
+
config: ConfigDefaults
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
3
90
|
|
|
4
|
-
export const ConfigProvider = ConfigProviderPlatform;
|
|
@@ -32,11 +32,12 @@ import { $date } from '@dequanto/utils/$date';
|
|
|
32
32
|
import { $hex } from '@dequanto/utils/$hex';
|
|
33
33
|
import { TAddress } from '@dequanto/models/TAddress';
|
|
34
34
|
import { $contract } from '@dequanto/utils/$contract';
|
|
35
|
+
import { $dependency } from '@dequanto/utils/$dependency';
|
|
36
|
+
import { TTransport } from '@dequanto/rpc/transports/ITransport';
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
type THardhatLib = typeof import('hardhat');
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
hh = require('hardhat');
|
|
40
|
+
export class HardhatProvider {
|
|
40
41
|
|
|
41
42
|
@memd.deco.memoize()
|
|
42
43
|
client(network: 'hardhat' | 'localhost' = 'hardhat', opts: IWeb3EndpointOptions = null) {
|
|
@@ -51,7 +52,7 @@ export class HardhatProvider {
|
|
|
51
52
|
{ url: 'ws://127.0.0.1:8545' },
|
|
52
53
|
];
|
|
53
54
|
} else {
|
|
54
|
-
opts.web3 = this.
|
|
55
|
+
opts.web3 = this.getHardhatProvider();
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
const client = new HardhatWeb3Client(opts);
|
|
@@ -59,7 +60,7 @@ export class HardhatProvider {
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
async forked (params: { platform?: TPlatform, url?: string, block?: number | 'latest' } = {}) {
|
|
62
|
-
const client = this.client('hardhat');
|
|
63
|
+
const client = await this.client('hardhat');
|
|
63
64
|
let { url, block } = params;
|
|
64
65
|
if (url == null) {
|
|
65
66
|
let platform = params.platform;
|
|
@@ -88,8 +89,8 @@ export class HardhatProvider {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
@memd.deco.memoize()
|
|
91
|
-
explorer (network: 'hardhat' | 'localhost' = 'hardhat') {
|
|
92
|
-
let client = this.client(network);
|
|
92
|
+
async explorer (network: 'hardhat' | 'localhost' = 'hardhat') {
|
|
93
|
+
let client = await this.client(network);
|
|
93
94
|
let Ctor = BlockChainExplorerProvider.create({
|
|
94
95
|
platform: 'hardhat',
|
|
95
96
|
getWeb3: () => client,
|
|
@@ -101,8 +102,10 @@ export class HardhatProvider {
|
|
|
101
102
|
|
|
102
103
|
@memd.deco.memoize()
|
|
103
104
|
deployer(index: number = 0): EoAccount {
|
|
104
|
-
const
|
|
105
|
-
const
|
|
105
|
+
// const hh = await this.getHardhat();
|
|
106
|
+
// const accounts: any = hh.config.networks.hardhat.accounts;
|
|
107
|
+
const mnemonic = `test test test test test test test test test test test junk`;
|
|
108
|
+
const account = $sig.$account.fromMnemonic(mnemonic, index);
|
|
106
109
|
return {
|
|
107
110
|
key: account.key,
|
|
108
111
|
address: account.address,
|
|
@@ -208,7 +211,7 @@ export class HardhatProvider {
|
|
|
208
211
|
|
|
209
212
|
const receipt = await Factory.deploy();
|
|
210
213
|
const { contract, ContractCtor } = await ContractClassFactory.fromAbi<TReturn>(receipt.contractAddress, abi, client, null);
|
|
211
|
-
const explorer = this.explorer();
|
|
214
|
+
const explorer = await this.explorer();
|
|
212
215
|
explorer.localDb.push({ name: '', abi: abi, address: receipt.contractAddress });
|
|
213
216
|
|
|
214
217
|
return {
|
|
@@ -249,7 +252,7 @@ export class HardhatProvider {
|
|
|
249
252
|
const receipt = await Factory.deploy();
|
|
250
253
|
const { contract, ContractCtor } = await ContractClassFactory.fromAbi<TReturn>(receipt.contractAddress, abi, client, null);
|
|
251
254
|
|
|
252
|
-
const explorer = this.explorer();
|
|
255
|
+
const explorer = await this.explorer();
|
|
253
256
|
explorer.localDb.push({ name: '', abi: abi, address: receipt.contractAddress });
|
|
254
257
|
return {
|
|
255
258
|
contract,
|
|
@@ -297,8 +300,8 @@ export class HardhatProvider {
|
|
|
297
300
|
artifacts,
|
|
298
301
|
tsgen: false,
|
|
299
302
|
};
|
|
300
|
-
|
|
301
|
-
await
|
|
303
|
+
const hh = await this.getHardhat();
|
|
304
|
+
await hh.run('compile', hhOptions);
|
|
302
305
|
|
|
303
306
|
if (root == null) {
|
|
304
307
|
root = 'file://' + $path.normalize(process.cwd());
|
|
@@ -494,4 +497,14 @@ export class HardhatProvider {
|
|
|
494
497
|
})
|
|
495
498
|
}
|
|
496
499
|
|
|
500
|
+
@memd.deco.memoize()
|
|
501
|
+
private async getHardhat (): Promise<THardhatLib> {
|
|
502
|
+
return await $dependency.load<THardhatLib>('hardhat');
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
private async getHardhatProvider (): Promise<TTransport.Transport> {
|
|
506
|
+
const hh = await this.getHardhat();
|
|
507
|
+
return hh.network.provider as any as TTransport.Transport;
|
|
508
|
+
}
|
|
509
|
+
|
|
497
510
|
}
|
|
@@ -3,6 +3,7 @@ import { Web3Client } from '../clients/Web3Client';
|
|
|
3
3
|
import { TPlatform } from '@dequanto/models/TPlatform';
|
|
4
4
|
import { IWeb3EndpointOptions } from '../clients/interfaces/IWeb3EndpointOptions';
|
|
5
5
|
import { ClientEndpoints } from '../clients/utils/ClientEndpoints';
|
|
6
|
+
import { IWeb3ClientOptions } from '@dequanto/clients/interfaces/IWeb3Client';
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
// https://hardhat.org/hardhat-network/reference/
|
|
@@ -18,7 +19,7 @@ export class HardhatWeb3Client extends Web3Client {
|
|
|
18
19
|
defaultGasLimit = 2_000_000
|
|
19
20
|
|
|
20
21
|
constructor (opts?: IWeb3EndpointOptions) {
|
|
21
|
-
super({
|
|
22
|
+
super(<IWeb3ClientOptions> {
|
|
22
23
|
...(opts ?? {}),
|
|
23
24
|
endpoints: ClientEndpoints.filterEndpoints($config.get('web3.hardhat.endpoints'), opts),
|
|
24
25
|
debug: {
|
package/src/json/JsonStoreFs.ts
CHANGED
|
@@ -115,6 +115,7 @@ export class JsonStoreFs<T> {
|
|
|
115
115
|
let str = this.encode(data);
|
|
116
116
|
|
|
117
117
|
await this.file.writeAsync(str, { skipHooks: true });
|
|
118
|
+
this.lock.resolve();
|
|
118
119
|
this.callWriteListeners(v, null);
|
|
119
120
|
} catch (error) {
|
|
120
121
|
console.error(`JsonStoreFs.WriteInner> ${this.path}`, error);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import memd from 'memd';
|
|
2
|
+
import { TTransport } from './ITransport';
|
|
3
|
+
|
|
4
|
+
export class DeferredTransport implements TTransport.Transport {
|
|
5
|
+
constructor(private deferred: Promise<TTransport.Options.Any>, private factory: (info: TTransport.Options.Any) => TTransport.Transport) {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
async request(req: TTransport.Request)
|
|
11
|
+
async request(req: TTransport.Request[])
|
|
12
|
+
async request(req: any) {
|
|
13
|
+
const inner = await this.getInner();
|
|
14
|
+
return inner.request(req);
|
|
15
|
+
}
|
|
16
|
+
async subscribe<TResult = any>(req: TTransport.Request): Promise<TTransport.Subscription<TResult>> {
|
|
17
|
+
const inner = await this.getInner();
|
|
18
|
+
return inner.subscribe(req);
|
|
19
|
+
}
|
|
20
|
+
async unsubscribe(req: TTransport.Request & { method: 'eth_unsubscribe'; params: [number]; }): Promise<TTransport.Subscription<any>> {
|
|
21
|
+
const inner = await this.getInner();
|
|
22
|
+
return inner.unsubscribe(req);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@memd.deco.memoize()
|
|
27
|
+
private async getInner () {
|
|
28
|
+
const transportInfo = await this.deferred;
|
|
29
|
+
const transport = this.factory(transportInfo);
|
|
30
|
+
return transport;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IWeb3EndpointOptions } from '@dequanto/clients/interfaces/IWeb3EndpointOptions';
|
|
2
|
+
import type { TEth } from '@dequanto/models/TEth';
|
|
2
3
|
import type { ClientOptions } from 'ws'
|
|
3
4
|
|
|
4
5
|
export namespace TTransport {
|
|
@@ -56,7 +57,7 @@ export namespace TTransport {
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
export type Web3Wrapper = {
|
|
59
|
-
web3
|
|
60
|
+
web3: IWeb3EndpointOptions['web3']
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
}
|
|
@@ -4,6 +4,8 @@ import { WsTransport } from './WsTransport';
|
|
|
4
4
|
import { TTransport } from './ITransport';
|
|
5
5
|
import { EIP1193Transport, IEip1193Provider } from './compatibility/EIP1193Transport';
|
|
6
6
|
import { Web3Transport } from './compatibility/Web3Transport';
|
|
7
|
+
import { $is } from '@dequanto/utils/$is';
|
|
8
|
+
import { DeferredTransport } from './DeferredTransport';
|
|
7
9
|
|
|
8
10
|
export namespace RpcTransport {
|
|
9
11
|
|
|
@@ -40,6 +42,9 @@ export namespace RpcTransport {
|
|
|
40
42
|
return mix;
|
|
41
43
|
}
|
|
42
44
|
if ('web3' in mix && mix.web3 != null) {
|
|
45
|
+
if ($is.Promise(mix.web3)) {
|
|
46
|
+
return new DeferredTransport(mix.web3, create);
|
|
47
|
+
}
|
|
43
48
|
if ('currentProvider' in mix.web3 && 'eth' in mix.web3) {
|
|
44
49
|
return new Web3Transport(mix.web3);
|
|
45
50
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memd from 'memd';
|
|
2
|
-
import
|
|
2
|
+
import { WebSocketProvider } from './WsTransportIsomorphic'
|
|
3
3
|
import { TTransport } from './ITransport';
|
|
4
4
|
import { MessageBasedTransport } from './MessageBasedTransport';
|
|
5
5
|
import { RpcSubscription } from '../RpcSubscription';
|
|
@@ -52,6 +52,7 @@ class WsTransportSingleton extends MessageBasedTransport {
|
|
|
52
52
|
@memd.deco.memoize({ perInstance: true })
|
|
53
53
|
private async connect() {
|
|
54
54
|
const { url, clientConfig } = this.options
|
|
55
|
+
const WebSocket = await WebSocketProvider.get();
|
|
55
56
|
const ws = new WebSocket(url, clientConfig ?? {});
|
|
56
57
|
|
|
57
58
|
const onMessage = ({ data }) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { $dependency } from '@dequanto/utils/$dependency';
|
|
2
|
+
|
|
1
3
|
declare var MozWebSocket;
|
|
2
4
|
declare var window;
|
|
3
5
|
|
|
@@ -19,8 +21,12 @@ if (ws == null && typeof window !== 'undefined') {
|
|
|
19
21
|
if (ws == null && typeof self !== 'undefined') {
|
|
20
22
|
ws = self.WebSocket || (self as any).MozWebSocket
|
|
21
23
|
}
|
|
22
|
-
if (ws == null) {
|
|
23
|
-
ws = require('ws');
|
|
24
|
-
}
|
|
25
24
|
|
|
26
|
-
export
|
|
25
|
+
export namespace WebSocketProvider {
|
|
26
|
+
export async function get (): Promise<typeof ws> {
|
|
27
|
+
if (ws != null) {
|
|
28
|
+
return ws;
|
|
29
|
+
}
|
|
30
|
+
return $dependency.load('ws');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -7,12 +7,10 @@ interface Web3 {
|
|
|
7
7
|
eth
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
export class Web3Transport implements TTransport.Transport {
|
|
12
11
|
|
|
13
12
|
private provider
|
|
14
13
|
|
|
15
|
-
|
|
16
14
|
constructor (private mix: Web3) {
|
|
17
15
|
this.provider = 'currentProvider' in mix ? mix.currentProvider : mix;
|
|
18
16
|
}
|
|
@@ -30,6 +28,4 @@ export class Web3Transport implements TTransport.Transport {
|
|
|
30
28
|
unsubscribe(req: TTransport.Request & { method: 'eth_unsubscribe'; params: [number]; }): Promise<RpcSubscription<any>> {
|
|
31
29
|
throw new Error('Method not implemented.');
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
31
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** ESM and CJS Loader */
|
|
2
|
+
|
|
3
|
+
export namespace $dependency {
|
|
4
|
+
|
|
5
|
+
export async function load<T = any> (name: string): Promise<T> {
|
|
6
|
+
//#if (CJS)
|
|
7
|
+
const r = require;
|
|
8
|
+
return Promise.resolve(require(name));
|
|
9
|
+
//#endif
|
|
10
|
+
|
|
11
|
+
//#if (ESM)
|
|
12
|
+
// @ts-ignore: Conditional import
|
|
13
|
+
const exp = await import(name);
|
|
14
|
+
return exp;
|
|
15
|
+
//#endif
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
package/src/utils/$is.ts
CHANGED
|
@@ -36,6 +36,9 @@ export namespace $is {
|
|
|
36
36
|
// Make addresses like `0x0` also valid (assumed zeros)
|
|
37
37
|
return /^0x[a-fA-F0-9]{1,40}$/g.test(val);
|
|
38
38
|
}
|
|
39
|
+
export function Promise(val): val is Promise<any> {
|
|
40
|
+
return typeof val === 'object' && val!== null && 'then' in val;
|
|
41
|
+
}
|
|
39
42
|
|
|
40
43
|
export function TxHash (val: string | TEth.Hex): boolean {
|
|
41
44
|
if (Hex(val) === false) {
|
package/src/utils/$logger.ts
CHANGED
|
@@ -2,6 +2,7 @@ import memd from 'memd';
|
|
|
2
2
|
import { $color } from './$color';
|
|
3
3
|
import { $date } from './$date';
|
|
4
4
|
import alot from 'alot';
|
|
5
|
+
import { $dependency } from './$dependency';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
export enum ELogLevel {
|
|
@@ -17,7 +18,9 @@ interface ILoggerOptions {
|
|
|
17
18
|
level?: ELogLevel
|
|
18
19
|
}
|
|
19
20
|
class Logger {
|
|
20
|
-
private
|
|
21
|
+
private stdCalls = [];
|
|
22
|
+
private stdOnHold = false;
|
|
23
|
+
private stdQueue = [];
|
|
21
24
|
|
|
22
25
|
constructor(private options?: ILoggerOptions) {
|
|
23
26
|
this.options ??= {};
|
|
@@ -122,16 +125,36 @@ class Logger {
|
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
private print(row: (string | any)[], params: { method: 'log' | 'warn' | 'error', isToast?: boolean }) {
|
|
125
|
-
if (
|
|
128
|
+
if (params?.isToast) {
|
|
129
|
+
if (StdToast.isLoaded !== true) {
|
|
130
|
+
this.stdOnHold = true;
|
|
131
|
+
StdToast.initialize().then(x => {
|
|
132
|
+
let arr = this.stdQueue;
|
|
133
|
+
this.stdOnHold = false;
|
|
134
|
+
this.stdQueue = [];
|
|
135
|
+
arr.map(([row, params]) => {
|
|
136
|
+
this.print(row, params);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (this.stdOnHold) {
|
|
144
|
+
this.stdQueue.push([row, params]);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (this.stdCalls[0]?.isToast) {
|
|
126
149
|
// Last print is the toast, clear it
|
|
127
150
|
StdToast.clean();
|
|
128
151
|
}
|
|
129
152
|
|
|
130
153
|
console[params.method](...row);
|
|
131
154
|
|
|
132
|
-
this.
|
|
133
|
-
if (this.
|
|
134
|
-
this.
|
|
155
|
+
this.stdCalls.unshift(params);
|
|
156
|
+
if (this.stdCalls.length > 100) {
|
|
157
|
+
this.stdCalls.splice(50);
|
|
135
158
|
}
|
|
136
159
|
|
|
137
160
|
}
|
|
@@ -186,7 +209,7 @@ export function l(strings: TemplateStringsArray, ...values: any[]) {
|
|
|
186
209
|
case 'bigint':
|
|
187
210
|
break;
|
|
188
211
|
default:
|
|
189
|
-
// skip all non-value types.
|
|
212
|
+
// skip colorizing all non-value types.
|
|
190
213
|
continue;
|
|
191
214
|
}
|
|
192
215
|
args[i - 1] = `${before}${value}${after}`;
|
|
@@ -197,20 +220,21 @@ export function l(strings: TemplateStringsArray, ...values: any[]) {
|
|
|
197
220
|
$logger.log(...args);
|
|
198
221
|
}
|
|
199
222
|
|
|
200
|
-
|
|
223
|
+
namespace StdToast {
|
|
224
|
+
|
|
225
|
+
let rl: typeof import('readline');
|
|
201
226
|
|
|
202
|
-
|
|
203
|
-
|
|
227
|
+
export let isLoaded = false;
|
|
228
|
+
export function clean() {
|
|
204
229
|
rl.clearLine(process.stdout, 0);
|
|
205
230
|
rl.cursorTo(process.stdout, 0, null);
|
|
206
231
|
|
|
207
232
|
rl.moveCursor(process.stdout, 0, -1);
|
|
208
233
|
rl.clearLine(process.stdout, 0);
|
|
209
234
|
}
|
|
210
|
-
|
|
211
|
-
@memd.deco.memoize()
|
|
212
|
-
static getRl() {
|
|
235
|
+
export async function initialize() {
|
|
213
236
|
/** lazy */
|
|
214
|
-
|
|
237
|
+
rl = await $dependency.load('readline');
|
|
238
|
+
isLoaded = true;
|
|
215
239
|
}
|
|
216
240
|
}
|
package/src/utils/$machine.ts
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
|
+
import { $dependency } from './$dependency';
|
|
1
2
|
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
export namespace $machine {
|
|
5
6
|
|
|
6
7
|
export function id(original: boolean = false): Promise<string> {
|
|
7
|
-
return new Promise((resolve: Function, reject: Function): Object => {
|
|
8
|
+
return new Promise(async (resolve: Function, reject: Function): Promise<Object> => {
|
|
9
|
+
const { exec } = await $dependency.load<typeof import('child_process')>('child_process');
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
return exec(getCommand(), {}, (err: any, stdout: any, stderr: any) => {
|
|
11
|
+
return exec(getCommand(), {}, async (err: any, stdout: any, stderr: any) => {
|
|
11
12
|
if (err) {
|
|
12
13
|
return reject(
|
|
13
14
|
new Error(`Error while obtaining machine id: ${err.stack}`)
|
|
14
15
|
);
|
|
15
16
|
}
|
|
16
17
|
let id: string = extractId(stdout.toString());
|
|
17
|
-
|
|
18
|
+
let result = original ? id : await hash(id);
|
|
19
|
+
return resolve(result);
|
|
18
20
|
});
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
function hash(guid: string): string {
|
|
23
|
-
const { createHash } =
|
|
24
|
+
async function hash(guid: string): Promise<string> {
|
|
25
|
+
const { createHash } = await $dependency.load<typeof import('crypto')>('crypto');
|
|
24
26
|
return createHash('sha256').update(guid).digest('hex');
|
|
25
27
|
}
|
|
26
28
|
|
package/tsconfig-src.json
CHANGED
package/typings/index.d.ts
CHANGED
package/cache/bsc/abis.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"0xfbD2aa7efA2B46Ce3c58D7ab0D92C176c71499C0":{"value":{"abi":"[{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"numbers\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"addresses\",\"type\":\"address[]\"},{\"internalType\":\"string[]\",\"name\":\"names\",\"type\":\"string[]\"},{\"internalType\":\"address\",\"name\":\"antiBot\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"builder\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountBNB\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountCoin\",\"type\":\"uint256\"}],\"name\":\"AutoLiquify\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"LockTilStartUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_maxTxAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_maxWalletToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"aboutMe\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"holder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"approveMax\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"adr\",\"type\":\"address\"}],\"name\":\"authorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountPercentage\",\"type\":\"uint256\"}],\"name\":\"clearStuckBalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"devWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"adr\",\"type\":\"address\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liftMax\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidityWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockDiff\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lockTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newTime\",\"type\":\"uint256\"}],\"name\":\"lpExtend\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lpLockCheck\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lpTimeCheck\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"marketingWallet\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pair\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"router\",\"outputs\":[{\"internalType\":\"contract IDEXRouter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_marketingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_liquidityFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_devFee\",\"type\":\"uint256\"}],\"name\":\"setBuyFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"percent\",\"type\":\"uint256\"}],\"name\":\"setMaxWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_marketingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_liquidityFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_devFee\",\"type\":\"uint256\"}],\"name\":\"setSellFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_enabled\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"_threshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_ratio\",\"type\":\"uint256\"}],\"name\":\"setTokenSwapSettings\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"percent\",\"type\":\"uint256\"}],\"name\":\"setTxLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_marketingWallet\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_liquidityWallet\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_devWallet\",\"type\":\"address\"}],\"name\":\"setWallets\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTrading\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"swapThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalBuyFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSellFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"adr\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"adr\",\"type\":\"address\"}],\"name\":\"unauthorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockLPAfterTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_telegram\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_website\",\"type\":\"string\"}],\"name\":\"updateAboutMe\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]","implementation":"0xfbD2aa7efA2B46Ce3c58D7ab0D92C176c71499C0"},"timestamp":1731230895383}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0xd"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0x72"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0xcdf"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"0xb"
|