├── .gitignore
├── .vscode
└── launch.json
├── LICENSE
├── all
├── chainlist.json
└── index.html
├── aptos
├── aptos
│ ├── my-app
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo192.png
│ │ │ ├── logo512.png
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ └── src
│ │ │ ├── App.css
│ │ │ ├── App.js
│ │ │ ├── App.test.js
│ │ │ ├── index.css
│ │ │ ├── index.js
│ │ │ ├── logo.svg
│ │ │ ├── reportWebVitals.js
│ │ │ └── setupTests.js
│ └── package.json
├── build
│ ├── asset-manifest.json
│ ├── icon128.png
│ ├── icon16.png
│ ├── icon32.png
│ ├── icon48.png
│ ├── index.html
│ ├── manifest.json
│ ├── prompt.html
│ └── static
│ │ └── js
│ │ ├── 164.b669e71b.chunk.js
│ │ ├── 696.e7a267bd.chunk.js
│ │ ├── ajs-destination.046d517c.chunk.js
│ │ ├── ajs-destination.046d517c.chunk.js.LICENSE.txt
│ │ ├── auto-track.c6536631.chunk.js
│ │ ├── background.js
│ │ ├── background.js.LICENSE.txt
│ │ ├── contentscript.js
│ │ ├── contentscript.js.LICENSE.txt
│ │ ├── core.js
│ │ ├── core.js.LICENSE.txt
│ │ ├── inpage.js
│ │ ├── inpage.js.LICENSE.txt
│ │ ├── legacyVideos.c3df5fe0.chunk.js
│ │ ├── main.js
│ │ ├── middleware.1b8b3237.chunk.js
│ │ ├── prompt.js
│ │ ├── queryString.de902f32.chunk.js
│ │ ├── remoteMiddleware.910f8018.chunk.js
│ │ └── schemaFilter.4b7d0c35.chunk.js
├── fauct.html
├── index.html
├── readme.md
└── sign
│ ├── a.json
│ ├── abi.json
│ ├── abi2.json
│ ├── accounts.js
│ ├── apt.js
│ ├── faucet.js
│ ├── index.js
│ ├── otest.js
│ ├── package.json
│ ├── readme.md
│ └── signData.json
├── ar
└── test
│ ├── index.html
│ ├── index.js
│ ├── package.json
│ └── vue
│ └── test
│ ├── .browserslistrc
│ ├── .gitignore
│ ├── README.md
│ ├── babel.config.js
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ └── index.html
│ ├── src
│ ├── App.vue
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ └── HelloWorld.vue
│ ├── main.ts
│ ├── router
│ │ └── index.ts
│ ├── shims-tsx.d.ts
│ ├── shims-vue.d.ts
│ ├── store
│ │ └── index.ts
│ └── views
│ │ ├── About.vue
│ │ └── Home.vue
│ ├── tsconfig.json
│ └── vue.config.js
├── atom
└── package.json
├── aws-s3
├── app.js
├── bin
│ └── www
├── controller
│ └── upload.js
├── package.json
├── public
│ ├── images
│ │ └── v3.png
│ └── stylesheets
│ │ └── style.css
├── readme.md
├── routes
│ ├── index.js
│ └── users.js
├── start.json
├── test.js
├── tmp
│ └── tmp-3-1680172703687
└── views
│ └── index.hbs
├── axios-fetch-adapter
└── i
├── btc
└── dapp
│ ├── bitcoinjs-lib.js
│ ├── buffer-bowers.js
│ ├── buffer.js
│ ├── index.html
│ ├── js
│ ├── axios.min.js
│ ├── bignumber.min.js
│ ├── jquery.min.js
│ ├── json.json
│ └── vconsole.min.js
│ ├── json-viewer
│ ├── jquery.json-viewer.css
│ ├── jquery.json-viewer.js
│ └── jquery.min.js
│ ├── package.json
│ ├── tiny-secp256k1
│ ├── index.js
│ ├── rand.browser.js
│ ├── rand.js
│ ├── secp256k1.js
│ ├── validate.js
│ ├── validate_error.js
│ └── wasm_loader.js
│ └── webpack.config.js
├── cert.pem
├── doc
└── evm
│ ├── arbitrum.md
│ ├── mnt.md
│ └── op.md
├── docker
├── docker-compose.yml
└── wordpress
│ ├── docker-compose.yml
│ ├── nginx_php
│ ├── conf.d
│ │ └── default.conf
│ ├── html
│ │ └── index.php
│ ├── nginx.conf
│ └── php
│ │ ├── php-fpm.conf
│ │ ├── php-fpm.d
│ │ └── www.conf
│ │ └── timezone.ini
│ └── readme.md
├── domains
├── READMD.md
├── address.js
├── js
│ └── web3.min.js
├── package.json
├── rpc.js
└── yarn.lock
├── es6
├── promise.js
└── promiseuse.js
├── eth
├── dapp
│ ├── abi
│ │ ├── demoAbi.js
│ │ ├── eft.json
│ │ ├── erc20-node.js
│ │ ├── erc20.bak.json
│ │ ├── erc20.js
│ │ ├── erc20.json
│ │ └── poolABI.js
│ ├── ethers.html
│ ├── index.html
│ ├── js
│ │ ├── ethers.umd.min.js
│ │ └── web3.min.js
│ ├── other
│ │ ├── Buffer.js
│ │ ├── bn.js
│ │ └── parse.js
│ ├── package.json
│ ├── sign.html
│ ├── test.html
│ ├── walletConnectv2
│ │ └── index.html
│ ├── web
│ │ └── rpc.html
│ ├── web3-eth-abi.js
│ └── web3.html
├── demo
│ ├── index.js
│ └── wagmi-bitkeep-react
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public
│ │ ├── bitkeep-icon.png
│ │ ├── index.html
│ │ ├── manifest.json
│ │ └── robots.txt
│ │ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── assets
│ │ └── bitkeep-icon.png
│ │ ├── components
│ │ ├── Account.js
│ │ ├── NetworkSwitcher.js
│ │ └── signMessage.js
│ │ ├── connectors
│ │ └── BitkeepConnector.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
└── sign
│ ├── encryptedData.js
│ ├── package.json
│ ├── recover.js
│ ├── sha3.js
│ ├── siwe.js
│ └── swie.js
├── example
└── web3demo1
│ ├── .gitignore
│ ├── README.md
│ ├── config-overrides.js
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ └── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── index.css
│ ├── index.js
│ ├── logo.svg
│ ├── reportWebVitals.js
│ └── setupTests.js
├── gowasm
├── AES.js
├── aes.go
├── eth.go
├── eth.html
├── eth.wasm
├── ethgo.go
├── index.html
├── lib.go
├── lib.wasm
├── package.json
├── pkg
│ └── mod
│ │ └── cache
│ │ └── lock
├── readm.md
├── server.go
├── test.go
├── test.html
├── test.wasm
└── wasm_exec.js
├── grpc.test
├── clientServer.js
├── grpcServer.js
├── package.json
├── proto
│ ├── index.js
│ └── moudle
│ │ └── hello.proto
└── static
│ └── index.html
├── key.pem
├── leveldb
├── index.js
└── package.json
├── luna
└── dapp
│ ├── index.html
│ ├── index.mjs
│ └── package.json
├── mulwallet
└── sdk
│ ├── LICENSE
│ ├── README.md
│ ├── dist
│ ├── index.html
│ └── index.js
│ ├── esbuild.config.js
│ ├── example
│ └── index.html
│ ├── package.json
│ ├── pnpm-lock.yaml
│ ├── src
│ ├── adapters
│ │ ├── AbstractAdapter.ts
│ │ ├── LegacyEip155Adapter.ts
│ │ └── TronLinkAdapter.ts
│ ├── constant
│ │ └── index.ts
│ ├── detect-provider
│ │ └── index.ts
│ ├── global.d.ts
│ ├── index.ts
│ ├── provider
│ │ ├── LegacyEip155Provider.ts
│ │ └── index.ts
│ └── utils
│ │ ├── browsers.ts
│ │ └── index.ts
│ └── tsconfig.json
├── near
├── dapp
│ └── index.html
└── package.json
├── node
├── express
│ ├── app.js
│ ├── bin
│ │ └── www
│ ├── package.json
│ ├── public
│ │ └── stylesheets
│ │ │ └── style.css
│ ├── routes
│ │ ├── index.js
│ │ └── users.js
│ └── views
│ │ ├── error.jade
│ │ ├── index.jade
│ │ └── layout.jade
├── package.json
└── serverRender
│ ├── art-template.html
│ ├── index.html
│ ├── public
│ └── aaa.text
│ ├── server.js
│ ├── servervue.js
│ ├── template.js
│ └── vue.js
├── package.json
├── package
└── package.json
├── resource
├── docker
│ └── wordPress
│ │ └── docker-compose.yml
├── index.html
├── learn
│ └── rx.html
└── luna
│ └── wallet-provider
│ ├── .eslintignore
│ ├── .eslintrc.js
│ ├── .github
│ └── workflows
│ │ └── test.yml
│ ├── .gitignore
│ ├── .husky
│ ├── .gitignore
│ └── pre-commit
│ ├── .prettierignore
│ ├── .prettierrc.js
│ ├── .yarn
│ ├── plugins
│ │ └── @yarnpkg
│ │ │ └── plugin-interactive-tools.cjs
│ └── releases
│ │ └── yarn-3.1.0.cjs
│ ├── .yarnrc.yml
│ ├── LICENSE
│ ├── README.md
│ ├── git
│ ├── HEAD
│ ├── config
│ ├── description
│ ├── hooks
│ │ ├── applypatch-msg.sample
│ │ ├── commit-msg.sample
│ │ ├── fsmonitor-watchman.sample
│ │ ├── post-update.sample
│ │ ├── pre-applypatch.sample
│ │ ├── pre-commit.sample
│ │ ├── pre-merge-commit.sample
│ │ ├── pre-push.sample
│ │ ├── pre-rebase.sample
│ │ ├── pre-receive.sample
│ │ ├── prepare-commit-msg.sample
│ │ ├── push-to-checkout.sample
│ │ └── update.sample
│ ├── index
│ ├── info
│ │ └── exclude
│ ├── logs
│ │ ├── HEAD
│ │ └── refs
│ │ │ ├── heads
│ │ │ └── main
│ │ │ └── remotes
│ │ │ └── origin
│ │ │ └── HEAD
│ ├── objects
│ │ └── pack
│ │ │ ├── pack-04f9191beb0725fb9b398672a475351e4f3fb446.idx
│ │ │ └── pack-04f9191beb0725fb9b398672a475351e4f3fb446.pack
│ ├── packed-refs
│ └── refs
│ │ ├── heads
│ │ └── main
│ │ └── remotes
│ │ └── origin
│ │ └── HEAD
│ ├── package.json
│ ├── packages
│ ├── .env
│ ├── .package.json
│ ├── .packages.json
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── logo.png
│ │ └── robots.txt
│ ├── scripts
│ │ ├── build.ts
│ │ └── start.multiple-wallets.ts
│ ├── src
│ │ ├── @terra-money
│ │ │ ├── use-wallet
│ │ │ │ ├── README.md
│ │ │ │ ├── index.ts
│ │ │ │ ├── useConnectedWallet.ts
│ │ │ │ ├── useInstallableWallets.ts
│ │ │ │ ├── useLCDClient.ts
│ │ │ │ └── useWallet.ts
│ │ │ ├── wallet-controller
│ │ │ │ ├── README.md
│ │ │ │ ├── controller.ts
│ │ │ │ ├── env.ts
│ │ │ │ ├── exception
│ │ │ │ │ ├── isError.ts
│ │ │ │ │ ├── mapExtensionTxError.ts
│ │ │ │ │ └── mapWalletConnectError.ts
│ │ │ │ ├── getChainOptions.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── modules
│ │ │ │ │ ├── connect-modal
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ └── style.ts
│ │ │ │ │ ├── extension-router
│ │ │ │ │ │ ├── ExtensionRouter.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── modal.style.ts
│ │ │ │ │ │ ├── modal.ts
│ │ │ │ │ │ ├── multiChannel.ts
│ │ │ │ │ │ ├── session.ts
│ │ │ │ │ │ └── types.ts
│ │ │ │ │ ├── legacy-extension
│ │ │ │ │ │ ├── LegacyExtensionConnector.ts
│ │ │ │ │ │ ├── createFixedExtension.ts
│ │ │ │ │ │ └── index.ts
│ │ │ │ │ ├── readonly-wallet
│ │ │ │ │ │ ├── connect.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── modal.style.ts
│ │ │ │ │ │ ├── modal.ts
│ │ │ │ │ │ ├── storage.ts
│ │ │ │ │ │ └── types.ts
│ │ │ │ │ └── walletconnect
│ │ │ │ │ │ ├── connect.ts
│ │ │ │ │ │ ├── errors.ts
│ │ │ │ │ │ ├── impl
│ │ │ │ │ │ └── socket-transport
│ │ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ │ └── network.ts
│ │ │ │ │ │ ├── index.ts
│ │ │ │ │ │ ├── modal.style.ts
│ │ │ │ │ │ ├── modal.ts
│ │ │ │ │ │ └── types.ts
│ │ │ │ ├── operators
│ │ │ │ │ ├── getExtensions.ts
│ │ │ │ │ ├── toConnectedWallet.ts
│ │ │ │ │ └── toLcdClient.ts
│ │ │ │ ├── utils
│ │ │ │ │ ├── __tests__
│ │ │ │ │ │ ├── sortConnections.test.ts
│ │ │ │ │ │ └── useragent.test.ts
│ │ │ │ │ ├── browser-check.ts
│ │ │ │ │ ├── checkExtensionReady.ts
│ │ │ │ │ └── sortConnections.ts
│ │ │ │ └── verifyBytes.ts
│ │ │ ├── wallet-provider
│ │ │ │ ├── README.md
│ │ │ │ ├── StaticWalletProvider.tsx
│ │ │ │ ├── WalletProvider.tsx
│ │ │ │ ├── index.ts
│ │ │ │ ├── useChainOptions.ts
│ │ │ │ └── useInstallChromeExtension.ts
│ │ │ ├── wallet-types
│ │ │ │ ├── README.md
│ │ │ │ ├── errors.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── lcd.ts
│ │ │ │ ├── tx.ts
│ │ │ │ ├── types.ts
│ │ │ │ └── wallet.ts
│ │ │ └── web-extension-interface
│ │ │ │ ├── IMPORTANT.md
│ │ │ │ ├── README.md
│ │ │ │ ├── connector.ts
│ │ │ │ ├── errors.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── models
│ │ │ │ ├── network.ts
│ │ │ │ ├── states.ts
│ │ │ │ ├── tx.ts
│ │ │ │ └── wallet.ts
│ │ ├── components
│ │ │ ├── CW20TokensSample.tsx
│ │ │ ├── ConnectSample.tsx
│ │ │ ├── NetworkSample.tsx
│ │ │ ├── QuerySample.tsx
│ │ │ ├── SignBytesSample.tsx
│ │ │ ├── SignSample.tsx
│ │ │ └── TxSample.tsx
│ │ ├── index.tsx
│ │ ├── main.tsx
│ │ ├── polyfills
│ │ │ ├── README.md
│ │ │ ├── polyfills.js
│ │ │ ├── process-es6-LICENSE.txt
│ │ │ └── process-es6.js
│ │ └── vite-env.d.ts
│ ├── tsconfig.json
│ ├── tsconfig.script.json
│ ├── vite.config.ts
│ └── vitest.config.ts
│ ├── readme-assets
│ └── trouble-shooting-guide.png
│ ├── templates
│ ├── create-react-app
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── config-overrides.js
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── logo.png
│ │ │ └── robots.txt
│ │ ├── sandbox.config.json
│ │ ├── src
│ │ │ ├── components
│ │ │ │ ├── CW20TokensSample.tsx
│ │ │ │ ├── ConnectSample.tsx
│ │ │ │ ├── NetworkSample.tsx
│ │ │ │ ├── QuerySample.tsx
│ │ │ │ ├── SignBytesSample.tsx
│ │ │ │ ├── SignSample.tsx
│ │ │ │ └── TxSample.tsx
│ │ │ ├── index.tsx
│ │ │ ├── react-app-env.d.ts
│ │ │ ├── setupTests.ts
│ │ │ └── style.css
│ │ └── tsconfig.json
│ ├── lit
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── logo.png
│ │ │ └── robots.txt
│ │ ├── sandbox.config.json
│ │ ├── src
│ │ │ ├── __tests__
│ │ │ │ └── sample.test.ts
│ │ │ ├── app.ts
│ │ │ ├── components
│ │ │ │ ├── connect-sample.ts
│ │ │ │ ├── query-sample.ts
│ │ │ │ └── tx-sample.ts
│ │ │ ├── controller.ts
│ │ │ ├── index.ts
│ │ │ ├── polyfills
│ │ │ │ ├── README.md
│ │ │ │ ├── polyfills.js
│ │ │ │ ├── process-es6-LICENSE.txt
│ │ │ │ └── process-es6.js
│ │ │ └── vite-env.d.ts
│ │ ├── tsconfig.json
│ │ └── vite.config.ts
│ ├── next
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── next-env.d.ts
│ │ ├── package.json
│ │ ├── pages
│ │ │ ├── _app.tsx
│ │ │ ├── _document.tsx
│ │ │ ├── connect-sample.tsx
│ │ │ ├── cw20-tokens-sample.tsx
│ │ │ ├── index.tsx
│ │ │ ├── network-sample.tsx
│ │ │ ├── query-sample.tsx
│ │ │ ├── sign-bytes-sample.tsx
│ │ │ ├── sign-sample.tsx
│ │ │ └── tx-sample.tsx
│ │ └── tsconfig.json
│ ├── svelte
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── logo.png
│ │ │ └── robots.txt
│ │ ├── sandbox.config.json
│ │ ├── src
│ │ │ ├── App.svelte
│ │ │ ├── __tests__
│ │ │ │ └── sample.test.ts
│ │ │ ├── components
│ │ │ │ ├── ConnectSample.svelte
│ │ │ │ ├── QuerySample.svelte
│ │ │ │ ├── TxSample.svelte
│ │ │ │ └── TxSampleForm.svelte
│ │ │ ├── controller.ts
│ │ │ ├── index.ts
│ │ │ ├── main.ts
│ │ │ ├── polyfills
│ │ │ │ ├── README.md
│ │ │ │ ├── polyfills.js
│ │ │ │ ├── process-es6-LICENSE.txt
│ │ │ │ └── process-es6.js
│ │ │ └── vite-env.d.ts
│ │ ├── svelte.config.js
│ │ ├── tsconfig.json
│ │ └── vite.config.ts
│ ├── vite
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── public
│ │ │ ├── favicon.ico
│ │ │ ├── logo.png
│ │ │ └── robots.txt
│ │ ├── sandbox.config.json
│ │ ├── src
│ │ │ ├── __tests__
│ │ │ │ └── sample.test.ts
│ │ │ ├── app.tsx
│ │ │ ├── components
│ │ │ │ ├── CW20TokensSample.tsx
│ │ │ │ ├── ConnectSample.tsx
│ │ │ │ ├── NetworkSample.tsx
│ │ │ │ ├── QuerySample.tsx
│ │ │ │ ├── SignBytesSample.tsx
│ │ │ │ ├── SignSample.tsx
│ │ │ │ └── TxSample.tsx
│ │ │ ├── index.tsx
│ │ │ ├── polyfills
│ │ │ │ ├── README.md
│ │ │ │ ├── polyfills.js
│ │ │ │ ├── process-es6-LICENSE.txt
│ │ │ │ └── process-es6.js
│ │ │ ├── style.css
│ │ │ └── vite-env.d.ts
│ │ ├── tsconfig.json
│ │ └── vite.config.ts
│ └── vue
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── public
│ │ ├── favicon.ico
│ │ ├── logo.png
│ │ └── robots.txt
│ │ ├── sandbox.config.json
│ │ ├── src
│ │ ├── App.vue
│ │ ├── __tests__
│ │ │ └── sample.test.ts
│ │ ├── components
│ │ │ ├── ConnectSample.vue
│ │ │ ├── QuerySample.vue
│ │ │ ├── TxSample.vue
│ │ │ └── TxSampleForm.vue
│ │ ├── controller.ts
│ │ ├── index.ts
│ │ ├── main.ts
│ │ ├── polyfills
│ │ │ ├── README.md
│ │ │ ├── polyfills.js
│ │ │ ├── process-es6-LICENSE.txt
│ │ │ └── process-es6.js
│ │ └── vite-env.d.ts
│ │ ├── tsconfig.json
│ │ └── vite.config.ts
│ └── yarn.lock
├── safe
└── Trust Wallet
│ └── MT19937_bug.js
├── scp
├── .editorconfig
├── .eslintignore
├── .eslintrc.yml
├── LICENSE
├── README.md
├── app.js
├── config
│ └── index.js
├── package.json
├── public
│ ├── css
│ │ └── style.css
│ └── js
│ │ └── scp.js
├── routes
│ └── index.js
└── views
│ ├── error.ejs
│ ├── index.ejs
│ ├── scpMeta.ejs
│ └── scpServerHeader.ejs
├── serverWorker
├── index.html
├── static
│ ├── cache.js
│ └── imges.png
└── sw.js
├── solana
├── dapp
│ ├── index.html
│ ├── js
│ │ └── @solana
│ │ │ ├── spl-token.js
│ │ │ └── web3.js
│ ├── package.json
│ └── yarn.lock
├── package.json
├── signMessage.js
└── yarn.lock
├── sui
└── dapp
│ └── my-app
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
│ ├── src
│ ├── App.js
│ ├── App.test.js
│ ├── SuiWallet
│ │ ├── index.css
│ │ └── index.js
│ ├── TestAccount.js
│ ├── TestButton.js
│ ├── TestWallets.js
│ ├── index.css
│ ├── index.js
│ ├── reportWebVitals.js
│ └── setupTests.js
│ └── yarn.lock
├── terra
├── .env
├── .gitignore
├── README.md
├── config-overrides.js
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── logo192.png
│ ├── logo512.png
│ ├── manifest.json
│ └── robots.txt
└── src
│ ├── App.css
│ ├── App.js
│ ├── index.css
│ ├── index.js
│ └── logo.svg
├── test
├── aptosSDK.js
├── index.global.js
├── index.html
└── index.js
├── tron
└── dapp
│ ├── index.html
│ ├── js
│ ├── TronWeb.js
│ └── vconsole.min.js
│ ├── other
│ └── index.js
│ └── package.json
├── truffle-solidity
├── .env.example
├── REANDME.md
├── build
│ └── contracts
│ │ ├── Address.json
│ │ ├── Context.json
│ │ ├── Distribute.json
│ │ ├── IERC20.json
│ │ ├── IERC20Permit.json
│ │ ├── Migrations.json
│ │ ├── MultiSender.json
│ │ ├── Ownable.json
│ │ ├── SafeERC20.json
│ │ ├── SimpleStorage.json
│ │ ├── TokenERC20.json
│ │ ├── TransferHelper.json
│ │ └── WeatherOracle.json
├── contracts
│ ├── Migrations.sol
│ ├── MultiSender.sol
│ ├── TokenERC20.sol
│ ├── WeatherOracle.sol
│ ├── eth.sol
│ └── learn.sol
├── migrations
│ └── 1_initial_migration.js
├── oracle machine
│ └── weather-oracle-service
│ │ ├── .babelrc
│ │ ├── .env.example
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── src
│ │ ├── consumer.js
│ │ ├── ethereum.js
│ │ ├── index.js
│ │ └── oracle.js
│ │ └── yarn.lock
├── package.json
├── test
│ ├── .gitkeep
│ └── index.json
├── truffle-config.js
├── yarn-error.log
└── yarn.lock
├── vs
└── index.html
├── walletConnect
├── AwesomeProject
│ ├── .buckconfig
│ ├── .bundle
│ │ └── config
│ ├── .eslintrc.js
│ ├── .flowconfig
│ ├── .gitignore
│ ├── .node-version
│ ├── .prettierrc.js
│ ├── .ruby-version
│ ├── .watchmanconfig
│ ├── App.js
│ ├── Gemfile
│ ├── __tests__
│ │ └── App-test.js
│ ├── android
│ │ ├── app
│ │ │ ├── _BUCK
│ │ │ ├── build.gradle
│ │ │ ├── build_defs.bzl
│ │ │ ├── debug.keystore
│ │ │ ├── proguard-rules.pro
│ │ │ └── src
│ │ │ │ ├── debug
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── java
│ │ │ │ │ └── com
│ │ │ │ │ └── awesomeproject
│ │ │ │ │ └── ReactNativeFlipper.java
│ │ │ │ └── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── awesomeproject
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ ├── MainApplication.java
│ │ │ │ │ └── newarchitecture
│ │ │ │ │ ├── MainApplicationReactNativeHost.java
│ │ │ │ │ ├── components
│ │ │ │ │ └── MainComponentsRegistry.java
│ │ │ │ │ └── modules
│ │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java
│ │ │ │ ├── jni
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── MainApplicationModuleProvider.cpp
│ │ │ │ ├── MainApplicationModuleProvider.h
│ │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp
│ │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h
│ │ │ │ ├── MainComponentsRegistry.cpp
│ │ │ │ ├── MainComponentsRegistry.h
│ │ │ │ └── OnLoad.cpp
│ │ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ └── rn_edit_text_material.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── values
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ └── settings.gradle
│ ├── app.json
│ ├── babel.config.js
│ ├── index.js
│ ├── ios
│ │ ├── .xcode.env
│ │ ├── AwesomeProject.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ └── xcshareddata
│ │ │ │ └── xcschemes
│ │ │ │ └── AwesomeProject.xcscheme
│ │ ├── AwesomeProject.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── AwesomeProject
│ │ │ ├── AppDelegate.h
│ │ │ ├── AppDelegate.mm
│ │ │ ├── Images.xcassets
│ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── main.m
│ │ ├── AwesomeProjectTests
│ │ │ ├── AwesomeProjectTests.m
│ │ │ └── Info.plist
│ │ ├── Podfile
│ │ └── Podfile.lock
│ ├── metro.config.js
│ ├── package.json
│ ├── page.js
│ ├── read.md
│ ├── shim.js
│ └── yarn.lock
├── index.html
├── package.json
├── reactDemo
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── public
│ │ ├── BitKeep_logo_circle.png
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.js
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ ├── setupTests.js
│ │ └── web3Modal.js
├── wc
│ └── index.html
└── yarn.lock
├── wireshare
├── app.js
├── bin
│ └── www
├── package.json
├── public
│ └── stylesheets
│ │ └── style.css
├── readme.md
├── routes
│ ├── index.js
│ └── users.js
├── views
│ ├── error.jade
│ ├── index.jade
│ └── layout.jade
├── yarn-error.log
└── yarn.lock
├── xinstall.js
├── yarn.lock
├── 基础
├── base64.js
├── bech32.js
├── buffer.js
└── package.json
└── 测试用例
└── tape
├── package.json
└── test
└── 1.js
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | *node_modules
3 | *package-lock.json
4 | *.zip
5 | docker/wordpress/db_data
6 | docker/wordpress/wordpress_data
7 | resource/
8 | nginx/
9 |
10 | truffle-solidity/truffle-config.js
11 |
12 |
13 | truffle-solidity/.env
14 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // 使用 IntelliSense 了解相关属性。
3 | // 悬停以查看现有属性的描述。
4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 |
8 |
9 | {
10 | "type": "pwa-chrome",
11 | "request": "launch",
12 | "name": "Launch Chrome against localhost",
13 | "url": "http://localhost:8082",
14 | "webRoot": "${workspaceFolder}/ar/test/vue/src",
15 | "breakOnLoad": true,
16 | "sourceMapPathOverrides": {
17 | "webpack:///./ar/test/vue/src/*": "${webRoot}/*",
18 | "webpack:///ar/test/vue/src/*": "${webRoot}/*"
19 | }
20 | }
21 |
22 | ]
23 | }
--------------------------------------------------------------------------------
/all/chainlist.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/all/chainlist.json
--------------------------------------------------------------------------------
/aptos/aptos/my-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/aptos/my-app/public/favicon.ico
--------------------------------------------------------------------------------
/aptos/aptos/my-app/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/aptos/my-app/public/logo192.png
--------------------------------------------------------------------------------
/aptos/aptos/my-app/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/aptos/my-app/public/logo512.png
--------------------------------------------------------------------------------
/aptos/aptos/my-app/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(document.getElementById('root'));
8 | root.render(
9 |
10 |
11 |
12 | );
13 |
14 | // If you want to start measuring performance in your app, pass a function
15 | // to log results (for example: reportWebVitals(console.log))
16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | reportWebVitals();
18 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/aptos/aptos/my-app/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/aptos/aptos/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aptos",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@manahippo/aptos-wallet-adapter": "^1.0.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/aptos/build/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/build/icon128.png
--------------------------------------------------------------------------------
/aptos/build/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/build/icon16.png
--------------------------------------------------------------------------------
/aptos/build/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/build/icon32.png
--------------------------------------------------------------------------------
/aptos/build/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/build/icon48.png
--------------------------------------------------------------------------------
/aptos/build/index.html:
--------------------------------------------------------------------------------
1 |
Petra
--------------------------------------------------------------------------------
/aptos/build/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Petra",
3 | "name": "Petra Aptos Wallet",
4 | "version": "1.0.0",
5 | "manifest_version": 3,
6 | "description": "A crypto wallet on Aptos.",
7 | "action": {
8 | "default_popup": "index.html"
9 | },
10 | "content_scripts": [{
11 | "matches": [""],
12 | "js": [
13 | "static/js/contentscript.js"
14 | ],
15 | "run_at": "document_start"
16 | }],
17 | "web_accessible_resources": [{
18 | "resources": ["static/js/inpage.js"],
19 | "matches": [""]
20 | }],
21 | "background": {
22 | "service_worker": "static/js/background.js"
23 | },
24 | "permissions": [
25 | "storage",
26 | "tabs",
27 | "alarms"
28 | ],
29 | "icons": {
30 | "16": "icon16.png",
31 | "32": "icon32.png",
32 | "48": "icon48.png",
33 | "128": "icon128.png"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/aptos/build/prompt.html:
--------------------------------------------------------------------------------
1 | Petra - Prompt
--------------------------------------------------------------------------------
/aptos/build/static/js/background.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*!
2 | * The buffer module from node.js, for the browser.
3 | *
4 | * @author Feross Aboukhadijeh
5 | * @license MIT
6 | */
7 |
8 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
9 |
10 | /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11 |
12 | /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
13 |
14 | /*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
15 |
--------------------------------------------------------------------------------
/aptos/build/static/js/contentscript.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*!
2 | * The buffer module from node.js, for the browser.
3 | *
4 | * @author Feross Aboukhadijeh
5 | * @license MIT
6 | */
7 |
8 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
9 |
10 | /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11 |
12 | /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
13 |
14 | /*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
15 |
--------------------------------------------------------------------------------
/aptos/build/static/js/inpage.js.LICENSE.txt:
--------------------------------------------------------------------------------
1 | /*!
2 | * The buffer module from node.js, for the browser.
3 | *
4 | * @author Feross Aboukhadijeh
5 | * @license MIT
6 | */
7 |
8 | /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */
9 |
10 | /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
11 |
12 | /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
13 |
14 | /*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
15 |
--------------------------------------------------------------------------------
/aptos/build/static/js/legacyVideos.c3df5fe0.chunk.js:
--------------------------------------------------------------------------------
1 | "use strict";(self.webpackChunk_petra_extension=self.webpackChunk_petra_extension||[]).push([[150],{21316:(e,n,t)=>{t.r(n),t.d(n,{loadLegacyVideoPlugins:()=>s});var i=t(9161);function s(e){return(0,i.mG)(this,void 0,void 0,(function(){var n;return(0,i.Jh)(this,(function(i){switch(i.label){case 0:return[4,t.e(696).then(t.t.bind(t,66696,23))];case 1:return n=i.sent(),e._plugins=n,[2]}}))}))}}}]);
--------------------------------------------------------------------------------
/aptos/build/static/js/queryString.de902f32.chunk.js:
--------------------------------------------------------------------------------
1 | "use strict";(self.webpackChunk_petra_extension=self.webpackChunk_petra_extension||[]).push([[96],{56509:(r,a,e)=>{function s(r,a){return Object.keys(a).reduce((function(e,s){s.startsWith(r)&&(e[s.substr(r.length)]=a[s]);return e}),{})}e.r(a),e.d(a,{queryString:()=>i});var t=e(37989);function i(r,a){var e=document.createElement("a");e.href=a;var i=e.search.slice(1).split("&").reduce((function(r,a){var e=a.split("="),s=e[0],i=e[1];return r[s]=(0,t.a)(i),r}),{}),n=[],u=i.ajs_uid,_=i.ajs_event;if(i.ajs_aid){var c=Array.isArray(i.ajs_aid)?i.ajs_aid[0]:i.ajs_aid;r.setAnonymousId(c)}if(u){var j=Array.isArray(i.ajs_uid)?i.ajs_uid[0]:i.ajs_uid,d=s("ajs_trait_",i);n.push(r.identify(j,d))}if(_){var f=Array.isArray(i.ajs_event)?i.ajs_event[0]:i.ajs_event,o=s("ajs_prop_",i);n.push(r.track(f,o))}return Promise.all(n)}}}]);
--------------------------------------------------------------------------------
/aptos/readme.md:
--------------------------------------------------------------------------------
1 | yarn run your_coin /Users/caoshiyuan/project/self/Blockchain/aptos/dapp/aptos-core/aptos-move/move-examples/moon_coin
2 |
3 |
4 |
5 | aptos move compile --named-addresses MoonCoin=0xb72c8e6e97730000a6fff4e598ae7338586dd0c2fc806d984e4ed6f945c61eac --save-metadata
--------------------------------------------------------------------------------
/aptos/sign/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sign",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "faucet": "node ./index.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "aptos": "^1.3.13",
13 | "bip39": "^3.0.4",
14 | "ed25519-hd-key": "^1.3.0",
15 | "js-sha3": "^0.8.0",
16 | "tslib": "^2.4.0",
17 | "tweetnacl": "^1.0.3"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/aptos/sign/readme.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aptos/sign/readme.md
--------------------------------------------------------------------------------
/ar/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/ar/test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "node index.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "human-crypto-keys": "^0.1.4",
13 | "node-forge": "^1.3.1"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ar/test/vue/test/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/ar/test/vue/test/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/ar/test/vue/test/README.md:
--------------------------------------------------------------------------------
1 | # test
2 |
3 | ## Project setup
4 | ```
5 | npm install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | npm run serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | npm run build
16 | ```
17 |
18 | ### Customize configuration
19 | See [Configuration Reference](https://cli.vuejs.org/config/).
20 |
--------------------------------------------------------------------------------
/ar/test/vue/test/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/ar/test/vue/test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "core-js": "^3.6.5",
11 | "human-crypto-keys": "^0.1.4",
12 | "vue": "^2.6.11",
13 | "vue-class-component": "^7.2.3",
14 | "vue-property-decorator": "^9.1.2",
15 | "vue-router": "^3.2.0",
16 | "vuex": "^3.4.0"
17 | },
18 | "devDependencies": {
19 | "@vue/cli-plugin-babel": "~4.5.15",
20 | "@vue/cli-plugin-router": "~4.5.15",
21 | "@vue/cli-plugin-typescript": "~4.5.15",
22 | "@vue/cli-plugin-vuex": "~4.5.15",
23 | "@vue/cli-service": "~4.5.15",
24 | "less": "^3.0.4",
25 | "less-loader": "^5.0.0",
26 | "typescript": "~4.1.5",
27 | "vue-template-compiler": "^2.6.11"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/ar/test/vue/test/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/ar/test/vue/test/public/favicon.ico
--------------------------------------------------------------------------------
/ar/test/vue/test/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/ar/test/vue/test/src/assets/logo.png
--------------------------------------------------------------------------------
/ar/test/vue/test/src/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import router from './router'
4 | import store from './store'
5 |
6 | Vue.config.productionTip = false
7 |
8 | window.root = new Vue({
9 | router,
10 | store,
11 | render: h => h(App)
12 | }).$mount('#app')
13 |
14 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueRouter, { RouteConfig } from 'vue-router'
3 | import Home from '../views/Home.vue'
4 |
5 | Vue.use(VueRouter)
6 |
7 | const routes: Array = [
8 | {
9 | path: '/',
10 | name: 'Home',
11 | component: Home
12 | },
13 | {
14 | path: '/about',
15 | name: 'About',
16 | // route level code-splitting
17 | // this generates a separate chunk (about.[hash].js) for this route
18 | // which is lazy-loaded when the route is visited.
19 | component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
20 | }
21 | ]
22 |
23 | const router = new VueRouter({
24 | mode: 'history',
25 | base: process.env.BASE_URL,
26 | routes
27 | })
28 |
29 | export default router
30 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/shims-tsx.d.ts:
--------------------------------------------------------------------------------
1 | import Vue, { VNode } from 'vue'
2 |
3 | declare global {
4 | namespace JSX {
5 | // tslint:disable no-empty-interface
6 | interface Element extends VNode {}
7 | // tslint:disable no-empty-interface
8 | interface ElementClass extends Vue {}
9 | interface IntrinsicElements {
10 | [elem: string]: any
11 | }
12 | }
13 | interface Window {
14 | root: any
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/shims-vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import Vue from 'vue'
3 | export default Vue
4 | }
5 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/store/index.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 |
4 | Vue.use(Vuex)
5 |
6 | export default new Vuex.Store({
7 | state: {
8 | params:[]
9 | },
10 | mutations: {
11 | setParams(state, params:any){
12 | state.params.push(JSON.parse(JSON.stringify(params)))
13 | }
14 | },
15 | actions: {
16 | },
17 | modules: {
18 | }
19 | })
20 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/views/About.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This is an about page
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ar/test/vue/test/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 |
8 |
19 |
--------------------------------------------------------------------------------
/ar/test/vue/test/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "strict": true,
6 | "jsx": "preserve",
7 | "importHelpers": true,
8 | "moduleResolution": "node",
9 | "experimentalDecorators": true,
10 | "skipLibCheck": true,
11 | "esModuleInterop": true,
12 | "allowSyntheticDefaultImports": true,
13 | "sourceMap": true,
14 | "baseUrl": ".",
15 | "types": [
16 | "webpack-env"
17 | ],
18 | "paths": {
19 | "@/*": [
20 | "src/*"
21 | ]
22 | },
23 | "lib": [
24 | "esnext",
25 | "dom",
26 | "dom.iterable",
27 | "scripthost"
28 | ]
29 | },
30 | "include": [
31 | "src/**/*.ts",
32 | "src/**/*.tsx",
33 | "src/**/*.vue",
34 | "tests/**/*.ts",
35 | "tests/**/*.tsx"
36 | ],
37 | "exclude": [
38 | "node_modules"
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/ar/test/vue/test/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | configureWebpack: {
3 | devtool: 'source-map'
4 | }
5 | }
--------------------------------------------------------------------------------
/atom/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "atom",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "cosmo-wallet-tool": "0.0.44"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/aws-s3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "foo",
3 | "version": "0.0.0",
4 | "private": true,
5 |
6 |
7 | "scripts": {
8 | "devxk": "cross-env ---DEBUG='http' nodemon ./bin/www",
9 | "devcsy": "cross-env --DEBUG='http' nodemon ./bin/www",
10 | "start": "node ./bin/www"
11 | },
12 | "dependencies": {
13 | "@aws-sdk/client-s3": "^3.298.0",
14 | "aws-sdk": "^2.1342.0",
15 | "cookie-parser": "~1.4.4",
16 | "cross-env": "^7.0.3",
17 | "debug": "~2.6.9",
18 | "express": "~4.16.1",
19 | "express-fileupload": "^1.4.0",
20 | "hbs": "~4.0.4",
21 | "http-errors": "~1.6.3",
22 | "morgan": "~1.9.1",
23 | "nodemon": "^2.0.22",
24 | "request": "^2.88.2",
25 | "uuid": "^9.0.0"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/aws-s3/public/images/v3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aws-s3/public/images/v3.png
--------------------------------------------------------------------------------
/aws-s3/public/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 50px;
3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 | }
5 |
6 | a {
7 | color: #00B7FF;
8 | }
9 |
--------------------------------------------------------------------------------
/aws-s3/readme.md:
--------------------------------------------------------------------------------
1 | {
2 | "Version": "2012-10-17",
3 | "Id": "Policy1679655952094",
4 | "Statement": [
5 | {
6 | "Sid": "Stmt1679655922731",
7 | "Effect": "Allow",
8 | "Principal": "*",
9 | "Action": "s3:*",
10 | "Resource": "arn:aws:s3:::caoshiyuan-aws/*"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/aws-s3/routes/users.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET users listing. */
5 | router.get('/', function(req, res, next) {
6 | res.send('respond with a resource');
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/aws-s3/start.json:
--------------------------------------------------------------------------------
1 | {
2 | "apps": [{
3 | "name": "aws-s3",
4 | "script": "./bin/www",
5 | "node_args": "--inspect=0.0.0.0:9999",
6 | "watch": false,
7 | "log_date_format": "YYYY-MM-DD HH:mm:ss",
8 | "env": {
9 | "//AWS_ACCESS_KEY_ID": "AKIAZ3S2RTKAXCBVB4VE",
10 | "//AWS_SECRET_ACCESS_KEY": "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",
11 | "AWS_SESSION_TOKEN(可选": "",
12 | "REGION": "ap-northeast-1",
13 | "BUCKET": "caoshiyuan-aws"
14 | }
15 | }]
16 | }
17 |
--------------------------------------------------------------------------------
/aws-s3/test.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aws-s3/test.js
--------------------------------------------------------------------------------
/aws-s3/tmp/tmp-3-1680172703687:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/aws-s3/tmp/tmp-3-1680172703687
--------------------------------------------------------------------------------
/axios-fetch-adapter/i:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/axios-fetch-adapter/i
--------------------------------------------------------------------------------
/btc/dapp/js/json.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/btc/dapp/js/json.json
--------------------------------------------------------------------------------
/btc/dapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "bitcoinjs-lib.js",
6 | "scripts": {
7 | "build": "webpack"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "base64-js": "^1.5.1",
13 | "crypto-browserify": "^3.12.0",
14 | "ieee754": "^1.2.1",
15 | "jquery.json-viewer": "^1.5.0",
16 | "stream-browserify": "^3.0.0",
17 | "webpack": "^5.83.1"
18 | },
19 | "devDependencies": {
20 | "webpack-cli": "^5.1.1"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/btc/dapp/tiny-secp256k1/rand.browser.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.generateInt32 = void 0;
4 | function get4RandomBytes() {
5 | const bytes = new Uint8Array(4);
6 | window.crypto.getRandomValues(bytes);
7 | return bytes;
8 | }
9 | // Only to be used to initialize the context for rust-secp256k1
10 | function generateInt32() {
11 | const array = get4RandomBytes();
12 | return ((array[0] << (3 * 8)) +
13 | (array[1] << (2 * 8)) +
14 | (array[2] << (1 * 8)) +
15 | array[3]);
16 | }
17 | exports.generateInt32 = generateInt32;
18 |
--------------------------------------------------------------------------------
/btc/dapp/tiny-secp256k1/rand.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.generateInt32 = void 0;
4 | const crypto_1 = require("crypto");
5 | function generateInt32() {
6 | return (0, crypto_1.randomBytes)(4).readInt32BE(0);
7 | }
8 | exports.generateInt32 = generateInt32;
9 |
--------------------------------------------------------------------------------
/btc/dapp/webpack.config.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require('path');
3 |
4 | module.exports = {
5 | entry: './buffer.js',
6 | output: {
7 | path: path.resolve(__dirname,"./"),
8 | filename: 'buffer-bowers.js',
9 | library:"Buffer",
10 | libraryTarget: 'umd' // 将库打包为 AMD 模块
11 |
12 | },
13 | resolve: {
14 | extensions: ['.js'],
15 | fallback: {
16 | "stream": require.resolve("stream-browserify"),
17 | "crypto": require.resolve("crypto-browserify")
18 | }
19 | },
20 | };
--------------------------------------------------------------------------------
/doc/evm/arbitrum.md:
--------------------------------------------------------------------------------
1 | #fee
2 | https://developer.arbitrum.io/devs-how-tos/how-to-estimate-gas
--------------------------------------------------------------------------------
/doc/evm/mnt.md:
--------------------------------------------------------------------------------
1 |
2 | #fee
3 | https://docs.mantle.xyz/network/for-validators/transaction-fees-on-l2
--------------------------------------------------------------------------------
/doc/evm/op.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # fee calc
4 | https://community.optimism.io/docs/developers/build/transaction-fees/#displaying-fees-to-users
--------------------------------------------------------------------------------
/docker/wordpress/nginx_php/conf.d/default.conf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/docker/wordpress/nginx_php/conf.d/default.conf
--------------------------------------------------------------------------------
/docker/wordpress/nginx_php/html/index.php:
--------------------------------------------------------------------------------
1 | setTimeout((()=>resolve(0)),1000))
4 | }
5 | function task1(){
6 | return new Promise(resolve=>setTimeout((()=>resolve(1)),1000))
7 | }
8 | function task2(){
9 | return new Promise(resolve=>setTimeout((()=>resolve(2)),1000))
10 | }
11 | function task3(){
12 | return new Promise((resolve,reject)=>setTimeout((async ()=>{
13 | try {
14 | const data = await task1()
15 | resolve(data+1)
16 | } catch (error) {
17 | reject(error)
18 | }
19 |
20 | }),1000))
21 | }
22 |
23 |
24 |
25 |
26 | async function init(){
27 |
28 | // const result = await Promise.all([task(),task2(),task3(),task1()])
29 | // console.log(result)
30 |
31 | console.log(await task())
32 | console.log(await task1())
33 | console.log(await task2())
34 | console.log(await task3())
35 |
36 |
37 |
38 |
39 | await task().then(task1()).then(task2())
40 |
41 |
42 | }
43 |
44 | init()
--------------------------------------------------------------------------------
/eth/dapp/other/Buffer.js:
--------------------------------------------------------------------------------
1 | const msg = 'abc'
2 | console.log(Buffer.from(msg))
--------------------------------------------------------------------------------
/eth/dapp/other/bn.js:
--------------------------------------------------------------------------------
1 | const BN =require("bn.js")
2 |
3 | console.log(new BN("asdsad", 10))
--------------------------------------------------------------------------------
/eth/dapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dapp",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "node": "node ./other/parse.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@ethereumjs/tx": "^3.5.1",
13 | "@metamask/eth-sig-util": "^4.0.1",
14 | "eth-sig-util": "^3.0.1",
15 | "ethers": "^5.7.2",
16 | "web3": "^1.7.1",
17 | "web3-eth-abi": "^1.7.3",
18 | "web3modal": "^1.9.8"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/eth/dapp/web/rpc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/eth/demo/index.js:
--------------------------------------------------------------------------------
1 | import { Connector, Chain } from 'wagmi'
2 | import { CoolWalletOptions, CoolWalletProvider } from 'cool-wallet-sdk'
3 |
4 | export class CoolWalletConnector extends Connector<
5 | CoolWalletProvider,
6 | CoolWalletOptions
7 | > {
8 | readonly id = 'coolWallet'
9 | readonly name = 'Cool Wallet'
10 | readonly ready = true
11 |
12 | #provider?: CoolWalletProvider
13 |
14 | constructor(config: { chains?: Chain[]; options: CoolWalletOptions }) {
15 | super(config)
16 | }
17 |
18 | async getProvider() {
19 | if (!this.#provider) {
20 | this.#provider = new CoolWalletProvider(this.options)
21 | }
22 | return this.#provider
23 | }
24 |
25 | // Implement other methods
26 | // connect, disconnect, getAccount, etc.
27 | }
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/eth/demo/wagmi-bitkeep-react/README.md
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/public/bitkeep-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/eth/demo/wagmi-bitkeep-react/public/bitkeep-icon.png
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/assets/bitkeep-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/eth/demo/wagmi-bitkeep-react/src/assets/bitkeep-icon.png
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/components/Account.js:
--------------------------------------------------------------------------------
1 | import { useAccount, useEnsName } from 'wagmi'
2 |
3 | export function Account() {
4 | const { address } = useAccount()
5 | const { data } = useEnsName({ address })
6 |
7 | return (
8 |
9 | {data ?? address}
10 | {data ? ` (${address})` : null}
11 |
12 | )
13 | }
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/components/NetworkSwitcher.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | import { useNetwork, useSwitchNetwork } from 'wagmi'
4 |
5 | export function NetworkSwitcher() {
6 | const { chain } = useNetwork()
7 | const { chains, error, isLoading, pendingChainId, switchNetwork } =
8 | useSwitchNetwork()
9 |
10 | if (!chain) return null
11 |
12 | return (
13 |
14 |
15 | Connected to {chain?.name ?? chain?.id}
16 | {chain?.unsupported && ' (unsupported)'}
17 |
18 |
19 | {switchNetwork && (
20 |
21 | {chains.map((x) =>
22 | x.id === chain?.id ? null : (
23 |
27 | ),
28 | )}
29 |
30 | )}
31 |
32 |
{error && error.message}
33 |
34 | )
35 | }
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/index.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | .block{
4 | margin: 10px 20px;
5 | }
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(document.getElementById('root'));
8 | root.render(
9 |
10 |
11 |
12 | );
13 |
14 | // If you want to start measuring performance in your app, pass a function
15 | // to log results (for example: reportWebVitals(console.log))
16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | reportWebVitals();
18 |
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/eth/demo/wagmi-bitkeep-react/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/eth/sign/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sign",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "encryptedData.js",
6 | "scripts": {
7 | "test": "node ./recover.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@ethereumjs/tx": "^4.2.0",
13 | "eth-sig-util": "^3.0.1",
14 | "ethers": "^5.7.2",
15 | "siwe": "^1.1.6"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/eth/sign/sha3.js:
--------------------------------------------------------------------------------
1 | const sha3 = require('js-sha3');
2 |
3 | function keccak256(data) {
4 | data = hex.arrayify(data);
5 | return '0x' + sha3.keccak_256(data);
6 | }
7 |
8 |
9 | console.log(keccak256("1"))
--------------------------------------------------------------------------------
/eth/sign/siwe.js:
--------------------------------------------------------------------------------
1 | const siwe = require('siwe');
2 |
3 | const domain = "localhost";
4 | const origin = "https://localhost/login";
5 |
6 | function createSiweMessage (address, statement) {
7 | const siweMessage = new siwe.SiweMessage({
8 | domain,
9 | address,
10 | statement,
11 | uri: origin,
12 | version: '1',
13 | chainId: '1'
14 | });
15 | return siweMessage.prepareMessage();
16 | }
17 |
18 | console.log(createSiweMessage(
19 | "0x6Ee9894c677EFa1c56392e5E7533DE76004C8D94",
20 | "This is a test statement."
21 | ));
--------------------------------------------------------------------------------
/eth/sign/swie.js:
--------------------------------------------------------------------------------
1 | // const msgHexToText = (hex) => {
2 | // try {
3 | // const stripped = hex
4 | // const buff = Buffer.from(stripped, 'hex');
5 | // return buff.length === 32 ? hex : buff.toString('utf8');
6 | // } catch (e) {
7 | // log.error(e);
8 | // return hex;
9 | // }
10 | // };
11 |
12 |
13 | // console.log(msgHexToText(Buffer.from("hello").toString("hex")))
14 | console.log(Buffer.from(`aaaaaa
15 | aaaaa
16 | aaaa`).toString("hex"))
--------------------------------------------------------------------------------
/example/web3demo1/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/example/web3demo1/config-overrides.js:
--------------------------------------------------------------------------------
1 |
2 | const webpack = require('webpack');
3 | // const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
4 | module.exports = function override(config) {
5 | const fallback = config.resolve.fallback || {};
6 | Object.assign(fallback, {
7 | "crypto": require.resolve("crypto-browserify"),
8 | "stream": require.resolve("stream-browserify"),
9 | "assert": require.resolve("assert"),
10 | "http": require.resolve("stream-http"),
11 | "https": require.resolve("https-browserify"),
12 | "os": require.resolve("os-browserify"),
13 | "url": require.resolve("url")
14 | })
15 | config.resolve.fallback = fallback;
16 | config.plugins = (config.plugins || []).concat([
17 | new webpack.ProvidePlugin({
18 | process: 'process/browser',
19 | Buffer: ['buffer', 'Buffer']
20 | })
21 | ])
22 | return config;
23 | }
24 |
--------------------------------------------------------------------------------
/example/web3demo1/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/example/web3demo1/public/favicon.ico
--------------------------------------------------------------------------------
/example/web3demo1/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/example/web3demo1/public/logo192.png
--------------------------------------------------------------------------------
/example/web3demo1/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/example/web3demo1/public/logo512.png
--------------------------------------------------------------------------------
/example/web3demo1/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/example/web3demo1/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/example/web3demo1/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/example/web3demo1/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/example/web3demo1/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/example/web3demo1/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(document.getElementById('root'));
8 | root.render(
9 |
10 |
11 |
12 | );
13 |
14 | // If you want to start measuring performance in your app, pass a function
15 | // to log results (for example: reportWebVitals(console.log))
16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | reportWebVitals();
18 |
--------------------------------------------------------------------------------
/example/web3demo1/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/example/web3demo1/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/gowasm/eth.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/gowasm/eth.wasm
--------------------------------------------------------------------------------
/gowasm/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
13 |
14 |
15 |
16 | +
17 |
18 | =
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/gowasm/lib.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/gowasm/lib.wasm
--------------------------------------------------------------------------------
/gowasm/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gowasm",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "AES.js",
6 | "scripts": {
7 | "test": "node ./AES.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "md5": "^2.3.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/gowasm/pkg/mod/cache/lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/gowasm/pkg/mod/cache/lock
--------------------------------------------------------------------------------
/gowasm/readm.md:
--------------------------------------------------------------------------------
1 |
2 | export GOOS=js
3 |
4 | export GOARCH=wasm
5 |
6 | export CGO_ENABLED=0
7 |
8 |
9 | go build -o lib.wasm lib.go
10 |
11 |
12 | export GOOS=mac
13 |
14 | export GOARCH=amd64
15 |
16 | sudo go run server.go
17 |
18 |
19 |
20 |
21 | https://www.likecs.com/show-719355.html#sc=1326
22 |
23 |
24 | go build -o test.wasm test.go
25 |
26 |
27 |
28 | https://www.vugu.org/doc/start
--------------------------------------------------------------------------------
/gowasm/server.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "flag"
5 | "log"
6 | "net/http"
7 | )
8 |
9 | var (
10 | listen = flag.String("listen", ":8087", "listen address")
11 | dir = flag.String("dir", ".", "files directory to serve")
12 | )
13 |
14 | func main() {
15 | flag.Parse()
16 | log.Printf("listening on %q...", *listen)
17 | err := http.ListenAndServe(*listen, http.FileServer(http.Dir(*dir)))
18 | log.Fatalln(err)
19 | }
--------------------------------------------------------------------------------
/gowasm/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/gowasm/test.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/gowasm/test.wasm
--------------------------------------------------------------------------------
/grpc.test/clientServer.js:
--------------------------------------------------------------------------------
1 | const express = require("express")
2 | const bodyParser = require('body-parser');
3 | const {hello_proto } = require('./proto/index')
4 | const grpc = require('@grpc/grpc-js')
5 | const router = express.Router();
6 |
7 |
8 |
9 | const app = express()
10 | app.use(bodyParser.json({ limit: 'Mixed' }));
11 | app.use(bodyParser.urlencoded({
12 | extended: true
13 | }));
14 | app.use(router);
15 | router.use(express.static(__dirname + '/static'));
16 |
17 |
18 |
19 | var client = new hello_proto.Greeter('localhost:50051', grpc.credentials.createInsecure())
20 |
21 |
22 | router.get("/hello", (req,res)=>{
23 | client.sayHello(req.query, function(err, response) {
24 | if (err) {
25 | console.error('Error: ', err)
26 | res.end(500,err)
27 | } else {
28 | console.log(response.message)
29 | res.end(response.message)
30 | }
31 | })
32 | })
33 | app.listen("3000",()=>{
34 | console.log("listen 3000")
35 | })
--------------------------------------------------------------------------------
/grpc.test/grpcServer.js:
--------------------------------------------------------------------------------
1 | const grpc = require('@grpc/grpc-js')
2 | const grpcProto = require('./proto/index')
3 |
4 |
5 | function sayHello(call, callback) {
6 | setTimeout(()=>{
7 | callback(null, { message: call.request.message })
8 | }, 2000)
9 |
10 | }
11 |
12 | function main() {
13 | var server = new grpc.Server()
14 | server.addService(grpcProto.hello_proto.Greeter.service, { sayHello: sayHello })
15 |
16 |
17 |
18 | server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => {
19 | server.start()
20 | console.log('grpc server started, 50051')
21 | })
22 | }
23 |
24 | main()
--------------------------------------------------------------------------------
/grpc.test/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "grpc.test",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "server.js",
6 | "scripts": {
7 | "start:grpc": "nodemon grpcServer.js",
8 | "start:client": "nodemon clientServer.js"
9 | },
10 | "author": "",
11 | "license": "ISC",
12 | "dependencies": {
13 | "@grpc/grpc-js": "^1.8.13",
14 | "body-parser": "^1.20.2",
15 | "ejs": "^3.1.9",
16 | "express": "^4.18.2",
17 | "nodemon": "^2.0.22"
18 | },
19 | "devDependencies": {
20 | "@grpc/proto-loader": "^0.7.6"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/grpc.test/proto/index.js:
--------------------------------------------------------------------------------
1 | const grpc = require('@grpc/grpc-js');
2 | const protoLoader = require('@grpc/proto-loader')
3 | const path = require("path")
4 |
5 | const PROTO_PATH = path.join(__dirname, "./moudle/hello.proto")
6 | const packageDefinition = protoLoader.loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true })
7 | const protoDescriptor = grpc.loadPackageDefinition(packageDefinition)
8 |
9 | const hello_proto = protoDescriptor.hello
10 | module.exports = {
11 | hello_proto
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/grpc.test/proto/moudle/hello.proto:
--------------------------------------------------------------------------------
1 | syntax="proto3"; // 标识,必须要有,表示是在使用proto3的协议
2 |
3 | package hello; // 包名,必须要有,可以理解为这个协议的命名空间
4 |
5 | // 定义一个服务Greeter
6 | // 其中有个rpc方法叫做 SayHello
7 | // 同时我们可以看到传参为HelloRequest,HelloRequest属于消息
8 | // 返回消息Greeter
9 | service Greeter {
10 | rpc SayHello (HelloRequest) returns (HelloReply) {}
11 | }
12 |
13 | // 对于消息的定义
14 | // 在nodejs里面,消息所定义的参数是存在一个数组里面的
15 | // 所以定义的时候,需要给出参数的位置是比较科学的
16 | // 注意:目前只针对于nodejs是这样存参数的,至于其他平台语言,不一定是这样的
17 | message HelloRequest {
18 | string message=1; // 第一个参数类型是string
19 | int32 age=2; // 第二个参数类型是int32
20 | }
21 |
22 | message HelloReply {
23 | string message=1; // 第一个参数类型是string
24 | }
25 |
--------------------------------------------------------------------------------
/grpc.test/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
15 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/leveldb/index.js:
--------------------------------------------------------------------------------
1 |
2 | const path = require("path");
3 | const { Level } = require("level");
4 | const dbPath = './nkbihfbeogaeaoehlefnkodbefgpgknn'
5 | const db = new Level(path.resolve(__dirname, dbPath), { valueEncoding: "json" })
6 |
7 |
8 |
9 | ;(async ()=>{
10 | for await (const [key, value] of db.iterator()) {
11 | console.log(key,value);
12 |
13 | // console.log([key, JSON.stringify(value, null, 2)])
14 | }
15 | // await db.put("","")
16 | // await db.get("","")
17 | db.close()
18 | })()
19 |
--------------------------------------------------------------------------------
/leveldb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "leveldb",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "node index.js"
8 | },
9 | "author": "faraway.cao",
10 | "license": "ISC"
11 | }
12 |
--------------------------------------------------------------------------------
/luna/dapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dapp",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "startNode": "./index.mjs"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@terra-money/terra.js": "^3.0.10"
13 | },
14 | "devDependencies": {
15 | "babel-register": "^6.26.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/mulwallet/sdk/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/mulwallet/sdk/README.md
--------------------------------------------------------------------------------
/mulwallet/sdk/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.0.1",
3 | "name": "@bitkeep/web3-sdk",
4 | "license": "MIT",
5 | "main": "dist/index.js",
6 | "typings": "dist/index.d.ts",
7 | "files": [
8 | "dist",
9 | "src/*.ts"
10 | ],
11 | "scripts": {
12 | "test1": "node ./test/valtio.test.js",
13 | "dev": "esbuild src/index.ts --outdir=dist --bundle --format=esm --servedir=dist --watch ",
14 | "build": "node esbuild.config",
15 | "test": "",
16 | "lint": "",
17 | "prepare": ""
18 | },
19 | "peerDependencies": {},
20 | "//husky": {
21 | "hooks": {
22 | "pre-commit": "tsdx lint"
23 | }
24 | },
25 | "prettier": {
26 | "printWidth": 80,
27 | "semi": true,
28 | "singleQuote": true,
29 | "trailingComma": "es5"
30 | },
31 | "author": "faraway.cao",
32 | "devDependencies": {
33 | "esbuild": "^0.18.10",
34 | "eventemitter3": "^5.0.1"
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/mulwallet/sdk/src/adapters/LegacyEip155Adapter.ts:
--------------------------------------------------------------------------------
1 | import { AbstractAdapter } from "./AbstractAdapter";
2 | import { SupportProviderFlag } from "../constant"
3 |
4 |
5 | type LegacyEip155AdapterOption = {
6 | isBitKeep: boolean // 是否走其他钱包
7 | }
8 | class LegacyEip155Adapter extends AbstractAdapter {
9 | constructor(Options: LegacyEip155AdapterOption = {
10 | isBitKeep: true
11 | }) {
12 | super({ providerFlag: SupportProviderFlag.EVM, isBitKeep: Options.isBitKeep })
13 | }
14 | connect(): Promise {
15 | const provider = this.getProvider()
16 | return provider.request({ method: "eth_requestAccounts" })
17 | }
18 | signMessage(params: any): Promise {
19 | const provider = this.getProvider()
20 | return provider.request({
21 | from: provider.selectedAddress,
22 | method: "personal_sign",
23 | params:[ params.message, provider.selectedAddress]
24 | })
25 | }
26 |
27 | }
28 |
29 | export { LegacyEip155Adapter }
--------------------------------------------------------------------------------
/mulwallet/sdk/src/adapters/TronLinkAdapter.ts:
--------------------------------------------------------------------------------
1 | import { AbstractAdapter } from "./AbstractAdapter";
2 | import { SupportProviderFlag } from "../constant"
3 | type TronLinkInjectedOptions = {
4 | isBitKeep: boolean
5 | }
6 |
7 | class TronLinkAdapter extends AbstractAdapter {
8 | constructor(Options: TronLinkInjectedOptions = {
9 | isBitKeep: true
10 | }) {
11 | super({ providerFlag: SupportProviderFlag.TRON, isBitKeep: Options.isBitKeep })
12 | }
13 | connect(): Promise{
14 | const { tronLink } = this.getProvider()
15 | return tronLink.request({ method: "tron_requestAccounts"})
16 | }
17 | signMessage(params: any): Promise {
18 | const { tronWeb } = this.getProvider()
19 | return this.isBitKeep ? tronWeb.trx.sign(params.message) : tronWeb.trx.signMessageV2(params.message)
20 | }
21 |
22 |
23 | }
24 |
25 | export { TronLinkAdapter }
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/mulwallet/sdk/src/global.d.ts:
--------------------------------------------------------------------------------
1 | declare winodw
2 |
3 | declare var bitkeep: {
4 | ethereum: {},
5 | tronLink: {},
6 | tronWeb: {},
7 | // solana: any,
8 | // phantom: any,
9 | // petra: any,
10 | // aptos: any,
11 | // arweave: any,
12 | unisat: {}
13 | // keplr
14 |
15 | }
16 |
17 | declare interface Window {
18 | bitkeep: any;
19 | ethereum: any;
20 | tronLink: {};
21 | tronWeb: {};
22 | // solana: any,
23 | // phantom: any,
24 | // petra: any,
25 | // aptos: any,
26 | // arweave: any,
27 | unisat: {}
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/mulwallet/sdk/src/utils/index.ts:
--------------------------------------------------------------------------------
1 |
2 | export * from "../provider"
3 |
4 |
5 |
--------------------------------------------------------------------------------
/near/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "near",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "near-api-js": "^0.44.2"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/node/express/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "init",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "node ./bin/www"
7 | },
8 | "dependencies": {
9 | "cookie-parser": "~1.4.4",
10 | "debug": "~2.6.9",
11 | "express": "~4.16.1",
12 | "http-errors": "~1.6.3",
13 | "jade": "~1.11.0",
14 | "morgan": "~1.9.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/node/express/public/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 50px;
3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 | }
5 |
6 | a {
7 | color: #00B7FF;
8 | }
9 |
--------------------------------------------------------------------------------
/node/express/routes/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET home page. */
5 | router.get('/', function(req, res, next) {
6 | res.render('index', { title: 'Express' });
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/node/express/routes/users.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET users listing. */
5 | router.get('/', function(req, res, next) {
6 | res.send('respond with a resource');
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/node/express/views/error.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | h1= message
5 | h2= error.status
6 | pre #{error.stack}
7 |
--------------------------------------------------------------------------------
/node/express/views/index.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | h1= title
5 | p Welcome to #{title}
6 |
--------------------------------------------------------------------------------
/node/express/views/layout.jade:
--------------------------------------------------------------------------------
1 | doctype html
2 | html
3 | head
4 | title= title
5 | link(rel='stylesheet', href='/stylesheets/style.css')
6 | body
7 | block content
8 |
--------------------------------------------------------------------------------
/node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "node",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "1.js",
6 | "scripts": {
7 | "vueRender": "node ./serverRender/vue.js",
8 | "templateRender": "node ./serverRender/template.js",
9 | "server": "node ./serverRender/server.js",
10 | "servervue": "node ./serverRender/servervue.js"
11 | },
12 | "author": "caoshiyuan",
13 | "license": "ISC",
14 | "dependencies": {
15 | "express": "^4.18.1",
16 | "vue": "^2.5.13",
17 | "vue-server-renderer": "^2.5.13"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/node/serverRender/art-template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | 服务端渲染
11 | {{keys}}
12 | {{data}}
13 |
14 |
--------------------------------------------------------------------------------
/node/serverRender/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | 培训 服务端渲染
11 |
12 |
--------------------------------------------------------------------------------
/node/serverRender/public/aaa.text:
--------------------------------------------------------------------------------
1 | 静态资源服务
--------------------------------------------------------------------------------
/node/serverRender/server.js:
--------------------------------------------------------------------------------
1 | var express = require("express"); // https createServer
2 | const fs = require("fs"); // stream path
3 | const path = require("path");
4 | // const axios = require("axios")
5 |
6 | // process .env
7 | //__dirname
8 | //golbal == window
9 |
10 | // https 包
11 | var app = express();
12 | app.use(express.static(path.join(__dirname, 'public')));
13 | app.use(async function (req,res) {
14 | const state = await new Promise((resolve) => {
15 | setInterval(() => {
16 | resolve({
17 | keys: "123123",
18 | data: "asdasda",
19 | });
20 | }, 1000);
21 | });
22 |
23 | let data = fs.readFileSync(path.resolve(__dirname, "./art-template.html"), "utf-8");
24 | Object.keys(state).forEach((key) => {
25 | data = data.replace(`{{${key}}}`, state[key]);
26 | });
27 | res.end(data, "utf-8") // mine Type
28 | });
29 |
30 | app.listen(3000,function(){
31 | console.log("listening 3000")
32 | });
33 |
--------------------------------------------------------------------------------
/node/serverRender/template.js:
--------------------------------------------------------------------------------
1 |
2 | const fs = require("fs")
3 | const path = require("path")
4 | console.log(__dirname)
5 | const state = {
6 | keys:"123123",
7 | data:"asdasda"
8 | }
9 | let data= fs.readFileSync("./serverRender/art-template.html",'utf-8')
10 | Object.keys(state).forEach(key=>{
11 | data = data.replace(`{{${key}}}`, state[key])
12 | })
13 |
14 | console.log(data)
15 |
16 |
--------------------------------------------------------------------------------
/node/serverRender/vue.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | const fs = require("fs")
4 |
5 |
6 | // /data
7 | // /data, req , res
8 | // nuxt
9 | // const nuxt vue-server-render
10 |
11 |
12 | // asyncData({isDev, route, store, env, params, query, req, res, redirect, error}) {
13 | // return { a:{}}
14 | // },
15 | // data(){
16 | // return {
17 | // a:{}
18 | // }
19 | // }
20 | // fetch(){
21 |
22 | // }
23 |
24 | // create(){
25 | // window
26 | // }
27 | // beforeCreate() {
28 |
29 | // },
30 | //
31 |
32 |
33 | {/*
34 | */}
35 |
36 | const data= fs.readFileSync("./vue.html",'utf-8')
37 |
38 | console.log(data)
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "@chainsafe/bls-keygen": "^0.4.0",
4 | "@metamask/eth-sig-util": "^5.0.2",
5 | "@mysten/wallet-adapter-react": "^7.0.0",
6 | "@suiet/wallet-adapter": "^0.0.18",
7 | "crypto-js": "^4.1.1",
8 | "dx-const-id-sdk": "^0.1.0",
9 | "elliptic": "^6.5.4",
10 | "eth-sig-util": "^3.0.1",
11 | "ethers": "^5.6.6",
12 | "geoip-lite": "^1.4.5",
13 | "http-server": "^14.1.1",
14 | "koa2-generator": "^1.1.7",
15 | "md5": "^2.3.0",
16 | "reflect-metadata": "^0.1.13"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/package/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "package",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@web3-onboard/walletconnect": "^2.0.8"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/resource/docker/wordPress/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3'
2 | services:
3 | mysqldb:
4 | image: mysql
5 | container_name: wordpress_mysql
6 | ports:
7 | - '3306:3306'
8 | volumes:
9 | - ./data:/var/lib/mysql
10 | restart: always
11 | command: --default-authentication-plugin=mysql_native_password --lower-case-table-names=1
12 | environment:
13 | MYSQL_ROOT_PASSWORD: 123456
14 | MYSQL_DATABASE: chengxulvtu
15 | MYSQL_USER: chengxulvtu
16 | MYSQL_PASSWORD: 123456
17 |
18 | wordpress:
19 | depends_on:
20 | - mysqldb
21 | image: wordpress
22 | container_name: wordpress_chengxulvtu
23 | ports:
24 | - "8080:80"
25 | restart: always
26 | environment:
27 | WORDPRESS_DB_HOST: wordpress_mysql:3306
28 | WORDPRESS_DB_NAME: chengxulvtu
29 | WORDPRESS_DB_USER: chengxulvtu
30 | WORDPRESS_DB_PASSWORD: 123456
31 | volumes:
32 | - ./html:/var/www/html
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | fixtures
3 | out
4 | dev
5 | build
6 | src/**/public
7 | templates/svelte
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [
3 | require.resolve('eslint-config-react-app'),
4 | require.resolve('eslint-config-react-app/jest'),
5 | require.resolve('eslint-config-prettier'),
6 | ],
7 |
8 | overrides: [
9 | {
10 | files: ['**/*.ts?(x)'],
11 | rules: {
12 | 'no-shadow': 'off',
13 | '@typescript-eslint/no-shadow': ['warn'],
14 | },
15 | },
16 | {
17 | files: ['**/*.stories.{js,jsx,ts,tsx}'],
18 | rules: {
19 | 'import/no-anonymous-default-export': 'off',
20 | 'react-hooks/rules-of-hooks': 'off',
21 | },
22 | },
23 | ],
24 |
25 | //rules: {
26 | // 'react-hooks/exhaustive-deps': [
27 | // 'warn',
28 | // {
29 | // additionalHooks: '(useCustomHook)',
30 | // },
31 | // ],
32 | //},
33 | };
34 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.gitignore:
--------------------------------------------------------------------------------
1 | # config
2 | .envrc
3 | .env
4 | !packages/.env
5 |
6 | # tools
7 | /.idea
8 |
9 | # node
10 | node_modules/
11 |
12 | # macos
13 | .DS_Store
14 |
15 | # generated files
16 | *.tgz
17 | lerna-debug.log
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
22 | # yarn berry
23 | .yarn/*
24 | !.yarn/releases
25 | !.yarn/plugins
26 |
27 | # output
28 | coverage/
29 | out/
30 | dev/
31 | build/
32 | test/storage/
33 | .eslintcache
34 | .chrome/
35 | tsconfig.tsbuildinfo
36 | puppeteer-user-data/
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | yarn run markdown-source-import README.md "packages/src/**/*.md" --git-add
5 |
6 | cp README.md packages/src/@terra-money/wallet-provider/README.md
7 | git add packages/src/@terra-money/wallet-provider/README.md
8 |
9 | yarn run lint-staged
10 |
11 | yarn workspace packages run precommit
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | fixtures
3 | out
4 | dev
5 | build
6 | src/**/public
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | ...require('@ssen/prettier-config'),
3 | };
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | nmHoistingLimits: workspaces
2 |
3 | nodeLinker: node-modules
4 |
5 | plugins:
6 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
7 | spec: "@yarnpkg/plugin-interactive-tools"
8 |
9 | yarnPath: .yarn/releases/yarn-3.1.0.cjs
10 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/heads/main
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/config:
--------------------------------------------------------------------------------
1 | [core]
2 | repositoryformatversion = 0
3 | filemode = true
4 | bare = false
5 | logallrefupdates = true
6 | ignorecase = true
7 | precomposeunicode = true
8 | [remote "origin"]
9 | url = git@github.com:terra-money/wallet-provider.git
10 | fetch = +refs/heads/*:refs/remotes/origin/*
11 | [branch "main"]
12 | remote = origin
13 | merge = refs/heads/main
14 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/description:
--------------------------------------------------------------------------------
1 | Unnamed repository; edit this file 'description' to name the repository.
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/hooks/applypatch-msg.sample:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to check the commit log message taken by
4 | # applypatch from an e-mail message.
5 | #
6 | # The hook should exit with non-zero status after issuing an
7 | # appropriate message if it wants to stop the commit. The hook is
8 | # allowed to edit the commit message file.
9 | #
10 | # To enable this hook, rename this file to "applypatch-msg".
11 |
12 | . git-sh-setup
13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
15 | :
16 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/hooks/commit-msg.sample:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to check the commit log message.
4 | # Called by "git commit" with one argument, the name of the file
5 | # that has the commit message. The hook should exit with non-zero
6 | # status after issuing an appropriate message if it wants to stop the
7 | # commit. The hook is allowed to edit the commit message file.
8 | #
9 | # To enable this hook, rename this file to "commit-msg".
10 |
11 | # Uncomment the below to add a Signed-off-by line to the message.
12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13 | # hook is more suited to it.
14 | #
15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17 |
18 | # This example catches duplicate Signed-off-by lines.
19 |
20 | test "" = "$(grep '^Signed-off-by: ' "$1" |
21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22 | echo >&2 Duplicate Signed-off-by lines.
23 | exit 1
24 | }
25 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/hooks/post-update.sample:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to prepare a packed repository for use over
4 | # dumb transports.
5 | #
6 | # To enable this hook, rename this file to "post-update".
7 |
8 | exec git update-server-info
9 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/hooks/pre-applypatch.sample:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to verify what is about to be committed
4 | # by applypatch from an e-mail message.
5 | #
6 | # The hook should exit with non-zero status after issuing an
7 | # appropriate message if it wants to stop the commit.
8 | #
9 | # To enable this hook, rename this file to "pre-applypatch".
10 |
11 | . git-sh-setup
12 | precommit="$(git rev-parse --git-path hooks/pre-commit)"
13 | test -x "$precommit" && exec "$precommit" ${1+"$@"}
14 | :
15 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/hooks/pre-merge-commit.sample:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to verify what is about to be committed.
4 | # Called by "git merge" with no arguments. The hook should
5 | # exit with non-zero status after issuing an appropriate message to
6 | # stderr if it wants to stop the merge commit.
7 | #
8 | # To enable this hook, rename this file to "pre-merge-commit".
9 |
10 | . git-sh-setup
11 | test -x "$GIT_DIR/hooks/pre-commit" &&
12 | exec "$GIT_DIR/hooks/pre-commit"
13 | :
14 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/hooks/pre-receive.sample:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to make use of push options.
4 | # The example simply echoes all push options that start with 'echoback='
5 | # and rejects all pushes when the "reject" push option is used.
6 | #
7 | # To enable this hook, rename this file to "pre-receive".
8 |
9 | if test -n "$GIT_PUSH_OPTION_COUNT"
10 | then
11 | i=0
12 | while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
13 | do
14 | eval "value=\$GIT_PUSH_OPTION_$i"
15 | case "$value" in
16 | echoback=*)
17 | echo "echo from the pre-receive-hook: ${value#*=}" >&2
18 | ;;
19 | reject)
20 | exit 1
21 | esac
22 | i=$((i + 1))
23 | done
24 | fi
25 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/index:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/git/index
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/info/exclude:
--------------------------------------------------------------------------------
1 | # git ls-files --others --exclude-from=.git/info/exclude
2 | # Lines that start with '#' are comments.
3 | # For a project mostly in C, the following would be a good set of
4 | # exclude patterns (uncomment them if you want to use them):
5 | # *.[oa]
6 | # *~
7 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/logs/HEAD:
--------------------------------------------------------------------------------
1 | 0000000000000000000000000000000000000000 6f4e74d46e9aa1833d65e68438896bbd54b93de3 caoshiyuan 1649068781 +0800 clone: from github.com:terra-money/wallet-provider.git
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/logs/refs/heads/main:
--------------------------------------------------------------------------------
1 | 0000000000000000000000000000000000000000 6f4e74d46e9aa1833d65e68438896bbd54b93de3 caoshiyuan 1649068781 +0800 clone: from github.com:terra-money/wallet-provider.git
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/logs/refs/remotes/origin/HEAD:
--------------------------------------------------------------------------------
1 | 0000000000000000000000000000000000000000 6f4e74d46e9aa1833d65e68438896bbd54b93de3 caoshiyuan 1649068781 +0800 clone: from github.com:terra-money/wallet-provider.git
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/objects/pack/pack-04f9191beb0725fb9b398672a475351e4f3fb446.idx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/git/objects/pack/pack-04f9191beb0725fb9b398672a475351e4f3fb446.idx
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/objects/pack/pack-04f9191beb0725fb9b398672a475351e4f3fb446.pack:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/git/objects/pack/pack-04f9191beb0725fb9b398672a475351e4f3fb446.pack
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/refs/heads/main:
--------------------------------------------------------------------------------
1 | 6f4e74d46e9aa1833d65e68438896bbd54b93de3
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/git/refs/remotes/origin/HEAD:
--------------------------------------------------------------------------------
1 | ref: refs/remotes/origin/main
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/.env:
--------------------------------------------------------------------------------
1 | SKIP_PREFLIGHT_CHECK=true
2 | DISABLE_NEW_JSX_TRANSFORM=true
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/.package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Ian ",
3 | "license": "Apache-2.0",
4 | "repository": "github:terra-money/wallet-provider",
5 | "bugs": "https://github.com/terra-money/wallet-provider/issues",
6 | "homepage": "https://github.com/terra-money/wallet-provider/tree/main/packages/src/{name}",
7 | "engines": {
8 | "node": ">=12"
9 | },
10 | "publishConfig": {
11 | "cache": "~/.npm",
12 | "access": "public"
13 | }
14 | }
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/.packages.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://rocket-hangar.github.io/rocket-punch/schemas/packages.json",
3 | "@terra-money/use-wallet": {
4 | "version": "3.8.0",
5 | "tag": "latest"
6 | },
7 | "@terra-money/*": {
8 | "version": "3.8.0",
9 | "tag": "latest"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 | Terra Wallet Provider Example
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/packages/public/favicon.ico
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/packages/public/logo.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/use-wallet/index.ts:
--------------------------------------------------------------------------------
1 | export * from '@terra-money/wallet-types';
2 |
3 | export * from './useWallet';
4 | export * from './useConnectedWallet';
5 | export * from './useInstallableWallets';
6 | export * from './useLCDClient';
7 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/use-wallet/useConnectedWallet.ts:
--------------------------------------------------------------------------------
1 | import {
2 | ConnectedWallet,
3 | createConnectedWallet,
4 | } from '@terra-money/wallet-types';
5 | import { useMemo } from 'react';
6 | import { useWallet } from './useWallet';
7 |
8 | export function useConnectedWallet(): ConnectedWallet | undefined {
9 | const {
10 | status,
11 | network,
12 | wallets,
13 | post,
14 | sign,
15 | signBytes,
16 | supportFeatures,
17 | connection,
18 | } = useWallet();
19 |
20 | return useMemo(() => {
21 | return createConnectedWallet({
22 | status,
23 | network,
24 | wallets,
25 | post,
26 | sign,
27 | signBytes,
28 | supportFeatures,
29 | connection,
30 | });
31 | }, [
32 | connection,
33 | network,
34 | post,
35 | sign,
36 | signBytes,
37 | status,
38 | supportFeatures,
39 | wallets,
40 | ]);
41 | }
42 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/use-wallet/useInstallableWallets.ts:
--------------------------------------------------------------------------------
1 | import {
2 | createInstallableWallets,
3 | Installation,
4 | } from '@terra-money/wallet-types';
5 | import { useMemo } from 'react';
6 | import { useWallet } from './useWallet';
7 |
8 | export function useInstallableWallets(): Installation[] | undefined {
9 | const { status, availableInstallations } = useWallet();
10 |
11 | return useMemo(() => {
12 | return createInstallableWallets({
13 | status,
14 | installations: availableInstallations,
15 | });
16 | }, [availableInstallations, status]);
17 | }
18 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/use-wallet/useLCDClient.ts:
--------------------------------------------------------------------------------
1 | import {
2 | createLCDClient,
3 | WalletLCDClientConfig,
4 | } from '@terra-money/wallet-types';
5 | import { LCDClient } from '@terra-money/terra.js';
6 | import { useMemo } from 'react';
7 | import { useWallet } from './useWallet';
8 |
9 | export function useLCDClient(
10 | lcdClientConfig?: WalletLCDClientConfig,
11 | ): LCDClient {
12 | const { network } = useWallet();
13 |
14 | return useMemo(() => {
15 | return createLCDClient({ lcdClientConfig, network });
16 | }, [lcdClientConfig, network]);
17 | }
18 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/README.md:
--------------------------------------------------------------------------------
1 | # Terra Wallet Controller
2 |
3 | This is a sub-structure of the [`@terra-money/wallet-provider`](https://www.npmjs.com/package/@terra-money/wallet-provider).
4 |
5 | You can use it when you want to develop in a framework other than React.
6 |
7 | This is not yet properly equipped with documents compared to wallet-provider, and may be more difficult to use than react hooks.
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/env.ts:
--------------------------------------------------------------------------------
1 | export const CHROME_EXTENSION_INSTALL_URL =
2 | 'https://chrome.google.com/webstore/detail/terra-station/aiifbnbfobpmeekipheeijimdpnlpgpp';
3 |
4 | export const DEFAULT_CHROME_EXTENSION_COMPATIBLE_BROWSER_CHECK = (
5 | userAgent: string,
6 | ) => {
7 | return /MathWallet\//.test(userAgent);
8 | };
9 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/exception/isError.ts:
--------------------------------------------------------------------------------
1 | export function isError(
2 | error: unknown,
3 | errorType: { new (...args: any[]): E },
4 | ): error is E {
5 | try {
6 | return (
7 | //@ts-ignore
8 | error instanceof errorType || error.constructor.name === errorType.name
9 | );
10 | } catch {
11 | return false;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/index.ts:
--------------------------------------------------------------------------------
1 | export * from '@terra-money/wallet-types';
2 |
3 | export * from './getChainOptions';
4 | export * from './controller';
5 | export * from './verifyBytes';
6 |
7 | export * from './operators/toConnectedWallet';
8 |
9 | export type { ReadonlyWalletSession } from './modules/readonly-wallet';
10 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/extension-router/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ExtensionRouter';
2 | export * from './types';
3 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/extension-router/multiChannel.ts:
--------------------------------------------------------------------------------
1 | import { TerraWebExtensionConnector } from '@terra-money/web-extension-interface';
2 |
3 | export interface ExtensionInfo {
4 | name: string;
5 | identifier: string;
6 | icon: string;
7 | connector?: () =>
8 | | TerraWebExtensionConnector
9 | | Promise;
10 | }
11 |
12 | declare global {
13 | interface Window {
14 | terraWallets: ExtensionInfo[] | undefined;
15 | }
16 | }
17 |
18 | export function getTerraExtensions(): ExtensionInfo[] {
19 | return Array.isArray(window.terraWallets)
20 | ? window.terraWallets
21 | : window.isTerraExtensionAvailable
22 | ? [
23 | {
24 | name: 'Terra Station',
25 | identifier: 'station',
26 | icon: 'https://assets.terra.money/icon/wallet-provider/station.svg',
27 | },
28 | ]
29 | : [];
30 | }
31 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/legacy-extension/index.ts:
--------------------------------------------------------------------------------
1 | export * from './LegacyExtensionConnector';
2 | export * from './createFixedExtension';
3 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/readonly-wallet/connect.ts:
--------------------------------------------------------------------------------
1 | import { clearStoredSession, getStoredSession, storeSession } from './storage';
2 | import { ReadonlyWalletSession } from './types';
3 |
4 | export interface ReadonlyWalletController extends ReadonlyWalletSession {
5 | disconnect: () => void;
6 | }
7 |
8 | export interface ReadonlyWalletOptions extends ReadonlyWalletSession {}
9 |
10 | export function connectIfSessionExists(): ReadonlyWalletController | null {
11 | const storedSession = getStoredSession();
12 |
13 | if (!!storedSession) {
14 | return connect(storedSession);
15 | }
16 |
17 | return null;
18 | }
19 |
20 | export function connect(
21 | options: ReadonlyWalletOptions,
22 | ): ReadonlyWalletController {
23 | storeSession(options);
24 |
25 | function disconnect() {
26 | clearStoredSession();
27 | }
28 |
29 | return {
30 | ...options,
31 | disconnect,
32 | };
33 | }
34 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/readonly-wallet/index.ts:
--------------------------------------------------------------------------------
1 | export * from './types';
2 | export * from './connect';
3 | export * from './modal';
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/readonly-wallet/types.ts:
--------------------------------------------------------------------------------
1 | import { NetworkInfo } from '@terra-money/wallet-types';
2 |
3 | export interface ReadonlyWalletSession {
4 | network: NetworkInfo;
5 | terraAddress: string;
6 | }
7 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/walletconnect/errors.ts:
--------------------------------------------------------------------------------
1 | export class WalletConnectUserDenied extends Error {}
2 |
3 | export class WalletConnectCreateTxFailed extends Error {
4 | constructor(message: string) {
5 | super(message);
6 | this.name = 'WalletConnectCreateTxFailed';
7 | }
8 | }
9 |
10 | export class WalletConnectTxFailed extends Error {
11 | constructor(
12 | public readonly txhash: string,
13 | message: string,
14 | public readonly raw_message: any,
15 | ) {
16 | super(message);
17 | this.name = 'WalletConnectTxFailed';
18 | }
19 | }
20 |
21 | export class WalletConnectTimeout extends Error {
22 | constructor(message: string) {
23 | super(message);
24 | this.name = 'WalletConnectTimeout';
25 | }
26 | }
27 |
28 | export class WalletConnectTxUnspecifiedError extends Error {
29 | constructor(message: string) {
30 | super(message);
31 | this.name = 'WalletConnectTxUnspecifiedError';
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/modules/walletconnect/index.ts:
--------------------------------------------------------------------------------
1 | export * from './connect';
2 | export * from './types';
3 | export * from './errors';
4 | export * from './impl/socket-transport';
5 | export * from './modal';
6 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/operators/toLcdClient.ts:
--------------------------------------------------------------------------------
1 | import {
2 | createLCDClient,
3 | WalletLCDClientConfig,
4 | WalletStates,
5 | } from '@terra-money/wallet-types';
6 | import { LCDClient } from '@terra-money/terra.js';
7 | import { OperatorFunction } from 'rxjs';
8 | import { map } from 'rxjs/operators';
9 |
10 | export function toLcdClient(
11 | lcdClientConfig?: WalletLCDClientConfig,
12 | ): OperatorFunction {
13 | return map((states) => {
14 | return createLCDClient({
15 | lcdClientConfig,
16 | network: states.network,
17 | });
18 | });
19 | }
20 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/utils/__tests__/useragent.test.ts:
--------------------------------------------------------------------------------
1 | import bowser from 'bowser';
2 | import { describe, expect, test } from 'vitest';
3 |
4 | describe('browserslist', () => {
5 | test('should be user agent is chrome', () => {
6 | [
7 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
8 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 11_0_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4298.0 Safari/537.36',
9 | ].forEach((userAgent) => {
10 | const browser = bowser.getParser(userAgent);
11 | expect(
12 | browser.satisfies({
13 | chrome: '>60',
14 | }),
15 | ).toBeTruthy();
16 | });
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/utils/checkExtensionReady.ts:
--------------------------------------------------------------------------------
1 | const interval = 500;
2 |
3 | declare global {
4 | interface Window {
5 | isTerraExtensionAvailable: boolean;
6 | }
7 | }
8 |
9 | export async function checkExtensionReady(
10 | timeout: number,
11 | isChromeExtensionCompatibleBrowser: boolean,
12 | ): Promise {
13 | return new Promise((resolve) => {
14 | if (isChromeExtensionCompatibleBrowser) {
15 | resolve(true);
16 | return;
17 | }
18 |
19 | const start = Date.now();
20 |
21 | function check() {
22 | if (
23 | window.isTerraExtensionAvailable === true ||
24 | Array.isArray(window.terraWallets)
25 | ) {
26 | resolve(true);
27 | } else if (Date.now() > start + timeout) {
28 | resolve(false);
29 | } else {
30 | setTimeout(check, interval);
31 | }
32 | }
33 |
34 | setTimeout(check, interval);
35 | });
36 | }
37 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/utils/sortConnections.ts:
--------------------------------------------------------------------------------
1 | import { Connection } from '@terra-money/wallet-types';
2 |
3 | export function sortConnections(connections: Connection[]): Connection[] {
4 | const stationIndex = connections.findIndex(
5 | ({ identifier }) => identifier === 'station',
6 | );
7 |
8 | if (stationIndex > -1) {
9 | const station = connections.splice(stationIndex, 1);
10 | return [...station, ...connections];
11 | }
12 |
13 | return connections;
14 | }
15 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-controller/verifyBytes.ts:
--------------------------------------------------------------------------------
1 | import { SignBytesResult } from '@terra-money/wallet-types';
2 | import jscrypto from 'jscrypto';
3 | import secp256k1 from 'secp256k1';
4 |
5 | export function verifyBytes(
6 | bytes: Buffer,
7 | signBytesResult: SignBytesResult['result'],
8 | ): boolean {
9 | const publicKey = signBytesResult.public_key?.toProto();
10 |
11 | if (publicKey && 'key' in publicKey) {
12 | return secp256k1.ecdsaVerify(
13 | signBytesResult.signature,
14 | Buffer.from(
15 | jscrypto.SHA256.hash(new jscrypto.Word32Array(bytes)).toString(),
16 | 'hex',
17 | ),
18 | publicKey.key,
19 | );
20 | }
21 |
22 | return false;
23 | }
24 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-provider/index.ts:
--------------------------------------------------------------------------------
1 | export * from '@terra-money/use-wallet';
2 | export * from '@terra-money/wallet-controller';
3 |
4 | export * from './useChainOptions';
5 | export * from './WalletProvider';
6 | export * from './useInstallChromeExtension';
7 | export * from './StaticWalletProvider';
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-provider/useChainOptions.ts:
--------------------------------------------------------------------------------
1 | import {
2 | getChainOptions,
3 | WalletControllerChainOptions,
4 | } from '@terra-money/wallet-controller';
5 | import { useEffect, useState } from 'react';
6 |
7 | export function useChainOptions(): WalletControllerChainOptions | null {
8 | const [chainOptions, setChainOptions] =
9 | useState(null);
10 |
11 | useEffect(() => {
12 | getChainOptions().then(setChainOptions);
13 | }, []);
14 |
15 | return chainOptions;
16 | }
17 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-provider/useInstallChromeExtension.ts:
--------------------------------------------------------------------------------
1 | import { ConnectType, useWallet } from '@terra-money/use-wallet';
2 | import { useMemo } from 'react';
3 |
4 | export function useInstallChromeExtension() {
5 | const { availableInstallTypes, install } = useWallet();
6 |
7 | return useMemo<(() => void) | null>(() => {
8 | return availableInstallTypes.some((type) => type === ConnectType.EXTENSION)
9 | ? () => install(ConnectType.EXTENSION)
10 | : null;
11 | }, [availableInstallTypes, install]);
12 | }
13 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-types/index.ts:
--------------------------------------------------------------------------------
1 | export * from './errors';
2 | export * from './tx';
3 | export * from './types';
4 | export * from './wallet';
5 | export * from './lcd';
6 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/wallet-types/tx.ts:
--------------------------------------------------------------------------------
1 | import { TxResult } from './types';
2 |
3 | export interface StringifiedTxResult {
4 | fee: string;
5 | gasAdjustment: string;
6 | id: number;
7 | msgs: string[];
8 | result: {
9 | height: number;
10 | raw_log: string;
11 | txhash: string;
12 | };
13 | success: boolean;
14 | }
15 |
16 | export function findTxResult(values: any[]): TxResult | undefined {
17 | return values.find((value) => {
18 | return (
19 | value &&
20 | Array.isArray(value.msgs) &&
21 | 'fee' in value &&
22 | 'gasAdjustment' in value &&
23 | 'result' in value &&
24 | 'success' in value
25 | );
26 | }) as TxResult | undefined;
27 | }
28 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/web-extension-interface/IMPORTANT.md:
--------------------------------------------------------------------------------
1 | # Do not change interface
2 |
3 | This interface is an important rule for communicating with the wallet-provider.
4 |
5 | Modifying this interface creates breaking changes in the wallet-provider and all dApps.
6 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/web-extension-interface/README.md:
--------------------------------------------------------------------------------
1 | # `@terra-money/web-extension-interface`
2 |
3 | // TODO
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/web-extension-interface/index.ts:
--------------------------------------------------------------------------------
1 | export * from './models/network';
2 | export * from './models/states';
3 | export * from './models/tx';
4 | export * from './models/wallet';
5 |
6 | export * from './connector';
7 |
8 | export * from './errors';
9 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/web-extension-interface/models/network.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @example
3 | * name: 'mainnet',
4 | * chainID: 'columbus-5',
5 | * lcd: 'https://lcd.terra.dev'
6 | */
7 | export interface WebExtensionNetworkInfo {
8 | name: string;
9 | chainID: string;
10 | lcd: string;
11 | }
12 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/web-extension-interface/models/states.ts:
--------------------------------------------------------------------------------
1 | import type { WebExtensionNetworkInfo } from './network';
2 | import type { WebExtensionWalletInfo } from './wallet';
3 |
4 | export enum WebExtensionStatus {
5 | INITIALIZING = 'initializing',
6 | NO_AVAILABLE = 'no_available',
7 | READY = 'ready',
8 | }
9 |
10 | export interface WebExtensionInitializing {
11 | type: WebExtensionStatus.INITIALIZING;
12 | }
13 |
14 | export interface WebExtensionNoAvailable {
15 | type: WebExtensionStatus.NO_AVAILABLE;
16 | isConnectorExists: boolean;
17 | isApproved?: boolean;
18 | }
19 |
20 | export interface WebExtensionReady {
21 | type: WebExtensionStatus.READY;
22 | focusedWalletAddress: string | undefined;
23 | wallets: WebExtensionWalletInfo[];
24 | network: WebExtensionNetworkInfo;
25 | }
26 |
27 | export type WebExtensionStates =
28 | | WebExtensionInitializing
29 | | WebExtensionNoAvailable
30 | | WebExtensionReady;
31 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/@terra-money/web-extension-interface/models/wallet.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Data type for storage and UI
3 | * This information is not protected (someone access)
4 | */
5 | export interface WebExtensionWalletInfo {
6 | /**
7 | * Wallet display name
8 | * This should be primary key
9 | */
10 | name: string;
11 |
12 | /**
13 | * Wallet address
14 | */
15 | terraAddress: string;
16 |
17 | /**
18 | * Wallet design
19 | * 1. some theme name (terra, anchor...)
20 | * 2. color hex (#ffffff, #000000...)
21 | */
22 | design: string;
23 | }
24 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/index.tsx:
--------------------------------------------------------------------------------
1 | //@ts-ignore
2 | window.global = window;
3 |
4 | import('./polyfills/polyfills').then(() => import('./main'));
5 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/polyfills/README.md:
--------------------------------------------------------------------------------
1 | # Node polyfills
2 |
3 | copied node polyfills from
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/polyfills/polyfills.js:
--------------------------------------------------------------------------------
1 | import * as buffer from 'buffer';
2 | import process from './process-es6';
3 |
4 | window.Buffer = buffer.Buffer;
5 | window.process = process;
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.svg' {
4 | import React from 'react';
5 | const content: string & {
6 | ReactComponent: React.ComponentType>;
7 | };
8 | export = content;
9 | }
10 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "module": "esnext",
18 | "moduleResolution": "node",
19 | "resolveJsonModule": true,
20 | "isolatedModules": true,
21 | "noEmit": true,
22 | "watch": true,
23 | "jsx": "react",
24 | "baseUrl": "src"
25 | },
26 | "include": [
27 | "src",
28 | "scripts"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/tsconfig.script.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "downlevelIteration": true,
4 | "allowSyntheticDefaultImports": true,
5 | "esModuleInterop": true,
6 | "module": "commonjs",
7 | "target": "ES2018",
8 | "moduleResolution": "node",
9 | "resolveJsonModule": true,
10 | "skipLibCheck": true,
11 | "baseUrl": "src"
12 | },
13 | "include": [
14 | "src",
15 | "scripts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/packages/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import reactRefresh from '@vitejs/plugin-react-refresh';
2 | import * as path from 'path';
3 | import { defineConfig } from 'vite';
4 | import svgr from 'vite-plugin-svgr';
5 | import tsconfigPaths from 'vite-tsconfig-paths';
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig({
9 | resolve: {
10 | alias: {
11 | 'process': path.resolve(__dirname, 'src/polyfills/process-es6.js'),
12 | 'readable-stream': 'vite-compatible-readable-stream',
13 | },
14 | },
15 | plugins: [reactRefresh(), tsconfigPaths(), svgr()],
16 | });
17 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/readme-assets/trouble-shooting-guide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/readme-assets/trouble-shooting-guide.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/.gitignore:
--------------------------------------------------------------------------------
1 | build/
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/README.md:
--------------------------------------------------------------------------------
1 | # This template is
2 |
3 | This is an example of performing basic Connect, Tx, and Query in the Web App using [wallet-provider](https://www.npmjs.com/package/@terra-money/wallet-provider).
4 |
5 | # Preview this template on the CodeSandbox
6 |
7 |
8 |
9 | # How to use this template
10 |
11 | ```sh
12 | npx terra-templates get wallet-provider:create-react-app your-app-name
13 | cd your-app-name
14 | npm install
15 | npm start
16 | ```
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/config-overrides.js:
--------------------------------------------------------------------------------
1 | const { ProvidePlugin } = require('webpack');
2 |
3 | module.exports = function override(config, env) {
4 | config.resolve.fallback = {
5 | crypto: require.resolve('crypto-browserify'),
6 | stream: require.resolve('stream-browserify'),
7 | buffer: require.resolve('buffer'),
8 | };
9 |
10 | config.plugins.push(
11 | new ProvidePlugin({
12 | Buffer: ['buffer', 'Buffer'],
13 | process: 'process/browser',
14 | }),
15 | );
16 |
17 | return config;
18 | };
19 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/create-react-app/public/favicon.ico
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | Terra Wallet Provider Example
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/create-react-app/public/logo.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/sandbox.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "infiniteLoopProtection": true,
3 | "hardReloadOnChange": false,
4 | "view": "browser",
5 | "template": "node",
6 | "container": {
7 | "port": 3000,
8 | "node": "16"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/src/components/QuerySample.tsx:
--------------------------------------------------------------------------------
1 | import { useConnectedWallet, useLCDClient } from '@terra-money/wallet-provider';
2 | import React, { useEffect, useState } from 'react';
3 |
4 | export function QuerySample() {
5 | const lcd = useLCDClient();
6 | const connectedWallet = useConnectedWallet();
7 |
8 | const [bank, setBank] = useState();
9 |
10 | useEffect(() => {
11 | if (connectedWallet) {
12 | lcd.bank.balance(connectedWallet.walletAddress).then(([coins]) => {
13 | setBank(coins.toString());
14 | });
15 | } else {
16 | setBank(null);
17 | }
18 | }, [connectedWallet, lcd]);
19 |
20 | return (
21 |
22 |
Query Sample
23 | {bank &&
{bank}
}
24 | {!connectedWallet &&
Wallet not connected!
}
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/src/style.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | margin: 0;
4 | }
5 |
6 | html {
7 | font-family: BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
8 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 | font-size: 16px;
12 | word-spacing: 1px;
13 | -ms-text-size-adjust: 100%;
14 | -webkit-text-size-adjust: 100%;
15 | box-sizing: border-box;
16 | }
17 |
18 | *,
19 | *::before,
20 | *::after {
21 | box-sizing: border-box;
22 | margin: 0;
23 | font-family: BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
24 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
25 | }
26 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/create-react-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "module": "esnext",
18 | "moduleResolution": "node",
19 | "resolveJsonModule": true,
20 | "isolatedModules": true,
21 | "noEmit": true,
22 | "watch": true,
23 | "jsx": "react-jsx",
24 | "baseUrl": "src"
25 | },
26 | "include": [
27 | "src"
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/.gitignore:
--------------------------------------------------------------------------------
1 | build/
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | Terra Wallet Provider Example
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/lit/public/favicon.ico
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/lit/public/logo.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/sandbox.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "infiniteLoopProtection": true,
3 | "hardReloadOnChange": false,
4 | "view": "browser",
5 | "template": "node",
6 | "container": {
7 | "port": 3000,
8 | "node": "16"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/__tests__/sample.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from 'vitest';
2 |
3 | describe('sample test', () => {
4 | test('should return 2', () => {
5 | expect(1 + 1).toBe(2);
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/app.ts:
--------------------------------------------------------------------------------
1 | import { initController } from 'controller';
2 | import { html, render } from 'lit';
3 | import './components/connect-sample';
4 | import './components/query-sample';
5 | import './components/tx-sample';
6 |
7 | const container = document.querySelector('#app') as HTMLElement;
8 |
9 | render(html`Initializing...
`, container);
10 |
11 | initController().then(() => {
12 | render(
13 | html`
14 |
15 |
16 |
17 | `,
18 | container,
19 | );
20 | });
21 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/controller.ts:
--------------------------------------------------------------------------------
1 | import {
2 | getChainOptions,
3 | WalletController,
4 | } from '@terra-money/wallet-controller';
5 |
6 | let instance: WalletController;
7 |
8 | export async function initController() {
9 | const chainOptions = await getChainOptions();
10 |
11 | instance = new WalletController({
12 | ...chainOptions,
13 | });
14 | }
15 |
16 | export function getController(): WalletController {
17 | return instance;
18 | }
19 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/index.ts:
--------------------------------------------------------------------------------
1 | //@ts-ignore
2 | window.global = window;
3 |
4 | import('./polyfills/polyfills').then(() => import('./app'));
5 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/polyfills/README.md:
--------------------------------------------------------------------------------
1 | # Node polyfills
2 |
3 | copied node polyfills from
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/polyfills/polyfills.js:
--------------------------------------------------------------------------------
1 | import * as buffer from 'buffer';
2 | import process from './process-es6';
3 |
4 | window.Buffer = buffer.Buffer;
5 | window.process = process;
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/lit/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "experimentalDecorators": true,
18 | "module": "esnext",
19 | "moduleResolution": "node",
20 | "resolveJsonModule": true,
21 | "isolatedModules": true,
22 | "noEmit": true,
23 | "watch": false,
24 | "baseUrl": "src"
25 | },
26 | "include": [
27 | "src",
28 | "scripts",
29 | "vite.config.ts"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/.gitignore:
--------------------------------------------------------------------------------
1 | .next/
2 | out/
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/README.md:
--------------------------------------------------------------------------------
1 | # This template is
2 |
3 | This is an example of performing basic Connect, Tx, and Query in the Web App using [wallet-provider](https://www.npmjs.com/package/@terra-money/wallet-provider).
4 |
5 | # Preview this template on the CodeSandbox
6 |
7 |
8 |
9 | # How to use this template
10 |
11 | ```sh
12 | npx terra-templates get wallet-provider:next your-app-name
13 | cd your-app-name
14 | npm install
15 | npm run dev
16 | ```
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | // NOTE: This file should not be edited
6 | // see https://nextjs.org/docs/basic-features/typescript for more information.
7 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "next-template",
3 | "version": "1.0.0",
4 | "scripts": {
5 | "dev": "next --port 4300",
6 | "build": "next build && next export",
7 | "start": "next start",
8 | "type-check": "tsc"
9 | },
10 | "dependencies": {
11 | "@terra-money/terra.js": "^3.0.2",
12 | "@terra-money/wallet-provider": "^3.6.5",
13 | "next": "^12.0.9",
14 | "react": "^17.0.2",
15 | "react-dom": "^17.0.2",
16 | "styled-components": "^5.3.3"
17 | },
18 | "devDependencies": {
19 | "@types/react": "^17.0.34",
20 | "@types/react-dom": "^17.0.11",
21 | "typescript": "^4.4.4"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import { Head, Html, Main, NextScript } from 'next/document';
2 |
3 | export default function Document() {
4 | return (
5 |
6 |
7 |
8 |
9 |
13 |
14 |
15 | Terra Wallet Provider Example
16 |
17 |
18 |
19 |
20 |
21 |
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import ConnectSample from './connect-sample';
2 | import CW20TokensSample from './cw20-tokens-sample';
3 | import NetworkSample from './network-sample';
4 | import QuerySample from './query-sample';
5 | import SignBytesSample from './sign-bytes-sample';
6 | import SignSample from './sign-sample';
7 | import TxSample from './tx-sample';
8 |
9 | export default function Index() {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/pages/query-sample.tsx:
--------------------------------------------------------------------------------
1 | import { useConnectedWallet, useLCDClient } from '@terra-money/wallet-provider';
2 | import React, { useEffect, useState } from 'react';
3 |
4 | export default function QuerySample() {
5 | const lcd = useLCDClient();
6 | const connectedWallet = useConnectedWallet();
7 |
8 | const [bank, setBank] = useState();
9 |
10 | useEffect(() => {
11 | if (connectedWallet) {
12 | lcd.bank.balance(connectedWallet.walletAddress).then(([coins]) => {
13 | setBank(coins.toString());
14 | });
15 | } else {
16 | setBank(null);
17 | }
18 | }, [connectedWallet, lcd]);
19 |
20 | return (
21 |
22 |
Query Sample
23 | {bank &&
{bank}
}
24 | {!connectedWallet &&
Wallet not connected!
}
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/next/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "module": "esnext",
18 | "moduleResolution": "node",
19 | "resolveJsonModule": true,
20 | "isolatedModules": true,
21 | "noEmit": true,
22 | "watch": true,
23 | "jsx": "preserve",
24 | "baseUrl": ".",
25 | "incremental": true
26 | },
27 | "include": [
28 | "next-env.d.ts",
29 | "**/*.ts",
30 | "**/*.tsx"
31 | ],
32 | "exclude": [
33 | "node_modules"
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/.gitignore:
--------------------------------------------------------------------------------
1 | build/
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | Terra Wallet Provider Example
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/svelte/public/favicon.ico
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/svelte/public/logo.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/sandbox.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "infiniteLoopProtection": true,
3 | "hardReloadOnChange": false,
4 | "view": "browser",
5 | "template": "node",
6 | "container": {
7 | "port": 3000,
8 | "node": "16"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/App.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 | {#if !initialized}
15 | Initializing...
16 | {:else}
17 |
18 |
19 |
20 | {/if}
21 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/__tests__/sample.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from 'vitest';
2 |
3 | describe('sample test', () => {
4 | test('should return 2', () => {
5 | expect(1 + 1).toBe(2);
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/controller.ts:
--------------------------------------------------------------------------------
1 | import {
2 | getChainOptions,
3 | WalletController,
4 | } from '@terra-money/wallet-controller';
5 |
6 | let instance: WalletController;
7 |
8 | export async function initController() {
9 | const chainOptions = await getChainOptions();
10 |
11 | instance = new WalletController({
12 | ...chainOptions,
13 | });
14 | }
15 |
16 | export function getController(): WalletController {
17 | return instance;
18 | }
19 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/index.ts:
--------------------------------------------------------------------------------
1 | //@ts-ignore
2 | window.global = window;
3 |
4 | import('./polyfills/polyfills').then(() => import('./main'));
5 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/main.ts:
--------------------------------------------------------------------------------
1 | import App from './App.svelte';
2 |
3 | new App({ target: document.querySelector('#app') as HTMLElement });
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/polyfills/README.md:
--------------------------------------------------------------------------------
1 | # Node polyfills
2 |
3 | copied node polyfills from
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/polyfills/polyfills.js:
--------------------------------------------------------------------------------
1 | import * as buffer from 'buffer';
2 | import process from './process-es6';
3 |
4 | window.Buffer = buffer.Buffer;
5 | window.process = process;
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/svelte.config.js:
--------------------------------------------------------------------------------
1 | import sveltePreprocess from 'svelte-preprocess'
2 |
3 | export default {
4 | // Consult https://github.com/sveltejs/svelte-preprocess
5 | // for more information about preprocessors
6 | preprocess: sveltePreprocess()
7 | }
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/svelte/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "experimentalDecorators": true,
18 | "module": "esnext",
19 | "moduleResolution": "node",
20 | "resolveJsonModule": true,
21 | "isolatedModules": true,
22 | "noEmit": true,
23 | "watch": false,
24 | "baseUrl": "src"
25 | },
26 | "include": [
27 | "src",
28 | "scripts",
29 | "vite.config.ts"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | Terra Wallet Provider Example
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/vite/public/favicon.ico
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/vite/public/logo.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/sandbox.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "infiniteLoopProtection": true,
3 | "hardReloadOnChange": false,
4 | "view": "browser",
5 | "template": "node",
6 | "container": {
7 | "port": 3000,
8 | "node": "16"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/__tests__/sample.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from 'vitest';
2 |
3 | describe('sample test', () => {
4 | test('should return 2', () => {
5 | expect(1 + 1).toBe(2);
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/components/QuerySample.tsx:
--------------------------------------------------------------------------------
1 | import { useConnectedWallet, useLCDClient } from '@terra-money/wallet-provider';
2 | import React, { useEffect, useState } from 'react';
3 |
4 | export function QuerySample() {
5 | const lcd = useLCDClient();
6 | const connectedWallet = useConnectedWallet();
7 |
8 | const [bank, setBank] = useState();
9 |
10 | useEffect(() => {
11 | if (connectedWallet) {
12 | lcd.bank.balance(connectedWallet.walletAddress).then(([coins]) => {
13 | setBank(coins.toString());
14 | });
15 | } else {
16 | setBank(null);
17 | }
18 | }, [connectedWallet, lcd]);
19 |
20 | return (
21 |
22 |
Query Sample
23 | {bank &&
{bank}
}
24 | {!connectedWallet &&
Wallet not connected!
}
25 |
26 | );
27 | }
28 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/index.tsx:
--------------------------------------------------------------------------------
1 | //@ts-ignore
2 | window.global = window;
3 |
4 | import('./polyfills/polyfills').then(() => import('./app'));
5 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/polyfills/README.md:
--------------------------------------------------------------------------------
1 | # Node polyfills
2 |
3 | copied node polyfills from
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/polyfills/polyfills.js:
--------------------------------------------------------------------------------
1 | import * as buffer from 'buffer';
2 | import process from './process-es6';
3 |
4 | window.Buffer = buffer.Buffer;
5 | window.process = process;
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/style.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | margin: 0;
4 | }
5 |
6 | html {
7 | font-family: BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
8 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
9 | -webkit-font-smoothing: antialiased;
10 | -moz-osx-font-smoothing: grayscale;
11 | font-size: 16px;
12 | word-spacing: 1px;
13 | -ms-text-size-adjust: 100%;
14 | -webkit-text-size-adjust: 100%;
15 | box-sizing: border-box;
16 | }
17 |
18 | *,
19 | *::before,
20 | *::after {
21 | box-sizing: border-box;
22 | margin: 0;
23 | font-family: BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
24 | 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
25 | }
26 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.svg' {
4 | import React from 'react';
5 | const content: string & {
6 | ReactComponent: React.ComponentType>;
7 | };
8 | export = content;
9 | }
10 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vite/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "module": "esnext",
18 | "moduleResolution": "node",
19 | "resolveJsonModule": true,
20 | "isolatedModules": true,
21 | "noEmit": true,
22 | "watch": false,
23 | "jsx": "react",
24 | "baseUrl": "src"
25 | },
26 | "include": [
27 | "src",
28 | "scripts",
29 | "vite.config.ts"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/.gitignore:
--------------------------------------------------------------------------------
1 | build/
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
15 | Terra Wallet Provider Example
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/vue/public/favicon.ico
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/resource/luna/wallet-provider/templates/vue/public/logo.png
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/sandbox.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "infiniteLoopProtection": true,
3 | "hardReloadOnChange": false,
4 | "view": "browser",
5 | "template": "node",
6 | "container": {
7 | "port": 3000,
8 | "node": "16"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/App.vue:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 | Initializing...
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/__tests__/sample.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from 'vitest';
2 |
3 | describe('sample test', () => {
4 | test('should return 2', () => {
5 | expect(1 + 1).toBe(2);
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/controller.ts:
--------------------------------------------------------------------------------
1 | import {
2 | getChainOptions,
3 | WalletController,
4 | } from '@terra-money/wallet-controller';
5 |
6 | let instance: WalletController;
7 |
8 | export async function initController() {
9 | const chainOptions = await getChainOptions();
10 |
11 | instance = new WalletController({
12 | ...chainOptions,
13 | });
14 | }
15 |
16 | export function getController(): WalletController {
17 | return instance;
18 | }
19 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/index.ts:
--------------------------------------------------------------------------------
1 | //@ts-ignore
2 | window.global = window;
3 |
4 | import('./polyfills/polyfills').then(() => import('./main'));
5 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './App.vue';
3 |
4 | createApp(App).mount('#app');
5 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/polyfills/README.md:
--------------------------------------------------------------------------------
1 | # Node polyfills
2 |
3 | copied node polyfills from
4 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/polyfills/polyfills.js:
--------------------------------------------------------------------------------
1 | import * as buffer from 'buffer';
2 | import process from './process-es6';
3 |
4 | window.Buffer = buffer.Buffer;
5 | window.process = process;
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import { DefineComponent } from 'vue';
5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6 | const component: DefineComponent<{}, {}, any>;
7 | export default component;
8 | }
9 |
--------------------------------------------------------------------------------
/resource/luna/wallet-provider/templates/vue/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2018",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "downlevelIteration": true,
10 | "allowJs": true,
11 | "skipLibCheck": true,
12 | "esModuleInterop": true,
13 | "allowSyntheticDefaultImports": true,
14 | "strict": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "experimentalDecorators": true,
18 | "module": "esnext",
19 | "moduleResolution": "node",
20 | "resolveJsonModule": true,
21 | "isolatedModules": true,
22 | "noEmit": true,
23 | "watch": false,
24 | "baseUrl": "src"
25 | },
26 | "include": [
27 | "src",
28 | "scripts",
29 | "vite.config.ts"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/safe/Trust Wallet/MT19937_bug.js:
--------------------------------------------------------------------------------
1 | // 引入 mersenne-twister 库
2 | const MersenneTwister=require('mersenne-twister')
3 | const sha256 = require("sha256")
4 | // 定义种子,可以使用用户提供的熵作为种子
5 | const entropy = 'face'; // 用户提供的随机字符
6 | const seed = sha256(entropy); // 使用 SHA256 散列算法将随机字符转换为种子
7 | // https://lab.miguelmota.com/ethereum-hdwallet/example/?
8 | console.log("__,",seed)
9 | // 0282d9b79f42c74c1550b20ff2dd16aafc3fe5d8ae9a00b2f66996d0ae882775
10 | // 4fc82b26aecb47d2868c4efbe3581732a3e7cbcc6c2efb32062c08170a05eeb8
11 | // 创建 MersenneTwister 实例并设置种子
12 | const mt = new MersenneTwister(seed);
13 |
14 | // 生成 256 位的伪随机数序列,作为私钥
15 | const privateKey = [];
16 | for (let i = 0; i < 8; i++) {
17 | privateKey.push(mt.random_int());
18 | }
19 |
20 | // 将私钥转换为十六进制字符串
21 | const privateKeyHex = privateKey.map(num => num.toString(16).padStart(8, '0')).join('');
22 | console.log(privateKeyHex);
23 |
--------------------------------------------------------------------------------
/scp/.editorconfig:
--------------------------------------------------------------------------------
1 | # EdititorConfig (v.0.0.1)
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
12 | [*.{json,yml}]
13 | indent_style = space
14 | indent_size = 2
15 |
16 | [*.md]
17 | insert_final_newline = false
18 | trim_trailing_whitespace = false
19 |
--------------------------------------------------------------------------------
/scp/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/scp/.eslintrc.yml:
--------------------------------------------------------------------------------
1 | env:
2 | es6: true
3 | node: true
4 | browser: false
5 | extends: 'eslint:recommended'
6 | installedESLint: true
7 | plugins:
8 | - import
9 | - promise
10 | parser: 'babel-eslint'
11 | parserOptions:
12 | sourceType: module
13 | rules:
14 | indent:
15 | - error
16 | - 2
17 | -
18 | SwitchCase: 1
19 | VariableDeclarator:
20 | var: 2
21 | let: 2
22 | const: 3
23 | linebreak-style:
24 | - error
25 | - unix
26 | quotes:
27 | - error
28 | - single
29 | semi:
30 | - error
31 | - never
32 | no-unused-vars:
33 | - warn
34 | - vars: all
35 | args: after-used
36 | no-undef: 1
37 | no-console: 1
38 |
--------------------------------------------------------------------------------
/scp/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/scp/README.md
--------------------------------------------------------------------------------
/scp/config/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | port: 3000
3 | }
4 |
--------------------------------------------------------------------------------
/scp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scp",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "nodemon app.js"
7 | },
8 | "dependencies": {
9 | "debug": "~2.6.8",
10 | "ejs": "~2.5.5",
11 | "koa": "^2.3.0",
12 | "koa-bodyparser": "^4.2.0",
13 | "koa-convert": "^1.2.0",
14 | "koa-json": "^2.0.2",
15 | "koa-logger": "^3.0.0",
16 | "koa-onerror": "^3.1.0",
17 | "koa-router": "^7.2.1",
18 | "koa-static": "^3.0.0",
19 | "koa-views": "^6.0.2",
20 | "nodemon": "^2.0.22"
21 | },
22 | "devDependencies": {
23 | "babel-eslint": "7.1.1",
24 | "eslint": "3.18.0"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/scp/public/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 50px;
3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 | }
5 |
6 | a {
7 | color: #00B7FF;
8 | }
9 |
--------------------------------------------------------------------------------
/scp/public/js/scp.js:
--------------------------------------------------------------------------------
1 | axios.get("https://www.baidu.com")
--------------------------------------------------------------------------------
/scp/views/error.ejs:
--------------------------------------------------------------------------------
1 | <%= message %>
2 | <%= error.status %>
3 | <%= error.stack %>
4 |
--------------------------------------------------------------------------------
/scp/views/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | <%= title %>
6 |
7 |
8 |
9 |
10 | <%= title %>
11 |
14 |
17 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/scp/views/scpMeta.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | <%= title %>
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/scp/views/scpServerHeader.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 |
8 |
9 |
10 |
11 | <%= title %>
12 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/serverWorker/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Service Worker
6 |
13 |
14 |
15 |
16 |
19 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/serverWorker/static/cache.js:
--------------------------------------------------------------------------------
1 | console.log("i am canche js")
--------------------------------------------------------------------------------
/serverWorker/static/imges.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/serverWorker/static/imges.png
--------------------------------------------------------------------------------
/solana/dapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dapp",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@solana/spl-token": "^0.1.6"
13 | },
14 | "devDependencies": {
15 | "@babel/core": "^7.17.8",
16 | "@babel/runtime": "^7.17.8"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/solana/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "solana",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "caoshiyuan",
6 | "license": "MIT",
7 | "scripts": {
8 | "test": "node ./signMessage.js"
9 | },
10 | "devDependencies": {
11 | "tweetnacl": "^1.0.3",
12 | "tweetnacl-util": "^0.15.1"
13 | },
14 | "dependencies": {
15 | "bs58": "^5.0.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/sui/dapp/my-app/public/favicon.ico
--------------------------------------------------------------------------------
/sui/dapp/my-app/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/sui/dapp/my-app/public/logo192.png
--------------------------------------------------------------------------------
/sui/dapp/my-app/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/sui/dapp/my-app/public/logo512.png
--------------------------------------------------------------------------------
/sui/dapp/my-app/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/App.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | import { useMemo } from "react";
4 | // import { useWallet } from "@mysten/wallet-adapter-react";
5 |
6 | import { WalletProvider } from "@mysten/wallet-adapter-react";
7 | import { WalletStandardAdapterProvider } from "@mysten/wallet-adapter-all-wallets";
8 |
9 | import { TestButton } from "./TestButton";
10 | import { TestAccount } from "./TestAccount";
11 | import { Testwallet } from "./TestWallets";
12 |
13 | import BitKeepWallet from "./SuiWallet"
14 | import "./index.css";
15 |
16 | function App() {
17 | const adapters = useMemo(
18 | () => [
19 | new WalletStandardAdapterProvider()
20 | ],
21 | []
22 | );
23 |
24 |
25 | return (
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | );
37 | }
38 |
39 | export default App;
40 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/SuiWallet/index.css:
--------------------------------------------------------------------------------
1 | #suiWallet {
2 | margin-top: 200px;
3 | }
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/TestAccount.js:
--------------------------------------------------------------------------------
1 | // Copyright (c) Mysten Labs, Inc.
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | // import { Button } from "@mui/material";
5 | import React, { useState, useEffect} from "react";
6 | import { useWallet} from "@mysten/wallet-adapter-react";
7 |
8 | export function TestAccount() {
9 | let { connected, getAccounts, wallet} = useWallet();
10 | const [account, setAccount] = useState("");
11 |
12 |
13 | useEffect(() => {
14 | if (!connected) {
15 | setAccount("");
16 | return
17 | }
18 |
19 | getAccounts().then((accounts) => {
20 | if (accounts && accounts.length) {
21 | setAccount(accounts[0]);
22 | }
23 | });
24 | }, [wallet, connected, getAccounts]);
25 |
26 |
27 |
28 | return (
29 |
30 | account: {account}
31 |
32 | );
33 | }
34 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | text-align: center;
9 | display: flex;
10 | flex-direction: column;
11 | justify-content: center;
12 |
13 | padding: 30px;
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/index.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import "./index.css";
4 | import App from "./App";
5 | import reportWebVitals from "./reportWebVitals";
6 |
7 |
8 |
9 | const root = ReactDOM.createRoot(document.getElementById("root"));
10 | root.render(
11 |
12 |
13 |
14 | );
15 |
16 | // If you want to start measuring performance in your app, pass a function
17 | // to log results (for example: reportWebVitals(console.log))
18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19 | reportWebVitals();
20 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/sui/dapp/my-app/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/terra/.env:
--------------------------------------------------------------------------------
1 | PORT=9001
--------------------------------------------------------------------------------
/terra/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/terra/config-overrides.js:
--------------------------------------------------------------------------------
1 | const { ProvidePlugin } = require('webpack');
2 |
3 | module.exports = function override(config, env) {
4 | config.resolve.fallback = {
5 | crypto: require.resolve('crypto-browserify'),
6 | stream: require.resolve('stream-browserify'),
7 | buffer: require.resolve('buffer'),
8 | };
9 |
10 | config.plugins.push(
11 | new ProvidePlugin({
12 | Buffer: ['buffer', 'Buffer'],
13 | process: 'process/browser',
14 | }),
15 | );
16 |
17 | config.ignoreWarnings = [/Failed to parse source map/];
18 |
19 | return config;
20 | };
21 |
--------------------------------------------------------------------------------
/terra/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/terra/public/favicon.ico
--------------------------------------------------------------------------------
/terra/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/terra/public/logo192.png
--------------------------------------------------------------------------------
/terra/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/terra/public/logo512.png
--------------------------------------------------------------------------------
/terra/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/terra/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/terra/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: left;
3 | padding: 20px;
4 | }
5 |
6 | .App-logo {
7 | height: 40vmin;
8 | pointer-events: none;
9 | }
10 |
11 | @media (prefers-reduced-motion: no-preference) {
12 | .App-logo {
13 | animation: App-logo-spin infinite 20s linear;
14 | }
15 | }
16 |
17 | .App-header {
18 | background-color: #282c34;
19 | min-height: 100vh;
20 | display: flex;
21 | flex-direction: column;
22 | align-items: center;
23 | justify-content: center;
24 | font-size: calc(10px + 2vmin);
25 | color: white;
26 | }
27 |
28 | .App-link {
29 | color: #61dafb;
30 | }
31 |
32 | .row {
33 | height: 2em;
34 | }
35 |
36 | @keyframes App-logo-spin {
37 | from {
38 | transform: rotate(0deg);
39 | }
40 | to {
41 | transform: rotate(360deg);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/terra/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/terra/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | // import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(document.getElementById('root'));
8 | root.render(
9 |
10 |
11 |
12 | );
13 |
14 | // If you want to start measuring performance in your app, pass a function
15 | // to log results (for example: reportWebVitals(console.log))
16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
17 | // reportWebVitals();
18 |
--------------------------------------------------------------------------------
/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/tron/dapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dapp",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "node ./other/index.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "tronweb": "^4.1.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/truffle-solidity/REANDME.md:
--------------------------------------------------------------------------------
1 | ### doc
2 |
3 | https://docs.infura.io/infura/#start-building-on-ethereum-and-ipfs
4 | //测试网络注册projectid
5 | https://infura.io/dashboard
6 |
7 | #truffle
8 | https://learnblockchain.cn/docs/truffle/quickstart.html
9 | https://trufflesuite.com/
10 | solidity 合约语法
11 | https://learnblockchain.cn/docs/solidity/introduction-to-smart-contracts.html#simple-smart-contract
12 |
13 |
14 | 中文教程
15 | https://www.jianshu.com/p/2ada466b3f1b
16 | https://zhuanlan.zhihu.com/p/161227342
17 | https://www.cnblogs.com/jameszou/p/10131443.html
18 |
19 | //很好的文章 了解
20 | https://ethereum.org/zh/developers/docs/standards/tokens/erc-20/
21 |
22 |
23 |
24 | `npm install truffle -g`
25 | `truffle compile` 编译
26 |
27 | truffle migrate 部署
28 |
29 | truffle migrate --network ropsten
30 |
31 |
32 | # 领取测试
33 | http://www.ichuhe.cn/archives/47598
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/truffle-solidity/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.4.22 <0.9.0;
3 |
4 | contract Migrations {
5 | address public owner = msg.sender;
6 | uint public last_completed_migration;
7 |
8 | modifier restricted() {
9 | require(
10 | msg.sender == owner,
11 | "This function is restricted to the contract's owner"
12 | );
13 | _;
14 | }
15 |
16 | function setCompleted(uint completed) public restricted {
17 | last_completed_migration = completed;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/truffle-solidity/contracts/learn.sol:
--------------------------------------------------------------------------------
1 | pragma solidity >=0.4.22 <0.9.0;
2 |
3 |
4 | contract SimpleStorage {
5 | uint storedData;
6 | //枚举
7 | enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
8 | ActionChoices choice;
9 | ActionChoices constant defaultChoice = ActionChoices.GoStraight;
10 | //函数类型
11 | // function () {internal|external} [pure|constant|view|payable] [returns ()]
12 |
13 |
14 |
15 | function setabcdefe(uint x) public {
16 | storedData = x;
17 | }
18 |
19 | function getabcdefe() public view returns (uint) {
20 | return storedData;
21 | }
22 |
23 | function setGoStraight() public {
24 | choice = ActionChoices.GoStraight;
25 | }
26 | function getChoice() public view returns (ActionChoices) {
27 | return choice;
28 | }
29 |
30 | function getDefaultChoice() public pure returns (uint) {
31 | return uint(defaultChoice);
32 | }
33 | }
--------------------------------------------------------------------------------
/truffle-solidity/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | // const Migrations = artifacts.require("Migrations");
2 | const HDWalletProvider = require("@truffle/hdwallet-provider");
3 | // module.exports = function (deployer) {
4 | // deployer.deploy(Migrations);
5 | // };
6 |
7 | // const SimpleStorage = artifacts.require("WeatherOracle");
8 |
9 | // module.exports = function(deployer) {
10 | // deployer.deploy(SimpleStorage);
11 | // };
12 |
13 | //erc20 token
14 |
15 | // const SimpleStorage = artifacts.require("TokenERC20");
16 |
17 | // module.exports = function(deployer) {
18 | // deployer.deploy(SimpleStorage);
19 | // };
20 |
21 | //批量转账合约
22 | // const MultiSender = artifacts.require("MultiSender");
23 |
24 | //
25 | const WeatherOracle = artifacts.require("WeatherOracle");
26 | module.exports = function(deployer) {
27 | deployer.deploy(WeatherOracle, "address");
28 | };
29 | // module.exports = function(deployer) {
30 | // deployer.deploy(SimpleStorage,0,'0xEba15228d988803E3bB740ecA47a7cC7a0463fAe');
31 | // };
--------------------------------------------------------------------------------
/truffle-solidity/oracle machine/weather-oracle-service/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | [
4 | "env",
5 | {
6 | "targets": {
7 | "node": "current"
8 | }
9 | }
10 | ]
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/truffle-solidity/oracle machine/weather-oracle-service/README.md:
--------------------------------------------------------------------------------
1 | # weather-oracle-service
2 | oracle service for getting weather data and relaying it to a smart contract
3 |
4 | ## Install dependencies
5 |
6 | Use `yarn` for that
7 |
8 | ```
9 | $ yarn install
10 | ```
11 |
12 | ## Setup Environment
13 |
14 | Get yourself a `.env` file, and update it as you see fit. Make sure your account has ETH to pay gas fees.
15 |
16 | ```
17 | $ cp .env.example .env
18 | ```
19 |
20 | ## Start the processes
21 |
22 | Start the weather oracle and the event lister with
23 |
24 | ```
25 | $ yarn develop
26 | ```
27 |
28 |
29 |
--------------------------------------------------------------------------------
/truffle-solidity/oracle machine/weather-oracle-service/src/consumer.js:
--------------------------------------------------------------------------------
1 | import { weatherUpdate } from "./ethereum";
2 |
3 | const consume = () => {
4 | weatherUpdate((error, result) => {
5 | console.error(error)
6 |
7 | console.log("NEW WEATHER DATA EVENT ON SMART CONTRACT");
8 | console.log("BLOCK NUMBER: ");
9 | console.log(" " + result.blockNumber)
10 | console.log("WEATHER DATA: ");
11 | console.log(result.args);
12 | console.log("\n");
13 | });
14 | };
15 |
16 | export default consume;
17 |
--------------------------------------------------------------------------------
/truffle-solidity/oracle machine/weather-oracle-service/src/index.js:
--------------------------------------------------------------------------------
1 | import startOracle from "./oracle";
2 | import startConsumer from "./consumer";
3 |
4 | startOracle();
5 | startConsumer();
6 |
--------------------------------------------------------------------------------
/truffle-solidity/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "complie": "truffle complie",
4 | "migrate:goerli": "truffle migrate --network goerli ",
5 | "migrate:bscText": "truffle migrate --network bscText ",
6 | "migrate:Heco": "truffle migrate --network Heco "
7 | },
8 | "dependencies": {
9 | "@openzeppelin/contracts": "^4.5.0",
10 | "@truffle/hdwallet-provider": "^2.0.5",
11 | "dotenv": "^16.3.1",
12 | "global": "^4.4.0",
13 | "truffle": "^5.5.9"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/truffle-solidity/test/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/truffle-solidity/test/.gitkeep
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.bundle/config:
--------------------------------------------------------------------------------
1 | BUNDLE_PATH: "vendor/bundle"
2 | BUNDLE_FORCE_RUBY_PLATFORM: 1
3 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: '@react-native-community',
4 | };
5 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.node-version:
--------------------------------------------------------------------------------
1 | 16
2 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | arrowParens: 'avoid',
3 | bracketSameLine: true,
4 | bracketSpacing: false,
5 | singleQuote: true,
6 | trailingComma: 'all',
7 | };
8 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.7.5
2 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4 | ruby '2.7.5'
5 |
6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2'
7 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/__tests__/App-test.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native';
6 | import React from 'react';
7 | import App from '../App';
8 |
9 | // Note: test renderer must be required after react-native.
10 | import renderer from 'react-test-renderer';
11 |
12 | it('renders correctly', () => {
13 | renderer.create();
14 | });
15 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/build_defs.bzl:
--------------------------------------------------------------------------------
1 | """Helper definitions to glob .aar and .jar targets"""
2 |
3 | def create_aar_targets(aarfiles):
4 | for aarfile in aarfiles:
5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6 | lib_deps.append(":" + name)
7 | android_prebuilt_aar(
8 | name = name,
9 | aar = aarfile,
10 | )
11 |
12 | def create_jar_targets(jarfiles):
13 | for jarfile in jarfiles:
14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15 | lib_deps.append(":" + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/debug.keystore
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/jni/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.13)
2 |
3 | # Define the library name here.
4 | project(awesomeproject_appmodules)
5 |
6 | # This file includes all the necessary to let you build your application with the New Architecture.
7 | include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
8 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/jni/MainApplicationModuleProvider.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | namespace facebook {
9 | namespace react {
10 |
11 | std::shared_ptr MainApplicationModuleProvider(
12 | const std::string &moduleName,
13 | const JavaTurboModule::InitParams ¶ms);
14 |
15 | } // namespace react
16 | } // namespace facebook
17 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/jni/OnLoad.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include "MainApplicationTurboModuleManagerDelegate.h"
3 | #include "MainComponentsRegistry.h"
4 |
5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
6 | return facebook::jni::initialize(vm, [] {
7 | facebook::react::MainApplicationTurboModuleManagerDelegate::
8 | registerNatives();
9 | facebook::react::MainComponentsRegistry::registerNatives();
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | AwesomeProject
3 |
4 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'AwesomeProject'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 | includeBuild('../node_modules/react-native-gradle-plugin')
5 |
6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
7 | include(":ReactAndroid")
8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
9 | include(":ReactAndroid:hermes-engine")
10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
11 | }
12 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "AwesomeProject",
3 | "displayName": "AwesomeProject"
4 | }
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import {AppRegistry} from 'react-native';
6 | import App from './App';
7 | import {name as appName} from './app.json';
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/ios/.xcode.env:
--------------------------------------------------------------------------------
1 | # This `.xcode.env` file is versioned and is used to source the environment
2 | # used when running script phases inside Xcode.
3 | # To customize your local environment, you can create an `.xcode.env.local`
4 | # file that is not versioned.
5 |
6 | # NODE_BINARY variable contains the PATH to the node executable.
7 | #
8 | # Customize the NODE_BINARY variable here.
9 | # For example, to use nvm with brew, add the following line
10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use
11 | export NODE_BINARY=$(command -v node)
12 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/ios/AwesomeProject.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/ios/AwesomeProject/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : UIResponder
5 |
6 | @property (nonatomic, strong) UIWindow *window;
7 |
8 | @end
9 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/ios/AwesomeProject/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/ios/AwesomeProject/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char *argv[])
6 | {
7 | @autoreleasepool {
8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/ios/AwesomeProjectTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | module.exports = {
9 | transformer: {
10 | getTransformOptions: async () => ({
11 | transform: {
12 | experimentalImportSupport: false,
13 | inlineRequires: true,
14 | },
15 | }),
16 | },
17 | };
18 |
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/page.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | import {
4 | SafeAreaView,
5 | ScrollView,
6 | StatusBar,
7 | StyleSheet,
8 | Text,
9 | useColorScheme,
10 | View,
11 | } from 'react-native';
12 |
13 | function Page(){
14 | return asdasdsadsa
15 | }
16 |
17 | export default Page
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/read.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/AwesomeProject/read.md
--------------------------------------------------------------------------------
/walletConnect/AwesomeProject/shim.js:
--------------------------------------------------------------------------------
1 | if (typeof __dirname === 'undefined') global.__dirname = '/'
2 | if (typeof __filename === 'undefined') global.__filename = ''
3 | if (typeof process === 'undefined') {
4 | global.process = require('process')
5 | } else {
6 | const bProcess = require('process')
7 | for (var p in bProcess) {
8 | if (!(p in process)) {
9 | process[p] = bProcess[p]
10 | }
11 | }
12 | }
13 |
14 | process.browser = false
15 | if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer
16 |
17 | // global.location = global.location || { port: 80 }
18 | const isDev = typeof __DEV__ === 'boolean' && __DEV__
19 | process.env['NODE_ENV'] = isDev ? 'development' : 'production'
20 | if (typeof localStorage !== 'undefined') {
21 | localStorage.debug = isDev ? '*' : ''
22 | }
23 |
24 | global.crypto = require('crypto')
25 | // If using the crypto shim, uncomment the following line to ensure
26 | // crypto is loaded first, so it can populate global.crypto
27 | // require('crypto')
28 |
--------------------------------------------------------------------------------
/walletConnect/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "walletconnect",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@walletconnect/client": "^1.7.7",
13 | "@walletconnect/qrcode-modal": "^1.7.7"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/README.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/reactDemo/README.md
--------------------------------------------------------------------------------
/walletConnect/reactDemo/public/BitKeep_logo_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/reactDemo/public/BitKeep_logo_circle.png
--------------------------------------------------------------------------------
/walletConnect/reactDemo/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/walletConnect/reactDemo/public/favicon.ico
--------------------------------------------------------------------------------
/walletConnect/reactDemo/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/src/App.css:
--------------------------------------------------------------------------------
1 | .testdemo > div {
2 | display: flex;
3 | flex-direction: column;
4 | max-width: 500px;
5 | margin-top: 30px;
6 | }
7 | input {
8 | height: 30px;
9 | }
--------------------------------------------------------------------------------
/walletConnect/reactDemo/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 | import reportWebVitals from './reportWebVitals';
5 |
6 | ReactDOM.render(
7 |
8 |
9 | ,
10 | document.getElementById('root')
11 | );
12 |
13 | // If you want to start measuring performance in your app, pass a function
14 | // to log results (for example: reportWebVitals(console.log))
15 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
16 | reportWebVitals();
17 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/walletConnect/reactDemo/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/walletConnect/wc/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | open
11 |
12 |
--------------------------------------------------------------------------------
/wireshare/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wireshare",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "cross-env --debug=* node ./bin/www "
7 | },
8 | "dependencies": {
9 | "cookie-parser": "~1.4.4",
10 | "cross-env": "^7.0.3",
11 | "debug": "~2.6.9",
12 | "express": "~4.16.1",
13 | "http-errors": "~1.6.3",
14 | "jade": "~1.11.0",
15 | "morgan": "~1.9.1"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/wireshare/public/stylesheets/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 50px;
3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 | }
5 |
6 | a {
7 | color: #00B7FF;
8 | }
9 |
--------------------------------------------------------------------------------
/wireshare/readme.md:
--------------------------------------------------------------------------------
1 | https://blog.csdn.net/weixin_39643244/article/details/110464226
2 |
3 | https://expeditedsecurity.com/blog/ssl-wireshark-mac-osx/
--------------------------------------------------------------------------------
/wireshare/routes/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET home page. */
5 | router.get('/', function(req, res, next) {
6 | res.render('index', { title: 'Express' });
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/wireshare/routes/users.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var router = express.Router();
3 |
4 | /* GET users listing. */
5 | router.get('/', function(req, res, next) {
6 | res.send('respond with a resource');
7 | });
8 |
9 | module.exports = router;
10 |
--------------------------------------------------------------------------------
/wireshare/views/error.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | h1= message
5 | h2= error.status
6 | pre #{error.stack}
7 |
--------------------------------------------------------------------------------
/wireshare/views/index.jade:
--------------------------------------------------------------------------------
1 | extends layout
2 |
3 | block content
4 | h1= title
5 | p Welcome to #{title}
6 |
--------------------------------------------------------------------------------
/wireshare/views/layout.jade:
--------------------------------------------------------------------------------
1 | doctype html
2 | html
3 | head
4 | title= title
5 | link(rel='stylesheet', href='/stylesheets/style.css')
6 | body
7 | block content
8 |
--------------------------------------------------------------------------------
/xinstall.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/keepresolve/Blockchain/1ad2feaef8732c601686b3c768c16388a7ead12a/xinstall.js
--------------------------------------------------------------------------------
/基础/base64.js:
--------------------------------------------------------------------------------
1 | const sources = Buffer.from([1, 2]) // 16进制 01 02 10进制 1 2 二进制 00000001 00000010
2 |
3 | // 00000001 00000010 ~ 000000 010000 0010 ~ 00000000 00010000 00001000 ~ 0 16 2 ~ A Q I
4 |
5 | console.log(sources)
6 | console.log(sources.toString("base64"))
7 |
8 |
9 | const sources1 = Buffer.from([0xff,0xee,0xf])
10 |
11 | // 111111 11 11101110 11111000
12 | // 00000001 00000010 ~ 000000 010000 0010 ~ 00000000 00010000 00001000 ~ 0 16 2 ~ A Q I
13 |
14 | console.log(sources1)
15 | console.log(sources1.toString("base64"))
--------------------------------------------------------------------------------
/基础/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "package",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "base64.js",
6 | "scripts": {
7 | "test": "node ./bech32.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "dependencies": {
12 | "bech32": "^2.0.0",
13 | "secp256k1": "^4.0.3"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/测试用例/tape/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "1.js",
6 | "scripts": {
7 | "test": "tape -r babel-register tests/**/*.js"
8 | },
9 | "author": "caoshiyuan",
10 | "license": "ISC",
11 | "devDependencies": {
12 | "tape": "^5.5.3"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/测试用例/tape/test/1.js:
--------------------------------------------------------------------------------
1 | var test = require('tape');
2 |
3 | test('timing test', function (t) {
4 | t.plan(2);
5 |
6 | t.equal(typeof Date.now, 'function');
7 | var start = Date.now();
8 |
9 | setTimeout(function () {
10 | t.equal(Date.now() - start, 100);
11 | }, 100);
12 | });
13 |
14 | test('test using promises', async function (t) {
15 | const result = await someAsyncThing();
16 | t.ok(result);
17 | });
--------------------------------------------------------------------------------