Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 8f24350

Browse files
authored
Merge pull request #173 from Bitcoin-com/stage
Update slp list docs
2 parents 6cd6f28 + 1663465 commit 8f24350

8 files changed

Lines changed: 2017 additions & 313 deletions

File tree

package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
{
22
"name": "developer.bitcoin.com",
33
"description": "Bitcoin.com developer resources and documentation",
4-
"version": "3.2.3",
4+
"version": "3.2.6",
55
"author": "Peter <peter@bitcoin.com> and Gabriel Cardona <gabriel@bitcoin.com>",
66
"dependencies": {
77
"badger-components-react": "^0.1.3",
8-
"gatsby": "^2.0.50",
9-
"gatsby-image": "^2.0.20",
8+
"gatsby": "^2.0.118",
9+
"gatsby-image": "^2.0.29",
1010
"gatsby-plugin-flow": "^1.0.2",
11-
"gatsby-plugin-google-tagmanager": "^2.0.6",
12-
"gatsby-plugin-manifest": "^2.0.9",
13-
"gatsby-plugin-offline": "^2.0.15",
14-
"gatsby-plugin-react-helmet": "^3.0.2",
15-
"gatsby-plugin-robots-txt": "^1.3.0",
16-
"gatsby-plugin-sharp": "^2.0.12",
17-
"gatsby-plugin-sitemap": "^2.0.2",
18-
"gatsby-plugin-styled-components": "^3.0.2",
19-
"gatsby-remark-autolink-headers": "^2.0.11",
11+
"gatsby-plugin-google-tagmanager": "^2.0.9",
12+
"gatsby-plugin-manifest": "^2.0.17",
13+
"gatsby-plugin-offline": "^2.0.23",
14+
"gatsby-plugin-react-helmet": "^3.0.6",
15+
"gatsby-plugin-robots-txt": "^1.4.0",
16+
"gatsby-plugin-sharp": "^2.0.20",
17+
"gatsby-plugin-sitemap": "^2.0.5",
18+
"gatsby-plugin-styled-components": "^3.0.5",
19+
"gatsby-remark-autolink-headers": "^2.0.14",
2020
"gatsby-remark-component": "^1.1.3",
21-
"gatsby-remark-copy-linked-files": "^2.0.6",
22-
"gatsby-remark-images": "^2.0.6",
23-
"gatsby-source-filesystem": "^2.0.8",
24-
"gatsby-transformer-remark": "^2.1.12",
25-
"gatsby-transformer-sharp": "^2.1.8",
21+
"gatsby-remark-copy-linked-files": "^2.0.9",
22+
"gatsby-remark-images": "^3.0.3",
23+
"gatsby-source-filesystem": "^2.0.20",
24+
"gatsby-transformer-remark": "^2.2.4",
25+
"gatsby-transformer-sharp": "^2.1.13",
2626
"isomorphic-fetch": "^2.2.1",
27-
"react": "^16.6.3",
28-
"react-dom": "^16.6.3",
27+
"react": "^16.8.1",
28+
"react-dom": "^16.8.1",
2929
"react-helmet": "^5.2.0",
30-
"react-icons": "^3.2.2",
31-
"react-syntax-highlighter": "^10.0.1",
30+
"react-icons": "^3.3.0",
31+
"react-syntax-highlighter": "^10.1.2",
3232
"recompose": "^0.30.0",
33-
"rehype-react": "^3.0.3",
34-
"styled-components": "^4.1.1"
33+
"rehype-react": "^3.1.0",
34+
"styled-components": "^4.1.3"
3535
},
3636
"keywords": [
3737
"gatsby",
@@ -51,10 +51,10 @@
5151
"test": "echo \"Error: no test specified\" && exit 1"
5252
},
5353
"devDependencies": {
54-
"babel-plugin-styled-components": "^1.8.0",
55-
"husky": "^1.1.4",
56-
"prettier": "^1.15.2",
57-
"pretty-quick": "^1.8.0"
54+
"babel-plugin-styled-components": "^1.10.0",
55+
"husky": "^1.3.1",
56+
"prettier": "^1.16.4",
57+
"pretty-quick": "^1.10.0"
5858
},
5959
"repository": {
6060
"type": "git",

src/atoms/StyledLink.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ const StyledLink = styled(Link)`
1616
color: ${props => props.theme.primary600};
1717
}
1818
`
19-
const StyledA = props => <StyledLink as="a" {...props} />
2019

2120
type Props = {
2221
children: React.Node,
2322
text?: string,
2423
to: string,
2524
href?: string,
25+
subtle?: ?boolean,
2626
}
2727

28+
const StyledA = (props: Props) => <StyledLink as="a" {...props} />
29+
2830
class SmartLink extends React.PureComponent<Props> {
2931
render() {
3032
const { children, text, ...rest } = this.props
@@ -33,8 +35,9 @@ class SmartLink extends React.PureComponent<Props> {
3335
const patternInternal = /^\/(?!\/)/
3436
const patternStaticAsset = /\/static\//g
3537

36-
const internal = patternInternal.test(to) || patternInternal.test(href)
37-
const isAsset = patternStaticAsset.test(href)
38+
const internal =
39+
patternInternal.test(to) || patternInternal.test(href || '')
40+
const isAsset = patternStaticAsset.test(href || '')
3841

3942
if (isAsset || !internal) {
4043
return (

src/components/NavBar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ class NavBar extends React.PureComponent<Props> {
7373
<Main>
7474
<Container>
7575
<NavLayout>
76-
<NavItem monospace to="/" isActive={homeActive}>
76+
<NavItem monospace="true" to="/" isActive={homeActive}>
7777
Home
7878
</NavItem>
79-
<NavItem monospace to="/learn" isActive={learnActive}>
79+
<NavItem monospace="true" to="/learn" isActive={learnActive}>
8080
Learn
8181
</NavItem>
8282
<NavItem
83-
monospace
83+
monospace="true"
8484
to="/develop"
8585
isActive={developActive && !learnActive}
8686
>
8787
Develop
8888
</NavItem>
89-
<NavItem monospace to="/about" isActive={aboutActive}>
89+
<NavItem monospace="true" to="/about" isActive={aboutActive}>
9090
About
9191
</NavItem>
9292
</NavLayout>

src/components/layouts/DefaultLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const DefaultLayout = ({ children, location }: Props) => (
4545
'BITBOX based bitcoin.com developer platform and resources'
4646
}
4747
keywords={
48-
'bitbox, developer tools, bitcoin, bitcoin cash, BCH, sdk, api'
48+
'bitbox, developer tools, bitcoin, bitcoin cash, BCH, sdk, api, slp, development tools'
4949
}
5050
location={location}
5151
image={Favicon}

src/components/layouts/base.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ html {
55
font-weight: 400;
66
font-size: 16px;
77
font-size-adjust: 0.5;
8+
height: auto !important;
89
}
910

1011
body {
1112
margin: 0;
1213
position: relative;
1314
color: #151b1e;
15+
height: auto !important;
1416
}
1517

1618
h1,

src/data/docs/slp/utils.md

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,23 @@ tokens : `Array` or `Object`. tokens or single token
3030
})();
3131

3232
// returns
33-
[ { id: '545cba6f72a08cbcb08c7d4e8166267942e8cb9a611328805c62fa538e861ba4',
34-
timestamp: '2018-08-14 13:42',
35-
symbol: '',
36-
name: '',
37-
document: '' },
38-
{ id: '83bfe019fcf976142c55e7c0ad4a429f4be1bc2cb138bd8d0bab8dd4cd4758c4',
39-
timestamp: '2018-08-14 13:57',
40-
symbol: '',
41-
name: '',
42-
document: '' },
43-
{ id: '323a1e35ae0b356316093d20f2d9fbc995d19314b5c0148b78dc8d9c0dab9d35',
44-
timestamp: '2018-08-14 17:53',
45-
symbol: '',
46-
name: '',
47-
document: ' } ]
33+
[ { id: 'a72788409fa0ff38556e0d26d17edcc8e6ac04dcdc4904eeb5297c6096dc6e75',
34+
timestamp: '2019-02-10 03:24',
35+
symbol: 'C',
36+
name: 'Contract Name',
37+
documentUri: 'documentUri',
38+
documentHash:
39+
'1000000000000000000000000000000000000000000000000000000000000001',
40+
decimals: 1,
41+
initialTokenQty: 10 },
42+
{ id: 'e6fe00fc1f53320b72bd5cbed76c0c82e5edfea1b6f9cb0f71bfb28c3b6211a8',
43+
timestamp: '2019-02-05 04:01',
44+
symbol: 'TESTNET3',
45+
name: 'SLP SDK Testnet Token 3',
46+
documentUri: 'badger@bitcoin.com',
47+
documentHash: '',
48+
decimals: 8,
49+
initialTokenQty: 100 }]
4850

4951
##### List single token
5052

@@ -60,13 +62,14 @@ tokens : `Array` or `Object`. tokens or single token
6062
})();
6163

6264
// returns
63-
// { id:
64-
// 'b3f4f132dc3b9c8c96316346993a8d54d729715147b7b11aa6c8cd909e955313',
65-
// timestamp: '2019-01-30 20:56',
66-
// symbol: 'SLPJS',
67-
// name: 'Awesome SLPJS README Token',
68-
// document: 'info@simpleledger.io'
69-
// }
65+
{ id: 'b3f4f132dc3b9c8c96316346993a8d54d729715147b7b11aa6c8cd909e955313',
66+
timestamp: '2019-01-30 21:56',
67+
symbol: 'SLPJS',
68+
name: 'Awesome SLPJS README Token',
69+
documentUri: 'info@simpleledger.io',
70+
documentHash: '',
71+
decimals: 2,
72+
initialTokenQty: 1000000 }
7073

7174
### `balancesForAddress`
7275

src/pages/slp.js

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -126,52 +126,54 @@ const SLPPage = ({ location, data }: Props) => (
126126
{`(async () => {
127127
try {
128128
let list = await SLP.Utils.list();
129-
console.log(list);
130-
} catch (error) {
131-
console.error(error);
132-
}
129+
console.log(list);
130+
} catch (error) {
131+
console.error(error);
133132
}
134-
)();
133+
})();
135134
136135
// returns
137-
[ { id: '545cba6f72a08cbcb08c7d4e8166267942e8cb9a611328805c62fa538e861ba4',
138-
timestamp: '2018-08-14 13:42',
139-
symbol: '',
140-
name: '',
141-
document: '' },
142-
{ id: '83bfe019fcf976142c55e7c0ad4a429f4be1bc2cb138bd8d0bab8dd4cd4758c4',
143-
timestamp: '2018-08-14 13:57',
144-
symbol: '',
145-
name: '',
146-
document: '' },
147-
{ id: '323a1e35ae0b356316093d20f2d9fbc995d19314b5c0148b78dc8d9c0dab9d35',
148-
timestamp: '2018-08-14 17:53',
149-
symbol: '',
150-
name: '',
151-
document: ' } ]
136+
[ { id: 'a72788409fa0ff38556e0d26d17edcc8e6ac04dcdc4904eeb5297c6096dc6e75',
137+
timestamp: '2019-02-10 03:24',
138+
symbol: 'C',
139+
name: 'Contract Name',
140+
documentUri: 'documentUri',
141+
documentHash:
142+
'1000000000000000000000000000000000000000000000000000000000000001',
143+
decimals: 1,
144+
initialTokenQty: 10 },
145+
{ id: 'e6fe00fc1f53320b72bd5cbed76c0c82e5edfea1b6f9cb0f71bfb28c3b6211a8',
146+
timestamp: '2019-02-05 04:01',
147+
symbol: 'TESTNET3',
148+
name: 'SLP SDK Testnet Token 3',
149+
documentUri: 'badger@bitcoin.com',
150+
documentHash: '',
151+
decimals: 8,
152+
initialTokenQty: 100 }]
152153
`}
153154
</Code>
154155
<Text>List single token by id</Text>
155156
<Code>
156157
{`(async () => {
157-
try {
158-
let list = await SLP.Utils.list(
159-
"b3f4f132dc3b9c8c96316346993a8d54d729715147b7b11aa6c8cd909e955313"
160-
);
161-
console.log(list);
162-
} catch (error) {
163-
console.error(error);
164-
}
165-
)();
158+
try {
159+
let list = await SLP.Utils.list(
160+
"b3f4f132dc3b9c8c96316346993a8d54d729715147b7b11aa6c8cd909e955313"
161+
);
162+
console.log(list);
163+
} catch (error) {
164+
console.error(error);
165+
}
166+
})();
166167
167168
// returns
168-
{ id:
169-
'b3f4f132dc3b9c8c96316346993a8d54d729715147b7b11aa6c8cd909e955313',
170-
timestamp: '2019-01-30 20:56',
169+
{ id: 'b3f4f132dc3b9c8c96316346993a8d54d729715147b7b11aa6c8cd909e955313',
170+
timestamp: '2019-01-30 21:56',
171171
symbol: 'SLPJS',
172172
name: 'Awesome SLPJS README Token',
173-
document: 'info@simpleledger.io'
174-
}
173+
documentUri: 'info@simpleledger.io',
174+
documentHash: '',
175+
decimals: 2,
176+
initialTokenQty: 1000000 }
175177
`}
176178
</Code>
177179
</PreviewItem>

0 commit comments

Comments
 (0)