Skip to content

Commit

Permalink
feat!: add reconnect, disconnect and changeChain, add better getProvi…
Browse files Browse the repository at this point in the history
…der and new connector to manage provider
  • Loading branch information
hugomrdias committed Sep 3, 2024
1 parent 443465b commit 94f8792
Show file tree
Hide file tree
Showing 6 changed files with 738 additions and 224 deletions.
14 changes: 8 additions & 6 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@
}
},
"dependencies": {
"@metamask/approval-controller": "^7.0.0",
"@metamask/approval-controller": "^7.0.2",
"@metamask/snaps-sdk": "^6.3.0",
"filsnap": "workspace:^",
"iso-filecoin": "^4.1.0"
"iso-filecoin": "^4.1.0",
"viem": "^2.20.1"
},
"devDependencies": {
"@playwright/test": "^1.45.1",
"@types/node": "^20.14.9",
"metamask-testing-tools": "^1.2.6",
"typescript": "5.5.3"
"@playwright/test": "^1.46.1",
"@types/node": "^22.5.2",
"metamask-testing-tools": "^2.0.0",
"typescript": "5.5.4"
},
"publishConfig": {
"provenance": true
Expand Down
27 changes: 27 additions & 0 deletions packages/adapter/src/chains.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const metamask = {
mainnet: {
chainId: '0x13a',
chainName: 'Filecoin',
rpcUrls: ['https://api.node.glif.io/rpc/v1'],
blockExplorerUrls: ['https://filfox.info', 'https://explorer.glif.io/'],
nativeCurrency: {
name: 'Filecoin',
symbol: 'FIL',
decimals: 18,
},
iconUrls: ['https://filsnap.dev/filecoin-logo.svg'],
},

testnet: {
chainId: '0x4cb2f',
chainName: 'Filecoin Calibration',
rpcUrls: ['https://api.calibration.node.glif.io/rpc/v1'],
blockExplorerUrls: ['https://filfox.info', 'https://explorer.glif.io/'],
nativeCurrency: {
name: 'Filecoin',
symbol: 'tFIL',
decimals: 18,
},
iconUrls: ['https://filsnap.dev/filecoin-logo.svg'],
},
}
9 changes: 4 additions & 5 deletions packages/adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export { FilsnapAdapter } from './snap'

export { filForwarderMetadata } from 'filsnap/filforwarder'
export type { SnapConfig, AccountInfo } from 'filsnap'
export type * from './types'

export { getRequestProvider } from './utils'
export type { Provider } from './utils'
export { FilsnapAdapter } from './snap'
export { filForwarderMetadata } from 'filsnap/filforwarder'
export * from './utils'
Loading

0 comments on commit 94f8792

Please sign in to comment.