Skip to content

Commit

Permalink
Fix in memory contract meta store for vanilla API (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferossgp authored Oct 23, 2024
1 parent 110031b commit b1afc80
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-tips-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@3loop/transaction-decoder': patch
---

Fix in-memory meta store was missing access to PubliClient for RPC requests
2 changes: 2 additions & 0 deletions packages/transaction-decoder/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Transaction Decoder

## Getting Started

To get started, install the package from npm, along with its peer dependencies:

```
$ npm i @3loop/transaction-decoder
```
Expand Down
6 changes: 3 additions & 3 deletions packages/transaction-decoder/src/vanilla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface TransactionDecoderOptions {
abiStore: VanillaAbiStore | Layer.Layer<EffectAbiStore<AbiParams, ContractAbiResult>>
contractMetaStore:
| VanillaContractMetaStore
| Layer.Layer<EffectContractMetaStore<ContractMetaParams, ContractMetaResult>>
| Layer.Layer<EffectContractMetaStore<ContractMetaParams, ContractMetaResult>, never, PublicClient>
logLevel?: LogLevel.Literal
}

Expand Down Expand Up @@ -76,7 +76,7 @@ export class TransactionDecoder {
)
}

let MetaStoreLive: Layer.Layer<EffectContractMetaStore<ContractMetaParams, ContractMetaResult>>
let MetaStoreLive: Layer.Layer<EffectContractMetaStore<ContractMetaParams, ContractMetaResult>, never, PublicClient>

if (Layer.isLayer(contractMetaStore)) {
MetaStoreLive = contractMetaStore as Layer.Layer<EffectContractMetaStore<ContractMetaParams, ContractMetaResult>>
Expand All @@ -93,7 +93,7 @@ export class TransactionDecoder {
}

const LoadersLayer = Layer.provideMerge(AbiStoreLive, MetaStoreLive)
const MainLayer = Layer.provideMerge(Layer.succeed(PublicClient, PublicClientLive), LoadersLayer).pipe(
const MainLayer = LoadersLayer.pipe(Layer.provideMerge(Layer.succeed(PublicClient, PublicClientLive))).pipe(
Layer.provide(Logger.minimumLogLevel(LogLevel.fromLiteral(logLevel))),
)

Expand Down

0 comments on commit b1afc80

Please sign in to comment.