import { TxEnvelopeEip8141 } from 'ox' import { expectTypeOf, test } from 'vp/test' test('default', () => { const envelope = TxEnvelopeEip8141.from({ chainId: 1, frames: [{ gas: 50000n }], sender: '0x1111111111111111111111111111111111111111', }) expectTypeOf(envelope).toEqualTypeOf<{ readonly chainId: 1 readonly frames: readonly [{ readonly gas: 50000n }] readonly sender: '0x1111111111111111111111111111111111111111' readonly type: 'eip8141' }>() expectTypeOf(envelope).toMatchTypeOf() expectTypeOf( TxEnvelopeEip8141.serialize(envelope), ).toEqualTypeOf() }) test('serialized', () => { const envelope = TxEnvelopeEip8141.from( '0x06' as TxEnvelopeEip8141.Serialized, ) expectTypeOf(envelope).toEqualTypeOf() }) test('unsigned signature', () => { const envelope = TxEnvelopeEip8141.from({ chainId: 1n, frames: [{}], sender: '0x1111111111111111111111111111111111111111', signatures: [{ scheme: 'secp256k1' }], }) expectTypeOf(envelope).toEqualTypeOf<{ readonly chainId: 1n readonly frames: readonly [{}] readonly sender: '0x1111111111111111111111111111111111111111' readonly signatures: readonly [{ readonly scheme: 'secp256k1' }] readonly type: 'eip8141' }>() expectTypeOf(envelope).toMatchTypeOf() })