Skip to content

Commit ddbcaae

Browse files
williamchonggitbook-bot
authored andcommitted
GitBook: [#3831] Add iscn ar widget page
1 parent 6759867 commit ddbcaae

File tree

22 files changed

+227
-87
lines changed

22 files changed

+227
-87
lines changed

Diff for: .gitbook/assets/image (5).png

498 KB
Loading

Diff for: SUMMARY.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,20 @@
3030
* [Web Widget](developer/like-pay/web-widget/README.md)
3131
* [Reference](developer/like-pay/web-widget/reference.md)
3232
* [Webhook](developer/like-pay/web-widget/webhook.md)
33-
* [ISCN](developer/international-standard-content-number-iscn/README.md)
34-
* [Specification](developer/international-standard-content-number-iscn/specification.md)
35-
* [Chain API](developer/international-standard-content-number-iscn/chain-api.md)
36-
* [JavaScript](developer/international-standard-content-number-iscn/javascript/README.md)
37-
* [iscn-js](developer/international-standard-content-number-iscn/javascript/iscn-js.md)
38-
* [iscn-message-types](developer/international-standard-content-number-iscn/javascript/iscn-message-types.md)
39-
* [Web Widget](developer/international-standard-content-number-iscn/web-widget/README.md)
40-
* [Reference](developer/international-standard-content-number-iscn/web-widget/reference.md)
41-
* [Batch upload tool](developer/international-standard-content-number-iscn/batch-upload-tool.md)
42-
* [ISCN Badge](developer/international-standard-content-number-iscn/iscn-badge.md)
43-
* [ISCN IPFS plugin](developer/international-standard-content-number-iscn/iscn-ipfs-plugin.md)
33+
* [ISCN](developer/iscn/README.md)
34+
* [Specification](developer/iscn/specification.md)
35+
* [Chain API](developer/iscn/chain-api.md)
36+
* [JavaScript](developer/iscn/javascript/README.md)
37+
* [iscn-js](developer/iscn/javascript/iscn-js.md)
38+
* [iscn-message-types](developer/iscn/javascript/iscn-message-types.md)
39+
* [Web Widget](developer/iscn/web-widget/README.md)
40+
* [ISCN Widget](developer/iscn/web-widget/iscn/README.md)
41+
* [Reference](developer/iscn/web-widget/iscn/reference.md)
42+
* [ISCN x Arweave Widget](developer/iscn/web-widget/iscn-ar/README.md)
43+
* [Reference](developer/iscn/web-widget/iscn-ar/reference.md)
44+
* [Batch upload tool](developer/iscn/batch-upload-tool.md)
45+
* [ISCN Badge](developer/iscn/iscn-badge.md)
46+
* [ISCN IPFS plugin](developer/iscn/iscn-ipfs-plugin.md)
4447
* [likecoin-js](developer/likecoin-js.md)
4548
* [Ecosystem Statistics Badge](developer/badge.md)
4649
* [Raise Proposal](developer/raise-proposal.md)

Diff for: developer/badge.md

+9-64
Original file line numberDiff line numberDiff line change
@@ -4,71 +4,16 @@ description: Real time LikeCoin info display badges
44

55
# Ecosystem Statistics Badge
66

7-
### Base URL [`https://static.like.co/badge`](https://static.like.co/badge)\`\`
7+
### Base URL [`https://static.like.co/badge`](https://static.like.co/badge)``
88

99
### Ecosystem statistics
1010

11-
<table>
12-
<thead>
13-
<tr>
14-
<th style="text-align:left">Data</th>
15-
<th style="text-align:left">Example</th>
16-
<th style="text-align:left">Path</th>
17-
</tr>
18-
</thead>
19-
<tbody>
20-
<tr>
21-
<td style="text-align:left">Number of Liker</td>
22-
<td style="text-align:left"><a href="https://like.co/"><img src="https://static.like.co/badge/stats/liker.svg" alt="Number of Liker"/></a>
23-
</td>
24-
<td style="text-align:left"><a href="https://static.like.co/badge/stats/liker.svg">/stats/liker.svg</a>
25-
</td>
26-
</tr>
27-
<tr>
28-
<td style="text-align:left">Number of creator
29-
<br />(users with content that has been liked before)</td>
30-
<td style="text-align:left"><a href="https://like.co/"><img src="https://static.like.co/badge/stats/creator.svg" alt="Number of creator"/></a>
31-
</td>
32-
<td style="text-align:left"><a href="https://static.like.co/badge/stats/creator.svg">/stats/creator.svg</a>
33-
</td>
34-
</tr>
35-
<tr>
36-
<td style="text-align:left">
37-
<p>Number of content</p>
38-
<p>(content that has at least 1 like)</p>
39-
</td>
40-
<td style="text-align:left"><a href="https://like.co/"><img src="https://static.like.co/badge/stats/content.svg" alt="Number of content"/></a>
41-
</td>
42-
<td style="text-align:left"><a href="https://static.like.co/badge/stats/content.svg">/stats/content.svg</a>
43-
</td>
44-
</tr>
45-
<tr>
46-
<td style="text-align:left">Number of LIKE token given out to creators</td>
47-
<td style="text-align:left"><a href="https://like.co/"><img src="https://static.like.co/badge/stats/LIKE.svg" alt="Number of LIKE given"/></a>
48-
</td>
49-
<td style="text-align:left"><a href="https://static.like.co/badge/stats/LIKE.svg">/stats/LIKE.svg</a>
50-
</td>
51-
</tr>
52-
<tr>
53-
<td style="text-align:left"><a href="international-standard-content-number-iscn/iscn-badge.md">ISCN Badge (Light) (Default)</a>
54-
</td>
55-
<td style="text-align:left">
56-
<img src="../.gitbook/assets/light-badge (1).svg" alt/>
57-
</td>
58-
<td style="text-align:left"><a href="international-standard-content-number-iscn/iscn-badge.md">/iscn/&lt;iscn-hash&gt;.svg</a>
59-
</td>
60-
</tr>
61-
<tr>
62-
<td style="text-align:left"><a href="international-standard-content-number-iscn/iscn-badge.md">ISCN Badge (Dark)</a>
63-
</td>
64-
<td style="text-align:left">
65-
<img src="../.gitbook/assets/dark-badge.svg" alt/>
66-
</td>
67-
<td style="text-align:left"><a href="international-standard-content-number-iscn/iscn-badge.md">/iscn/&lt;iscn-hash&gt;.svg?dark=1</a>
68-
</td>
69-
</tr>
70-
</tbody>
71-
</table>
72-
73-
11+
| Data | Example | Path |
12+
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------- |
13+
| Number of Liker | [![Number of Liker](https://static.like.co/badge/stats/liker.svg)](https://like.co) | [/stats/liker.svg](https://static.like.co/badge/stats/liker.svg) |
14+
| <p>Number of creator <br>(users with content that has been liked before)</p> | [![Number of creator](https://static.like.co/badge/stats/creator.svg)](https://like.co) | [/stats/creator.svg](https://static.like.co/badge/stats/creator.svg) |
15+
| <p>Number of content</p><p>(content that has at least 1 like)</p> | [![Number of content](https://static.like.co/badge/stats/content.svg)](https://like.co) | [/stats/content.svg](https://static.like.co/badge/stats/content.svg) |
16+
| Number of LIKE token given out to creators | [![Number of LIKE given](https://static.like.co/badge/stats/LIKE.svg)](https://like.co) | [/stats/LIKE.svg](https://static.like.co/badge/stats/LIKE.svg) |
17+
| [ISCN Badge (Light) (Default)](iscn/iscn-badge.md) | ![](<../.gitbook/assets/light-badge (1).svg>) | [/iscn/\<iscn-hash>.svg](iscn/iscn-badge.md) |
18+
| [ISCN Badge (Dark)](iscn/iscn-badge.md) | ![](../.gitbook/assets/dark-badge.svg) | [/iscn/\<iscn-hash>.svg?dark=1](iscn/iscn-badge.md) |
7419

Diff for: developer/international-standard-content-number-iscn/README.md

-2
This file was deleted.

Diff for: developer/iscn/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
coverY: 0
3+
---
4+
5+
# ISCN
6+

Diff for: developer/iscn/web-widget/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Web Widget
2+

Diff for: developer/iscn/web-widget/iscn-ar/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Submit ISCN entry via like.co web widget
3+
---
4+
5+
# ISCN x Arweave Widget
6+
7+
Easily allow users to submit file to Arweave and register ISCN using Keplr or Liker ID.
8+
9+
![](<../../../../.gitbook/assets/image (5).png>)
10+
11+
Please refer to [Reference](reference.md) for more information.

Diff for: developer/iscn/web-widget/iscn-ar/reference.md

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
description: ISCN AR web widget API Reference
3+
---
4+
5+
# Reference
6+
7+
### Base URL <a href="#base-url" id="base-url"></a>
8+
9+
Testnet: [`https://rinkeby.like.co/in/widget/iscn-ar`](reference.md#input-link-https-rinkeby-like-co-in-widget-pay-to-ckxpress-and-amount-1-and-via-kiutest-0-and-fee-1-1)``
10+
11+
Production: [`https://like.co/in/widget/iscn-ar`](https://like.co/in/widget/iscn-ar)``
12+
13+
Since `postMessage()` would be needed for operating this widget, caller is expected to use `window.open` on the above urls.
14+
15+
### &#x20;Input Params <a href="#input-params" id="input-params"></a>
16+
17+
| redirect\_uri | Act as a whitelist host for postMessage, actual redirect is not implemented, please use with `opener` below |
18+
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
19+
| opener | default 0. If set, would fire a `postMessage` back to `window.opener` with `redirect_uri` host as target, then close current window |
20+
21+
### PostMessage input format
22+
23+
#### Mark widget as ready
24+
25+
Send this action to switch widget to ready to accept mode.
26+
27+
```javascript
28+
{ action: 'INIT_WIDGET' }
29+
```
30+
31+
| Key | Value | |
32+
| ------ | ------------ | - |
33+
| action | INIT\_WIDGET | |
34+
35+
#### Send ISCN Data
36+
37+
Submit ISCN data to widget
38+
39+
```javascript
40+
{
41+
action: 'SUBMIT_ISCN_DATA',
42+
data: {
43+
files: [
44+
{
45+
filename: 'index.html',
46+
mimeType: 'text/html',
47+
data: 'PCFET0NUWVBFIGh0bWw+PGh0bWw+Ci...',
48+
},
49+
{
50+
filename: 'wp-content/uploads/image.png',
51+
mimeType: 'image/png',
52+
data: 'iVBORw0KGgoAAAANSUhEUgAABAAAAA...',
53+
},
54+
],
55+
name: 'LikeCoin Update &#124; Launching $LIKE Airdrop and Civic Likers Web3',
56+
tags: ['Airdrop', 'Civic Liker', 'Depub', 'LikeCoin', 'Progress Update'],
57+
author: 'likecoin',
58+
description: 'Launch of LikeCoin Airdrop The long-awaited 50 million...',
59+
},
60+
}
61+
```
62+
63+
| Key | Description |
64+
| ---------------- | ---------------------------------------- |
65+
| action | SUBMIT\_ISCN\_DATA |
66+
| data | ISCN Data for submission |
67+
| data.files | Array of files to be uploaded to Arweave |
68+
| data.name | Title for the ISCN content |
69+
| data.tags | Tags for the content |
70+
| data.author | Name of the author |
71+
| data.description | Description for the content |
72+
73+
### Emit event format
74+
75+
#### ISCN\_WIDGET\_READY
76+
77+
Fired when widget is ready to receive message
78+
79+
```
80+
{
81+
action: 'ISCN_WIDGET_READY',
82+
}
83+
```
84+
85+
#### ARWEAVE\_SUBMITTED
86+
87+
Fired when files are uploaded to Arweave and IPFS
88+
89+
```
90+
{
91+
action: 'ARWEAVE_SUBMITTED',
92+
data: {
93+
ipfsHash,
94+
arweaveId,
95+
}
96+
}
97+
```
98+
99+
#### ISCN\_SUBMITTED
100+
101+
Fired when content is submitted to ISCN
102+
103+
```javascript
104+
{
105+
action: 'ISCN_SUBMITTED',
106+
data: {
107+
tx_hash,
108+
iscnId,
109+
}
110+
}
111+
```
112+
113+
### Example Code <a href="#example-link" id="example-link"></a>
114+
115+
```javascript
116+
const w = window.open('https://like.co/in/widget/iscn-ar?opener=1&redirect_uri=https%3A%2F%2Flike.community');
117+
118+
const ISCN_WIDGET_ORIGIN = 'https://like.co';
119+
120+
function onPostMessage(event) {
121+
if (event.origin !== 'like') {
122+
return;
123+
}
124+
try {
125+
const { action, data } = JSON.parse(event.data);
126+
if (action === 'ISCN_WIDGET_READY') {
127+
w.postMessage(JSON.stringify({ action: 'INIT_WIDGET' }), ISCN_WIDGET_ORIGIN);
128+
w.postMessage(sendISCNPayload());
129+
} else if (action === 'ARWEAVE_SUBMITTED') {
130+
const {
131+
ipfsHash, arweaveId,
132+
} = data;
133+
console.log(ipfsHash, arweaveId);
134+
} else if (action === 'ISCN_SUBMITTED') {
135+
const {
136+
tx_hash: txHash, iscnId,
137+
} = data;
138+
console.log(txHash, iscnId);
139+
} else {
140+
console.log(`Unknown event: ${action}`);
141+
}
142+
} catch (err) {
143+
console.error(err);
144+
}
145+
}
146+
window.addEventListener('message', onPostMessage, false);
147+
148+
function sendISCNPayload() {
149+
w.postMessage(JSON.stringify({
150+
action: 'SUBMIT_ISCN_DATA',
151+
data: {
152+
files: [
153+
{
154+
filename: 'index.html',
155+
mimeType: 'text/html',
156+
data: 'PCFET0NUWVBFIGh0bWw+PGh0bWw+Ci...',
157+
},
158+
{
159+
filename: 'wp-content/uploads/image.png',
160+
mimeType: 'image/png',
161+
data: 'iVBORw0KGgoAAAANSUhEUgAABAAAAA...',
162+
},
163+
],
164+
title: 'LikeCoin Update &#124; Launching $LIKE Airdrop and Civic Likers Web3',
165+
tags: ['Airdrop', 'Civic Liker', 'Depub', 'LikeCoin', 'Progress Update'],
166+
author: 'likecoin',
167+
description: 'Launch of LikeCoin Airdrop The long-awaited 50 million...',
168+
},
169+
170+
}), ISCN_WIDGET_ORIGIN);
171+
}
172+
173+
```
174+
175+
[\
176+
](https://docs.like.co/developer/like-pay/web-widget)

Diff for: developer/international-standard-content-number-iscn/web-widget/README.md renamed to developer/iscn/web-widget/iscn/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
description: Submit ISCN entry via like.co web widget
33
---
44

5-
# Web Widget
5+
# ISCN Widget
66

77
Easily allow users to submit an ISCN entry via like.co and Liker ID.
88

9-
![](../../../.gitbook/assets/iscnwidget.png)
9+
![](../../../../.gitbook/assets/iscnwidget.png)
1010

1111
Please refer to [Reference](reference.md) for more information.
12-

Diff for: developer/likecoin-chain-api/sample/cosmjs/iscn.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ISCN
22

3-
Please refer to the [ISCN](../../../international-standard-content-number-iscn/) section
4-
5-
{% page-ref page="../../../international-standard-content-number-iscn/javascript/iscn-js.md" %}
6-
3+
Please refer to the [ISCN](../../../iscn/) section
74

5+
{% content-ref url="../../../iscn/javascript/iscn-js.md" %}
6+
[iscn-js.md](../../../iscn/javascript/iscn-js.md)
7+
{% endcontent-ref %}
88

Diff for: faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Frequently Asked Questions
99
## [​LikeCoin - Decentralized Publishing](./) <a href="#likecoin-zan-shang-gong-min-gong-he-guo" id="likecoin-zan-shang-gong-min-gong-he-guo"></a>
1010

1111
* [What is Decentralized Publishing #DePub?](./)
12-
* [What is ISCN?](developer/international-standard-content-number-iscn/)
12+
* [What is ISCN?](developer/iscn/)
1313
* [What is the relationship between ISCN and IPFS?](general-guides/decentralized-publishing/iscn-ipfs-relationship.md)
1414
* [Why the decentralization nature of ISCN is good to content ecosystem?](general-guides/decentralized-publishing/benefits.md)
1515
* [Any cost for registering ISCN?](general-guides/decentralized-publishing/what-is-iscn.md)

Diff for: general-guides/governance/likecoin-chain.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ LikeCoin chain is a distributed ledger of the DAO, the open government of Liker
88

99
On November 15, 2019, LikeCoin upgraded from ERC-20 to the LikeCoin chain code name SheungWan based on the [Cosmos Hub](https://cosmos.network) ecosystem.&#x20;
1010

11-
On August 18, 2021 (GMT+8), the LikeCoin chain upgraded to FoTan, which incorporates advanced features such as [International Standard Content Number (“ISCN”)](../../developer/international-standard-content-number-iscn/), IBC (Inter-blockchain communication) and other features of [Stargate](https://stargate.cosmos.network).
11+
On August 18, 2021 (GMT+8), the LikeCoin chain upgraded to FoTan, which incorporates advanced features such as [International Standard Content Number (“ISCN”)](../../developer/iscn/), IBC (Inter-blockchain communication) and other features of [Stargate](https://stargate.cosmos.network).
1212

1313

Diff for: general-guides/wallet/fotan.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: What is the impact on Liker?
44

55
# FoTan upgrade FAQ
66

7-
LikeCoin chain was upgraded from SheungWan to Fotan version on August 18, 2021 19:45 GMT+8. After the upgrade, the LikeCoin chain supports [ISCN ( International Standard Content Number )](../../developer/international-standard-content-number-iscn/) content registry and IBC ( Inter Blockchain Communication ). Validators upgraded the chain together on Google Meet. During the upgrade, all transactions on Liker Land were suspended.&#x20;
7+
LikeCoin chain was upgraded from SheungWan to Fotan version on August 18, 2021 19:45 GMT+8. After the upgrade, the LikeCoin chain supports [ISCN ( International Standard Content Number )](../../developer/iscn/) content registry and IBC ( Inter Blockchain Communication ). Validators upgraded the chain together on Google Meet. During the upgrade, all transactions on Liker Land were suspended.&#x20;
88

99
Have questions on the upgrade? Please check out the following FAQ.
1010

0 commit comments

Comments
 (0)