chore: add bare-react-native flow example - #72
Conversation
|
Deployment failed for project sidebar-example with the following error: |
|
Deployment failed for project blindpay with the following error: |
|
Deployment failed for project lifi with the following error: |
|
Deployment failed for project dynamic-morpho with the following error: |
|
Deployment failed for project dynamic-gasless-starter with the following error: |
|
Deployment failed for project dynamic-aave with the following error: |
|
Deployment failed for project circle-gateway with the following error: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
297fd3a to
83d4437
Compare
The committed pnpm-lock.yaml resolved every @dynamic-labs* package against the internal fbinfra555artifactory.jfrog.io proxy, which is unreachable outside Fireblocks' network. A public clone running `pnpm install --frozen-lockfile` in this example would fail. Rewrote all 191 tarball resolution URLs to the equivalent public registry.npmjs.org path for the same package/version. Verified byte-for-byte equivalence by installing once via the internal proxy to populate the local pnpm store, then re-running `pnpm install --frozen-lockfile --offline` against the rewritten lockfile -- it resolved entirely from the local content-addressed store with zero network calls, confirming the integrity hashes match. No package.json changes.
83d4437 to
69896dd
Compare
emtesenair
left a comment
There was a problem hiding this comment.
Tried running this locally (iOS). Install, typecheck, lint and pod install all worked; I couldn't complete a native build for reasons local to my machine, so the notes below come from reading the code plus building a production JS bundle from this branch.
One blocking issue, plus two smaller ones inline.
| destinationAddress, | ||
| }: CreateDepositFlowParams) => { | ||
| const res = await fetch( | ||
| `${config.dynamic.apiBaseUrl}/server/${config.dynamic.environmentId}/flow/deposit`, |
There was a problem hiding this comment.
Blocking (same at createWithdrawFlow.ts:24)
config.dynamic.apiBaseUrl is process.env.DYNAMIC_API_BASE_URL || undefined (config.ts:25), and both .env.example and the README document that var as optional/blank. With the .env the README tells you to write, this interpolates to "undefined/server/<envId>/flow/deposit" and fetch throws TypeError: Failed to parse URL.
Confirmed in a production bundle built from this branch — the emitted config contains apiBaseUrl: void 0, while environmentId inlines correctly. So deposit and withdraw both fail at the first step for anyone following the setup instructions.
dynamicClient.ts already handles this correctly by spreading coreConfig conditionally so the SDK applies its own default — but these two hand-rolled REST calls have no such fallback. Suggest an always-defined value for them, e.g. flowApiBaseUrl: process.env.DYNAMIC_API_BASE_URL || 'https://app.dynamicauth.com/api/v0' (the SDK's own DEFAULT_API_BASE_URL), or make the var required with a startup throw like the ones already guarding environmentId/apiKey.
| }), | ||
| }, | ||
| ); | ||
| const { flow } = (await res.json()) as { flow: { id: string } }; |
There was a problem hiding this comment.
(same at createWithdrawFlow.ts:59)
No res.ok check before const { flow } = await res.json(). On any non-2xx — an API key without flow.write, a rejected amount — the body has no flow field, so this surfaces as Cannot read property 'id' of undefined and hides the real error. Worth a status check that includes the response body in the thrown message.
| FBLazyVector: 941bef1c8eeabd9fe1f501e30a5220beee913886 | ||
| fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd | ||
| glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 | ||
| hermes-engine: 228692ee4d4390de83b99d1756f67b1502d9fbc6 |
There was a problem hiding this comment.
Running the README's bundle exec pod install immediately changes this hermes-engine checksum (228692ee… → 955a0383…), leaving a dirty tree on first install. The Podfile forces RCT_BUILD_HERMES_FROM_SOURCE ||= 'true' for everyone, and source vs prebuilt yields different podspec checksums, so the committed lock looks like it was generated without that setting active. Worth regenerating it with the Podfile as committed.
Adds bare-react-native example with flow