Skip to content

Commit

Permalink
Merge pull request #1051 from onflow/nialexsan/fix-github-links
Browse files Browse the repository at this point in the history
fix links
  • Loading branch information
nialexsan authored Dec 16, 2024
2 parents bcd9654 + 509ec5b commit b967325
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions docs/tools/clients/fcl-js/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ A method to use allowing the user to personally sign data via FCL Compatible Wal
| Type | Description |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Array` | An Array of [CompositeSignatures](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/wallet-provider-spec/draft-v2.md#compositesignature): {`addr`, `keyId`, `signature`} |
| `Array` | An Array of [CompositeSignatures](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/wallet-provider-spec/draft-v2.md#compositesignature): {`addr`, `keyId`, `signature`} |
#### Usage
Expand Down Expand Up @@ -810,7 +810,7 @@ Decodes the response from `fcl.send()` into the appropriate JSON representation
#### Note
📣 To define your own decoder, see [`tutorial`](https://github.com/onflow/flow-js-sdk/tree/master/packages/sdk/src/decode).
📣 To define your own decoder, see [`tutorial`](https://github.com/onflow/fcl-js/tree/master/packages/sdk/src/decode).
#### Arguments
Expand Down Expand Up @@ -1600,7 +1600,7 @@ Builders are modular functions that can be coupled together with `fcl.send([...b
### `Interaction`
An interaction is an object containing the information to perform an action on chain.This object is populated through builders and converted into the approriate access node API call. See the interaction object [here](https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/src/interaction/interaction.js). A 'partial' interaction is an interaction object that does not have sufficient information to the intended on-chain action. Multiple partial interactions (through builders) can be coupled to create a complete interaction.
An interaction is an object containing the information to perform an action on chain.This object is populated through builders and converted into the approriate access node API call. See the interaction object [here](https://github.com/onflow/fcl-js/blob/master/packages/sdk/src/interaction/interaction.ts). A 'partial' interaction is an interaction object that does not have sufficient information to the intended on-chain action. Multiple partial interactions (through builders) can be coupled to create a complete interaction.
---
Expand Down Expand Up @@ -1739,7 +1739,7 @@ const authorizationFunction = async (account) => {
}
```
- [Detailed explanation](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/wallet-provider-spec/authorization-function.md)
- [Detailed explanation](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/wallet-provider-spec/authorization-function.md)
---
Expand Down Expand Up @@ -1807,7 +1807,7 @@ const signingFunction = ({
#### Examples:
- [Detailed explanation](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/wallet-provider-spec/authorization-function.md)
- [Detailed explanation](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/wallet-provider-spec/authorization-function.md)
---
Expand Down Expand Up @@ -1931,7 +1931,7 @@ A collection is a list of transactions that are contained in the same block.
### `ResponseObject`
The format of all responses in FCL returned from `fcl.send(...)`. For full details on the values and descriptions of the keys, view [here](https://github.com/onflow/flow-js-sdk/tree/master/packages/sdk/src/response).
The format of all responses in FCL returned from `fcl.send(...)`. For full details on the values and descriptions of the keys, view [here](https://github.com/onflow/fcl-js/tree/master/packages/sdk/src/response).
| Key |
| ------------------- |
Expand Down
4 changes: 2 additions & 2 deletions docs/tools/clients/fcl-js/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ The discovery feature can be used via API, allowing you to customize your own UI

## Support

Notice an problem or want to request a feature? [Add an issue](https://github.com/onflow/flow-js-sdk/issues).
Notice an problem or want to request a feature? [Add an issue](https://github.com/onflow/fcl-js/issues).

Discuss FCL with the community on the [forum](https://forum.onflow.org/c/developer-tools/flow-fcl/22).

Join the Flow community on [Discord](https://discord.gg/k6cZ7QC) to keep up to date and to talk to the team.
Join the Flow community on [Discord](https://discord.gg/flow) to keep up to date and to talk to the team.
2 changes: 1 addition & 1 deletion docs/tools/clients/fcl-js/user-signatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A method to use allowing the user to personally sign data via FCL Compatible Wal

| Type | Description |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Array` | An Array of [CompositeSignatures](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/wallet-provider-spec/draft-v2.md#compositesignature): {`addr`, `keyId`, `signature`} |
| `Array` | An Array of [CompositeSignatures](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/wallet-provider-spec/draft-v2.md#compositesignature): {`addr`, `keyId`, `signature`} |

#### Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/tools/flow-dev-wallet/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ flow project deploy --network emulator

## Configuring Your JavaScript Application

The Flow Dev Wallet is designed to be used with [`@onflow/fcl`](https://github.com/onflow/flow-js-sdk) version `1.0.0` or higher. The FCL package can be installed with: `npm install @onflow/fcl` or `yarn add @onflow/fcl`.
The Flow Dev Wallet is designed to be used with [`@onflow/fcl`](https://github.com/onflow/fcl-js) version `1.0.0` or higher. The FCL package can be installed with: `npm install @onflow/fcl` or `yarn add @onflow/fcl`.

To use the dev wallet, configure FCL to point to the address of a locally running [Flow emulator](#start-the-emulator) and the dev wallet endpoint.

Expand Down
2 changes: 1 addition & 1 deletion docs/tools/wallet-provider-spec/authorization-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const response = fcl.send([

The builder functions, `fcl.proposer`, `fcl.payer` and `fcl.authorizations` each consume the Authorization Function and set it as the resolve field on the internal Account object it creates.

During the resolve phase of the Flow JS-SDK and FCL, when [`resolveAccounts`](https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/src/resolve/resolve.js#L22) is called, the resolve field on each internal Account object is called, which means each Authorization Function is called appropriately and the account is _resolved_ into the data structure the authorizationFunction returns. These accounts are then deduped based on the a mix of the `addr`, `keyId` and `tempId` so that only a single signature request happens per `address` `keyId` pair. When [`resolveSignatures`](https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/src/resolve/resolve.js#L25) is called the signing function for each `address` `keyId` pair is called returning a composite signature for each signatory role.
During the resolve phase of the Flow JS-SDK and FCL, when [`resolveAccounts`](https://github.com/onflow/fcl-js/blob/master/packages/sdk/src/resolve/resolve.js#L58) is called, the resolve field on each internal Account object is called, which means each Authorization Function is called appropriately and the account is _resolved_ into the data structure the authorizationFunction returns. These accounts are then deduped based on the a mix of the `addr`, `keyId` and `tempId` so that only a single signature request happens per `address` `keyId` pair. When [`resolveSignatures`](https://github.com/onflow/fcl-js/blob/master/packages/sdk/src/resolve/resolve.js#L62) is called the signing function for each `address` `keyId` pair is called returning a composite signature for each signatory role.

## How to Create An Authorization Function

Expand Down
32 changes: 16 additions & 16 deletions docs/tools/wallet-provider-spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Each response back to FCL must be "wrapped" in a `PollingResponse`. The `status`

In summary, zero or more `PENDING` responses should be followed by a non-pending response. It is entirely acceptable for your service to immediately return an `APPROVED` Polling Response, skipping a `PENDING` state.

See also [PollingResponse](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/polling-response.js).
See also [PollingResponse](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/polling-response.js).

Here are some examples of valid `PollingResponse` objects:
```javascript
Expand Down Expand Up @@ -249,12 +249,12 @@ The meaning of the fields is as follows.
- `data`: Additional information used with a service of type `open-id`.

See also:
- [authn](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/authn.js)
- [authz](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/authz.js)
- [user-signature](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/user-signature.js)
- [pre-authz](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/pre-authz.js)
- [open-id](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/open-id.js)
- [back-channel-rpc](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/back-channel-rpc.js)
- [authn](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/authn.js)
- [authz](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/authz.js)
- [user-signature](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/user-signature.js)
- [pre-authz](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/pre-authz.js)
- [open-id](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/open-id.js)
- [back-channel-rpc](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/back-channel-rpc.js)

### `Identity`
This object is used to define the identity of the user.
Expand Down Expand Up @@ -350,7 +350,7 @@ interface CompositeSignature extends ObjectBase {
}
```

See also [CompositeSignature](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/composite-signature.js).
See also [CompositeSignature](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/composite-signature.js).

### `OpenID`
TODO
Expand Down Expand Up @@ -384,8 +384,8 @@ type ExtensionServiceInitiationMessage = {
This object is used to invoke a service when the `EXT/RPC` service method is used.
## See also
- [local-view](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/local-view.js)
- [frame](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/frame.js)
- [local-view](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/local-view.js)
- [frame](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/frame.js)
# Service Methods
Expand Down Expand Up @@ -431,15 +431,15 @@ graph LR
--> End1(End)
```

![IFRAME/RPC Diagram](https://raw.githubusercontent.com/onflow/flow-js-sdk/master/packages/fcl/assets/service-method-diagrams/iframe-rpc.png)
![IFRAME/RPC Diagram](https://raw.githubusercontent.com/onflow/fcl-js/master/packages/fcl-core/assets/service-method-diagrams/iframe-rpc.png)

## POP/RPC | TAB/RPC (Front Channel)

`POP/RPC` and `TAB/RPC` work in an almost entirely similar way to `IFRAME/RPC`, except instead of rendering the `method` in an iframe, we render it in a popup or new tab. The same communication protocol between the rendered view and FCL applies.

![POP/RPC Diagram](https://raw.githubusercontent.com/onflow/flow-js-sdk/master/packages/fcl/assets/service-method-diagrams/pop-rpc.png)
![POP/RPC Diagram](https://raw.githubusercontent.com/onflow/fcl-js/master/packages/fcl-core/assets/service-method-diagrams/pop-rpc.png)

![TAB/RPC Diagram](https://raw.githubusercontent.com/onflow/flow-js-sdk/master/packages/fcl/assets/service-method-diagrams/tab-rpc.png)
![TAB/RPC Diagram](https://raw.githubusercontent.com/onflow/fcl-js/master/packages/fcl-core/assets/service-method-diagrams/tab-rpc.png)

## HTTP/POST (Back Channel)

Expand All @@ -455,7 +455,7 @@ If it is `APPROVED` FCL will return, otherwise if it is `DECLINED` FCL will erro
There is an additional optional feature that `HTTP/POST` enables in the first `PollingResponse` that is returned.
This optional feature is the ability for FCL to render an iframe, popup or new tab, and it can be triggered by supplying a service `type: "VIEW/IFRAME"`, `type: "VIEW/POP"` or `type: "VIEW/TAB"` and the `endpoint` that the wallet wishes to render in the `local` field of the `PollingResponse`. This is a great way for a wallet provider to switch to a webpage if displaying a UI is necessary for the service it is performing.

![HTTP/POST Diagram](https://raw.githubusercontent.com/onflow/flow-js-sdk/master/packages/fcl/assets/service-method-diagrams/http-post.png)
![HTTP/POST Diagram](https://raw.githubusercontent.com/onflow/fcl-js/master/packages/fcl-core/assets/service-method-diagrams/http-post.png)

## EXT/RPC (Front Channel)

Expand Down Expand Up @@ -502,7 +502,7 @@ Here is a code example for how an extension popup might send its response:
});
```

![EXT/RPC Diagram](https://raw.githubusercontent.com/onflow/flow-js-sdk/master/packages/fcl/assets/service-method-diagrams/ext-rpc.png)
![EXT/RPC Diagram](https://raw.githubusercontent.com/onflow/fcl-js/master/packages/fcl-core/assets/service-method-diagrams/ext-rpc.png)

## `data` and `params`

Expand Down Expand Up @@ -744,7 +744,7 @@ An authorization service is expected to know the Account and the Key that will b
FCL will use the `method` provided to request an array of composite signature from authorization service (Wrapped in a `PollingResponse`).
The authorization service will be sent a `Signable`.
The service is expected to construct an encoded message to sign from `Signable.voucher`.
It then needs to hash the encoded message, and prepend a required [transaction domain tag](https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/src/encode/encode.js#L12-L13).
It then needs to hash the encoded message, and prepend a required [transaction domain tag](https://github.com/onflow/fcl-js/blob/master/packages/sdk/src/encode/encode.ts#L18-L21).
Finally it signs the payload with the user/s keys, producing a signature.
This signature, as a HEX string, is sent back to FCL as part of the `CompositeSignature` which includes the user address and keyID in the data property of a `PollingResponse`.

Expand Down
6 changes: 3 additions & 3 deletions docs/tools/wallet-provider-spec/user-signature.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ As a prerequisite, **FCL** is configured to point to the Wallet Provider's Authe
> setting the **Wallet Discovery Url** to the wallet provider's **Authentication Endpoint**
> by configuring fcl like this `config().put("discovery.wallet", "https://my-awesome-wallet-provider.com/fcl/authenticate")`.
Common Configuration Keys and additional info can be found here [How to Configure FCL](https://github.com/onflow/flow-js-sdk/blob/master/docs/configure-fcl.mdx#common-configuration-keys)
Common Configuration Keys and additional info can be found here [How to Configure FCL](../clients/fcl-js/configure-fcl.md#common-configuration-keys)

1. A user initiates authentication with the wallet provider via application UI
2. The wallet confirms a user's identity and sends back information used to configure **FCL** for future user actions in the application
3. Included in the authentication response should be the provider's [Key Services](#) including a **`user-signature`** service for use with **`signUserMessage()`**

# User Signature Service

A [user-signature service](https://github.com/onflow/flow-js-sdk/blob/master/packages/fcl/src/current-user/normalize/user-signature.js#L4-L14) is a standard service, with methods for **IFRAME/RPC** or **HTTP/POST**.
A [user-signature service](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/user-signature.js) is a standard service, with methods for **IFRAME/RPC** or **HTTP/POST**.

The `user-signature` service receives a signable message from **FCL** and returns a standard [PollingResponse](https://github.com/onflow/flow-js-sdk/blob/8e53ac59636e28cdcfa2494de6cb278e71bc14c2/packages/fcl/src/current-user/normalize/polling-response.js#L5) with an array of [CompositeSignatures](https://github.com/onflow/flow-js-sdk/blob/8e53ac59636e28cdcfa2494de6cb278e71bc14c2/packages/fcl/src/current-user/normalize/composite-signature.js#L4) or `null` as the data.
The `user-signature` service receives a signable message from **FCL** and returns a standard [PollingResponse](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/polling-response.js#L5) with an array of [CompositeSignatures](https://github.com/onflow/fcl-js/blob/master/packages/fcl-core/src/normalizers/service/composite-signature.js#L4) or `null` as the data.

A status of **Approved** needs to have an array of composite signatures as data.

Expand Down

0 comments on commit b967325

Please sign in to comment.