Porto.create
Creates a new Porto instance.
Imports
Named
import { Porto } from 'porto'
Examples
The simplest way to create a new Porto instance is to call the Porto.create()
function.
This will automatically inject Porto's provider into your Application via EIP-6963.
import { Porto } from 'porto'
Porto.create()
Accessing the Provider
You can access Porto's EIP-1193 Provider directly via the provider
instance.
import { Porto } from 'porto'
const porto = Porto.create()
const accounts = await porto.provider.request({
method: 'wallet_connect',
})
Implementations
TODO
Storage
TODO
Custom Chains
TODO
Parameters
announceProvider
- Type:
boolean
- Default:
true
Whether to announce the provider via EIP-6963.
chains
- Type:
readonly [Chains.Chain, ...Chains.Chain[]]
- Default:
[Chains.odysseyTestnet]
List of supported chains.
implementation
- Type:
Implementation.Implementation
- Default:
Implementation.dialog()
Implementation to use.
Available:
Implementation.dialog()
: Requests & signing is handled via an iframe or popup dialog.Implementation.local()
: Requests & signing is handled locally.
storage
- Type:
Storage.Storage
- Default:
Storage.idb()
Storage to use.
Available:
Storage.idb()
: Uses IndexedDBStorage.memory()
: Uses In-memory storeStorage.localStorage()
: Useswindow.localStorage
Storage.cookie()
: Usesdocument.cookie
transports
- Type:
{ [chainId: string]: Transport | { default: Transport; relay?: Transport | undefined } }
- Default:
{}
Transport to use for each chain.
Return Type
Porto
The Porto instance.