Skip to content

Commit

Permalink
Merge branch 'main' into onramp-support-any-network
Browse files Browse the repository at this point in the history
  • Loading branch information
rustam-cb committed Feb 21, 2025
2 parents db3e360 + 498d6fc commit 211823d
Show file tree
Hide file tree
Showing 55 changed files with 2,522 additions and 274 deletions.
32 changes: 26 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 0.37.2

### Patch Changes

- **fix**: Improve chain support for non Base transactions. By @dschlabach #2016
- **docs**: Documentation updates and improvements. By @dschlabach @maximevtush @kilavvy

## 0.37.1

### Patch Changes

- **feat**: Add `Checkout` component telemetry. By @cpcramer #1968
- **feat**: Add `Fund` component telemetry. By @cpcramer #1967
- **feat**: Add `Mint` component telemetry. By @cpcramer #1966
- **feat**: Add `WalletAdvanced` component telemetry. By @cpcramer #1963
- **feat**: Add `ConnectWallet` component telemetry. By @cpcramer #1957
- **docs**: Documentation updates and improvements. By @dschlabach @dramarereg @tomasandroil @maximevtush
- **chore**: `sendAnalytics` improvements. @By @dschlabach #1999
- **feat**: Add `isSponsored` support for the `Earn` component. @dschlabach 1998

## 0.37.0

### Minor Changes
Expand Down Expand Up @@ -78,7 +98,7 @@ Note: OnchainKit is not collecting any telemetry as of `v0.36.11`. This will be
- **fix**: Made improvements to FundCard component. By @rustam-cb #1806 #1818 #1839
- **fix**: Made improvements to WalletIsland component. By @brendan-cb #1842
- **fix**: Made internal typesafety and efficiency improvements. By @dschlabach #1855 #1843
- **fix**: Fixed typos in documentation and commments. By @youyyytrok @vipocenka #1840 #1841
- **fix**: Fixed typos in documentation and comments. By @youyyytrok @vipocenka #1840 #1841

## 0.36.7

Expand Down Expand Up @@ -539,7 +559,7 @@ export type LifeCycleStatus =
### Patch Changes

- **feat**: moved `onSuccess` and `onError` for Swap component at top level. By @zizzamia #1123 886d974
- **patch**: removed unneccessary address prop from `Transaction` component and fix issue where Sponsor component isn't visible. By @abcrane123 #1114
- **patch**: removed unnecessary address prop from `Transaction` component and fix issue where Sponsor component isn't visible. By @abcrane123 #1114
- **chore**: updated disconnect SVG image. By @cpcramer #1103
- **fix**: improved issue with Swap where it wasn't fetching quote for amount without a leading 0. By @abcrane123 #1128

Expand Down Expand Up @@ -621,7 +641,7 @@ export type LifeCycleStatus =

### Patch Changes

- **feat**: added `Permit2` approval process for UniversalRouter in the `Swap` experiece. By @0xAlec #980 16c004b
- **feat**: added `Permit2` approval process for UniversalRouter in the `Swap` experience. By @0xAlec #980 16c004b

## 0.28.0

Expand Down Expand Up @@ -760,7 +780,7 @@ Learn more about this component type at https://onchainkit.xyz/transactiontypes#

### Patch Changes

- **fix**: copy popover style within the `IdenityLayout`. By @zizzamia #870 3128263
- **fix**: copy popover style within the `IdentityLayout`. By @zizzamia #870 3128263
- **feat**: added toast animation for `TransactionToast` component. By @abcrane123 #865

## 0.26.0
Expand Down Expand Up @@ -911,7 +931,7 @@ Breaking Changes

### Patch Changes

- **fix**: revert peer dependancy PRs. f4fcd2a
- **fix**: revert peer dependency PRs. f4fcd2a

## 0.22.3

Expand Down Expand Up @@ -1191,7 +1211,7 @@ Features
### Patch Changes

- **feat**: converted `Badge` to css. By @zizzamia #476 9b03393
- **feat**: converted `TokenRow` to css, add modifier state and add additinal display controls. By @kyhyco #473
- **feat**: converted `TokenRow` to css, add modifier state and add additional display controls. By @kyhyco #473

## 0.19.1

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Coinbase
Copyright (c) 2025 Coinbase

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coinbase/onchainkit",
"version": "0.37.0",
"version": "0.37.2",
"type": "module",
"repository": "https://github.com/coinbase/onchainkit.git",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions site/docs/components/landing/ComponentPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getHighlightedCode } from './getHighlightedCode.tsx';
// Demo components and code snippets
import BuyDemo, { buyDemoCode } from './BuyDemo.tsx';
import CheckoutDemo, { checkoutDemoCode } from './CheckoutDemo.tsx';
import EarnDemo, { earnDemoCode } from './EarnDemo.tsx';
import FundDemo, { fundDemoCode } from './FundDemo.tsx';
import IdentityCardDemo, { identityCardDemoCode } from './IdentityCardDemo.tsx';
import NftMintCardDemo, { nftMintCardDemoCode } from './NftMintCardDemo.tsx';
Expand Down Expand Up @@ -74,6 +75,12 @@ const components: Component[] = [
description:
'Display the Basename, avatar, address, and social media links associated with a wallet.',
},
{
name: 'Earn',
component: EarnDemo,
code: earnDemoCode,
description: 'Earn interest on your crypto holdings.',
},
];

function ComponentPreview() {
Expand Down
39 changes: 39 additions & 0 deletions site/docs/components/landing/EarnDemo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {
DepositAmountInput,
DepositBalance,
DepositButton,
Earn,
EarnDeposit,
EarnDetails,
} from '@coinbase/onchainkit/earn';
import App from '../App.tsx';

export const earnDemoCode = `
import { Earn } from '@coinbase/onchainkit/earn';
import App from '../App.tsx';
function EarnDemo() {
return (
<App>
<Earn vaultAddress="0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A" />
</App>
);
}
`;

function EarnDemo() {
return (
<App>
<Earn vaultAddress="0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A">
<EarnDeposit>
<EarnDetails />
<DepositAmountInput />
<DepositBalance />
<DepositButton disabled={true} />
</EarnDeposit>
</Earn>
</App>
);
}

export default EarnDemo;
7 changes: 7 additions & 0 deletions site/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@ import type { ReactNode } from 'react';
import ThemeProvider from './contexts/Theme.tsx';

export default function Layout({ children }: { children: ReactNode }) {
// Fixes loading of dynamic imports during deployments
// https://vite.dev/guide/build#load-error-handling
if (typeof window !== 'undefined') {
window.addEventListener('vite:preloadError', () => {
window.location.reload();
});
}
return <ThemeProvider>{children}</ThemeProvider>;
}
30 changes: 30 additions & 0 deletions site/docs/pages/earn/earn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,36 @@ function CustomDepositButtons() {
Taking advantage of the data and methods provided by `useEarnContext`, developers can implement fully custom deposit and withdraw interfaces, modifying everything from UI elements to input behavior.


## Examples

### Sponsoring transactions

To sponsor transactions, you can use the `isSponsored` prop.

```tsx twoslash
// @noErrors: 2304
<Earn vaultAddress="0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A" isSponsored />
```

Ensure that your `OnchainKitProvider` has a `paymaster` configured:

```tsx twoslash
// @noErrors: 2304 17008 1005
<OnchainKitProvider
config={{ // [!code focus]
paymaster: process.env.PAYMASTER_ENDPOINT, // [!code focus]
}} // [!code focus]
>
```

:::tip
If you have a contract allowlist set on Coinbase Developer Platform, you'll need to ensure that the following contract functions are allowed:

- `deposit` on the Morpho vault
- `redeem` on the Morpho vault
- `approve` on the token being deposited
:::

## Components

The `Earn` component includes the following subcomponents:
Expand Down
2 changes: 2 additions & 0 deletions site/docs/pages/earn/types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type EarnReact = {
children?: React.ReactNode;
className?: string;
vaultAddress: Address;
isSponsored?: boolean;
};
```

Expand All @@ -48,6 +49,7 @@ export type EarnReact = {
export type EarnProviderReact = {
children: React.ReactNode;
vaultAddress: Address;
isSponsored?: boolean;
};
```

Expand Down
Loading

0 comments on commit 211823d

Please sign in to comment.