Skip to content

KeyringPairProvider

The KeyringPairProvider is the simple wrapper on-top of a KeyringPair instance, it's easily to start with.

Usage

import { KeyringPairProvider } from '@phala/sdk'
 
const provider = await KeyringPairProvider.createFromSURI(client.api, '//Alice')

create

Get a provider instance from a KeyringPair instance.

Usage

import { Keyring } from '@polkadot/api'
import { KeyringPairProvider } from '@phala/sdk'
 
const keyring = new Keyring({ type: 'sr25519' })
const alice = keyring.addFromUri('//Alice')
const provider = KeyringPairProvider.create(client.api, alice) 

Parameters

api

ApiPromise

pair

KeyringPair

createFromSURI

Get a provider instance from a suri string. suri is the Substrate Uri, it's a string that contains the mnemonic and derivation path.

Usage

import { KeyringPairProvider } from '@phala/sdk'
 
const provider = await KeyringPairProvider.createFromSURI(client.api, '//Alice') 

Parameters

api

ApiPromise

suri

string

Please check out the Substrate Uri for more details.

options (optional)

KeyringPairCreate

The create options for the Keyring instance, it's a plain object with the following properties:

  • type: KeypairType
  • meta: KeyringPair$Meta
  • ss58Format: number

You can learn more about Keyring from the polkadot-js documentation.