Skip to content

Commit

Permalink
Merge pull request #255 from framesjs/fix/expose-new-types-utils
Browse files Browse the repository at this point in the history
fix: expose new types utils
  • Loading branch information
stephancill authored Mar 27, 2024
2 parents 5f9fcfb + 0b681fb commit f224a71
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-rivers-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

fix: expose core types and utils via frames.js/types and frames.js/utils
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { createFrames, types } from "frames.js/next";
import { createFrames } from "frames.js/next";
import { FramesMiddleware } from "frames.js/types";

const priceMiddleware: types.FramesMiddleware<
any,
{ ethPrice?: number }
> = async (ctx, next) => {
type PriceContext = { ethPrice?: number };

const priceMiddleware: FramesMiddleware<any, PriceContext> = async (
ctx,
next
) => {
try {
const res = await fetch(
"https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"
Expand Down
22 changes: 21 additions & 1 deletion packages/frames.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,26 @@
"default": "./dist/core/index.cjs"
}
},
"./types": {
"import": {
"types": "./dist/core/types.d.ts",
"default": "./dist/core/types.js"
},
"require": {
"types": "./dist/core/types.d.cts",
"default": "./dist/core/types.cjs"
}
},
"./utils": {
"import": {
"types": "./dist/core/utils.d.ts",
"default": "./dist/core/utils.js"
},
"require": {
"types": "./dist/core/utils.d.cts",
"default": "./dist/core/utils.cjs"
}
},
"./middleware": {
"import": {
"types": "./dist/middleware/index.d.ts",
Expand Down Expand Up @@ -246,4 +266,4 @@
"protobufjs": "^7.2.6",
"viem": "^2.7.8"
}
}
}

0 comments on commit f224a71

Please sign in to comment.