├── .babelrc
├── .circleci
└── config.yml
├── .github
└── issue_template.md
├── .gitignore
├── LICENSE
├── README.md
├── examples
├── example.css
├── index.html
├── test-server-sdk.js
└── zabo.js
├── package-lock.json
├── package.json
├── src
├── api.js
├── constants.js
├── core
│ └── SDK.js
├── err.js
├── index.d.ts
├── index.js
├── resources
│ ├── accounts.js
│ ├── blockchains.js
│ ├── currencies.js
│ ├── index.js
│ ├── providers.js
│ ├── teams.js
│ ├── trading.js
│ ├── transactions.js
│ └── users.js
├── sdk.js
└── utils.js
├── test
├── api.spec.js
├── index.spec.js
├── mock
│ ├── api.js
│ ├── dummy
│ │ ├── account.json
│ │ ├── address.json
│ │ ├── balances.json
│ │ ├── blockchains
│ │ │ ├── balances.json
│ │ │ ├── block.json
│ │ │ ├── contract.json
│ │ │ ├── token-transfers.json
│ │ │ ├── tokens.json
│ │ │ ├── transaction.json
│ │ │ └── transactions.json
│ │ ├── currencies.json
│ │ ├── exchange-rates.json
│ │ ├── index.js
│ │ ├── providers.json
│ │ ├── team.json
│ │ ├── trading
│ │ │ ├── order.json
│ │ │ ├── orders.json
│ │ │ ├── symbols.json
│ │ │ └── ticker.json
│ │ ├── transaction.json
│ │ ├── transactions.json
│ │ ├── user.json
│ │ └── users.json
│ └── interfaces.js
├── resources
│ ├── accounts.spec.js
│ ├── blockchains.spec.js
│ ├── currencies.spec.js
│ ├── providers.spec.js
│ ├── teams.spec.js
│ ├── trading.spec.js
│ ├── transactions.spec.js
│ └── utils.spec.js
└── utils.spec.js
├── tsconfig.json
└── webpack.config.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@babel/plugin-proposal-class-properties"
4 | ]
5 | }
--------------------------------------------------------------------------------
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | jobs:
3 | checkout:
4 | working_directory: ~/repo
5 | docker:
6 | - image: circleci/node:12
7 |
8 | steps:
9 | - restore_cache:
10 | keys:
11 | - v1-repo-{{ .Environment.CIRCLE_SHA1 }}
12 | - v1-repo-
13 |
14 | - checkout
15 |
16 | - save_cache:
17 | key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
18 | paths:
19 | - ~/repo
20 |
21 | build:
22 | working_directory: ~/repo
23 | docker:
24 | - image: circleci/node:12
25 |
26 | steps:
27 | - restore_cache:
28 | keys:
29 | - v1-repo-{{ .Environment.CIRCLE_SHA1 }}
30 |
31 | - restore_cache:
32 | keys:
33 | - v1-dependencies-{{ checksum "package-lock.json" }}
34 | - v1-dependencies-
35 |
36 | - run:
37 | name: "Install tools"
38 | command: sudo apt-get update && sudo apt-get install -y python-dev moreutils
39 |
40 | - run: npm ci
41 |
42 | - save_cache:
43 | paths:
44 | - ~/repo/node_modules
45 | - ~/repo/awsdir
46 | key: v1-dependencies-{{ checksum "package-lock.json" }}
47 |
48 | test:
49 | working_directory: ~/repo
50 | docker:
51 | - image: circleci/node:12
52 |
53 | steps:
54 | - restore_cache:
55 | keys:
56 | - v1-repo-{{ .Environment.CIRCLE_SHA1 }}
57 |
58 | - restore_cache:
59 | keys:
60 | - v1-dependencies-{{ checksum "package-lock.json" }}
61 |
62 | - restore_cache:
63 | keys:
64 | - v1-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
65 |
66 | - run: npm run test
67 |
68 | compile:
69 | working_directory: ~/repo
70 | docker:
71 | - image: circleci/node:12
72 |
73 | steps:
74 | - restore_cache:
75 | keys:
76 | - v1-repo-{{ .Environment.CIRCLE_SHA1 }}
77 |
78 | - restore_cache:
79 | keys:
80 | - v1-dependencies-{{ checksum "package-lock.json" }}
81 |
82 | - restore_cache:
83 | keys:
84 | - v1-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
85 | - v1-{{ .Environment.CIRCLE_BRANCH }}-
86 |
87 | - run:
88 | name: "Compile static files"
89 | command: npm run build
90 |
91 | - save_cache:
92 | paths:
93 | - ~/repo/dist
94 | key: v1-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
95 |
96 | deploy:
97 | docker:
98 | - image: circleci/node:12
99 |
100 | working_directory: ~/repo
101 |
102 | steps:
103 | - run:
104 | name: "Check if we want to deploy"
105 | command: |
106 | if [[ "$CIRCLE_BRANCH" =~ ^(develop|stage|master|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
107 | echo "Continuing with build"
108 | else
109 | circleci step halt
110 | fi
111 |
112 | - run:
113 | name: "Install tools"
114 | command: |
115 | sudo apt-get update && sudo apt-get install -y jq python-dev moreutils
116 | curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
117 | unzip awscli-bundle.zip
118 | sudo awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
119 |
120 | - restore_cache:
121 | keys:
122 | - v1-repo-{{ .Environment.CIRCLE_SHA1 }}
123 |
124 | - restore_cache:
125 | keys:
126 | - v1-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
127 |
128 | - run:
129 | name: "Get version"
130 | command: |
131 | echo 'export THISVER="$(npm run getv | tail -1)"' >> $BASH_ENV
132 |
133 | - run:
134 | name: "Deploy code"
135 | command: |
136 | cd dist
137 | if [ $CIRCLE_BRANCH == 'develop' ]; then
138 | aws s3 sync ./ "s3://cdn.zabo.com/develop/$THISVER"
139 | aws s3 sync ./ "s3://cdn.zabo.com/develop/latest"
140 | elif [[ "$CIRCLE_BRANCH" =~ ^(master|stage|[0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
141 | if [ $CIRCLE_BRANCH == 'master' ]; then
142 | aws s3 sync ./ "s3://cdn.zabo.com/$THISVER"
143 | aws s3 sync ./ "s3://cdn.zabo.com/latest"
144 | else
145 | aws s3 sync ./ "s3://cdn.zabo.com/$CIRCLE_BRANCH"
146 | fi
147 | else
148 | echo "no build"
149 | fi
150 |
151 | workflows:
152 | version: 2
153 | build-compile-deploy:
154 | jobs:
155 | - checkout
156 | - build:
157 | requires:
158 | - checkout
159 | - test:
160 | requires:
161 | - build
162 | - compile:
163 | requires:
164 | - build
165 | - deploy:
166 | context: zabo-cdn
167 | requires:
168 | - compile
169 | - test
170 |
--------------------------------------------------------------------------------
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 | ## What SDK version are you using?
2 |
3 |
4 | ### What technology and versions are you using that is causing issues with the SDK?
5 |
6 |
11 |
12 |
13 | ### What did you do?
14 |
15 |
19 |
20 | ### What did you expect to see?
21 |
22 |
23 |
24 | ### What did you see instead?
25 |
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Output of 'npm run build'
55 | dist/
56 |
57 | # Yarn Integrity file
58 | .yarn-integrity
59 |
60 | # dotenv environment variables file
61 | .env
62 |
63 | # next.js build output
64 | .next
65 |
66 | .npmrc
67 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Modular, Inc
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | What is Zabo? A unified cryptocurrency API.
2 | =========================
3 | [](https://circleci.com/gh/zabo-api/zabo-sdk-js/tree/master)
4 | [](https://discord.gg/vGHYuUT)
5 | [](https://forum.zabo.com)
6 |
7 | [Zabo](https://zabo.com) is an API for connecting with cryptocurrency exchanges, wallets and protocols like Bitcoin. Instead of manually integrating with [Coinbase API](https://zabo.com/integrations/coinbase), [Binance API](https://zabo.com/integrations/binance), [Bitcoin APIs](https://zabo.com/integrations/bitcoin) or the hundreds of other cryptocurrency APIs - you can simply use Zabo for them all.
8 |
9 | We believe teams and developers should focus on building great products, not worry about the fragmented landscape of exchange APIs and blockchain protocols.
10 |
11 | For our updated list of integrations, [check out our Zabo integrations](https://zabo.com/integrations).
12 |
13 | # Zabo API Javascript (JS) SDK
14 |
15 | The Zabo SDK for JS provides convenient access to the Zabo API from applications written in browser and server-side JavaScript.
16 |
17 | Please keep in mind that [you must register](https://zabo.com/login) and receive a team id to use in your client application, or if you are using the server side functions, [generate an API keypair from your dashboard](https://zabo.com/dashboard).
18 |
19 | ## Documentation
20 | See the [Zabo API docs](https://zabo.com/docs).
21 |
22 | ## Installation
23 | For a standard browser application, add the script tag to your html file:
24 | ```html
25 |
65 |
66 |
122 |