Skip to content

Commit

Permalink
Fixed config args/options in README
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Aug 22, 2023
1 parent 4333e5a commit 3c9e2d1
Showing 1 changed file with 34 additions and 19 deletions.
53 changes: 34 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,54 @@ Include when configuring the Session Kit:
```ts
import {TransactPluginResourceProvider} from '@wharfkit/transact-plugin-resource-provider'

const kit = new SessionKit({
// ... your other options
transactPlugins: [new TransactPluginResourceProvider()],
})
const kit = new SessionKit(
{
// ... your session kit args
},
{
// ... your other options
transactPlugins: [new TransactPluginResourceProvider()],
}
)
```

Or when you are manually configuring a Session:

```ts
import {TransactPluginResourceProvider} from '@wharfkit/transact-plugin-resource-provider'

const session = new Session({
// ... your other options
transactPlugins: [new TransactPluginResourceProvider()],
})
const session = new Session(
{
// ... your session kit args
},
{
// ... your other options
transactPlugins: [new TransactPluginResourceProvider()],
}
)
```

The plugin is also capable of utilizing any API that conforms to the [Resource Provider API specification](https://forums.eoscommunity.org/t/initial-specification-for-the-resource-provider-api-endpoint/1546). To change the default endpoints, specify them in the constructor as a key/value pair using the chainId and URL.

```ts
import {TransactPluginResourceProvider} from '@wharfkit/transact-plugin-resource-provider'

const session = new Session({
// ... your other options
transactPlugins: [
new TransactPluginResourceProvider({
endpoints: {
'73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d':
'https://jungle4.greymass.com',
},
}),
],
})
const session = new Session(
{
// ... your session kit args
},
{
// ... your other session kit options
transactPlugins: [
new TransactPluginResourceProvider({
endpoints: {
'73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d':
'https://jungle4.greymass.com',
},
}),
],
}
)
```

The full list of options that can be passed in during instantiation are defined in the `ResourceProviderOptions`:
Expand Down

0 comments on commit 3c9e2d1

Please sign in to comment.