MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / getMinimalOptions

Function getMinimalOptions

app/core/RPCMethods/RPCMethodMiddleware.test.ts:112–139  ·  view source on GitHub ↗

* Return a minimal set of options for `getRpcMethodMiddleware`. These options * are complete enough to test at least some method handlers, and they are type- * compatible. They don't represent a realistic scenario. * * @returns A minimal set of options for `getRpcMethodMiddleware`

()

Source from the content-addressed store, hash-verified

110 * @returns A minimal set of options for `getRpcMethodMiddleware`
111 */
112function getMinimalOptions() {
113 return {
114 hostname: '',
115 getProviderState: jest.fn(),
116 navigation: jest.fn(),
117 url: { current: '' },
118 title: { current: '' },
119 icon: { current: undefined },
120 // Bookmarks
121 isHomepage: jest.fn(),
122 // Show autocomplete
123 fromHomepage: { current: false },
124 toggleUrlModal: jest.fn(),
125 // Wizard
126 wizardScrollAdjusted: { current: false },
127 // For the browser
128 tabId: '' as const,
129 // For WalletConnect
130 isWalletConnect: false,
131 // For MM SDK
132 isMMSDK: false,
133 getApprovedHosts: jest.fn(),
134 setApprovedHosts: jest.fn(),
135 approveHost: jest.fn(),
136 injectHomePageScripts: jest.fn(),
137 analytics: {},
138 };
139}
140
141/**
142 * Return a minimal set of options for `getRpcMethodMiddleware` when used in a

Callers 5

getMinimalBrowserOptionsFunction · 0.85
getMinimalSDKOptionsFunction · 0.85
setupSignatureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected