- Consolidated duplicate UndoManagers to single instance - Fixed connection promise to only resolve on 'connected' status - Fixed WebSocketProvider import (WebsocketProvider) - Added proper doc.destroy() cleanup - Renamed isPresenceInitialized property to avoid conflict Co-Authored-By: Paperclip <noreply@paperclip.ing>
31 lines
688 B
TypeScript
31 lines
688 B
TypeScript
import type { ErrorType } from '../../errors/utils.js'
|
|
import type { Kzg } from '../../types/kzg.js'
|
|
|
|
export type DefineKzgParameters = Kzg
|
|
export type DefineKzgReturnType = Kzg
|
|
export type DefineKzgErrorType = ErrorType
|
|
|
|
/**
|
|
* Defines a KZG interface.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* import * as cKzg from 'c-kzg'
|
|
* import { defineKzg } from 'viem'
|
|
* import { mainnetTrustedSetupPath } from 'viem/node'
|
|
*
|
|
* cKzg.loadTrustedSetup(mainnetTrustedSetupPath)
|
|
*
|
|
* const kzg = defineKzg(cKzg)
|
|
* ```
|
|
*/
|
|
export function defineKzg({
|
|
blobToKzgCommitment,
|
|
computeBlobKzgProof,
|
|
}: DefineKzgParameters): DefineKzgReturnType {
|
|
return {
|
|
blobToKzgCommitment,
|
|
computeBlobKzgProof,
|
|
}
|
|
}
|