diff --git a/src/lib/docs/.templates/class.md b/src/lib/docs/.templates/class.md index d9cc334a..6213fb1c 100644 --- a/src/lib/docs/.templates/class.md +++ b/src/lib/docs/.templates/class.md @@ -33,7 +33,7 @@ Description of list of Arguments - `foo`: bar -### [Options](https://wharfkit.github.io/session/interfaces/SessionOptions.html) +### [Options](https://wharfkit.github.io/js/session/interfaces/SessionOptions.html) Description of list of Options @@ -47,7 +47,7 @@ Brief usage description - `method`: Description -[class definition](https://wharfkit.github.io/session/classes/Session.html#abiCache). +[class definition](https://wharfkit.github.io/js/session/classes/Session.html#abicache). ### Properties @@ -62,4 +62,4 @@ Brief usage description ### TypeDocs -- [Session Documentation](https://wharfkit.github.io/session/classes/Session.html) +- [Session Documentation](https://wharfkit.github.io/js/session/classes/Session.html) diff --git a/src/lib/docs/.templates/interface.md b/src/lib/docs/.templates/interface.md index bc783ab2..61eb3440 100644 --- a/src/lib/docs/.templates/interface.md +++ b/src/lib/docs/.templates/interface.md @@ -33,7 +33,7 @@ Description of list of Arguments - `foo`: bar -### [Options](https://wharfkit.github.io/session/interfaces/SessionOptions.html) +### [Options](https://wharfkit.github.io/js/session/interfaces/SessionOptions.html) Description of list of Options @@ -47,7 +47,7 @@ Brief usage description - `method`: Description -[interface definition](https://wharfkit.github.io/session/interfacees/Session.html#abiCache). +[interface definition](https://wharfkit.github.io/js/session/interfaces/SessionOptions.html). ### Properties @@ -62,4 +62,4 @@ Brief usage description ### TypeDocs -- [Session Documentation](https://wharfkit.github.io/session/interfacees/Session.html) +- [Session Documentation](https://wharfkit.github.io/js/session/classes/Session.html) diff --git a/src/lib/docs/.templates/method.md b/src/lib/docs/.templates/method.md index ac886144..268b6aac 100644 --- a/src/lib/docs/.templates/method.md +++ b/src/lib/docs/.templates/method.md @@ -40,7 +40,7 @@ Commonly used parameters that can be passed this way include: - `permissionLevel`: A specific [PermissionLevel](/docs/antelope/permission-level) to login with, preventing any user account selection. - `walletPlugin`: A specific [WalletPlugin](/docs/session-kit/plugin-wallet) to authenticate with, preventing any user wallet selection. -A complete list of all parameters can be found in the [LoginOptions](https://wharfkit.github.io/session/interfaces/LoginOptions.html) documentation. +A complete list of all parameters can be found in the [LoginOptions](https://wharfkit.github.io/js/session/interfaces/LoginOptions.html) documentation. ### Example Override diff --git a/src/lib/docs/Antelope/APIClient.md b/src/lib/docs/Antelope/APIClient.md index 6c225b81..363c2eac 100644 --- a/src/lib/docs/Antelope/APIClient.md +++ b/src/lib/docs/Antelope/APIClient.md @@ -43,7 +43,7 @@ const client = new APIClient({ provider }) Once an `APIClient` is established for a given chain, it will give access to a number of predefined API endpoints as method calls. -The list of available methods embedded in the `APIClient` can be found in either the [ChainAPI](https://wharfkit.github.io/antelope/classes/ChainAPI.html) or [HistoryAPI](https://wharfkit.github.io/antelope/classes/HistoryAPI.html) autodocs. The autocompletion helpers in the developer's IDE should also prompt with the available options in either `client.v1.chain` or `client.v1.history`. +The list of available methods embedded in the `APIClient` can be found in either the [ChainAPI](https://wharfkit.github.io/js/antelope/classes/ChainAPI.html) or [HistoryAPI](https://wharfkit.github.io/js/antelope/classes/HistoryAPI.html) autodocs. The autocompletion helpers in the developer's IDE should also prompt with the available options in either `client.v1.chain` or `client.v1.history`. Every API call made through the `APIClient` returns a promise that must be handled either through `await` or `.then`. The example below illustrates the two ways you could call the `/v1/chain/get_info` API endpoint and return a response. diff --git a/src/lib/docs/Antelope/P2PClient.md b/src/lib/docs/Antelope/P2PClient.md index 0c9b20a5..172954c2 100644 --- a/src/lib/docs/Antelope/P2PClient.md +++ b/src/lib/docs/Antelope/P2PClient.md @@ -32,7 +32,7 @@ socket.connect(9876, "jungle4.greymass.com") This will create a listener and connect it to the desired endpoint. -The next step is setting up the `P2PClient` instance and giving it an instance of a [P2PProvider](https://wharfkit.github.io/antelope/interfaces/P2PProvider.html). A default provider is exported from the [Antelope](/docs/antelope) library and is named [SimpleEnvelopeP2PProvider](https://wharfkit.github.io/antelope/classes/SimpleEnvelopeP2PProvider.html). This provider accepts the `socket` created in the first step and instructs the client to listen to the events it emits. +The next step is setting up the `P2PClient` instance and giving it an instance of a [P2PProvider](https://wharfkit.github.io/js/antelope/interfaces/P2PProvider.html). A default provider is exported from the [Antelope](/docs/antelope) library and is named [SimpleEnvelopeP2PProvider](https://wharfkit.github.io/js/antelope/classes/SimpleEnvelopeP2PProvider.html). This provider accepts the `socket` created in the first step and instructs the client to listen to the events it emits. ```ts import { diff --git a/src/lib/docs/Releases.md b/src/lib/docs/Releases.md index 97658876..3f7e9c94 100644 --- a/src/lib/docs/Releases.md +++ b/src/lib/docs/Releases.md @@ -10,6 +10,6 @@ slug: index Each release of the `@wharfkit` packages has a page describing what it contains and how to upgrade a project to it. -## [Wharf 4.0.0](/docs/releases/4-0-0) +## [Wharf 4.0.1](/docs/releases/4-0-1) -Every `@wharfkit` package shares one version number and ships from one repository, so installing any of them resolves the rest to a matching version. The release carries the API changes developed as `@wharfkit/antelope` 2.0, session keys in `@wharfkit/session`, and a signing reliability fix for Anchor on iOS. The release notes also cover [upgrading a project to it](/docs/releases/4-0-0#upgrading). +Every `@wharfkit` package shares one version number and ships from one repository, so installing any of them resolves the rest to a matching version. The release carries the API changes developed as `@wharfkit/antelope` 2.0, session keys in `@wharfkit/session`, and a signing reliability fix for Anchor on iOS. The release notes also cover [upgrading a project to it](/docs/releases/4-0-1#upgrading). diff --git a/src/lib/docs/Releases/4.0.0.md b/src/lib/docs/Releases/4.0.1.md similarity index 80% rename from src/lib/docs/Releases/4.0.0.md rename to src/lib/docs/Releases/4.0.1.md index 49788e85..427149e4 100644 --- a/src/lib/docs/Releases/4.0.0.md +++ b/src/lib/docs/Releases/4.0.1.md @@ -1,29 +1,29 @@ --- -title: Wharf 4.0.0 -description: What ships in the 4.0.0 release of the @wharfkit packages and how to upgrade a project to it. +title: Wharf 4.0.1 +description: What ships in the 4.0.1 release of the @wharfkit packages and how to upgrade a project to it. category: Releases published: true -slug: 4-0-0 +slug: 4-0-1 order: 1 --- -# Wharf 4.0.0 +# Wharf 4.0.1 -Wharf 4.0.0 is the first release in which every `@wharfkit` package shares one version number, so installing any one of them brings the matching versions of the rest. It also brings session keys to `@wharfkit/session`, the API changes developed as `@wharfkit/antelope` 2.0, and a signing reliability fix for Anchor on iOS. +In Wharf 4.0.1, every `@wharfkit` package shares one version number, so installing any one of them brings the matching versions of the rest. The release also brings session keys to `@wharfkit/session`, the API changes developed as `@wharfkit/antelope` 2.0, and a signing reliability fix for Anchor on iOS. Package names on npm are unchanged, and every package is developed in [github.com/wharfkit/js](https://github.com/wharfkit/js). ## Upgrading -Set every `@wharfkit` entry in your `package.json` to `^4.0.0`, whatever version it was on before, and reinstall from a clean lockfile: +Set every `@wharfkit` entry in your `package.json` to `^4.0.1`, whatever version it was on before, and reinstall from a clean lockfile: ```json { "dependencies": { - "@wharfkit/antelope": "^4.0.0", - "@wharfkit/session": "^4.0.0", - "@wharfkit/wallet-plugin-anchor": "^4.0.0", - "@wharfkit/web-renderer": "^4.0.0" + "@wharfkit/antelope": "^4.0.1", + "@wharfkit/session": "^4.0.1", + "@wharfkit/wallet-plugin-anchor": "^4.0.1", + "@wharfkit/web-renderer": "^4.0.1" } } ``` @@ -32,12 +32,13 @@ Packages in the release depend on each other by exact version, and none declares Every package requires Node.js 20.19.0 or later, and both of its bundles are compiled to ES2020. webpack 4 and browsers released before March 2020 cannot parse that level; to support them, transpile `@wharfkit` packages in your build. Projects that must stay on an older Node.js version can stay on `@wharfkit/antelope@1`. -After reinstalling, confirm that your project resolves one copy of antelope with `npm ls @wharfkit/antelope` (or `yarn why`, `pnpm why`). The expected result is one entry at `4.0.0`. `@wharfkit/apiclient-leap`, `-telos` and `-wax` are outside the release and depend on an older antelope, so a project using one of them resolves a second copy. +After reinstalling, confirm that your project resolves one copy of antelope with `npm ls @wharfkit/antelope` (or `yarn why`, `pnpm why`). The expected result is one entry at `4.0.1`. `@wharfkit/apiclient-leap`, `-telos` and `-wax` are outside the release and depend on an older antelope, so a project using one of them resolves a second copy. ### Changes to check in your code - **K1 signatures differ byte for byte** from the ones 1.x produced for the same key and message. They are valid and canonical, and older signatures still verify. Re-record any test that asserts a literal signature string. -- **`PrivateKey.sharedSecret()` returns the full 32 bytes** of the shared x-coordinate, where 1.x stripped leading zero bytes. About one key pair in 256 derives a different secret. For those sessions, Anchor desktop, Anchor Android, Web Authenticator and TackleBox cannot open a request from a 4.0.0 application, and the request expires or fails until the user logs in again. Anchor's option to sign manually or with another device still works in those sessions. Pass `{legacy: true}` to read data you encrypted with 1.x. +- **`PrivateKey.sharedSecret()` returns the full 32 bytes** of the shared x-coordinate, where 1.x stripped leading zero bytes. Pass `{legacy: true}` for the stripped form. +- **A binary extension field (`T$`) absent from the data is left out** of the object or `Struct` instance antelope decodes, matching nodeos, where 1.x set it to `null`. An empty optional field (`T?`) still decodes as `null`. Check any code that tests a decoded extension field for `null`. - **`Float32.toString()` returns the shortest round-tripping string**, so `1.5` renders as `"1.5"` in place of `"1.5000000"`. Infinity, NaN and negative zero render as nodeos spells them. - **`SessionKit.restore()` takes a `PartialSerializedSession`**, and the `RestoreArgs` type is removed. Only an explicit `import type {RestoreArgs}` needs editing. - **`SessionKit.persistSession()` takes options** in place of a boolean: `persistSession(session, {setAsDefault: false})`. @@ -91,6 +92,8 @@ Signing with Anchor on the same iOS device completes when Safari brings the user - `@wharfkit/protocol-scatter` and the four wallet plugins built on it import cleanly under Node.js. - `@wharfkit/account-creation-plugin-metamask` no longer brings a second copy of antelope. - `@wharfkit/bundle` ships `@wharfkit/web-ui` in place of `@wharfkit/web-renderer`, adds `@wharfkit/token` and `@wharfkit/roborovski`, and its ES module build is one file that imports correctly. +- `@wharfkit/atomicassets` reads the AtomicMarket v2 royalty endpoints and the marketplace stats endpoint, reports the media-type descriptors on schema fields and the live collection fee on auctions, buyoffers and template buyoffers, and percent-encodes the path segments you pass it, contributed by [robrigo](https://github.com/robrigo). +- `@wharfkit/contract` sends a scope bound of zero to the chain. - Every package is licensed under `BSD-3-Clause`. `@wharfkit/signing-request` was previously MIT. ### New packages diff --git a/src/lib/docs/SessionKit/Login.md b/src/lib/docs/SessionKit/Login.md index 2e2c2c5d..86863340 100644 --- a/src/lib/docs/SessionKit/Login.md +++ b/src/lib/docs/SessionKit/Login.md @@ -40,7 +40,7 @@ Commonly used parameters that can be passed this way include: - `permissionLevel`: A specific [PermissionLevel](/docs/antelope/permission-level) to login with, preventing any user account selection. - `walletPlugin`: A specific [WalletPlugin](/docs/session-kit/plugin-wallet) to authenticate with, preventing any user wallet selection. -A complete list of all parameters can be found in the [LoginOptions](https://wharfkit.github.io/session/interfaces/LoginOptions.html) documentation. +A complete list of all parameters can be found in the [LoginOptions](https://wharfkit.github.io/js/session/interfaces/LoginOptions.html) documentation. ### Example Override diff --git a/src/lib/docs/SessionKit/Session.md b/src/lib/docs/SessionKit/Session.md index 6f96707c..7a9ad171 100644 --- a/src/lib/docs/SessionKit/Session.md +++ b/src/lib/docs/SessionKit/Session.md @@ -39,7 +39,7 @@ const options = { const session = new Session(args, options) ``` -### [Arguments](https://wharfkit.github.io/session/interfaces/SessionArgs.html) +### [Arguments](https://wharfkit.github.io/js/session/interfaces/SessionArgs.html) The first parameter passed to the `Session` is an object containing all the required configuration data. @@ -48,7 +48,7 @@ The first parameter passed to the `Session` is an object containing all the requ - `permission`: The name of an [Authority](/docs/antelope/authority) defined on the account that the session will use. - `walletPlugin`: An instance of a [WalletPlugin](/docs/session-kit/plugin-wallet) that allows signing transactions for this session. -### [Options](https://wharfkit.github.io/session/interfaces/SessionOptions.html) +### [Options](https://wharfkit.github.io/js/session/interfaces/SessionOptions.html) The second parameter is an optional object, with every individual property of the object also being optional. This parameter allows passing additional data to further customize the `Session`. @@ -73,7 +73,7 @@ Once a `Session` instance is created, methods can be called to perform specific - `transact`: The [Transact](/docs/session-kit/transact) method is the most commonly used method on a `Session` instance and is used to sign and broadcast a transaction. - `serialize`: A method which converts the `Session` into a plain JSON object for storage purposes. -A complete list of all methods can be found in the [class definition](https://wharfkit.github.io/session/classes/Session.html#abiCache). +A complete list of all methods can be found in the [class definition](https://wharfkit.github.io/js/session/classes/Session.html#abicache). ### Properties @@ -94,4 +94,4 @@ On any established instance of a `Session`, the following are common properties ### TypeDocs -- [Session Documentation](https://wharfkit.github.io/session/classes/Session.html) +- [Session Documentation](https://wharfkit.github.io/js/session/classes/Session.html) diff --git a/src/lib/docs/SessionKit/SessionKit.md b/src/lib/docs/SessionKit/SessionKit.md index 75518020..4892fb41 100644 --- a/src/lib/docs/SessionKit/SessionKit.md +++ b/src/lib/docs/SessionKit/SessionKit.md @@ -12,7 +12,7 @@ The `SessionKit` class provided by the [Session Kit](/docs/session-kit) is respo ## Creation -When using the `SessionKit` within a web application, the developer will first establish an instance of the class with the required [SessionKitArgs](https://wharfkit.github.io/session/interfaces/SessionKitArgs.html). +When using the `SessionKit` within a web application, the developer will first establish an instance of the class with the required [SessionKitArgs](https://wharfkit.github.io/js/session/interfaces/SessionKitArgs.html). A simple example for a web application using the [WebRenderer](/docs/session-kit/web-renderer) and [WalletPluginAnchor](https://github.com/wharfkit/wallet-plugin-anchor) would be as follows: @@ -40,7 +40,7 @@ const options = { const sessionKit = new SessionKit(args, options) ``` -### [Arguments](https://wharfkit.github.io/session/interfaces/SessionKitArgs.html) +### [Arguments](https://wharfkit.github.io/js/session/interfaces/SessionKitArgs.html) The first parameter passed to the `SessionKit` is an object containing all the required configuration options. @@ -49,7 +49,7 @@ The first parameter passed to the `SessionKit` is an object containing all the r - `ui`: An instance of a [UserInterface](/docs/session-kit/plugin-user-interface), like the [WebRenderer](/docs/session-kit/web-renderer). - `walletPlugins`: An array containing at least one [WalletPlugin](/docs/session-kit/plugin-wallet). -### [Options](https://wharfkit.github.io/session/interfaces/SessionKitOptions.html) +### [Options](https://wharfkit.github.io/js/session/interfaces/SessionKitOptions.html) The second parameter passed would be all of the optional arguments: @@ -81,4 +81,4 @@ A number of methods are available on an instance of the `SessionKit`. ### TypeDocs -- [SessionKit Documentation](https://wharfkit.github.io/session/classes/SessionKit.html) +- [SessionKit Documentation](https://wharfkit.github.io/js/session/classes/SessionKit.html) diff --git a/src/lib/docs/SessionKit/Transact.md b/src/lib/docs/SessionKit/Transact.md index b1835460..8d97ed17 100644 --- a/src/lib/docs/SessionKit/Transact.md +++ b/src/lib/docs/SessionKit/Transact.md @@ -34,7 +34,7 @@ const result = await session.transact(arguments) ## Arguments -The `transact` call takes an instance of [TransactArgs](https://wharfkit.github.io/session/interfaces/TransactArgs.html), which requires an object that represents a transaction specified in one of four variants. +The `transact` call takes an instance of [TransactArgs](https://wharfkit.github.io/js/session/interfaces/TransactArgs.html), which requires an object that represents a transaction specified in one of four variants. ```ts interface TransactArgs { @@ -125,7 +125,7 @@ interface TransactOptions { ### ABIs -An array of [ABIs](/docs/antelope/abi) can be passed to a specific `transact` call using the [TransactABIDef](https://wharfkit.github.io/session/interfaces/TransactABIDef.html) format. +An array of [ABIs](/docs/antelope/abi) can be passed to a specific `transact` call using the [TransactABIDef](https://wharfkit.github.io/js/session/interfaces/TransactABIDef.html) format. ```ts interface TransactABIDef { diff --git a/src/lib/docs/SessionKit/TransactPlugin.md b/src/lib/docs/SessionKit/TransactPlugin.md index 85fff32c..bf8d2420 100644 --- a/src/lib/docs/SessionKit/TransactPlugin.md +++ b/src/lib/docs/SessionKit/TransactPlugin.md @@ -198,7 +198,7 @@ type TransactHookMutable = ( The first parameter of a `TransactHookMutable` is the `request` value, which is an instance of a [SigningRequest](https://github.com/greymass/eosio-signing-request/tree/master/src) and represents the transaction at that point in the transaction lifecycle. The second parameter is the `context`, which is the TransactContext instance that was established to represent the state of the current transaction and provide methods to assist in interpreting the request. -The hook function must either return nothing, or return an object that matches the [TransactHookResponse](https://wharfkit.github.io/session/interfaces/TransactHookResponse.html) interface. This requires that it pass back a `request` value, which can either be modified or simply pass back the `request` value it received. This response may also optionally pass back an array of signatures, if the plugin itself was responsible for appending signatures to this upcoming transaction. +The hook function must either return nothing, or return an object that matches the [TransactHookResponse](https://wharfkit.github.io/js/session/interfaces/TransactHookResponse.html) interface. This requires that it pass back a `request` value, which can either be modified or simply pass back the `request` value it received. This response may also optionally pass back an array of signatures, if the plugin itself was responsible for appending signatures to this upcoming transaction. An example of a mutable hook is as follows: diff --git a/src/lib/docs/SessionKit/TransactResult.md b/src/lib/docs/SessionKit/TransactResult.md index 240fd4d6..0412e112 100644 --- a/src/lib/docs/SessionKit/TransactResult.md +++ b/src/lib/docs/SessionKit/TransactResult.md @@ -45,7 +45,7 @@ The results returned from the [APIClient](/docs/antelope/api-client) after succe ### revisions -An instance of [TransactRevisions](https://wharfkit.github.io/session/classes/TransactRevisions.html) which contains a history of modifications made to the transaction through the execution of the included [TransactPlugins](/docs/session-kit/plugin-transact). +An instance of [TransactRevisions](https://wharfkit.github.io/js/session/classes/TransactRevisions.html) which contains a history of modifications made to the transaction through the execution of the included [TransactPlugins](/docs/session-kit/plugin-transact). ### signatures diff --git a/src/lib/docs/SessionKit/UserInterface.md b/src/lib/docs/SessionKit/UserInterface.md index 4302f0be..0e22c45c 100644 --- a/src/lib/docs/SessionKit/UserInterface.md +++ b/src/lib/docs/SessionKit/UserInterface.md @@ -81,7 +81,7 @@ DefinedUserInterface (e.g. WebRenderer) ↳ implements UserInterface ``` -The `UserInterface` ([docs](https://wharfkit.github.io/session/interfaces/UserInterface.html)) is defined as an interface with the data structures that the [SessionKit](/docs/session-kit/session-kit-factory) requires in order to function. One layer above this is an `AbstractUserInterface` ([docs](https://wharfkit.github.io/session/classes/AbstractUserInterface.html)) declared as an abstract class from which complete implementations may extend in order to inherit base functionality. +The `UserInterface` ([docs](https://wharfkit.github.io/js/session/interfaces/UserInterface.html)) is defined as an interface with the data structures that the [SessionKit](/docs/session-kit/session-kit-factory) requires in order to function. One layer above this is an `AbstractUserInterface` ([docs](https://wharfkit.github.io/js/session/classes/AbstractUserInterface.html)) declared as an abstract class from which complete implementations may extend in order to inherit base functionality. ### Life Cycle @@ -119,9 +119,9 @@ After initial processing has been completed by the [SessionKit](/docs/session-ki This data will be used in order to facilitate a number of scenarios based on the various capabilities of the [WalletPlugin](/docs/session-kit/plugin-wallet) instances in use: 1. Prompt the user to select a [WalletPlugin](/docs/session-kit/plugin-wallet), if multiple are provided and it was not defined during the [Login](/docs/session-kit/login) call. -2. Prompt the user to select a blockchain, if multiple are provided and the selected [WalletPlugin](/docs/session-kit/plugin-wallet) has [requiresChainSelect](https://wharfkit.github.io/session/interfaces/WalletPluginConfig.html#requiresChainSelect) set to `true`. If the [WalletPlugin](/docs/session-kit/plugin-wallet) also has an array of `supportedChains` defined, the list of available chains must be filtered down to match this list. -3. Prompt the user to enter an account name manually, if the selected [WalletPlugin](/docs/session-kit/plugin-wallet) has [requiresPermissionEntry](https://wharfkit.github.io/session/interfaces/WalletPluginConfig.html#requiresPermissionEntry) set to `true`. -4. Prompt the user to select a permission associated to a [PublicKey](/docs/antelope/public-key), if the selected [WalletPlugin](/docs/session-kit/plugin-wallet) has [requiresPermissionSelect](https://wharfkit.github.io/session/interfaces/WalletPluginConfig.html#requiresPermissionSelect) set to `true`. +2. Prompt the user to select a blockchain, if multiple are provided and the selected [WalletPlugin](/docs/session-kit/plugin-wallet) has [requiresChainSelect](https://wharfkit.github.io/js/session/interfaces/WalletPluginConfig.html#requireschainselect) set to `true`. If the [WalletPlugin](/docs/session-kit/plugin-wallet) also has an array of `supportedChains` defined, the list of available chains must be filtered down to match this list. +3. Prompt the user to enter an account name manually, if the selected [WalletPlugin](/docs/session-kit/plugin-wallet) has [requiresPermissionEntry](https://wharfkit.github.io/js/session/interfaces/WalletPluginConfig.html#requirespermissionentry) set to `true`. +4. Prompt the user to select a permission associated to a [PublicKey](/docs/antelope/public-key), if the selected [WalletPlugin](/docs/session-kit/plugin-wallet) has [requiresPermissionSelect](https://wharfkit.github.io/js/session/interfaces/WalletPluginConfig.html#requirespermissionselect) set to `true`. The [SessionKit](/docs/session-kit/session-kit-factory) will await a response from the `UserInterface` conforming to the `UserInterfaceLoginResponse` pattern, or until an `Error` is thrown. diff --git a/src/lib/docs/SessionKit/WalletPlugin.md b/src/lib/docs/SessionKit/WalletPlugin.md index badcda6c..d2d68b39 100644 --- a/src/lib/docs/SessionKit/WalletPlugin.md +++ b/src/lib/docs/SessionKit/WalletPlugin.md @@ -126,7 +126,7 @@ In order for the `WalletPlugin` to authenticate users, it will need to implement **Note**: If during the [Login](/docs/session-kit/login) process the `WalletPlugin` needs to interact with the end user, the [UserInterface](/docs/session-kit/plugin-user-interface) instance provided on the LoginContext can be used to prompt the user. -The `WalletPlugin` will now need to communicate with the external application in order to formulate a response. The goal is for the `login` method to return an object that matches the [WalletPluginLoginResponse](https://wharfkit.github.io/session/interfaces/WalletPluginLoginResponse.html) interface that contains: +The `WalletPlugin` will now need to communicate with the external application in order to formulate a response. The goal is for the `login` method to return an object that matches the [WalletPluginLoginResponse](https://wharfkit.github.io/js/session/interfaces/WalletPluginLoginResponse.html) interface that contains: - `chain`: A typed [Checksum256](/docs/antelope/checksum) indicating the blockchain ID the user is logging in with. - `permissionLevel`: A typed [PermissionLevel](/docs/antelope/permission-level) indicating which account and permission the user has selected. @@ -172,7 +172,7 @@ One of the primary purposes of a `WalletPlugin` is to facilitate the signing of **Note**: If during the [Transact](/docs/session-kit/transact) process the `WalletPlugin` needs to interact with the end user, the [UserInterface](/docs/session-kit/plugin-user-interface) instance provided on the TransactContext can be used to prompt the user. -The `WalletPlugin` will then need to communicate with the external application, relaying the transaction, in order to retrieve a signature. This process should return an object that matches the [WalletPluginSignResponse](https://wharfkit.github.io/session/interfaces/WalletPluginSignResponse.html) interface that contains: +The `WalletPlugin` will then need to communicate with the external application, relaying the transaction, in order to retrieve a signature. This process should return an object that matches the [WalletPluginSignResponse](https://wharfkit.github.io/js/session/interfaces/WalletPluginSignResponse.html) interface that contains: - `signatures`: An array containing one or more [Signature](/docs/antelope/signature) typed objects with signatures authorizing the transaction. - `resolved`: An optional `ResolvedSigningRequest`, in the event that the transaction was modified by the wallet. diff --git a/src/lib/guides/SessionKit/getting-started-web-application.md b/src/lib/guides/SessionKit/getting-started-web-application.md index cf3d6fdb..ca29cd80 100644 --- a/src/lib/guides/SessionKit/getting-started-web-application.md +++ b/src/lib/guides/SessionKit/getting-started-web-application.md @@ -122,7 +122,7 @@ With the application now having access to an established `Session`, the applicat const result = await session.transact(data) ``` -This method, similar to `login()`, is an asynchronous call that triggers the `UserInterface` to start the flow for a user to sign the transaction. The `data` required for this call must be that of [TransactArgs](https://wharfkit.github.io/session/interfaces/TransactArgs.html). The simplest variant of this data is a single action, which the application can provide -- similar to the example below. +This method, similar to `login()`, is an asynchronous call that triggers the `UserInterface` to start the flow for a user to sign the transaction. The `data` required for this call must be that of [TransactArgs](https://wharfkit.github.io/js/session/interfaces/TransactArgs.html). The simplest variant of this data is a single action, which the application can provide -- similar to the example below. ```ts const data = { @@ -142,7 +142,7 @@ const result2 = await session.transact({ action: data }) This action is a call to the `transfer` action on the `eosio.token` contract. The `authorization` field is an array which is populated using the `session.permissionLevel` property to automatically template with. The `data` field on the action is the information required by the smart contract action, which is using the `session.actor` to specify the `from` field, and manually defining the rest of the required fields. -This `data` is passed into the `transact()` call as `{ action: data }` to indicate it is a single action being performed for this transaction. If successful, the response from this call is returned as a [TransactResult](https://wharfkit.github.io/session/interfaces/TransactResult.html). If the process fails, an `Error` will be thrown. +This `data` is passed into the `transact()` call as `{ action: data }` to indicate it is a single action being performed for this transaction. If successful, the response from this call is returned as a [TransactResult](https://wharfkit.github.io/js/session/interfaces/TransactResult.html). If the process fails, an `Error` will be thrown. ## Persisting a Session diff --git a/src/routes/blog/posts/14-sessionkit-user-interface-preview.md b/src/routes/blog/posts/14-sessionkit-user-interface-preview.md index a2023220..f718ef4d 100644 --- a/src/routes/blog/posts/14-sessionkit-user-interface-preview.md +++ b/src/routes/blog/posts/14-sessionkit-user-interface-preview.md @@ -111,7 +111,7 @@ Multiple different wallet plugins can be set up in similar ways, each optionally ### Setting up the SessionKit instance -Now with a [UserInterface](https://wharfkit.github.io/session/interfaces/UserInterface.html) and one [WalletPlugin](https://wharfkit.github.io/session/interfaces/WalletPlugin.html), the instance of the [SessionKit](https://wharfkit.github.io/session/classes/SessionKit.html) itself can be [constructed with those components](https://github.com/wharfkit/example-vite-svelte-ts/blob/3fb8c99eb19030698929edc855f651331ac94f04/src/lib/Login.svelte#L12-L53) being passed in as constructor arguments. +Now with a [UserInterface](https://wharfkit.github.io/js/session/interfaces/UserInterface.html) and one [WalletPlugin](https://wharfkit.github.io/js/session/interfaces/WalletPlugin.html), the instance of the [SessionKit](https://wharfkit.github.io/js/session/classes/SessionKit.html) itself can be [constructed with those components](https://github.com/wharfkit/example-vite-svelte-ts/blob/3fb8c99eb19030698929edc855f651331ac94f04/src/lib/Login.svelte#L12-L53) being passed in as constructor arguments. ```ts import { SessionKit } from "@wharfkit/session" @@ -132,7 +132,7 @@ const sessionKit = new SessionKit({ A few additional parameters are being passed in, including: - The `appName`, which represents an Antelope styled [Name](https://greymass.github.io/eosio-core/classes/Name.html) that will be presented to users within the Wharf User Interface and provide future connectivity with other systems. -- An array of `chains` that the application supports in the [ChainDefinition](https://wharfkit.github.io/session/classes/ChainDefinition.html) format, with each chain having a `id` for the Chain ID and a `url` specifying how to access one of its APIs. +- An array of `chains` that the application supports in the [ChainDefinition](https://wharfkit.github.io/js/session/classes/ChainDefinition.html) format, with each chain having a `id` for the Chain ID and a `url` specifying how to access one of its APIs. This results in a variable called `sessionKit` that can now be used to create, restore, or retrieve sessions for this application. @@ -144,9 +144,9 @@ With an instance of the Session Kit now available in the app, it can now provide const loginResult = await sessionKit.login() ``` -Once called, the Web Renderer will walk the user through selecting the decisions required to connect with the application. When complete this will return a [LoginResult](https://wharfkit.github.io/session/interfaces/LoginResult.html) that contains the resulting Session. +Once called, the Web Renderer will walk the user through selecting the decisions required to connect with the application. When complete this will return a [LoginResult](https://wharfkit.github.io/js/session/interfaces/LoginResult.html) that contains the resulting Session. -The `loginResult` will contain the [context](https://wharfkit.github.io/session/classes/LoginContext.html) that was used during the login, the [response](https://wharfkit.github.io/session/interfaces/WalletPluginLoginResponse.html) from the Wallet Plugin, and most importantly a [Session](https://wharfkit.github.io/session/classes/Session.html) that can be used to communicate with that user and their preferred wallet. +The `loginResult` will contain the [context](https://wharfkit.github.io/js/session/classes/LoginContext.html) that was used during the login, the [response](https://wharfkit.github.io/js/session/interfaces/WalletPluginLoginResponse.html) from the Wallet Plugin, and most importantly a [Session](https://wharfkit.github.io/js/session/classes/Session.html) that can be used to communicate with that user and their preferred wallet. The Session returned in `loginResult` should be made available to any part of the application that needs to be able to perform transactions or perform session management functions. Depending on which JS frameworks you are using, how and where you store this session may vary. The most basic example of storing the session could be represented as: diff --git a/src/routes/blog/posts/6-session-introduction.md b/src/routes/blog/posts/6-session-introduction.md index 6ccc7140..77496e02 100644 --- a/src/routes/blog/posts/6-session-introduction.md +++ b/src/routes/blog/posts/6-session-introduction.md @@ -76,11 +76,11 @@ const session = new Session({ }) ``` -The value returned by running this code is a new [Session](https://wharfkit.github.io/session/classes/Session.html) object which can now be persisted and used throughout an applications codebase. The session can be used to interact with the blockchain using its [transact](https://wharfkit.github.io/session/classes/Session.html#transact) method. +The value returned by running this code is a new [Session](https://wharfkit.github.io/js/session/classes/Session.html) object which can now be persisted and used throughout an applications codebase. The session can be used to interact with the blockchain using its [transact](https://wharfkit.github.io/js/session/classes/Session.html#transact) method. ### The `transact` method -The `transact` method's goal is to take a smart contract action or full transaction and execute it. This method requires a single argument compatible with the [TransactArgs](https://wharfkit.github.io/session/interfaces/TransactArgs.html) type, which contains information about the action(s) that should be performed. This information can be passed as a single action, an array of actions, a full transaction, or an [EOSIO Signing Request](https://github.com/greymass/eosio-signing-request/) payload. +The `transact` method's goal is to take a smart contract action or full transaction and execute it. This method requires a single argument compatible with the [TransactArgs](https://wharfkit.github.io/js/session/interfaces/TransactArgs.html) type, which contains information about the action(s) that should be performed. This information can be passed as a single action, an array of actions, a full transaction, or an [EOSIO Signing Request](https://github.com/greymass/eosio-signing-request/) payload. As of version 0.1.1 of the `@wharfkit/session` library, passing this parameter as a single action would be: @@ -111,7 +111,7 @@ In the above example, it defines a single action that executes the `transfer` ac This action is being passed into the `transact` method call on the `Session` object on the last line, which facilitates the creation of the signature and sending the transaction to the blockchain. -The `response` value returned by the call is a [TransactResponse](https://wharfkit.github.io/session/interfaces/TransactResult.html) which contains all the relevant information related to the transaction, including: +The `response` value returned by the call is a [TransactResponse](https://wharfkit.github.io/js/session/interfaces/TransactResult.html) which contains all the relevant information related to the transaction, including: - `chain`: The chain used during this transaction. - `request`: The raw EOSIO Signing Request that was used at the start of the call. @@ -127,7 +127,7 @@ If any errors occur during the `transact` call, an exception will be thrown cont Any developer experienced in application development on Antelope-based blockchains will be very well versed with the design paradigms of the Session Kit that have been discussed so far. To highlight the additional benefits that the Session Kit brings, we must now shift our focus to the Plugin architecture. -This feature helps differentiate the Session Kit from previous solutions by providing additional flexibility and customization. Plugins offer an opportunity for developers to hook into many of the predefined processes within the Session and extend its capabilities. The Session makes use of the [TransactPlugin](https://wharfkit.github.io/session/interfaces/TransactPlugin.html) type. A TransactPlugin can register custom logic at 4 different points in the `transact` flow, before and after the sign and broadcast phases. +This feature helps differentiate the Session Kit from previous solutions by providing additional flexibility and customization. Plugins offer an opportunity for developers to hook into many of the predefined processes within the Session and extend its capabilities. The Session makes use of the [TransactPlugin](https://wharfkit.github.io/js/session/interfaces/TransactPlugin.html) type. A TransactPlugin can register custom logic at 4 different points in the `transact` flow, before and after the sign and broadcast phases. In this example, the script is now going to utilize a Resource Provider plugin, one which analyzes a transaction to determine if the authorizing account requires network resources to perform it. The source code for this plugin can be found here: diff --git a/static/_redirects b/static/_redirects new file mode 100644 index 00000000..8aa4b65c --- /dev/null +++ b/static/_redirects @@ -0,0 +1 @@ +/docs/releases/4-0-0 /docs/releases/4-0-1 301