Skip to content

Commit

Permalink
fix: widget peer dependency versions & feat: update supported network…
Browse files Browse the repository at this point in the history
… list (#238)

* fix: specify viem and wagmi peer dependency version ranges correctly

* feature: update supported network list and token list

* refactor: clean-up
  • Loading branch information
kasparkallas authored Jun 30, 2024
1 parent 66ba08b commit 2e6e8c1
Show file tree
Hide file tree
Showing 28 changed files with 2,094 additions and 852 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-starfishes-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@superfluid-finance/widget": patch
---

Specify viem and wagmi peer dependencies correctly
5 changes: 5 additions & 0 deletions .changeset/spicy-radios-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@superfluid-finance/widget": minor
---

Update supported network list and token list
5 changes: 2 additions & 3 deletions apps/hosted-widget/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import superfluidMetadata from "@superfluid-finance/widget/metadata";

export const superfluidRpcUrls = superfluidMetadata.networks.reduce(
(acc, network) => {
acc[
network.chainId
] = `https://rpc-endpoints.superfluid.dev/${network.name}`;
acc[network.chainId] =
`https://rpc-endpoints.superfluid.dev/${network.name}`;
return acc;
},
{} as Record<number, string>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ const ExportEditor: FC = () => {
{selectedExportOption === "ipfs"
? "You’ll create a hosted link to your checkout which you can embed in your CTAs."
: selectedExportOption === "json"
? "Use this JSON configuration when embedding react or web component directly to your code."
: ""}
? "Use this JSON configuration when embedding react or web component directly to your code."
: ""}
</Typography>
</Box>
{switchExportOption(selectedExportOption, json)}
Expand Down
48 changes: 9 additions & 39 deletions apps/widget-builder/src/hooks/useDemoMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const demoPaymentDetails: WidgetProps["paymentDetails"] = {
paymentOptions: [
{
receiverAddress: "0xf26ce9749f29e61c25d0333bce2301cb2dfd3a22", // rebounder
chainId: supportedNetwork.goerli.id,
chainId: supportedNetwork.optimismSepolia.id,
superToken: {
address: "0x8ae68021f6170e5a766be613cea0d75236ecca9a", // fUSDCx
address: "0x00d05Eed85Bad962bA5237DD4aFFF12004455a8a", // fUSDCx
},
flowRate: {
amountEther: "1",
Expand All @@ -34,9 +34,9 @@ const demoPaymentDetails: WidgetProps["paymentDetails"] = {
} as const,
{
receiverAddress: "0xf26ce9749f29e61c25d0333bce2301cb2dfd3a22", // rebounder
chainId: supportedNetwork.goerli.id,
chainId: supportedNetwork.optimismSepolia.id,
superToken: {
address: "0xf2d68898557ccb2cf4c10c3ef2b034b2a69dad00", // fDAIx
address: "0xD6FAF98BeFA647403cc56bDB598690660D5257d2", // fDAIx
},
flowRate: {
amountEther: "1",
Expand All @@ -45,7 +45,7 @@ const demoPaymentDetails: WidgetProps["paymentDetails"] = {
} as const,
{
receiverAddress: "0x7d3e32ae08f50387a83cf222e08d8ec26317d7aa", // vitalik.eth
chainId: supportedNetwork.goerli.id,
chainId: supportedNetwork.optimismSepolia.id,
superToken: {
address: "0x7d3e32ae08f50387a83cf222e08d8ec26317d7aa", // ZYA
},
Expand All @@ -56,7 +56,7 @@ const demoPaymentDetails: WidgetProps["paymentDetails"] = {
} as const,
{
receiverAddress: "0x7d3e32ae08f50387a83cf222e08d8ec26317d7aa", // vitalik.eth
chainId: supportedNetwork.goerli.id,
chainId: supportedNetwork.optimismSepolia.id,
superToken: {
address: "0xcc48a0349077b91ab540d2e46addffb4a4a26251", // NTDL
},
Expand All @@ -65,36 +65,6 @@ const demoPaymentDetails: WidgetProps["paymentDetails"] = {
period: "month",
},
} as const,
{
receiverAddress: "0xf26ce9749f29e61c25d0333bce2301cb2dfd3a22", // rebounder
chainId: supportedNetwork.polygonMumbai.id,
superToken: {
address: "0x42bb40bf79730451b11f6de1cba222f17b87afd7", // fUSDCx
},
flowRate: {
amountEther: "1",
period: "month",
},
} as const,
{
receiverAddress: "0x5d8b4c2554aeb7e86f387b4d6c00ac33499ed01f", // rebounder
chainId: supportedNetwork.polygonMumbai.id,
superToken: {
address: "0x5d8b4c2554aeb7e86f387b4d6c00ac33499ed01f", // fDAIx
},
transferAmountEther: "1",
flowRate: {
amountEther: "1",
period: "month",
},
} as const,
{
receiverAddress: "0x5d8b4c2554aeb7e86f387b4d6c00ac33499ed01f", // rebounder
chainId: supportedNetwork.polygonMumbai.id,
superToken: {
address: "0x5d8b4c2554aeb7e86f387b4d6c00ac33499ed01f", // fDAIx
},
} as const,
{
receiverAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", // vitalik.eth
chainId: supportedNetwork.celo.id,
Expand All @@ -113,9 +83,9 @@ const defaultPaymentDetails: WidgetProps["paymentDetails"] = {
paymentOptions: [
{
receiverAddress: "0xf26ce9749f29e61c25d0333bce2301cb2dfd3a22", // rebounder
chainId: supportedNetwork.goerli.id,
chainId: supportedNetwork.optimismSepolia.id,
superToken: {
address: "0x8ae68021f6170e5a766be613cea0d75236ecca9a", // fUSDCx
address: "0x131780640EDf9830099AAc2203229073d6D2FE69", // fUSDCx
},
flowRate: {
amountEther: "1",
Expand Down Expand Up @@ -153,7 +123,7 @@ const demoExistentialNFT: ExistentialNFT = {
symbol: "DEMO",
owner: "0xab1D164065aed9A3e42fca42c2c20997f369A2B0",
deployments: {
80001: "0x5d8b4c2554aeb7e86f387b4d6c00ac33499ed01f",
11155420: "0x5d8b4c2554aeb7e86f387b4d6c00ac33499ed01f", // TODO: doesn't exist
},
};

Expand Down
5 changes: 2 additions & 3 deletions apps/widget-builder/src/superfluidRpcUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import superfluidMetadata from "@superfluid-finance/widget/metadata";

export const superfluidRpcUrls = superfluidMetadata.networks.reduce(
(acc, network) => {
acc[
network.chainId
] = `https://rpc-endpoints.superfluid.dev/${network.name}`;
acc[network.chainId] =
`https://rpc-endpoints.superfluid.dev/${network.name}`;
return acc;
},
{} as Record<number, string>,
Expand Down
8 changes: 4 additions & 4 deletions apps/widget-builder/src/types/general.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ export type NullableObject<T> = {
export type ObjectKeys<T> = T extends object
? (keyof T)[]
: T extends number
? []
: T extends Array<any> | string
? string[]
: never;
? []
: T extends Array<any> | string
? string[]
: never;

export type Font = {
family: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const PricingCard: FC<PricingCardProps> = ({
paymentOptions: [
{
receiverAddress: randomReceiver,
chainId: 80001,
chainId: 11155420,
superToken: {
address: Token,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/b2b-service-demo/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Configuration = {
IntercomAppID: "o7qlnuli",
IntercomSurveyID: 34698139,
WalletConnectProjectID: "952483bf7a0f5ace4c40eb53967f1368",
Token: "0x42bb40bf79730451b11f6de1cba222f17b87afd7" as `0x${string}`,
Token: "0xD6FAF98BeFA647403cc56bDB598690660D5257d2" as `0x${string}`,
Sender: "0xab1D164065aed9A3e42fca42c2c20997f369A2B0" as `0x${string}`,
CFAV1ForwarderAddress:
"0xcfA132E353cB4E398080B9700609bb008eceB125" as `0x${string}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const SubscribeButton = () => {
paymentOptions: [
{
receiverAddress: randomReceiver,
chainId: 80001,
chainId: 11155420,
superToken: {
address: Token,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/donation-demo/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Configuration = {
IntercomAppID: "o7qlnuli",
IntercomSurveyID: 34698139,
WalletConnectProjectID: "952483bf7a0f5ace4c40eb53967f1368",
Token: "0x42bb40bf79730451b11f6de1cba222f17b87afd7" as `0x${string}`,
Token: "0x00d05Eed85Bad962bA5237DD4aFFF12004455a8a" as `0x${string}`,
Sender: "0xab1D164065aed9A3e42fca42c2c20997f369A2B0" as `0x${string}`,
CFAV1ForwarderAddress:
"0xcfA132E353cB4E398080B9700609bb008eceB125" as `0x${string}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const WidgetWrapper: FC<WidgetWrapperProps> = ({ children }) => {
paymentOptions: [
{
receiverAddress: randomReceiver,
chainId: 80001,
chainId: 11155420,
superToken: {
address: Token,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/gated-community-demo/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const Configuration = {
IntercomAppID: "o7qlnuli",
IntercomSurveyID: 34698139,
WalletConnectProjectID: "952483bf7a0f5ace4c40eb53967f1368",
Token: "0x42bb40bf79730451b11f6de1cba222f17b87afd7" as `0x${string}`,
Token: "0xD6FAF98BeFA647403cc56bDB598690660D5257d2" as `0x${string}`,
Sender: "0xab1D164065aed9A3e42fca42c2c20997f369A2B0" as `0x${string}`,
CFAV1ForwarderAddress:
"0xcfA132E353cB4E398080B9700609bb008eceB125" as `0x${string}`,
Expand Down
Loading

0 comments on commit 2e6e8c1

Please sign in to comment.