Skip to content

Commit d9a138a

Browse files
committed
[MNY-236] Portal: Update BridgeWidget script docs to reflect new typescript type (#8200)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on making the `buy` properties optional in the configuration for the "Buy" tab UI, enhancing flexibility by allowing users to omit certain parameters. It also updates the documentation to reflect these changes. ### Detailed summary - Changed `buy` properties (`amount`, `chainId`) from required to optional in type definitions. - Updated documentation to remove "Required" tags for `amount` and `chainId`. - Clarified descriptions for `amount`, `chainId`, and `tokenAddress` in the documentation. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Buy configuration is now optional in the bridge widget; amount and chain selection can be omitted and will use defaults. * Removed forced preset buy values, enabling more flexible initialization. * **Documentation** * Updated docs to reflect optional Buy fields and default behaviors. * Revised examples and type descriptions to indicate optional amount and chain settings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 777aed1 commit d9a138a

File tree

1 file changed

+9
-13
lines changed
  • apps/portal/src/app/bridge/bridge-widget-script

1 file changed

+9
-13
lines changed

apps/portal/src/app/bridge/bridge-widget-script/page.mdx

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ The BridgeWidget Script makes it easy to embed cross-chain swaps and fiat onramp
5353
BridgeWidget.render(container, {
5454
clientId: "your-thirdweb-client-id",
5555
theme: "dark",
56-
buy: {
57-
chainId: 8453,
58-
amount: "0.1",
59-
},
6056
});
6157
</script>
6258
```
@@ -126,9 +122,9 @@ type Options = {
126122
};
127123
};
128124
};
129-
buy: {
130-
amount: string;
131-
chainId: number;
125+
buy?: {
126+
amount?: string;
127+
chainId?: number;
132128
tokenAddress?: string;
133129
buttonLabel?: string;
134130
onCancel?: (quote: BuyOrOnrampPrepareResult | undefined) => void;
@@ -310,8 +306,8 @@ The options to configure the "Buy" tab UI.
310306

311307
```ts
312308
type Buy = {
313-
amount: string; // Required
314-
chainId: number; // Required
309+
amount?: string;
310+
chainId?: number;
315311
tokenAddress?: string;
316312
buttonLabel?: string;
317313
onCancel?: (quote: BuyOrOnrampPrepareResult | undefined) => void;
@@ -327,21 +323,21 @@ type Buy = {
327323
```
328324
329325
330-
<Details summary="amount" tags={["Required"]}>
326+
<Details summary="amount">
331327
332328
Set the default token amount shown in the "Buy" tab.
333329
334330
</Details>
335331
336-
<Details summary="chainId" tags={["Required"]}>
332+
<Details summary="chainId">
337333
338-
Specify which chain should be selected in the "Buy" tab.
334+
Specify the default chain to be selected in the "Buy" tab.
339335
340336
</Details>
341337
342338
<Details summary="tokenAddress">
343339
344-
Specify which token should be selected in the "Buy" tab. If not specified, the native token of the selected chain will be selected.
340+
Specify the default token to be selected in the "Buy" tab. If not specified, the native token of the selected chain will be selected.
345341
346342
</Details>
347343

0 commit comments

Comments
 (0)