Skip to main content

Create SDK Plugin

Assemble plugin dependencies + config into one instance.

import { createTenebraePlugin } from '@kohaku-eth/tenebrae';
import { MemoryStorage } from '@kohaku-eth/plugins';
import { createAesGcmSecureStorageCryptoBrowser } from '@tenebra/shared/utils/crypto/create-aes-gcm-secure-storage-crypto-browser.utils';

const TENEBRAE_SDK_STORAGE = new MemoryStorage();
const TENEBRAE_SDK_STORAGE_CRYPTO = createAesGcmSecureStorageCryptoBrowser(wrappingKey32Bytes);

const plugin = await createTenebraePlugin(
{
storage: TENEBRAE_SDK_STORAGE,
// Host subset — wallet shell also supplies network + keystore.
// provider: Host['provider'] & Pick<TxSigner, 'sendTransaction'>
provider,
},
config,
{ storageCrypto: TENEBRAE_SDK_STORAGE_CRYPTO }
);

After create, continue on Methods.


Next