Skip to content

Commit

Permalink
feat: update mm and others (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Sep 7, 2023
1 parent 032f8ba commit 06dd585
Show file tree
Hide file tree
Showing 12 changed files with 2,116 additions and 1,828 deletions.
28 changes: 14 additions & 14 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@
"keywords": [],
"license": "MIT",
"dependencies": {
"@acab/reset.css": "^0.5.3",
"@preact/signals": "^1.1.5",
"@acab/reset.css": "^0.7.0",
"@preact/signals": "^1.2.1",
"clsx": "^2.0.0",
"dns-over-http-resolver": "^2.1.1",
"dns-over-http-resolver": "^2.1.2",
"filsnap-adapter": "workspace:^",
"filsnap-adapter-react": "workspace:^",
"iso-base": "^1.1.2",
"iso-filecoin": "^2.0.2",
"metamask-testing-tools": "^1.1.4",
"preact": "^10.16.0",
"react-hook-form": "^7.45.2",
"viem": "^1.4.2",
"wagmi": "^1.3.9",
"iso-base": "^2.0.1",
"iso-filecoin": "^3.0.0",
"metamask-testing-tools": "^1.1.5",
"preact": "^10.17.1",
"react-hook-form": "^7.46.1",
"viem": "^1.10.4",
"wagmi": "^1.4.1",
"water.css": "^2.1.1"
},
"devDependencies": {
"@babel/core": "^7.22.9",
"@playwright/test": "^1.37.0",
"@babel/core": "^7.22.15",
"@playwright/test": "^1.37.1",
"@preact/preset-vite": "^2.5.0",
"@types/node": "^20.4.5",
"@types/node": "^20.5.9",
"tiny-git-rev-sync": "^0.1.0",
"vite": "^4.4.7"
"vite": "^4.4.9"
},
"eslintConfig": {
"extends": [
Expand Down
16 changes: 8 additions & 8 deletions examples/fil-forwarder-viem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
"license": "MIT",
"dependencies": {
"filsnap-adapter": "workspace:^",
"iso-base": "^1.1.2",
"iso-filecoin": "^2.0.2",
"prettier": "3.0.0",
"viem": "^1.4.2"
"iso-base": "^2.0.1",
"iso-filecoin": "^3.0.0",
"prettier": "3.0.3",
"viem": "^1.10.4"
},
"devDependencies": {
"@babel/core": "^7.22.9",
"@playwright/test": "^1.37.0",
"@babel/core": "^7.22.15",
"@playwright/test": "^1.37.1",
"@preact/preset-vite": "^2.5.0",
"@types/node": "^20.4.5",
"vite": "^4.4.7"
"@types/node": "^20.5.9",
"vite": "^4.4.9"
},
"eslintConfig": {
"extends": [
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
"docs": "typedoc --out docs --plugin typedoc-plugin-missing-exports --plugin typedoc-plugin-zod"
},
"devDependencies": {
"depcheck": "^1.4.3",
"hd-scripts": "^7.0.0",
"lint-staged": "^13.2.3",
"prettier": "3.0.0",
"depcheck": "^1.4.5",
"hd-scripts": "^8.0.0",
"lint-staged": "^14.0.1",
"prettier": "3.0.3",
"simple-git-hooks": "^2.9.0",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.1",
"typedoc-plugin-zod": "^1.0.2",
"typescript": "5.1.6",
"wireit": "^0.10.0"
"typedoc": "^0.25.1",
"typedoc-plugin-missing-exports": "^2.1.0",
"typedoc-plugin-zod": "^1.1.0",
"typescript": "5.2.2",
"wireit": "^0.13.0"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
Expand Down
8 changes: 4 additions & 4 deletions packages/adapter-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
"devDependencies": {
"@testing-library/react-hooks": "^8.0.1",
"@types/mocha": "^10.0.1",
"@types/node": "^20.4.5",
"@types/node": "^20.5.9",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"assert": "^2.0.0",
"mocha": "^10.2.0",
"playwright-test": "^12.1.1",
"preact": "^10.16.0",
"playwright-test": "^12.3.0",
"preact": "^10.17.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"typescript": "5.1.6"
"typescript": "5.2.2"
},
"peerDependencies": {
"react": "^16.8.0 || ^17 || ^18"
Expand Down
8 changes: 4 additions & 4 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
"filsnap": "workspace:^"
},
"devDependencies": {
"@playwright/test": "^1.37.0",
"@types/node": "^20.4.5",
"metamask-testing-tools": "^1.1.4",
"typescript": "5.1.6"
"@playwright/test": "^1.37.1",
"@types/node": "^20.5.9",
"metamask-testing-tools": "^1.1.5",
"typescript": "5.2.2"
},
"publishConfig": {
"provenance": true
Expand Down
38 changes: 19 additions & 19 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,39 +62,39 @@
},
"dependencies": {
"@metamask/key-tree": "^9.0.0",
"@metamask/snaps-ui": "^0.32.2",
"iso-base": "^1.1.2",
"iso-filecoin": "^2.1.0",
"@metamask/snaps-ui": "^1.0.2",
"iso-base": "^2.0.1",
"iso-filecoin": "^3.0.0",
"merge-options": "^3.0.4",
"viem": "^1.4.2",
"zod": "^3.21.4"
"viem": "^1.10.4",
"zod": "^3.22.2"
},
"devDependencies": {
"@metamask/snaps-cli": "^0.32.2",
"@metamask/snaps-rollup-plugin": "^0.32.2",
"@metamask/snaps-types": "^0.32.2",
"@playwright/test": "^1.37.0",
"@rollup/plugin-commonjs": "^25.0.3",
"@rollup/plugin-node-resolve": "^15.1.0",
"@metamask/snaps-cli": "^1.0.2",
"@metamask/snaps-rollup-plugin": "^1.0.2",
"@metamask/snaps-types": "^1.0.2",
"@playwright/test": "^1.37.1",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-sucrase": "^5.0.1",
"@rollup/plugin-terser": "^0.4.3",
"@types/chai": "^4.3.5",
"@types/chai-as-promised": "^7.1.5",
"@types/chai": "^4.3.6",
"@types/chai-as-promised": "^7.1.6",
"@types/chai-subset": "^1.3.3",
"@types/mocha": "^10.0.1",
"@types/sinon": "^10.0.15",
"@types/sinon": "^10.0.16",
"@types/sinon-chai": "^3.2.9",
"chai": "^4.3.7",
"chai": "^4.3.8",
"chai-as-promised": "^7.1.1",
"chai-parentheses": "^0.0.2",
"chai-subset": "^1.6.0",
"metamask-testing-tools": "^1.1.4",
"metamask-testing-tools": "^1.1.5",
"mocha": "^10.2.0",
"playwright-test": "^12.1.1",
"rollup": "^3.27.0",
"playwright-test": "^12.3.0",
"rollup": "^3.29.0",
"sinon": "^15.2.0",
"sinon-chai": "^3.7.0",
"typescript": "5.1.6"
"typescript": "5.2.2"
},
"publishConfig": {
"provenance": true
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/filecoin-project/filsnap.git"
},
"source": {
"shasum": "Wu+W3SNWIUaV5EBIUv6IEDyYl0rxD8iXsdpPo2BqAVs=",
"shasum": "GXC5VmE+TTVTGTrdmpgF4IOYqRDqNOjUec5htMvfVUI=",
"location": {
"npm": {
"filePath": "dist/snap.js",
Expand Down
7 changes: 4 additions & 3 deletions packages/snap/src/rpc/gas-for-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ export async function getGasForMessage(
value: message.value,
}

const { error, result } = await rpc.gasEstimate(
const { error, result } = await rpc.gasEstimate({
msg,
maxFee == null ? DEFAULT_MAX_FEE : maxFee
)
maxFee: maxFee == null ? DEFAULT_MAX_FEE : maxFee,
})

if (error != null) {
return serializeError(`RPC call to "GasEstimateMessageGas" failed`, error)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/snap/src/rpc/get-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ export async function getAccountInfo(
ctx: SnapContext
): Promise<GetAccountInfoResponse> {
const balance = await ctx.rpc.balance(ctx.account.address.toString())

if (balance.error != null) {
return serializeError('RPC call to "WalletBalance" failed', balance.error)
}

return {
error: null,
result: {
Expand Down
9 changes: 6 additions & 3 deletions packages/snap/src/rpc/send-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ export async function sendMessage(
ctx: SnapContext,
params: SignedMessage
): Promise<SendMessageResponse> {
const response = await ctx.rpc.pushMessage(params.message, {
type: params.signature.type,
data: base64pad.decode(params.signature.data),
const response = await ctx.rpc.pushMessage({
msg: params.message,
signature: {
type: params.signature.type,
data: base64pad.decode(params.signature.data),
},
})

if (response.error != null) {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/test/e2e/gas-estimate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test.describe('fil_getGasForMessage', () => {
const estimate = await metamask.invokeSnap<GasForMessageResponse>({
request: {
method: 'fil_getGasForMessage',
// @ts-expect-error - Invalid params
// @ts-expect-error - invalid params
params: { message },
} satisfies GasForMessageRequest,
page,
Expand Down

0 comments on commit 06dd585

Please sign in to comment.