-
Notifications
You must be signed in to change notification settings - Fork 538
Version Packages #7079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version Packages #7079
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
destinationAmount: 10000000000000000n, | ||
blockNumber: 22026509n, | ||
timestamp: 1741730936680, | ||
estimatedExecutionTimeMs: 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a missing comma after estimatedExecutionTimeMs: 1000
in the example code. This would cause a syntax error if someone copies this code directly. The correct syntax should be:
estimatedExecutionTimeMs: 1000,
This correction should be applied to both instances of this property in the example code to ensure it's valid JavaScript/TypeScript.
estimatedExecutionTimeMs: 1000 | |
estimatedExecutionTimeMs: 1000, |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7079 +/- ##
==========================================
- Coverage 55.59% 55.59% -0.01%
==========================================
Files 901 901
Lines 58123 58121 -2
Branches 4064 4064
==========================================
- Hits 32315 32313 -2
Misses 25703 25703
Partials 105 105
🚀 New features to boost your workflow:
|
size-limit report 📦
|
764d4c6
to
19d91f4
Compare
19d91f4
to
1e0571d
Compare
WalkthroughThis update removes documentation and code references for the Bridge.Transfer and Bridge.Onramp modules and their APIs, as well as the patch for faster Changes
Poem
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
💤 Files with no reviewable changes (4)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🪛 Gitleaks (8.26.0)packages/thirdweb/CHANGELOG.md123-123: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) 147-147: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) ⏰ Context from checks skipped due to timeout of 90000ms (8)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
packages/wagmi-adapter/package.json (1)
35-39
: 🛠️ Refactor suggestionUpdate peerDependency for
thirdweb
to match the new release.
The adapter’speerDependencies
still require"thirdweb": "^5.85.0"
, but the main SDK is now at5.100.0
. To ensure compatibility, bump this version range.Proposed diff:
--- a/packages/wagmi-adapter/package.json +++ b/packages/wagmi-adapter/package.json @@ peerDependencies - "thirdweb": "^5.85.0", + "thirdweb": "^5.100.0",
♻️ Duplicate comments (2)
packages/thirdweb/CHANGELOG.md (2)
30-30
: Missing comma afterestimatedExecutionTimeMs: 1000
will cause syntax errors.There appears to be a missing comma after
estimatedExecutionTimeMs: 1000
in the example code. This would cause a syntax error if someone copies this code directly.- estimatedExecutionTimeMs: 1000 + estimatedExecutionTimeMs: 1000,
53-53
:⚠️ Potential issueMissing comma in example code.
Similar to the previous issue, there's a missing comma after
estimatedExecutionTimeMs: 1000
in this line of the example response object.- estimatedExecutionTimeMs: 1000 + estimatedExecutionTimeMs: 1000,
🧹 Nitpick comments (1)
packages/wagmi-adapter/CHANGELOG.md (1)
3-4
: Enhance changelog with summary details: The new0.2.80
header is empty. Please include a brief description of the changes or fixes introduced in this version for better release traceability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (7)
.changeset/open-readers-do.md
(0 hunks).changeset/stale-yaks-bathe.md
(0 hunks).changeset/tidy-seas-sing.md
(0 hunks)packages/thirdweb/CHANGELOG.md
(1 hunks)packages/thirdweb/package.json
(1 hunks)packages/wagmi-adapter/CHANGELOG.md
(1 hunks)packages/wagmi-adapter/package.json
(1 hunks)
💤 Files with no reviewable changes (3)
- .changeset/open-readers-do.md
- .changeset/tidy-seas-sing.md
- .changeset/stale-yaks-bathe.md
🧰 Additional context used
🪛 Gitleaks (8.26.0)
packages/thirdweb/CHANGELOG.md
123-123: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
147-147: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: Size
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/wagmi-adapter/package.json (2)
2-3
: Discrepancy with AI-generated summary.
The summary mentions removal of Bridge.Transfer and Bridge.Onramp docs and a performance patch, but this file only contains a version bump for the wagmi-adapter.Likely an incorrect or invalid review comment.
3-3
: Version bump looks correct.
Updating"version"
from0.2.79
to0.2.80
aligns with the automatic Changesets release.packages/thirdweb/package.json (2)
1-4
: Inconsistent AI summary: The AI-generated summary mentions removal ofBridge.Transfer
andBridge.Onramp
documentation, but this file only contains a version bump to5.100.0
. The summary does not reflect the actual change here.Likely an incorrect or invalid review comment.
3-3
: Approve version bump: Bumping version to5.100.0
correctly aligns with the release for the new Bridge.Transfer and Bridge.Onramp modules.
## 0.2.80 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing version bump in package.json: The changelog entry was added for 0.2.80
, but ensure packages/wagmi-adapter/package.json
is updated to this version to avoid mismatches during publish.
🤖 Prompt for AI Agents
In packages/wagmi-adapter/CHANGELOG.md at lines 3 to 4, the changelog shows
version 0.2.80 but the package.json file in packages/wagmi-adapter/package.json
has not been updated to this version. Update the version field in package.json
to 0.2.80 to keep it consistent with the changelog and prevent publish issues.
|
||
### Patch Changes | ||
|
||
- [#7064](https://github.com/thirdweb-dev/js/pull/7064) [`64964da`](https://github.com/thirdweb-dev/js/commit/64964da22e11d4a40696d4c0aecb69f74c67fff8) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Faster useSendTransaction execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch change for useSendTransaction should be removed per PR objectives.
According to the PR objectives, the patch for faster useSendTransaction
execution should also be removed from the changelog as it's mentioned in the AI summary for removal.
🤖 Prompt for AI Agents
In packages/thirdweb/CHANGELOG.md at line 168, remove the entry referencing the
patch for faster useSendTransaction execution, as the PR objectives specify that
this patch should be excluded from the changelog.
1e0571d
to
00f9567
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (4)
packages/thirdweb/CHANGELOG.md (4)
7-164
: This Bridge.Transfer module documentation should be removed as per PR objectives.According to the PR objectives and AI summary, this PR is specifically removing the documentation for Bridge.Transfer and Bridge.Onramp modules from the changelog. This entire section documenting the Bridge.Transfer module should be removed to align with the PR's purpose.
🧰 Tools
🪛 Gitleaks (8.26.0)
123-123: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
147-147: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
168-168
: Patch change for useSendTransaction should be removed per PR objectives.According to the PR objectives, the patch for faster
useSendTransaction
execution should also be excluded from the changelog as it's mentioned in the AI summary for removal.
170-244
: This Bridge.Onramp module documentation should be removed as per PR objectives.According to the PR objectives and AI summary, this PR is specifically removing the documentation for Bridge.Transfer and Bridge.Onramp modules from the changelog. This entire section about the Bridge.Onramp module should be removed to align with the PR's purpose.
30-30
: Missing comma in code example creates a syntax error.There appears to be a missing comma after
estimatedExecutionTimeMs: 1000
in the example code. This would cause a syntax error if someone copies this code directly. The correct syntax should be:- estimatedExecutionTimeMs: 1000 + estimatedExecutionTimeMs: 1000,This correction should be applied to both instances of this property in the example code to ensure it's valid JavaScript/TypeScript.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (7)
.changeset/open-readers-do.md
(0 hunks).changeset/stale-yaks-bathe.md
(0 hunks).changeset/tidy-seas-sing.md
(0 hunks)packages/thirdweb/CHANGELOG.md
(1 hunks)packages/thirdweb/package.json
(1 hunks)packages/wagmi-adapter/CHANGELOG.md
(1 hunks)packages/wagmi-adapter/package.json
(1 hunks)
💤 Files with no reviewable changes (3)
- .changeset/open-readers-do.md
- .changeset/stale-yaks-bathe.md
- .changeset/tidy-seas-sing.md
✅ Files skipped from review due to trivial changes (2)
- packages/wagmi-adapter/CHANGELOG.md
- packages/thirdweb/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/wagmi-adapter/package.json
🧰 Additional context used
🪛 Gitleaks (8.26.0)
packages/thirdweb/CHANGELOG.md
123-123: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
147-147: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Build Packages
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Unit Tests
- GitHub Check: Analyze (javascript)
```typescript | ||
const quote = await Bridge.Transfer.prepare({ | ||
chainId: 1, | ||
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential API keys detected in example code.
Security tools have flagged potential API keys in the example code. While these appear to be placeholders (like 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
for USDC token address), it's worth ensuring that no actual API keys or sensitive values are included in the examples. Consider using obviously fake values like 0x123...
for all examples.
Also applies to: 147-147
🧰 Tools
🪛 Gitleaks (8.26.0)
123-123: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🤖 Prompt for AI Agents
In packages/thirdweb/CHANGELOG.md at lines 123 and 147, the example code
includes real-looking token addresses that security tools may mistake for actual
API keys or sensitive data. Replace these addresses with clearly fake
placeholder values such as "0x123..." to avoid any confusion or security
concerns while keeping the examples illustrative.
2df3694
to
d1e3616
Compare
d1e3616
to
ba55c53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
packages/thirdweb/CHANGELOG.md (1)
166-168
:⚠️ Potential issuePatch change for useSendTransaction should be removed per PR objectives.
According to the PR objectives, the patch for faster
useSendTransaction
execution should also be removed from the changelog as it's mentioned in the AI summary for removal.-### Patch Changes - -- [#7064](https://github.com/thirdweb-dev/js/pull/7064) [`64964da`](https://github.com/thirdweb-dev/js/commit/64964da22e11d4a40696d4c0aecb69f74c67fff8) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Faster useSendTransaction execution
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.changeset/open-readers-do.md
(0 hunks).changeset/stale-yaks-bathe.md
(0 hunks).changeset/tidy-seas-sing.md
(0 hunks)packages/thirdweb/CHANGELOG.md
(1 hunks)packages/thirdweb/package.json
(2 hunks)packages/wagmi-adapter/CHANGELOG.md
(1 hunks)packages/wagmi-adapter/package.json
(1 hunks)
💤 Files with no reviewable changes (3)
- .changeset/open-readers-do.md
- .changeset/tidy-seas-sing.md
- .changeset/stale-yaks-bathe.md
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/wagmi-adapter/package.json
- packages/wagmi-adapter/CHANGELOG.md
- packages/thirdweb/package.json
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Unit Tests
- GitHub Check: E2E Tests (pnpm, esbuild)
- GitHub Check: Size
- GitHub Check: Lint Packages
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: E2E Tests (pnpm, vite)
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
packages/thirdweb/CHANGELOG.md (3)
3-4
: LGTM!The version number is correctly included in the header.
5-6
: LGTM!The Minor Changes section header is correctly formatted.
246-246
: LGTM!This section with the version header is correctly formatted and should remain.
- [#7076](https://github.com/thirdweb-dev/js/pull/7076) [`89ccc80`](https://github.com/thirdweb-dev/js/commit/89ccc80d9c5dd188bef495bda048c3aa7f0739af) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Added Bridge.Onramp.prepare and Bridge.Onramp.status functions | ||
|
||
## Bridge.Onramp.prepare | ||
|
||
Prepares an onramp transaction, returning a link from the specified provider to onramp to the specified token. | ||
|
||
```typescript | ||
import { Bridge } from "thirdweb"; | ||
import { ethereum } from "thirdweb/chains"; | ||
import { NATIVE_TOKEN_ADDRESS, toWei } from "thirdweb/utils"; | ||
|
||
const preparedOnramp = await Bridge.Onramp.prepare({ | ||
client: thirdwebClient, | ||
onramp: "stripe", | ||
chainId: ethereum.id, | ||
tokenAddress: NATIVE_TOKEN_ADDRESS, | ||
receiver: "0x...", // receiver's address | ||
amount: toWei("10"), // 10 of the destination token | ||
// Optional params: | ||
// sender: "0x...", // sender's address | ||
// onrampTokenAddress: NATIVE_TOKEN_ADDRESS, // token to initially onramp to | ||
// onrampChainId: 1, // chain to initially onramp to | ||
// currency: "USD", | ||
// maxSteps: 2, | ||
// purchaseData: { customId: "123" } | ||
}); | ||
|
||
console.log(preparedOnramp.link); // URL to redirect the user to | ||
console.log(preparedOnramp.currencyAmount); // Price in fiat currency | ||
``` | ||
|
||
## Bridge.Onramp.status | ||
|
||
Retrieves the status of an Onramp session created via Bridge.Onramp.prepare. | ||
|
||
```typescript | ||
import { Bridge } from "thirdweb"; | ||
|
||
const onrampStatus = await Bridge.Onramp.status({ | ||
id: "022218cc-96af-4291-b90c-dadcb47571ec", | ||
client: thirdwebClient, | ||
}); | ||
|
||
// Possible results: | ||
// { | ||
// status: "CREATED", | ||
// transactions: [], | ||
// purchaseData: { | ||
// orderId: "abc-123", | ||
// }, | ||
// } | ||
// | ||
// or | ||
// { | ||
// status: "PENDING", | ||
// transactions: [], | ||
// purchaseData: { | ||
// orderId: "abc-123", | ||
// }, | ||
// } | ||
// | ||
// or | ||
// { | ||
// status: "COMPLETED", | ||
// transactions: [ | ||
// { | ||
// chainId: 1, | ||
// transactionHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", | ||
// }, | ||
// ], | ||
// purchaseData: { | ||
// orderId: "abc-123", | ||
// }, | ||
// } | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Bridge.Onramp module documentation should be removed as per PR objectives.
According to the AI summary, this PR is specifically removing documentation for the Bridge.Transfer and Bridge.Onramp modules from the changelog. This entire section about the Bridge.Onramp module should be removed to align with the PR objectives.
-- [#7076](https://github.com/thirdweb-dev/js/pull/7076) [`89ccc80`](https://github.com/thirdweb-dev/js/commit/89ccc80d9c5dd188bef495bda048c3aa7f0739af) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Added Bridge.Onramp.prepare and Bridge.Onramp.status functions
-
- ## Bridge.Onramp.prepare
-
- Prepares an onramp transaction, returning a link from the specified provider to onramp to the specified token.
-
- ```typescript
- import { Bridge } from "thirdweb";
- import { ethereum } from "thirdweb/chains";
- import { NATIVE_TOKEN_ADDRESS, toWei } from "thirdweb/utils";
-
- const preparedOnramp = await Bridge.Onramp.prepare({
- client: thirdwebClient,
- onramp: "stripe",
- chainId: ethereum.id,
- tokenAddress: NATIVE_TOKEN_ADDRESS,
- receiver: "0x...", // receiver's address
- amount: toWei("10"), // 10 of the destination token
- // Optional params:
- // sender: "0x...", // sender's address
- // onrampTokenAddress: NATIVE_TOKEN_ADDRESS, // token to initially onramp to
- // onrampChainId: 1, // chain to initially onramp to
- // currency: "USD",
- // maxSteps: 2,
- // purchaseData: { customId: "123" }
- });
-
- console.log(preparedOnramp.link); // URL to redirect the user to
- console.log(preparedOnramp.currencyAmount); // Price in fiat currency
- ```
-
- ## Bridge.Onramp.status
-
- Retrieves the status of an Onramp session created via Bridge.Onramp.prepare.
-
- ```typescript
- import { Bridge } from "thirdweb";
-
- const onrampStatus = await Bridge.Onramp.status({
- id: "022218cc-96af-4291-b90c-dadcb47571ec",
- client: thirdwebClient,
- });
-
- // Possible results:
- // {
- // status: "CREATED",
- // transactions: [],
- // purchaseData: {
- // orderId: "abc-123",
- // },
- // }
- //
- // or
- // {
- // status: "PENDING",
- // transactions: [],
- // purchaseData: {
- // orderId: "abc-123",
- // },
- // }
- //
- // or
- // {
- // status: "COMPLETED",
- // transactions: [
- // {
- // chainId: 1,
- // transactionHash: "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
- // },
- // ],
- // purchaseData: {
- // orderId: "abc-123",
- // },
- // }
- ```
🤖 Prompt for AI Agents
In packages/thirdweb/CHANGELOG.md from lines 170 to 244, remove the entire
section documenting the Bridge.Onramp module, including the prepare and status
function descriptions and example code, to align with the PR objectives of
removing Bridge.Transfer and Bridge.Onramp documentation from the changelog.
to: "0x...", | ||
value: 10000026098875381n, | ||
data: "0x...", | ||
chainId: 1, | ||
type: "eip1559" | ||
} | ||
] | ||
} | ||
], | ||
expiration: 1741730936680, | ||
intent: { | ||
chainId: 1, | ||
tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", | ||
amount: 10000000000000000n, | ||
sender: "0x...", | ||
receiver: "0x..." | ||
} | ||
} | ||
``` | ||
|
||
## Sending the transactions | ||
|
||
The `transactions` array is a series of [ox](https://oxlib.sh) EIP-1559 transactions that must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions: | ||
|
||
- Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction. | ||
- All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address. | ||
- If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price. | ||
|
||
NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full completion of the transfer. | ||
|
||
You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option: | ||
|
||
```ts | ||
const quote = await Bridge.Transfer.prepare({ | ||
chainId: 1, | ||
tokenAddress: NATIVE_TOKEN_ADDRESS, | ||
amount: toWei("0.01"), | ||
sender: "0x...", | ||
receiver: "0x...", | ||
purchaseData: { | ||
reference: "payment-123", | ||
metadata: { | ||
note: "Transfer to Alice", | ||
}, | ||
}, | ||
client: thirdwebClient, | ||
}); | ||
``` | ||
|
||
## Fees | ||
|
||
There may be fees associated with the transfer. These fees are paid by the `feePayer` address, which defaults to the `sender` address. You can specify a different address with the `feePayer` option. If you do not specify an option or explicitly specify `sender`, the fees will be added to the input amount. If you specify the `receiver` as the fee payer the fees will be subtracted from the destination amount. | ||
|
||
For example, if you were to request a transfer with `feePayer` set to `receiver`: | ||
|
||
```typescript | ||
const quote = await Bridge.Transfer.prepare({ | ||
chainId: 1, | ||
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC | ||
amount: 100_000_000n, // 100 USDC | ||
sender: "0x...", | ||
receiver: "0x...", | ||
feePayer: "receiver", | ||
client: thirdwebClient, | ||
}); | ||
``` | ||
|
||
The returned quote might look like: | ||
|
||
```typescript | ||
{ | ||
originAmount: 100_000_000n, // 100 USDC | ||
destinationAmount: 99_970_000n, // 99.97 USDC | ||
... | ||
} | ||
``` | ||
|
||
If you were to request a transfer with `feePayer` set to `sender`: | ||
|
||
```typescript | ||
const quote = await Bridge.Transfer.prepare({ | ||
chainId: 1, | ||
tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC | ||
amount: 100_000_000n, // 100 USDC | ||
sender: "0x...", | ||
receiver: "0x...", | ||
feePayer: "sender", | ||
client: thirdwebClient, | ||
}); | ||
``` | ||
|
||
The returned quote might look like: | ||
|
||
```typescript | ||
{ | ||
originAmount: 100_030_000n, // 100.03 USDC | ||
destinationAmount: 100_000_000n, // 100 USDC | ||
... | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Bridge.Transfer module documentation should be removed as per PR objectives.
According to the AI summary, this PR is specifically removing documentation for the Bridge.Transfer and Bridge.Onramp modules from the changelog. This entire section documenting the Bridge.Transfer module (including all code examples and explanations) should be removed.
-### Minor Changes
-
-- [#7064](https://github.com/thirdweb-dev/js/pull/7064) [`64964da`](https://github.com/thirdweb-dev/js/commit/64964da22e11d4a40696d4c0aecb69f74c67fff8) Thanks [@gregfromstl](https://github.com/gregfromstl)! - Adds Bridge.Transfer module for direct token transfers:
-
- ```typescript
- import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
-
- const quote = await Bridge.Transfer.prepare({
- chainId: 1,
- tokenAddress: NATIVE_TOKEN_ADDRESS,
- amount: toWei("0.01"),
- sender: "0x...",
- receiver: "0x...",
- client: thirdwebClient,
- });
- ```
-
- This will return a quote that might look like:
-
- ```typescript
- {
- originAmount: 10000026098875381n,
- destinationAmount: 10000000000000000n,
- blockNumber: 22026509n,
- timestamp: 1741730936680,
- estimatedExecutionTimeMs: 1000
- steps: [
- {
- originToken: {
- chainId: 1,
- address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
- symbol: "ETH",
- name: "Ethereum",
- decimals: 18,
- priceUsd: 2000,
- iconUri: "https://..."
- },
- destinationToken: {
- chainId: 1,
- address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
- symbol: "ETH",
- name: "Ethereum",
- decimals: 18,
- priceUsd: 2000,
- iconUri: "https://..."
- },
- originAmount: 10000026098875381n,
- destinationAmount: 10000000000000000n,
- estimatedExecutionTimeMs: 1000
- transactions: [
- {
- action: "approval",
- id: "0x",
- to: "0x...",
- data: "0x...",
- chainId: 1,
- type: "eip1559"
- },
- {
- action: "transfer",
- to: "0x...",
- value: 10000026098875381n,
- data: "0x...",
- chainId: 1,
- type: "eip1559"
- }
- ]
- }
- ],
- expiration: 1741730936680,
- intent: {
- chainId: 1,
- tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
- amount: 10000000000000000n,
- sender: "0x...",
- receiver: "0x..."
- }
- }
- ```
-
- ## Sending the transactions
-
- The `transactions` array is a series of [ox](https://oxlib.sh) EIP-1559 transactions that must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:
-
- - Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
- - All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address.
- - If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
-
- NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full completion of the transfer.
-
- You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option:
-
- ```ts
- const quote = await Bridge.Transfer.prepare({
- chainId: 1,
- tokenAddress: NATIVE_TOKEN_ADDRESS,
- amount: toWei("0.01"),
- sender: "0x...",
- receiver: "0x...",
- purchaseData: {
- reference: "payment-123",
- metadata: {
- note: "Transfer to Alice",
- },
- },
- client: thirdwebClient,
- });
- ```
-
- ## Fees
-
- There may be fees associated with the transfer. These fees are paid by the `feePayer` address, which defaults to the `sender` address. You can specify a different address with the `feePayer` option. If you do not specify an option or explicitly specify `sender`, the fees will be added to the input amount. If you specify the `receiver` as the fee payer the fees will be subtracted from the destination amount.
-
- For example, if you were to request a transfer with `feePayer` set to `receiver`:
-
- ```typescript
- const quote = await Bridge.Transfer.prepare({
- chainId: 1,
- tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
- amount: 100_000_000n, // 100 USDC
- sender: "0x...",
- receiver: "0x...",
- feePayer: "receiver",
- client: thirdwebClient,
- });
- ```
-
- The returned quote might look like:
-
- ```typescript
- {
- originAmount: 100_000_000n, // 100 USDC
- destinationAmount: 99_970_000n, // 99.97 USDC
- ...
- }
- ```
-
- If you were to request a transfer with `feePayer` set to `sender`:
-
- ```typescript
- const quote = await Bridge.Transfer.prepare({
- chainId: 1,
- tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
- amount: 100_000_000n, // 100 USDC
- sender: "0x...",
- receiver: "0x...",
- feePayer: "sender",
- client: thirdwebClient,
- });
- ```
-
- The returned quote might look like:
-
- ```typescript
- {
- originAmount: 100_030_000n, // 100.03 USDC
- destinationAmount: 100_000_000n, // 100 USDC
- ...
- }
- ```
🤖 Prompt for AI Agents
In packages/thirdweb/CHANGELOG.md from lines 7 to 164, remove the entire
Bridge.Transfer module documentation section including all code examples,
explanations, and notes as this documentation is no longer relevant and should
be deleted according to the PR objectives.
ba55c53
to
f5b9802
Compare
f5b9802
to
9c92e5a
Compare
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
[email protected]
Minor Changes
#7064
64964da
Thanks @gregfromstl! - Adds Bridge.Transfer module for direct token transfers:This will return a quote that might look like:
Sending the transactions
The
transactions
array is a series of ox EIP-1559 transactions that must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:approval
action specified. You can perform approvals withsendAndConfirmTransaction
, then proceed to the next transaction.sender
address, regardless of which chain they are on. The final transaction will use thereceiver
as the recipient address.expiration
timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.NOTE: To get the status of each non-approval transaction, use
Bridge.status
rather than checking for transaction inclusion. This function will ensure full completion of the transfer.You can include arbitrary data to be included on any webhooks and status responses with the
purchaseData
option:Fees
There may be fees associated with the transfer. These fees are paid by the
feePayer
address, which defaults to thesender
address. You can specify a different address with thefeePayer
option. If you do not specify an option or explicitly specifysender
, the fees will be added to the input amount. If you specify thereceiver
as the fee payer the fees will be subtracted from the destination amount.For example, if you were to request a transfer with
feePayer
set toreceiver
:The returned quote might look like:
If you were to request a transfer with
feePayer
set tosender
:The returned quote might look like:
Patch Changes
#7064
64964da
Thanks @gregfromstl! - Faster useSendTransaction execution#7092
d623978
Thanks @joaquim-verges! - Show deposit modal for tokens that don't have any UB routes#7076
89ccc80
Thanks @joaquim-verges! - Added Bridge.Onramp.prepare and Bridge.Onramp.status functionsBridge.Onramp.prepare
Prepares an onramp transaction, returning a link from the specified provider to onramp to the specified token.
Bridge.Onramp.status
Retrieves the status of an Onramp session created via Bridge.Onramp.prepare.
@thirdweb-dev/[email protected]
PR-Codex overview
This PR updates the versions for
@thirdweb-dev/wagmi-adapter
andthirdweb
, introduces new features in theBridge
module, and modifies type definitions for better structure.Detailed summary
@thirdweb-dev/wagmi-adapter
version to0.2.80
.thirdweb
version to5.100.0
.Bridge.Transfer
module for direct token transfers.Bridge.Onramp.prepare
andBridge.Onramp.status
functions.Summary by CodeRabbit
Revert
Chores