5 |
6 |
7 |
14 |
--------------------------------------------------------------------------------
/docs/.vuepress/styles/palette.styl:
--------------------------------------------------------------------------------
1 | // placeholder for test, dont't remove it.
2 |
3 | //$accentColor = #f00
4 | $accentColor = #3099f2
5 | $textColor = #2c3e50
6 | $borderColor = #eaecef
7 | $codeBgColor = #282c34
8 | $badgeTip = #3099f2
9 | $badgeWarning = darken(#ffe564, 35%)
10 | $badgeError = #DA596
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | 1. Open project in terminal and run `yarn`
4 | 2. Once install is finish run `yarn start` to run locally
5 | 3. Open your browser and it should be hosted on `localhost:8080/`
6 |
7 | To enable Algolia DocSearch locally, run `cp .env-template .env` and populate
8 | the fields with the correct values.
9 |
--------------------------------------------------------------------------------
/docs/.vuepress/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "UniSat Documentation",
3 | "short_name": "UniSat Docs",
4 | "icons": [
5 | {
6 | "src": "/logo.png",
7 | "sizes": "72x72 96x96 128x128 256x256 512x512"
8 | }
9 | ],
10 | "start_url": "/index.html",
11 | "display": "standalone",
12 | "background_color": "#fff",
13 | "theme_color": "#f6851b"
14 | }
15 |
--------------------------------------------------------------------------------
/docs/guide/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Introduction
3 |
4 | Welcome to UniSat's Developer Documentation. This documentation is for learning to develop applications for UniSat Wallet.
5 |
6 | - You can find the latest version of UniSat Wallet on our [official website](https://unisat.io/).
7 | - To learn how to contribute to the UniSat project itself, visit our [Github Docs](https://github.com/unisat-wallet/extension).
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/snippets/WatchAssetParams.ts:
--------------------------------------------------------------------------------
1 | interface WatchAssetParams {
2 | type: 'ERC20'; // In the future, other standards will be supported
3 | options: {
4 | address: string; // The address of the token contract
5 | 'symbol': string; // A ticker symbol or shorthand, up to 5 characters
6 | decimals: number; // The number of token decimals
7 | image: string; // A string url of the token logo
8 | };
9 | }
10 |
--------------------------------------------------------------------------------
/scripts/build.js:
--------------------------------------------------------------------------------
1 | require('dotenv').config()
2 |
3 | const { dev, build } = require('vuepress')
4 | const config = require('../docs/.vuepress/config')()
5 |
6 | const command = process.argv[2]
7 |
8 | switch (command) {
9 | case 'build':
10 | build(config)
11 | return
12 |
13 | case 'dev':
14 | dev(config)
15 | return
16 |
17 | default:
18 | throw new Error(`Unrecognized command "${command}".`)
19 | }
20 |
--------------------------------------------------------------------------------
/docs/.vuepress/enhanceApp.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | import ConnectButton from './components/ConnectButton';
4 | import SendTransaction from './components/SendTransaction';
5 |
6 | export default ({ Vue, isServer }) => {
7 | if (!isServer) {
8 | import('vue-toasted' /* webpackChunkName: "notification" */).then((module) => {
9 | Vue.use(module.default)
10 | })
11 | }
12 |
13 | Vue.component('ConnectButton', ConnectButton);
14 | Vue.component('SendTransaction', SendTransaction);
15 | }
16 |
--------------------------------------------------------------------------------
/docs/guide/accessing-accounts.md:
--------------------------------------------------------------------------------
1 | # Accessing Accounts
2 |
3 | User accounts are used in a variety of contexts in BitcoinSV, including as identifiers and for signing transactions. In order to request a signature from the user or have the user approve a transaction, one must be able to access the user's accounts. The `wallet methods` below involve a signature or transaction approval and all require connect before use.
4 |
5 | - `sendBitcoin`
6 | - `sendInscription`
7 | - `signTx`
8 | - `signMessage`
9 |
10 | Once you've [connected to a user](./getting-started.html), you can always re-check the current account by checking `unisat.connect()`.
11 |
--------------------------------------------------------------------------------
/docs/guide/defining-your-icon.md:
--------------------------------------------------------------------------------
1 | # Defining Your App's Icon
2 |
3 | When your site makes a login request to a UniSat user, UniSat may render a modal that display's your site icon.
4 |
5 | We retrieve this icon using the HTML selector `
link[rel="shortcut icon"]`, so to customize this icon for your site, just make sure to follow the [favicon standard](https://en.wikipedia.org/wiki/Favicon), and make sure to have a `link` tag within your site's `head` with `rel = "shortcut icon"`, like this.
6 |
7 | The tag's `href` attribute will be used for assigning the site icon.
8 |
9 | ```html
10 |
11 |
12 |
13 | ```
14 |
--------------------------------------------------------------------------------
/docs/.vuepress/components/UpgradePath.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
34 |
--------------------------------------------------------------------------------
/docs/.vuepress/components/GithubContributor.vue:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
25 |
26 |
48 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 UniSat
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docs/.vuepress/components/ConnectButton.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Success! A pending promise for
7 | unisat.request() was
8 | created.
9 |
10 | the result is :{{ result }}
11 |
12 |
13 |
14 |
15 |
16 |
40 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "description": "UniSat documentation.",
4 | "scripts": {
5 | "dev": "yarn start",
6 | "start": "node scripts/build.js dev",
7 | "build": "node scripts/build.js build",
8 | "lint": "prettier docs/guide/*.md docs/snippets/*",
9 | "lint:fix": "yarn lint --write",
10 | "view-info": "vuepress view-info docs",
11 | "show-help": "vuepress --help"
12 | },
13 | "repository": {
14 | "type": "git",
15 | "url": "https://github.com/unisat/unisat-docs/"
16 | },
17 | "keywords": [
18 | "documentation",
19 | "vue",
20 | "generator"
21 | ],
22 | "author": "Austin Akers",
23 | "license": "MIT",
24 | "bugs": {
25 | "url": "https://github.com/unisat/unisat-docs/issues"
26 | },
27 | "homepage": "https://github.com/unisat/unisat-docs",
28 | "devDependencies": {
29 | "@vuepress/plugin-back-to-top": "^1.5.4",
30 | "@vuepress/plugin-medium-zoom": "^1.5.4",
31 | "@vuepress/plugin-pwa": "^1.5.4",
32 | "@vuepress/theme-vue": "^1.5.4",
33 | "dotenv": "^8.2.0",
34 | "prettier": "^2.1.1",
35 | "vue-tabs-component": "^1.5.0",
36 | "vue-toasted": "^1.1.28",
37 | "vuepress": "^1.8.2",
38 | "vuepress-plugin-redirect": "^1.2.4",
39 | "vuepress-plugin-tabs": "^0.3.0"
40 | },
41 | "dependencies": {}
42 | }
43 |
--------------------------------------------------------------------------------
/docs/.vuepress/styles/index.styl:
--------------------------------------------------------------------------------
1 | //Syles for Vuepress Plugin Tabs
2 | @require '~vuepress-plugin-tabs/dist/themes/default.styl'
3 |
4 |
5 | // placeholder for test, dont't remove it.
6 |
7 | //.content {
8 | // font-size 30px;
9 | //}
10 |
11 | pre.vue-container
12 | border-left-width: .5rem;
13 | border-left-style: solid;
14 | border-color: #42b983;
15 | border-radius: 0px;
16 | & > code
17 | font-size: 14px !important;
18 | & > p
19 | margin: -5px 0 -20px 0;
20 | code
21 | background-color: #42b983 !important;
22 | padding: 3px 5px;
23 | border-radius: 3px;
24 | color #000
25 | em
26 | color #808080
27 | font-weight light
28 |
29 | .btn {
30 | border: none;
31 | color: white;
32 | padding: 15px 32px;
33 | text-align: center;
34 | text-decoration: none;
35 | display: inline-block;
36 | font-size: 16px;
37 | box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14),
38 | 0 1px 10px 0 rgba(0, 0, 0, 0.12);
39 | }
40 |
41 | .primaryBtn {
42 | background-color: #037dd6;
43 | }
44 |
45 | .greenBtn {
46 | background-color: #4caf50;
47 | }
48 |
49 | .feedback {
50 | margin: 10px 0px;
51 | padding: 20px;
52 | border-radius: 6px;
53 | background-color: #E7893C;
54 | color: white;
55 | }
56 |
57 | .green-background {
58 | background-color: #79B473;
59 | }
60 |
61 | .fade-enter-active{
62 | transition: opacity 1.5s;
63 | }
64 | .fade-leave-active {
65 | opacity: 0;
66 | }
67 | .fade-enter, .fade-leave-to {
68 | opacity: 0;
69 | }
70 |
--------------------------------------------------------------------------------
/docs/guide/getting-started.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | To develop for UniSat Wallet, install UniSat Wallet on your development machine. [Download here](https://unisat.io/).
4 |
5 | ::: warning A quick note...
6 | This guide assumes intermediate knowledge of HTML, CSS, and JavaScript.
7 | :::
8 |
9 | Once UniSat Wallet is installed and running, you should find that new browser tabs have a `window.unisat` object available in the developer console.
10 | This is how your website will interact with UniSat Wallet.
11 |
12 | [comment]: <> (## Basic Considerations)
13 |
14 | ### Browser Detection
15 |
16 | To verify if the browser is running UniSat Wallet, copy and paste the code snippet below in the developer console of your web browser:
17 |
18 | ```javascript
19 | if (typeof window.unisat !== 'undefined') {
20 | console.log('UniSat Wallet is installed!');
21 | }
22 | ```
23 |
24 | You can review the full API for the `window.unisat` object [here](./unisat-provider.html).
25 |
26 | ### Connecting to UniSat Wallet
27 |
28 | "Connecting" or "logging in" to UniSat Wallet effectively means "to access the user's Bitcoin account(s)".
29 |
30 | You should **only** initiate a connection request in response to direct user action, such as clicking a button.
31 | You should **always** disable the "connect" button while the connection request is pending.
32 | You should **never** initiate a connection request on page load.
33 |
34 | We recommend that you provide a button to allow the user to connect UniSat Wallet to your dapp.
35 | Clicking this button should call the following method:
36 |
37 | ```javascript
38 | unisat.requestAccounts()
39 | ```
40 |
41 | ### Demo
42 |
43 | - [Online Demo](https://demo.unisat.io)
44 | - [Demo source code](https://github.com/unisat-wallet/unisat-web3-demo)
45 |
46 |
--------------------------------------------------------------------------------
/docs/.vuepress/components/SendTransaction.vue:
--------------------------------------------------------------------------------
1 |
2 |