@farcaster/miniapp-sdk 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import * as Provider from 'ox/Provider';
2
- export declare const ethereumProvider: Provider.Provider;
2
+ export declare const ethereumProvider: ReturnType<typeof Provider.from>;
3
3
  export declare function getEthereumProvider(): Promise<Provider.Provider | undefined>;
@@ -20,10 +20,9 @@ function toProviderRpcError({ code, details, }) {
20
20
  return new Provider.ProviderRpcError(code, details ?? 'Unknown provider RPC error');
21
21
  }
22
22
  }
23
- export const ethereumProvider = Provider.from({
23
+ const providerConfig = {
24
24
  ...emitter,
25
25
  async request(args) {
26
- // @ts-expect-error
27
26
  const request = store.prepare(args);
28
27
  try {
29
28
  const response = await miniAppHost
@@ -49,7 +48,8 @@ export const ethereumProvider = Provider.from({
49
48
  });
50
49
  }
51
50
  },
52
- });
51
+ };
52
+ export const ethereumProvider = Provider.from(providerConfig);
53
53
  export async function getEthereumProvider() {
54
54
  try {
55
55
  const capabilities = await miniAppHost.getCapabilities();