Skip to content

Commit

Permalink
chore: add existing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellmattryan committed Jun 28, 2023
1 parent 571c448 commit 6fb0f7d
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 32 deletions.
30 changes: 0 additions & 30 deletions .github/dependabot.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Docs

on:
push:
branches:
- 'develop'

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- uses: retypeapp/action-build@v3
with:
config: docs

- uses: retypeapp/action-github-pages@v3
with:
branch: retype
update-branch: true
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# template
# Bloom Docs

A template repository for any Bloom project.
> Developer documentation for Bloom
8 changes: 8 additions & 0 deletions deep-links/api-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
icon: stack
order: 999
---

# API Reference

Coming soon.
8 changes: 8 additions & 0 deletions deep-links/guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
icon: book
order: 1000
---

# Guide

Coming soon.
11 changes: 11 additions & 0 deletions deep-links/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
icon: link
expanded: true
order: 999
---

# Deep Links

[Guide](guide.md)
[API Reference](api-reference.md)
[Specification](specification.md)
187 changes: 187 additions & 0 deletions deep-links/specification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
---
icon: search
order: 998
---

# Specification

Deep links are special URLs that, when navigated to, open
applications rather than a website.
In our case we are interested in the user experiences that they enable
between websites, applications, platforms, etc. by providing more interoperability.

Firefly has its own deep link scheme, exposing (limited) functionality that is required in
some type of user flow. A trivial example would be a user who buys native tokens on Soonaverse and
must make a payment transaction to execute the buy order. Clicking on a deep link embedded inside the
Soonaverse platform triggers Firefly to open and auto-fill the transaction data as necessary, making it
a simple confirm and click job for the user.

:::caution
Firefly **will NEVER** automatically execute actions initiated by a deep link; they should **ALWAYS** require manual
confirmation on behalf of the user.
:::

## Scheme

The Firefly deep link scheme can be broken down to the following (simple) syntax:

```
firefly[-<stage>]://<context>/<operation>[?param=<param>]
```

The parameters are as follows:

- `stage` - indicates a specific stage of the app to target, options are:
- `alpha` - the first available version of Firefly containing brand new features
- `beta` - the next available version of Firefly containing new but slightly tested features
- `shimmer` - the Firefly Shimmer version, containing new and well-tested features
- `context` - the part of Firefly that contains the operation, options are:
- `wallet` - managing coins and tokens
- `collectibles` - managing NFTs
- `governance` - managing voting events and proposals
- `operation` - an operation within a specific context (see below for more detail)
- `param` - query parameter(s) relevant for the specified operation

If you wish to target the production version, simply omit this from the prefix:

```
firefly://
```

:::caution
This deep link scheme is **NOT** compatible with Firefly V1, as that version of the application is in maintenance mode.
:::

## Contexts

### Wallet

#### Send Form

This operation brings the user to the send form popup:

:::image
![](../static/send-form-popup.png "Send form popup")
:::

The deep link structure is as follows:

```
firefly://wallet/sendForm?address=<address>&amount=<amount>[&unit=<unit>][&assetId=<assetId>][&metadata=<metadata>][&tag=<tag>]
```

The following parameters are **required**:

- `address` - the recipient's address where the funds will be sent to
- **MUST** be a Bech32 address; considering support for other address types in the future
- `amount` - the amount of tokens to send in the transaction
- **MAY** contain a decimal so long as it makes sense given the value of the `unit` param (see below)

The following parameters are **optional**:

- `unit` - a specified denomination of the token to use, if applicable (default for IOTA is `Mi`, SMR is `SMR`)
- `assetId` - the identifier of the asset to send, e.g. `4218` (IOTA), `4219` (SMR), or a native token ID (default is base token of the network, i.e. IOTA or SMR)
- `metadata` - a string of text to embed as metadata in the transaction
- `tag` - a string to tag the transaction for indexing purposes

Example:

[!button Click me!](firefly://wallet/sendForm?address=iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx&amount=10&unit=Gi)

Source:

```
firefly://wallet/sendForm?address=iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx&amount=10&unit=Gi
```

#### Send Confirmation

This operation brings the user to the send confirmation popup:

:::image
![](../static/send-confirmation-popup.png "Send confirmation popup")
:::

The deep link structure is as follows:

```
firefly://wallet/sendConfirmation?address=<address>&amount=<amount>[&unit=<unit>][&assetId=<assetId>][&metadata=<metadata>][&tag=<tag>][&giftStorageDeposit=<true|false>][&disableToggleGift=<true|false>][&disableChangeExpiration=<true|false>][&surplus=<surplus>]
```

The following parameters are **required**:

- `address` - the recipient's address where the funds will be sent to
- **MUST** be a Bech32 address; considering support for other address types in the future
- `amount` - the amount of tokens to send in the transaction
- **MAY** contain a decimal so long as it makes sense given the value of the `unit` param (see below)

The following parameters are **optional**:

- `unit` - a specified denomination of the token to use, if applicable (default for IOTA is `Mi`, SMR is `SMR`)
- `assetId` - the identifier of the asset to send, e.g. `4218` (IOTA), `4219` (SMR), or a native token ID (default is base token of the network, i.e. IOTA or SMR)
- `metadata` - a string of text to embed as metadata in the transaction
- `tag` - a string to tag the transaction for indexing purposes
- `giftStorageDeposit` - gifts the tokens used in funding the storage deposit for a transaction
- `disableToggleGift` - prevents the user from being able to toggle the option to gift the storage deposit
- `disableChangeExpiration` - prevents the user from being able to change the expiration time of the transaction
- `surplus` - send additional amounts of the base token when transferring native tokens

Example:

[!button Click me!](firefly://wallet/sendForm?address=iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx&amount=10&unit=Gi&giftStorageDeposit=true&surplus=1&metadata=Take%20my%20money)

Source:

```
firefly://wallet/sendConfirmation?address=iota1qrhacyfwlcnzkvzteumekfkrrwks98mpdm37cj4xx3drvmjvnep6xqgyzyx&amount=10&unit=Gi&giftStorageDeposit=true&disableToggleGift=true&surplus=1&metadata=Take%20my%20money
```

### Collectibles

Coming :soon:

### Governance

#### Add Proposal

This operation brings the user to the add proposal popup:

:::image
![](../static/add-proposal-popup.png "Add proposal popup")
:::

The deep link structure is as follows:

```
firefly://governance/addProposal?eventId=<eventId>&nodeUrl=<nodeUrl>
```

The following parameters are **required**:

- `eventId` - the event ID of the proposal's corresponding participation event in the network

The following parameter(s) are **optional**:

- `nodeUrl` - the specific node that is tracking the proposal's corresponding participation event

:::info
If the node requires authentication (e.g. username and password, JWT), the user will be required
to manually enter the information.
:::

Example:

[!button Click me!](firefly://governance/addProposal?eventId=0x6d27606a773a3c87c151af09ad58ddc831864e2141ef598075dc24be5668ca7f7f&nodeUrl=https://api.testnet.shimmer.network)

Source:

```
firefly://governance/addProposal?eventId=0x6d27606a773a3c87c151af09ad58ddc831864e2141ef598075dc24be5668ca7f7f&nodeUrl=https://api.testnet.shimmer.network
```

<style>
.image {
margin: auto;
max-width: 420px;
}
</style>
11 changes: 11 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
icon: home
order: 1000
---

# Welcome

Welcome to the Bloom docs :cherry_blossom:

Here you will find all the documentation you need to develop with Bloom.
Please feel free to reach out if you have any questions!
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@bloom-labs/docs",
"version": "0.1.0",
"description": "Developer documentation for Bloom",
"main": "index.js",
"repository": "git@github.com:bloomwalletio/bloom-docs.git",
"author": "Matthew Maxwell <maxwellmattryan@gmail.com>",
"license": "MIT",
"private": false,
"scripts": {
"start": "retype watch"
},
"devDependencies": {
"retypeapp": "^3.0.3"
}
}
40 changes: 40 additions & 0 deletions retype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
input: ./
output: .retype
url: bloomwalletio.github.io/docs/
favicon: static/icon_firefly.png

branding:
title: Bloom
label: v0.1.0
logo: 'static/icon_firefly.svg'

meta:
title: ' | Bloom Developer Docs'

edit:
repo: 'https://github.com/bloomwalletio/bloom'
base: /docs
branch: develop

links:
- text: Home
link: './index.md'
icon: home

- text: Issues
link: 'https://github.com/bloomwalletio/bloom/issues'
icon: issue-opened
target: blank

- text: Discussions
link: 'https://github.com/bloomwalletio/bloom/discussions'
icon: comment-discussion
target: blank

- text: GitHub
link: 'https://github.com/bloomwalletio/bloom'
icon: mark-github
target: blank

footer:
copyright: '&copy; Copyright {{ year }}. All rights reserved.'
Binary file added static/add-proposal-popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/icon_firefly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions static/icon_firefly.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/send-confirmation-popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/send-form-popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


retypeapp@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/retypeapp/-/retypeapp-3.0.3.tgz#2d3b33bc56087a11804e29ab0519b8b23daf8e67"
integrity sha512-W5gNDz+a5uYvckyujfUytu6IjqX0t+Wih9cR7Mf2U8PQBdvcq0X+Dmda2kUut3dSqfeefgS9ffOVJgf58ZRQbw==

0 comments on commit 6fb0f7d

Please sign in to comment.