diff --git a/docs/tools/clients/fcl-js/api.md b/docs/tools/clients/fcl-js/api.md index 92432faab7..c2c112e483 100644 --- a/docs/tools/clients/fcl-js/api.md +++ b/docs/tools/clients/fcl-js/api.md @@ -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 @@ -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 @@ -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. --- @@ -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) --- @@ -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) --- @@ -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 | | ------------------- | diff --git a/docs/tools/clients/fcl-js/index.md b/docs/tools/clients/fcl-js/index.md index 8cad59b29b..8dd5aa43a5 100644 --- a/docs/tools/clients/fcl-js/index.md +++ b/docs/tools/clients/fcl-js/index.md @@ -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. diff --git a/docs/tools/clients/fcl-js/user-signatures.md b/docs/tools/clients/fcl-js/user-signatures.md index fd30fc0e71..dfb4c28608 100644 --- a/docs/tools/clients/fcl-js/user-signatures.md +++ b/docs/tools/clients/fcl-js/user-signatures.md @@ -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 diff --git a/docs/tools/flow-dev-wallet/index.md b/docs/tools/flow-dev-wallet/index.md index 7e658f2fca..d57efa9327 100644 --- a/docs/tools/flow-dev-wallet/index.md +++ b/docs/tools/flow-dev-wallet/index.md @@ -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. diff --git a/docs/tools/wallet-provider-spec/authorization-function.md b/docs/tools/wallet-provider-spec/authorization-function.md index af13b6dee5..4206442ed2 100644 --- a/docs/tools/wallet-provider-spec/authorization-function.md +++ b/docs/tools/wallet-provider-spec/authorization-function.md @@ -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 diff --git a/docs/tools/wallet-provider-spec/index.md b/docs/tools/wallet-provider-spec/index.md index 820fa7e479..916a6692a4 100644 --- a/docs/tools/wallet-provider-spec/index.md +++ b/docs/tools/wallet-provider-spec/index.md @@ -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 @@ -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. @@ -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 @@ -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 @@ -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) @@ -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) @@ -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` @@ -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`. diff --git a/docs/tools/wallet-provider-spec/user-signature.md b/docs/tools/wallet-provider-spec/user-signature.md index f41f2e9382..5e30d87c0a 100644 --- a/docs/tools/wallet-provider-spec/user-signature.md +++ b/docs/tools/wallet-provider-spec/user-signature.md @@ -36,7 +36,7 @@ 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 @@ -44,9 +44,9 @@ Common Configuration Keys and additional info can be found here [How to Configur # 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.