@medialane/ui 0.257.0 → 0.259.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/add-guardian-dialog.cjs +1 -1
- package/dist/components/account/add-guardian-dialog.cjs.map +1 -1
- package/dist/components/account/add-guardian-dialog.js +1 -1
- package/dist/components/account/add-guardian-dialog.js.map +1 -1
- package/dist/components/account/device-approval-dialog.cjs +2 -2
- package/dist/components/account/device-approval-dialog.cjs.map +1 -1
- package/dist/components/account/device-approval-dialog.js +2 -2
- package/dist/components/account/device-approval-dialog.js.map +1 -1
- package/dist/components/account/devices-section.cjs +1 -1
- package/dist/components/account/devices-section.cjs.map +1 -1
- package/dist/components/account/devices-section.js +1 -1
- package/dist/components/account/devices-section.js.map +1 -1
- package/dist/components/account/guardian-recovery-section.cjs +1 -1
- package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
- package/dist/components/account/guardian-recovery-section.js +1 -1
- package/dist/components/account/guardian-recovery-section.js.map +1 -1
- package/dist/components/comments-section.cjs +5 -4
- package/dist/components/comments-section.cjs.map +1 -1
- package/dist/components/comments-section.js +5 -4
- package/dist/components/comments-section.js.map +1 -1
- package/dist/components/drop/create/launch-dialog.cjs +1 -1
- package/dist/components/drop/create/launch-dialog.cjs.map +1 -1
- package/dist/components/drop/create/launch-dialog.js +1 -1
- package/dist/components/drop/create/launch-dialog.js.map +1 -1
- package/dist/components/drop/page/drop-manage.cjs +1 -1
- package/dist/components/drop/page/drop-manage.cjs.map +1 -1
- package/dist/components/drop/page/drop-manage.js +1 -1
- package/dist/components/drop/page/drop-manage.js.map +1 -1
- package/dist/components/drop/page/drop-mint-dialog.cjs +1 -1
- package/dist/components/drop/page/drop-mint-dialog.cjs.map +1 -1
- package/dist/components/drop/page/drop-mint-dialog.js +1 -1
- package/dist/components/drop/page/drop-mint-dialog.js.map +1 -1
- package/dist/components/empty-or-error.cjs +2 -2
- package/dist/components/empty-or-error.cjs.map +1 -1
- package/dist/components/empty-or-error.js +2 -2
- package/dist/components/empty-or-error.js.map +1 -1
- package/dist/components/fast-mint/fast-mint.cjs +2 -1
- package/dist/components/fast-mint/fast-mint.cjs.map +1 -1
- package/dist/components/fast-mint/fast-mint.js +2 -1
- package/dist/components/fast-mint/fast-mint.js.map +1 -1
- package/dist/components/launchpad/coin-create.cjs +9 -7
- package/dist/components/launchpad/coin-create.cjs.map +1 -1
- package/dist/components/launchpad/coin-create.js +9 -7
- package/dist/components/launchpad/coin-create.js.map +1 -1
- package/dist/components/launchpad/collection-create-form.cjs +11 -14
- package/dist/components/launchpad/collection-create-form.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-form.js +12 -15
- package/dist/components/launchpad/collection-create-form.js.map +1 -1
- package/dist/components/launchpad/collection-create-presets.cjs +8 -8
- package/dist/components/launchpad/collection-create-presets.cjs.map +1 -1
- package/dist/components/launchpad/collection-create-presets.d.cts +2 -1
- package/dist/components/launchpad/collection-create-presets.d.ts +2 -1
- package/dist/components/launchpad/collection-create-presets.js +8 -8
- package/dist/components/launchpad/collection-create-presets.js.map +1 -1
- package/dist/components/launchpad/edition-mint.cjs +9 -7
- package/dist/components/launchpad/edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/edition-mint.js +9 -7
- package/dist/components/launchpad/edition-mint.js.map +1 -1
- package/dist/components/launchpad/pop-create.cjs +5 -6
- package/dist/components/launchpad/pop-create.cjs.map +1 -1
- package/dist/components/launchpad/pop-create.js +5 -6
- package/dist/components/launchpad/pop-create.js.map +1 -1
- package/dist/components/launchpad/remix-mint.cjs +9 -7
- package/dist/components/launchpad/remix-mint.cjs.map +1 -1
- package/dist/components/launchpad/remix-mint.js +9 -7
- package/dist/components/launchpad/remix-mint.js.map +1 -1
- package/dist/components/launchpad/single-edition-mint.cjs +9 -7
- package/dist/components/launchpad/single-edition-mint.cjs.map +1 -1
- package/dist/components/launchpad/single-edition-mint.js +9 -7
- package/dist/components/launchpad/single-edition-mint.js.map +1 -1
- package/dist/components/launchpad/sponsorship-create.cjs +5 -6
- package/dist/components/launchpad/sponsorship-create.cjs.map +1 -1
- package/dist/components/launchpad/sponsorship-create.js +5 -6
- package/dist/components/launchpad/sponsorship-create.js.map +1 -1
- package/dist/components/launchpad/tier-mint-form.cjs +5 -6
- package/dist/components/launchpad/tier-mint-form.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-form.js +5 -6
- package/dist/components/launchpad/tier-mint-form.js.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.cjs +2 -2
- package/dist/components/launchpad/tier-mint-presets.cjs.map +1 -1
- package/dist/components/launchpad/tier-mint-presets.d.cts +2 -1
- package/dist/components/launchpad/tier-mint-presets.d.ts +2 -1
- package/dist/components/launchpad/tier-mint-presets.js +2 -2
- package/dist/components/launchpad/tier-mint-presets.js.map +1 -1
- package/dist/components/license-request-page.cjs +1 -1
- package/dist/components/license-request-page.cjs.map +1 -1
- package/dist/components/license-request-page.js +1 -1
- package/dist/components/license-request-page.js.map +1 -1
- package/dist/components/marketplace-dialog-primitives.cjs +0 -30
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.d.cts +1 -12
- package/dist/components/marketplace-dialog-primitives.d.ts +1 -12
- package/dist/components/marketplace-dialog-primitives.js +1 -30
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/media-wallet/activate-card.cjs +1 -1
- package/dist/components/media-wallet/activate-card.cjs.map +1 -1
- package/dist/components/media-wallet/activate-card.js +1 -1
- package/dist/components/media-wallet/activate-card.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-activity.cjs +1 -1
- package/dist/components/media-wallet/media-wallet-activity.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-activity.js +1 -1
- package/dist/components/media-wallet/media-wallet-activity.js.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.cjs +2 -6
- package/dist/components/media-wallet/media-wallet-send.cjs.map +1 -1
- package/dist/components/media-wallet/media-wallet-send.js +2 -6
- package/dist/components/media-wallet/media-wallet-send.js.map +1 -1
- package/dist/components/pop-claim-button.cjs +5 -4
- package/dist/components/pop-claim-button.cjs.map +1 -1
- package/dist/components/pop-claim-button.js +5 -4
- package/dist/components/pop-claim-button.js.map +1 -1
- package/dist/components/pop-manage-page.cjs +2 -2
- package/dist/components/pop-manage-page.cjs.map +1 -1
- package/dist/components/pop-manage-page.js +2 -2
- package/dist/components/pop-manage-page.js.map +1 -1
- package/dist/components/portfolio-sponsorships.cjs +2 -2
- package/dist/components/portfolio-sponsorships.cjs.map +1 -1
- package/dist/components/portfolio-sponsorships.js +2 -2
- package/dist/components/portfolio-sponsorships.js.map +1 -1
- package/dist/components/sponsorship-offer-page.cjs +5 -4
- package/dist/components/sponsorship-offer-page.cjs.map +1 -1
- package/dist/components/sponsorship-offer-page.js +5 -4
- package/dist/components/sponsorship-offer-page.js.map +1 -1
- package/dist/components/transaction-dialog.cjs +4 -4
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.d.cts +3 -1
- package/dist/components/transaction-dialog.d.ts +3 -1
- package/dist/components/transaction-dialog.js +4 -4
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/components/{creation-success.cjs → transaction-success.cjs} +14 -15
- package/dist/components/transaction-success.cjs.map +1 -0
- package/dist/components/transaction-success.d.cts +20 -0
- package/dist/components/transaction-success.d.ts +20 -0
- package/dist/components/{creation-success.js → transaction-success.js} +10 -11
- package/dist/components/transaction-success.js.map +1 -0
- package/dist/components/transfer-collection-ownership.cjs +5 -4
- package/dist/components/transfer-collection-ownership.cjs.map +1 -1
- package/dist/components/transfer-collection-ownership.js +5 -4
- package/dist/components/transfer-collection-ownership.js.map +1 -1
- package/dist/components/wallet/export-key-section.cjs +3 -3
- package/dist/components/wallet/export-key-section.cjs.map +1 -1
- package/dist/components/wallet/export-key-section.d.cts +1 -2
- package/dist/components/wallet/export-key-section.d.ts +1 -2
- package/dist/components/wallet/export-key-section.js +3 -3
- package/dist/components/wallet/export-key-section.js.map +1 -1
- package/dist/index.cjs +6 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -8
- package/dist/index.js.map +1 -1
- package/dist/utils/describe-error.cjs +16 -11
- package/dist/utils/describe-error.cjs.map +1 -1
- package/dist/utils/describe-error.d.cts +4 -4
- package/dist/utils/describe-error.d.ts +4 -4
- package/dist/utils/describe-error.js +16 -10
- package/dist/utils/describe-error.js.map +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.cts +1 -1
- package/dist/utils/media-wallet/use-erc20-balance.d.ts +1 -1
- package/dist/utils/success-messages.cjs +54 -0
- package/dist/utils/success-messages.cjs.map +1 -0
- package/dist/utils/success-messages.d.cts +31 -0
- package/dist/utils/success-messages.d.ts +31 -0
- package/dist/utils/success-messages.js +30 -0
- package/dist/utils/success-messages.js.map +1 -0
- package/dist/utils/use-email-code.cjs +2 -2
- package/dist/utils/use-email-code.cjs.map +1 -1
- package/dist/utils/use-email-code.js +2 -2
- package/dist/utils/use-email-code.js.map +1 -1
- package/dist/utils/use-transaction.cjs +16 -2
- package/dist/utils/use-transaction.cjs.map +1 -1
- package/dist/utils/use-transaction.d.cts +1 -0
- package/dist/utils/use-transaction.d.ts +1 -0
- package/dist/utils/use-transaction.js +17 -3
- package/dist/utils/use-transaction.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/creation-success.cjs.map +0 -1
- package/dist/components/creation-success.d.cts +0 -20
- package/dist/components/creation-success.d.ts +0 -20
- package/dist/components/creation-success.js.map +0 -1
- package/dist/components/transaction-done.cjs +0 -46
- package/dist/components/transaction-done.cjs.map +0 -1
- package/dist/components/transaction-done.d.cts +0 -18
- package/dist/components/transaction-done.d.ts +0 -18
- package/dist/components/transaction-done.js +0 -22
- package/dist/components/transaction-done.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface SuccessMessage {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
}
|
|
5
|
+
declare const successMessages: {
|
|
6
|
+
listed: ({ name, price }: {
|
|
7
|
+
name: string;
|
|
8
|
+
price: string;
|
|
9
|
+
}) => SuccessMessage;
|
|
10
|
+
offered: ({ name, price }: {
|
|
11
|
+
name: string;
|
|
12
|
+
price: string;
|
|
13
|
+
}) => SuccessMessage;
|
|
14
|
+
accepted: ({ name, price }: {
|
|
15
|
+
name: string;
|
|
16
|
+
price: string;
|
|
17
|
+
}) => SuccessMessage;
|
|
18
|
+
countered: ({ name, price }: {
|
|
19
|
+
name: string;
|
|
20
|
+
price: string;
|
|
21
|
+
}) => SuccessMessage;
|
|
22
|
+
transferred: ({ name, to }: {
|
|
23
|
+
name: string;
|
|
24
|
+
to: string;
|
|
25
|
+
}) => SuccessMessage;
|
|
26
|
+
cancelled: ({ kind }: {
|
|
27
|
+
kind: string;
|
|
28
|
+
}) => SuccessMessage;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { type SuccessMessage, successMessages };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface SuccessMessage {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
}
|
|
5
|
+
declare const successMessages: {
|
|
6
|
+
listed: ({ name, price }: {
|
|
7
|
+
name: string;
|
|
8
|
+
price: string;
|
|
9
|
+
}) => SuccessMessage;
|
|
10
|
+
offered: ({ name, price }: {
|
|
11
|
+
name: string;
|
|
12
|
+
price: string;
|
|
13
|
+
}) => SuccessMessage;
|
|
14
|
+
accepted: ({ name, price }: {
|
|
15
|
+
name: string;
|
|
16
|
+
price: string;
|
|
17
|
+
}) => SuccessMessage;
|
|
18
|
+
countered: ({ name, price }: {
|
|
19
|
+
name: string;
|
|
20
|
+
price: string;
|
|
21
|
+
}) => SuccessMessage;
|
|
22
|
+
transferred: ({ name, to }: {
|
|
23
|
+
name: string;
|
|
24
|
+
to: string;
|
|
25
|
+
}) => SuccessMessage;
|
|
26
|
+
cancelled: ({ kind }: {
|
|
27
|
+
kind: string;
|
|
28
|
+
}) => SuccessMessage;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { type SuccessMessage, successMessages };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const successMessages = {
|
|
2
|
+
listed: ({ name, price }) => ({
|
|
3
|
+
title: "Listing created",
|
|
4
|
+
description: `${name} is listed for ${price}. The order is recorded onchain.`
|
|
5
|
+
}),
|
|
6
|
+
offered: ({ name, price }) => ({
|
|
7
|
+
title: "Offer created",
|
|
8
|
+
description: `Your offer of ${price} on ${name} is recorded onchain.`
|
|
9
|
+
}),
|
|
10
|
+
accepted: ({ name, price }) => ({
|
|
11
|
+
title: "Sale completed",
|
|
12
|
+
description: `${name} sold for ${price}. Ownership is recorded onchain with the buyer's wallet.`
|
|
13
|
+
}),
|
|
14
|
+
countered: ({ name, price }) => ({
|
|
15
|
+
title: "Counter-offer created",
|
|
16
|
+
description: `Your counter of ${price} on ${name} is recorded onchain.`
|
|
17
|
+
}),
|
|
18
|
+
transferred: ({ name, to }) => ({
|
|
19
|
+
title: "Transfer completed",
|
|
20
|
+
description: `${name} is owned by ${to}.`
|
|
21
|
+
}),
|
|
22
|
+
cancelled: ({ kind }) => ({
|
|
23
|
+
title: `${kind.charAt(0).toUpperCase()}${kind.slice(1)} cancelled`,
|
|
24
|
+
description: "The order is cancelled onchain."
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
successMessages
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=success-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/success-messages.ts"],"sourcesContent":["export interface SuccessMessage {\n title: string;\n description: string;\n}\n\nexport const successMessages = {\n listed: ({ name, price }: { name: string; price: string }): SuccessMessage => ({\n title: \"Listing created\",\n description: `${name} is listed for ${price}. The order is recorded onchain.`,\n }),\n offered: ({ name, price }: { name: string; price: string }): SuccessMessage => ({\n title: \"Offer created\",\n description: `Your offer of ${price} on ${name} is recorded onchain.`,\n }),\n accepted: ({ name, price }: { name: string; price: string }): SuccessMessage => ({\n title: \"Sale completed\",\n description: `${name} sold for ${price}. Ownership is recorded onchain with the buyer's wallet.`,\n }),\n countered: ({ name, price }: { name: string; price: string }): SuccessMessage => ({\n title: \"Counter-offer created\",\n description: `Your counter of ${price} on ${name} is recorded onchain.`,\n }),\n transferred: ({ name, to }: { name: string; to: string }): SuccessMessage => ({\n title: \"Transfer completed\",\n description: `${name} is owned by ${to}.`,\n }),\n cancelled: ({ kind }: { kind: string }): SuccessMessage => ({\n title: `${kind.charAt(0).toUpperCase()}${kind.slice(1)} cancelled`,\n description: \"The order is cancelled onchain.\",\n }),\n};\n"],"mappings":"AAKO,MAAM,kBAAkB;AAAA,EAC7B,QAAQ,CAAC,EAAE,MAAM,MAAM,OAAwD;AAAA,IAC7E,OAAO;AAAA,IACP,aAAa,GAAG,IAAI,kBAAkB,KAAK;AAAA,EAC7C;AAAA,EACA,SAAS,CAAC,EAAE,MAAM,MAAM,OAAwD;AAAA,IAC9E,OAAO;AAAA,IACP,aAAa,iBAAiB,KAAK,OAAO,IAAI;AAAA,EAChD;AAAA,EACA,UAAU,CAAC,EAAE,MAAM,MAAM,OAAwD;AAAA,IAC/E,OAAO;AAAA,IACP,aAAa,GAAG,IAAI,aAAa,KAAK;AAAA,EACxC;AAAA,EACA,WAAW,CAAC,EAAE,MAAM,MAAM,OAAwD;AAAA,IAChF,OAAO;AAAA,IACP,aAAa,mBAAmB,KAAK,OAAO,IAAI;AAAA,EAClD;AAAA,EACA,aAAa,CAAC,EAAE,MAAM,GAAG,OAAqD;AAAA,IAC5E,OAAO;AAAA,IACP,aAAa,GAAG,IAAI,gBAAgB,EAAE;AAAA,EACxC;AAAA,EACA,WAAW,CAAC,EAAE,KAAK,OAAyC;AAAA,IAC1D,OAAO,GAAG,KAAK,OAAO,CAAC,EAAE,YAAY,CAAC,GAAG,KAAK,MAAM,CAAC,CAAC;AAAA,IACtD,aAAa;AAAA,EACf;AACF;","names":[]}
|
|
@@ -41,7 +41,7 @@ function useEmailCode(email, api) {
|
|
|
41
41
|
dispatch({ type: "send-succeeded" });
|
|
42
42
|
return true;
|
|
43
43
|
} catch (err) {
|
|
44
|
-
dispatch({ type: "send-failed", message: (0, import_describe_error.describeError)(err
|
|
44
|
+
dispatch({ type: "send-failed", message: (0, import_describe_error.describeError)(err).message });
|
|
45
45
|
return false;
|
|
46
46
|
}
|
|
47
47
|
},
|
|
@@ -57,7 +57,7 @@ function useEmailCode(email, api) {
|
|
|
57
57
|
await after?.();
|
|
58
58
|
return true;
|
|
59
59
|
} catch (err) {
|
|
60
|
-
dispatch({ type: "verify-failed", message: (0, import_describe_error.describeError)(err
|
|
60
|
+
dispatch({ type: "verify-failed", message: (0, import_describe_error.describeError)(err).message });
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
63
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-email-code.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useReducer } from \"react\";\nimport type { AccountApi } from \"@medialane/sdk\";\nimport { describeError } from \"./describe-error.js\";\nimport { emailCodeReducer, initialEmailCodeState, type EmailCodeState } from \"./email-code.js\";\n\nexport type EmailCodeApi = Pick<AccountApi, \"requestEmailCode\" | \"verifyEmailCode\">;\n\nexport interface EmailCode {\n state: EmailCodeState;\n setCode(code: string): void;\n send(to?: string): Promise<boolean>;\n fail(message: string): void;\n verify(options?: { code?: string; after?: () => Promise<void> | void }): Promise<boolean>;\n markReady(): void;\n}\n\nexport function useEmailCode(email: string | null, api: () => EmailCodeApi): EmailCode {\n const [state, dispatch] = useReducer(emailCodeReducer, initialEmailCodeState);\n\n useEffect(() => {\n if (state.cooldown === 0) return;\n const id = setTimeout(() => dispatch({ type: \"tick\" }), 1000);\n return () => clearTimeout(id);\n }, [state.cooldown]);\n\n const send = useCallback(\n async (to = email) => {\n if (!to) return false;\n dispatch({ type: \"send-started\" });\n try {\n await api().requestEmailCode(to);\n dispatch({ type: \"send-succeeded\" });\n return true;\n } catch (err) {\n dispatch({ type: \"send-failed\", message: describeError(err
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-email-code.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useReducer } from \"react\";\nimport type { AccountApi } from \"@medialane/sdk\";\nimport { describeError } from \"./describe-error.js\";\nimport { emailCodeReducer, initialEmailCodeState, type EmailCodeState } from \"./email-code.js\";\n\nexport type EmailCodeApi = Pick<AccountApi, \"requestEmailCode\" | \"verifyEmailCode\">;\n\nexport interface EmailCode {\n state: EmailCodeState;\n setCode(code: string): void;\n send(to?: string): Promise<boolean>;\n fail(message: string): void;\n verify(options?: { code?: string; after?: () => Promise<void> | void }): Promise<boolean>;\n markReady(): void;\n}\n\nexport function useEmailCode(email: string | null, api: () => EmailCodeApi): EmailCode {\n const [state, dispatch] = useReducer(emailCodeReducer, initialEmailCodeState);\n\n useEffect(() => {\n if (state.cooldown === 0) return;\n const id = setTimeout(() => dispatch({ type: \"tick\" }), 1000);\n return () => clearTimeout(id);\n }, [state.cooldown]);\n\n const send = useCallback(\n async (to = email) => {\n if (!to) return false;\n dispatch({ type: \"send-started\" });\n try {\n await api().requestEmailCode(to);\n dispatch({ type: \"send-succeeded\" });\n return true;\n } catch (err) {\n dispatch({ type: \"send-failed\", message: describeError(err).message });\n return false;\n }\n },\n [email, api],\n );\n\n const verify = useCallback<EmailCode[\"verify\"]>(\n async ({ code, after } = {}) => {\n const toVerify = code ?? state.code;\n if (!email || toVerify.length !== 6) return false;\n dispatch({ type: \"verify-started\" });\n try {\n await api().verifyEmailCode(email, toVerify);\n await after?.();\n return true;\n } catch (err) {\n dispatch({ type: \"verify-failed\", message: describeError(err).message });\n return false;\n }\n },\n [email, state.code, api],\n );\n\n const setCode = useCallback((code: string) => dispatch({ type: \"code-changed\", code }), []);\n const markReady = useCallback(() => dispatch({ type: \"send-succeeded\" }), []);\n const fail = useCallback((message: string) => dispatch({ type: \"verify-failed\", message }), []);\n\n return { state, setCode, send, verify, markReady, fail };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAmD;AAEnD,4BAA8B;AAC9B,wBAA6E;AAatE,SAAS,aAAa,OAAsB,KAAoC;AACrF,QAAM,CAAC,OAAO,QAAQ,QAAI,yBAAW,oCAAkB,uCAAqB;AAE5E,8BAAU,MAAM;AACd,QAAI,MAAM,aAAa,EAAG;AAC1B,UAAM,KAAK,WAAW,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC,GAAG,GAAI;AAC5D,WAAO,MAAM,aAAa,EAAE;AAAA,EAC9B,GAAG,CAAC,MAAM,QAAQ,CAAC;AAEnB,QAAM,WAAO;AAAA,IACX,OAAO,KAAK,UAAU;AACpB,UAAI,CAAC,GAAI,QAAO;AAChB,eAAS,EAAE,MAAM,eAAe,CAAC;AACjC,UAAI;AACF,cAAM,IAAI,EAAE,iBAAiB,EAAE;AAC/B,iBAAS,EAAE,MAAM,iBAAiB,CAAC;AACnC,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,iBAAS,EAAE,MAAM,eAAe,aAAS,qCAAc,GAAG,EAAE,QAAQ,CAAC;AACrE,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,CAAC,OAAO,GAAG;AAAA,EACb;AAEA,QAAM,aAAS;AAAA,IACb,OAAO,EAAE,MAAM,MAAM,IAAI,CAAC,MAAM;AAC9B,YAAM,WAAW,QAAQ,MAAM;AAC/B,UAAI,CAAC,SAAS,SAAS,WAAW,EAAG,QAAO;AAC5C,eAAS,EAAE,MAAM,iBAAiB,CAAC;AACnC,UAAI;AACF,cAAM,IAAI,EAAE,gBAAgB,OAAO,QAAQ;AAC3C,cAAM,QAAQ;AACd,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,iBAAS,EAAE,MAAM,iBAAiB,aAAS,qCAAc,GAAG,EAAE,QAAQ,CAAC;AACvE,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,CAAC,OAAO,MAAM,MAAM,GAAG;AAAA,EACzB;AAEA,QAAM,cAAU,0BAAY,CAAC,SAAiB,SAAS,EAAE,MAAM,gBAAgB,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1F,QAAM,gBAAY,0BAAY,MAAM,SAAS,EAAE,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAC5E,QAAM,WAAO,0BAAY,CAAC,YAAoB,SAAS,EAAE,MAAM,iBAAiB,QAAQ,CAAC,GAAG,CAAC,CAAC;AAE9F,SAAO,EAAE,OAAO,SAAS,MAAM,QAAQ,WAAW,KAAK;AACzD;","names":[]}
|
|
@@ -18,7 +18,7 @@ function useEmailCode(email, api) {
|
|
|
18
18
|
dispatch({ type: "send-succeeded" });
|
|
19
19
|
return true;
|
|
20
20
|
} catch (err) {
|
|
21
|
-
dispatch({ type: "send-failed", message: describeError(err
|
|
21
|
+
dispatch({ type: "send-failed", message: describeError(err).message });
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
24
|
},
|
|
@@ -34,7 +34,7 @@ function useEmailCode(email, api) {
|
|
|
34
34
|
await after?.();
|
|
35
35
|
return true;
|
|
36
36
|
} catch (err) {
|
|
37
|
-
dispatch({ type: "verify-failed", message: describeError(err
|
|
37
|
+
dispatch({ type: "verify-failed", message: describeError(err).message });
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-email-code.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useReducer } from \"react\";\nimport type { AccountApi } from \"@medialane/sdk\";\nimport { describeError } from \"./describe-error.js\";\nimport { emailCodeReducer, initialEmailCodeState, type EmailCodeState } from \"./email-code.js\";\n\nexport type EmailCodeApi = Pick<AccountApi, \"requestEmailCode\" | \"verifyEmailCode\">;\n\nexport interface EmailCode {\n state: EmailCodeState;\n setCode(code: string): void;\n send(to?: string): Promise<boolean>;\n fail(message: string): void;\n verify(options?: { code?: string; after?: () => Promise<void> | void }): Promise<boolean>;\n markReady(): void;\n}\n\nexport function useEmailCode(email: string | null, api: () => EmailCodeApi): EmailCode {\n const [state, dispatch] = useReducer(emailCodeReducer, initialEmailCodeState);\n\n useEffect(() => {\n if (state.cooldown === 0) return;\n const id = setTimeout(() => dispatch({ type: \"tick\" }), 1000);\n return () => clearTimeout(id);\n }, [state.cooldown]);\n\n const send = useCallback(\n async (to = email) => {\n if (!to) return false;\n dispatch({ type: \"send-started\" });\n try {\n await api().requestEmailCode(to);\n dispatch({ type: \"send-succeeded\" });\n return true;\n } catch (err) {\n dispatch({ type: \"send-failed\", message: describeError(err
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-email-code.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useEffect, useReducer } from \"react\";\nimport type { AccountApi } from \"@medialane/sdk\";\nimport { describeError } from \"./describe-error.js\";\nimport { emailCodeReducer, initialEmailCodeState, type EmailCodeState } from \"./email-code.js\";\n\nexport type EmailCodeApi = Pick<AccountApi, \"requestEmailCode\" | \"verifyEmailCode\">;\n\nexport interface EmailCode {\n state: EmailCodeState;\n setCode(code: string): void;\n send(to?: string): Promise<boolean>;\n fail(message: string): void;\n verify(options?: { code?: string; after?: () => Promise<void> | void }): Promise<boolean>;\n markReady(): void;\n}\n\nexport function useEmailCode(email: string | null, api: () => EmailCodeApi): EmailCode {\n const [state, dispatch] = useReducer(emailCodeReducer, initialEmailCodeState);\n\n useEffect(() => {\n if (state.cooldown === 0) return;\n const id = setTimeout(() => dispatch({ type: \"tick\" }), 1000);\n return () => clearTimeout(id);\n }, [state.cooldown]);\n\n const send = useCallback(\n async (to = email) => {\n if (!to) return false;\n dispatch({ type: \"send-started\" });\n try {\n await api().requestEmailCode(to);\n dispatch({ type: \"send-succeeded\" });\n return true;\n } catch (err) {\n dispatch({ type: \"send-failed\", message: describeError(err).message });\n return false;\n }\n },\n [email, api],\n );\n\n const verify = useCallback<EmailCode[\"verify\"]>(\n async ({ code, after } = {}) => {\n const toVerify = code ?? state.code;\n if (!email || toVerify.length !== 6) return false;\n dispatch({ type: \"verify-started\" });\n try {\n await api().verifyEmailCode(email, toVerify);\n await after?.();\n return true;\n } catch (err) {\n dispatch({ type: \"verify-failed\", message: describeError(err).message });\n return false;\n }\n },\n [email, state.code, api],\n );\n\n const setCode = useCallback((code: string) => dispatch({ type: \"code-changed\", code }), []);\n const markReady = useCallback(() => dispatch({ type: \"send-succeeded\" }), []);\n const fail = useCallback((message: string) => dispatch({ type: \"verify-failed\", message }), []);\n\n return { state, setCode, send, verify, markReady, fail };\n}\n"],"mappings":";AAEA,SAAS,aAAa,WAAW,kBAAkB;AAEnD,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB,6BAAkD;AAatE,SAAS,aAAa,OAAsB,KAAoC;AACrF,QAAM,CAAC,OAAO,QAAQ,IAAI,WAAW,kBAAkB,qBAAqB;AAE5E,YAAU,MAAM;AACd,QAAI,MAAM,aAAa,EAAG;AAC1B,UAAM,KAAK,WAAW,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC,GAAG,GAAI;AAC5D,WAAO,MAAM,aAAa,EAAE;AAAA,EAC9B,GAAG,CAAC,MAAM,QAAQ,CAAC;AAEnB,QAAM,OAAO;AAAA,IACX,OAAO,KAAK,UAAU;AACpB,UAAI,CAAC,GAAI,QAAO;AAChB,eAAS,EAAE,MAAM,eAAe,CAAC;AACjC,UAAI;AACF,cAAM,IAAI,EAAE,iBAAiB,EAAE;AAC/B,iBAAS,EAAE,MAAM,iBAAiB,CAAC;AACnC,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,iBAAS,EAAE,MAAM,eAAe,SAAS,cAAc,GAAG,EAAE,QAAQ,CAAC;AACrE,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,CAAC,OAAO,GAAG;AAAA,EACb;AAEA,QAAM,SAAS;AAAA,IACb,OAAO,EAAE,MAAM,MAAM,IAAI,CAAC,MAAM;AAC9B,YAAM,WAAW,QAAQ,MAAM;AAC/B,UAAI,CAAC,SAAS,SAAS,WAAW,EAAG,QAAO;AAC5C,eAAS,EAAE,MAAM,iBAAiB,CAAC;AACnC,UAAI;AACF,cAAM,IAAI,EAAE,gBAAgB,OAAO,QAAQ;AAC3C,cAAM,QAAQ;AACd,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,iBAAS,EAAE,MAAM,iBAAiB,SAAS,cAAc,GAAG,EAAE,QAAQ,CAAC;AACvE,eAAO;AAAA,MACT;AAAA,IACF;AAAA,IACA,CAAC,OAAO,MAAM,MAAM,GAAG;AAAA,EACzB;AAEA,QAAM,UAAU,YAAY,CAAC,SAAiB,SAAS,EAAE,MAAM,gBAAgB,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1F,QAAM,YAAY,YAAY,MAAM,SAAS,EAAE,MAAM,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAC5E,QAAM,OAAO,YAAY,CAAC,YAAoB,SAAS,EAAE,MAAM,iBAAiB,QAAQ,CAAC,GAAG,CAAC,CAAC;AAE9F,SAAO,EAAE,OAAO,SAAS,MAAM,QAAQ,WAAW,KAAK;AACzD;","names":[]}
|
|
@@ -32,12 +32,14 @@ function useTransaction() {
|
|
|
32
32
|
const [txHash, setTxHash] = (0, import_react.useState)(null);
|
|
33
33
|
const [receipt, setReceipt] = (0, import_react.useState)(null);
|
|
34
34
|
const [error, setError] = (0, import_react.useState)(null);
|
|
35
|
+
const [retryable, setRetryable] = (0, import_react.useState)(true);
|
|
35
36
|
const run = (0, import_react.useCallback)(
|
|
36
37
|
async (work) => {
|
|
37
38
|
setPhase("preparing");
|
|
38
39
|
setTxHash(null);
|
|
39
40
|
setReceipt(null);
|
|
40
41
|
setError(null);
|
|
42
|
+
setRetryable(true);
|
|
41
43
|
try {
|
|
42
44
|
const signer = await app.getSigner();
|
|
43
45
|
let hash = null;
|
|
@@ -62,7 +64,18 @@ function useTransaction() {
|
|
|
62
64
|
setPhase("success");
|
|
63
65
|
return true;
|
|
64
66
|
} catch (err) {
|
|
65
|
-
|
|
67
|
+
if (err instanceof import_starknet.SponsoredCallRejectedError) {
|
|
68
|
+
console.error("[medialane] transaction refused", {
|
|
69
|
+
reference: err.requestId?.slice(0, 8),
|
|
70
|
+
stage: err.stage,
|
|
71
|
+
status: err.status,
|
|
72
|
+
code: err.code,
|
|
73
|
+
detail: err.detail
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const notice = (0, import_describe_error.describeError)(err);
|
|
77
|
+
setError(notice.message);
|
|
78
|
+
setRetryable(notice.retryable);
|
|
66
79
|
setPhase("error");
|
|
67
80
|
return false;
|
|
68
81
|
} finally {
|
|
@@ -76,8 +89,9 @@ function useTransaction() {
|
|
|
76
89
|
setTxHash(null);
|
|
77
90
|
setReceipt(null);
|
|
78
91
|
setError(null);
|
|
92
|
+
setRetryable(true);
|
|
79
93
|
}, []);
|
|
80
|
-
return { phase, txHash, receipt, error, run, reset };
|
|
94
|
+
return { phase, txHash, receipt, error, retryable, run, reset };
|
|
81
95
|
}
|
|
82
96
|
// Annotate the CommonJS export names for ESM import in node:
|
|
83
97
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-transaction.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\nimport { assertTransactionSucceeded, syncTransactionBestEffort, type ReceiptLike } from \"@medialane/sdk/starknet\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\nimport type { FastMintSigner } from \"../components/fast-mint/types.js\";\nimport { describeError } from \"./describe-error.js\";\n\nexport type TransactionPhase = \"idle\" | \"preparing\" | \"submitting\" | \"confirming\" | \"success\" | \"error\";\n\nexport function useTransaction() {\n const app = useMedialaneApp();\n const [phase, setPhase] = useState<TransactionPhase>(\"idle\");\n const [txHash, setTxHash] = useState<string | null>(null);\n const [receipt, setReceipt] = useState<ReceiptLike | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n const run = useCallback(\n async (work: (signer: FastMintSigner) => Promise<void>): Promise<boolean> => {\n setPhase(\"preparing\");\n setTxHash(null);\n setReceipt(null);\n setError(null);\n try {\n const signer = await app.getSigner();\n let hash: string | null = null;\n const tracked: FastMintSigner = {\n address: signer.address,\n signTypedData: (data) => signer.signTypedData(data),\n execute: async (calls, opts) => {\n setPhase(\"submitting\");\n const result = await signer.execute(calls, opts);\n hash = result.txHash;\n setTxHash(result.txHash);\n setPhase(\"confirming\");\n return result;\n },\n };\n await work(tracked);\n if (hash) {\n const client = app.getClient();\n setReceipt(await assertTransactionSucceeded(client.provider, hash));\n await syncTransactionBestEffort(client, hash);\n }\n setPhase(\"success\");\n return true;\n } catch (err) {\n
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-transaction.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\nimport { SponsoredCallRejectedError, assertTransactionSucceeded, syncTransactionBestEffort, type ReceiptLike } from \"@medialane/sdk/starknet\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\nimport type { FastMintSigner } from \"../components/fast-mint/types.js\";\nimport { describeError } from \"./describe-error.js\";\n\nexport type TransactionPhase = \"idle\" | \"preparing\" | \"submitting\" | \"confirming\" | \"success\" | \"error\";\n\nexport function useTransaction() {\n const app = useMedialaneApp();\n const [phase, setPhase] = useState<TransactionPhase>(\"idle\");\n const [txHash, setTxHash] = useState<string | null>(null);\n const [receipt, setReceipt] = useState<ReceiptLike | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [retryable, setRetryable] = useState(true);\n\n const run = useCallback(\n async (work: (signer: FastMintSigner) => Promise<void>): Promise<boolean> => {\n setPhase(\"preparing\");\n setTxHash(null);\n setReceipt(null);\n setError(null);\n setRetryable(true);\n try {\n const signer = await app.getSigner();\n let hash: string | null = null;\n const tracked: FastMintSigner = {\n address: signer.address,\n signTypedData: (data) => signer.signTypedData(data),\n execute: async (calls, opts) => {\n setPhase(\"submitting\");\n const result = await signer.execute(calls, opts);\n hash = result.txHash;\n setTxHash(result.txHash);\n setPhase(\"confirming\");\n return result;\n },\n };\n await work(tracked);\n if (hash) {\n const client = app.getClient();\n setReceipt(await assertTransactionSucceeded(client.provider, hash));\n await syncTransactionBestEffort(client, hash);\n }\n setPhase(\"success\");\n return true;\n } catch (err) {\n if (err instanceof SponsoredCallRejectedError) {\n console.error(\"[medialane] transaction refused\", {\n reference: err.requestId?.slice(0, 8),\n stage: err.stage,\n status: err.status,\n code: err.code,\n detail: err.detail,\n });\n }\n const notice = describeError(err);\n setError(notice.message);\n setRetryable(notice.retryable);\n setPhase(\"error\");\n return false;\n } finally {\n app.releaseSigner?.();\n }\n },\n [app],\n );\n\n const reset = useCallback(() => {\n setPhase(\"idle\");\n setTxHash(null);\n setReceipt(null);\n setError(null);\n setRetryable(true);\n }, []);\n\n return { phase, txHash, receipt, error, retryable, run, reset };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAsC;AACtC,sBAAoH;AACpH,2BAAgC;AAEhC,4BAA8B;AAIvB,SAAS,iBAAiB;AAC/B,QAAM,UAAM,sCAAgB;AAC5B,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAA2B,MAAM;AAC3D,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAwB,IAAI;AACxD,QAAM,CAAC,SAAS,UAAU,QAAI,uBAA6B,IAAI;AAC/D,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAwB,IAAI;AACtD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,IAAI;AAE/C,QAAM,UAAM;AAAA,IACV,OAAO,SAAsE;AAC3E,eAAS,WAAW;AACpB,gBAAU,IAAI;AACd,iBAAW,IAAI;AACf,eAAS,IAAI;AACb,mBAAa,IAAI;AACjB,UAAI;AACF,cAAM,SAAS,MAAM,IAAI,UAAU;AACnC,YAAI,OAAsB;AAC1B,cAAM,UAA0B;AAAA,UAC9B,SAAS,OAAO;AAAA,UAChB,eAAe,CAAC,SAAS,OAAO,cAAc,IAAI;AAAA,UAClD,SAAS,OAAO,OAAO,SAAS;AAC9B,qBAAS,YAAY;AACrB,kBAAM,SAAS,MAAM,OAAO,QAAQ,OAAO,IAAI;AAC/C,mBAAO,OAAO;AACd,sBAAU,OAAO,MAAM;AACvB,qBAAS,YAAY;AACrB,mBAAO;AAAA,UACT;AAAA,QACF;AACA,cAAM,KAAK,OAAO;AAClB,YAAI,MAAM;AACR,gBAAM,SAAS,IAAI,UAAU;AAC7B,qBAAW,UAAM,4CAA2B,OAAO,UAAU,IAAI,CAAC;AAClE,oBAAM,2CAA0B,QAAQ,IAAI;AAAA,QAC9C;AACA,iBAAS,SAAS;AAClB,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,YAAI,eAAe,4CAA4B;AAC7C,kBAAQ,MAAM,mCAAmC;AAAA,YAC/C,WAAW,IAAI,WAAW,MAAM,GAAG,CAAC;AAAA,YACpC,OAAO,IAAI;AAAA,YACX,QAAQ,IAAI;AAAA,YACZ,MAAM,IAAI;AAAA,YACV,QAAQ,IAAI;AAAA,UACd,CAAC;AAAA,QACH;AACA,cAAM,aAAS,qCAAc,GAAG;AAChC,iBAAS,OAAO,OAAO;AACvB,qBAAa,OAAO,SAAS;AAC7B,iBAAS,OAAO;AAChB,eAAO;AAAA,MACT,UAAE;AACA,YAAI,gBAAgB;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,GAAG;AAAA,EACN;AAEA,QAAM,YAAQ,0BAAY,MAAM;AAC9B,aAAS,MAAM;AACf,cAAU,IAAI;AACd,eAAW,IAAI;AACf,aAAS,IAAI;AACb,iBAAa,IAAI;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,SAAO,EAAE,OAAO,QAAQ,SAAS,OAAO,WAAW,KAAK,MAAM;AAChE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
|
-
import { assertTransactionSucceeded, syncTransactionBestEffort } from "@medialane/sdk/starknet";
|
|
3
|
+
import { SponsoredCallRejectedError, assertTransactionSucceeded, syncTransactionBestEffort } from "@medialane/sdk/starknet";
|
|
4
4
|
import { useMedialaneApp } from "../components/medialane-app.js";
|
|
5
5
|
import { describeError } from "./describe-error.js";
|
|
6
6
|
function useTransaction() {
|
|
@@ -9,12 +9,14 @@ function useTransaction() {
|
|
|
9
9
|
const [txHash, setTxHash] = useState(null);
|
|
10
10
|
const [receipt, setReceipt] = useState(null);
|
|
11
11
|
const [error, setError] = useState(null);
|
|
12
|
+
const [retryable, setRetryable] = useState(true);
|
|
12
13
|
const run = useCallback(
|
|
13
14
|
async (work) => {
|
|
14
15
|
setPhase("preparing");
|
|
15
16
|
setTxHash(null);
|
|
16
17
|
setReceipt(null);
|
|
17
18
|
setError(null);
|
|
19
|
+
setRetryable(true);
|
|
18
20
|
try {
|
|
19
21
|
const signer = await app.getSigner();
|
|
20
22
|
let hash = null;
|
|
@@ -39,7 +41,18 @@ function useTransaction() {
|
|
|
39
41
|
setPhase("success");
|
|
40
42
|
return true;
|
|
41
43
|
} catch (err) {
|
|
42
|
-
|
|
44
|
+
if (err instanceof SponsoredCallRejectedError) {
|
|
45
|
+
console.error("[medialane] transaction refused", {
|
|
46
|
+
reference: err.requestId?.slice(0, 8),
|
|
47
|
+
stage: err.stage,
|
|
48
|
+
status: err.status,
|
|
49
|
+
code: err.code,
|
|
50
|
+
detail: err.detail
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const notice = describeError(err);
|
|
54
|
+
setError(notice.message);
|
|
55
|
+
setRetryable(notice.retryable);
|
|
43
56
|
setPhase("error");
|
|
44
57
|
return false;
|
|
45
58
|
} finally {
|
|
@@ -53,8 +66,9 @@ function useTransaction() {
|
|
|
53
66
|
setTxHash(null);
|
|
54
67
|
setReceipt(null);
|
|
55
68
|
setError(null);
|
|
69
|
+
setRetryable(true);
|
|
56
70
|
}, []);
|
|
57
|
-
return { phase, txHash, receipt, error, run, reset };
|
|
71
|
+
return { phase, txHash, receipt, error, retryable, run, reset };
|
|
58
72
|
}
|
|
59
73
|
export {
|
|
60
74
|
useTransaction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/use-transaction.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\nimport { assertTransactionSucceeded, syncTransactionBestEffort, type ReceiptLike } from \"@medialane/sdk/starknet\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\nimport type { FastMintSigner } from \"../components/fast-mint/types.js\";\nimport { describeError } from \"./describe-error.js\";\n\nexport type TransactionPhase = \"idle\" | \"preparing\" | \"submitting\" | \"confirming\" | \"success\" | \"error\";\n\nexport function useTransaction() {\n const app = useMedialaneApp();\n const [phase, setPhase] = useState<TransactionPhase>(\"idle\");\n const [txHash, setTxHash] = useState<string | null>(null);\n const [receipt, setReceipt] = useState<ReceiptLike | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n const run = useCallback(\n async (work: (signer: FastMintSigner) => Promise<void>): Promise<boolean> => {\n setPhase(\"preparing\");\n setTxHash(null);\n setReceipt(null);\n setError(null);\n try {\n const signer = await app.getSigner();\n let hash: string | null = null;\n const tracked: FastMintSigner = {\n address: signer.address,\n signTypedData: (data) => signer.signTypedData(data),\n execute: async (calls, opts) => {\n setPhase(\"submitting\");\n const result = await signer.execute(calls, opts);\n hash = result.txHash;\n setTxHash(result.txHash);\n setPhase(\"confirming\");\n return result;\n },\n };\n await work(tracked);\n if (hash) {\n const client = app.getClient();\n setReceipt(await assertTransactionSucceeded(client.provider, hash));\n await syncTransactionBestEffort(client, hash);\n }\n setPhase(\"success\");\n return true;\n } catch (err) {\n
|
|
1
|
+
{"version":3,"sources":["../../src/utils/use-transaction.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\nimport { SponsoredCallRejectedError, assertTransactionSucceeded, syncTransactionBestEffort, type ReceiptLike } from \"@medialane/sdk/starknet\";\nimport { useMedialaneApp } from \"../components/medialane-app.js\";\nimport type { FastMintSigner } from \"../components/fast-mint/types.js\";\nimport { describeError } from \"./describe-error.js\";\n\nexport type TransactionPhase = \"idle\" | \"preparing\" | \"submitting\" | \"confirming\" | \"success\" | \"error\";\n\nexport function useTransaction() {\n const app = useMedialaneApp();\n const [phase, setPhase] = useState<TransactionPhase>(\"idle\");\n const [txHash, setTxHash] = useState<string | null>(null);\n const [receipt, setReceipt] = useState<ReceiptLike | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [retryable, setRetryable] = useState(true);\n\n const run = useCallback(\n async (work: (signer: FastMintSigner) => Promise<void>): Promise<boolean> => {\n setPhase(\"preparing\");\n setTxHash(null);\n setReceipt(null);\n setError(null);\n setRetryable(true);\n try {\n const signer = await app.getSigner();\n let hash: string | null = null;\n const tracked: FastMintSigner = {\n address: signer.address,\n signTypedData: (data) => signer.signTypedData(data),\n execute: async (calls, opts) => {\n setPhase(\"submitting\");\n const result = await signer.execute(calls, opts);\n hash = result.txHash;\n setTxHash(result.txHash);\n setPhase(\"confirming\");\n return result;\n },\n };\n await work(tracked);\n if (hash) {\n const client = app.getClient();\n setReceipt(await assertTransactionSucceeded(client.provider, hash));\n await syncTransactionBestEffort(client, hash);\n }\n setPhase(\"success\");\n return true;\n } catch (err) {\n if (err instanceof SponsoredCallRejectedError) {\n console.error(\"[medialane] transaction refused\", {\n reference: err.requestId?.slice(0, 8),\n stage: err.stage,\n status: err.status,\n code: err.code,\n detail: err.detail,\n });\n }\n const notice = describeError(err);\n setError(notice.message);\n setRetryable(notice.retryable);\n setPhase(\"error\");\n return false;\n } finally {\n app.releaseSigner?.();\n }\n },\n [app],\n );\n\n const reset = useCallback(() => {\n setPhase(\"idle\");\n setTxHash(null);\n setReceipt(null);\n setError(null);\n setRetryable(true);\n }, []);\n\n return { phase, txHash, receipt, error, retryable, run, reset };\n}\n"],"mappings":";AAEA,SAAS,aAAa,gBAAgB;AACtC,SAAS,4BAA4B,4BAA4B,iCAAmD;AACpH,SAAS,uBAAuB;AAEhC,SAAS,qBAAqB;AAIvB,SAAS,iBAAiB;AAC/B,QAAM,MAAM,gBAAgB;AAC5B,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA2B,MAAM;AAC3D,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAwB,IAAI;AACxD,QAAM,CAAC,SAAS,UAAU,IAAI,SAA6B,IAAI;AAC/D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AACtD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,IAAI;AAE/C,QAAM,MAAM;AAAA,IACV,OAAO,SAAsE;AAC3E,eAAS,WAAW;AACpB,gBAAU,IAAI;AACd,iBAAW,IAAI;AACf,eAAS,IAAI;AACb,mBAAa,IAAI;AACjB,UAAI;AACF,cAAM,SAAS,MAAM,IAAI,UAAU;AACnC,YAAI,OAAsB;AAC1B,cAAM,UAA0B;AAAA,UAC9B,SAAS,OAAO;AAAA,UAChB,eAAe,CAAC,SAAS,OAAO,cAAc,IAAI;AAAA,UAClD,SAAS,OAAO,OAAO,SAAS;AAC9B,qBAAS,YAAY;AACrB,kBAAM,SAAS,MAAM,OAAO,QAAQ,OAAO,IAAI;AAC/C,mBAAO,OAAO;AACd,sBAAU,OAAO,MAAM;AACvB,qBAAS,YAAY;AACrB,mBAAO;AAAA,UACT;AAAA,QACF;AACA,cAAM,KAAK,OAAO;AAClB,YAAI,MAAM;AACR,gBAAM,SAAS,IAAI,UAAU;AAC7B,qBAAW,MAAM,2BAA2B,OAAO,UAAU,IAAI,CAAC;AAClE,gBAAM,0BAA0B,QAAQ,IAAI;AAAA,QAC9C;AACA,iBAAS,SAAS;AAClB,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,YAAI,eAAe,4BAA4B;AAC7C,kBAAQ,MAAM,mCAAmC;AAAA,YAC/C,WAAW,IAAI,WAAW,MAAM,GAAG,CAAC;AAAA,YACpC,OAAO,IAAI;AAAA,YACX,QAAQ,IAAI;AAAA,YACZ,MAAM,IAAI;AAAA,YACV,QAAQ,IAAI;AAAA,UACd,CAAC;AAAA,QACH;AACA,cAAM,SAAS,cAAc,GAAG;AAChC,iBAAS,OAAO,OAAO;AACvB,qBAAa,OAAO,SAAS;AAC7B,iBAAS,OAAO;AAChB,eAAO;AAAA,MACT,UAAE;AACA,YAAI,gBAAgB;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,GAAG;AAAA,EACN;AAEA,QAAM,QAAQ,YAAY,MAAM;AAC9B,aAAS,MAAM;AACf,cAAU,IAAI;AACd,eAAW,IAAI;AACf,aAAS,IAAI;AACb,iBAAa,IAAI;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,SAAO,EAAE,OAAO,QAAQ,SAAS,OAAO,WAAW,KAAK,MAAM;AAChE;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medialane/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.259.0",
|
|
4
4
|
"description": "Shared UI components for Medialane apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"preview": "vite --config preview/vite.config.ts"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@medialane/sdk": ">=0.
|
|
54
|
+
"@medialane/sdk": ">=0.207.0 <0.208.0",
|
|
55
55
|
"@radix-ui/react-checkbox": ">=1.1.0",
|
|
56
56
|
"@radix-ui/react-collapsible": ">=1.1.0",
|
|
57
57
|
"@radix-ui/react-dialog": ">=1.1.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@happy-dom/global-registrator": "^20.14.5",
|
|
87
87
|
"@hookform/resolvers": "^3.10.0",
|
|
88
|
-
"@medialane/sdk": "0.
|
|
88
|
+
"@medialane/sdk": "0.207.0",
|
|
89
89
|
"@radix-ui/react-checkbox": "^1.3.8",
|
|
90
90
|
"@radix-ui/react-collapsible": "^1.1.17",
|
|
91
91
|
"@radix-ui/react-dialog": "^1.1.20",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/creation-success.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Check, ImageIcon } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Button } from \"./button.js\";\n\nexport interface CreationSuccessAction {\n href: string;\n label: string;\n}\n\nexport interface CreationSuccessProps {\n name: string;\n image?: string | null;\n caption: string;\n primary?: CreationSuccessAction;\n secondary?: CreationSuccessAction;\n onAgain: () => void;\n againLabel: string;\n children?: ReactNode;\n}\n\nexport function CreationSuccess({ name, image, caption, primary, secondary, onAgain, againLabel, children }: CreationSuccessProps) {\n return (\n <div className=\"flex w-full flex-col items-center gap-6 py-2 text-center\">\n <div className=\"relative\">\n <div className=\"relative h-40 w-40 overflow-hidden rounded-3xl border border-border bg-muted shadow-lg\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"160px\" unoptimized className=\"object-cover\" />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center text-muted-foreground/40\">\n <ImageIcon className=\"h-10 w-10\" />\n </div>\n )}\n </div>\n <span className=\"absolute -bottom-2 -right-2 flex h-9 w-9 items-center justify-center rounded-full bg-emerald-500 text-white ring-4 ring-background\">\n <Check className=\"h-5 w-5\" strokeWidth={3} />\n </span>\n </div>\n\n <div className=\"w-full min-w-0 space-y-1\">\n <p className=\"line-clamp-2 break-words text-xl font-bold\">{name}</p>\n <p className=\"text-sm text-muted-foreground\">{caption}</p>\n </div>\n\n <div className=\"flex w-full flex-col gap-2\">\n {(primary || secondary) && (\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n {primary && (\n <Button asChild className=\"flex-1\">\n <Link href={primary.href}>{primary.label}</Link>\n </Button>\n )}\n {secondary && (\n <Button asChild variant=\"outline\" className=\"flex-1\">\n <Link href={secondary.href}>{secondary.label}</Link>\n </Button>\n )}\n </div>\n )}\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={onAgain}>\n {againLabel}\n </Button>\n </div>\n\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BM;AAxBN,0BAAiC;AACjC,kBAAiB;AACjB,mBAAkB;AAClB,oBAAuB;AAkBhB,SAAS,gBAAgB,EAAE,MAAM,OAAO,SAAS,SAAS,WAAW,SAAS,YAAY,SAAS,GAAyB;AACjI,SACE,6CAAC,SAAI,WAAU,4DACb;AAAA,iDAAC,SAAI,WAAU,YACb;AAAA,kDAAC,SAAI,WAAU,0FACZ,kBACC,4CAAC,aAAAA,SAAA,EAAM,KAAK,OAAO,KAAK,MAAM,MAAI,MAAC,OAAM,SAAQ,aAAW,MAAC,WAAU,gBAAe,IAEtF,4CAAC,SAAI,WAAU,2EACb,sDAAC,iCAAU,WAAU,aAAY,GACnC,GAEJ;AAAA,MACA,4CAAC,UAAK,WAAU,sIACd,sDAAC,6BAAM,WAAU,WAAU,aAAa,GAAG,GAC7C;AAAA,OACF;AAAA,IAEA,6CAAC,SAAI,WAAU,4BACb;AAAA,kDAAC,OAAE,WAAU,8CAA8C,gBAAK;AAAA,MAChE,4CAAC,OAAE,WAAU,iCAAiC,mBAAQ;AAAA,OACxD;AAAA,IAEA,6CAAC,SAAI,WAAU,8BACX;AAAA,kBAAW,cACX,6CAAC,SAAI,WAAU,mCACZ;AAAA,mBACC,4CAAC,wBAAO,SAAO,MAAC,WAAU,UACxB,sDAAC,YAAAC,SAAA,EAAK,MAAM,QAAQ,MAAO,kBAAQ,OAAM,GAC3C;AAAA,QAED,aACC,4CAAC,wBAAO,SAAO,MAAC,SAAQ,WAAU,WAAU,UAC1C,sDAAC,YAAAA,SAAA,EAAK,MAAM,UAAU,MAAO,oBAAU,OAAM,GAC/C;AAAA,SAEJ;AAAA,MAEF,4CAAC,wBAAO,SAAQ,SAAQ,MAAK,MAAK,WAAU,yBAAwB,SAAS,SAC1E,sBACH;AAAA,OACF;AAAA,IAEC;AAAA,KACH;AAEJ;","names":["Image","Link"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
interface CreationSuccessAction {
|
|
5
|
-
href: string;
|
|
6
|
-
label: string;
|
|
7
|
-
}
|
|
8
|
-
interface CreationSuccessProps {
|
|
9
|
-
name: string;
|
|
10
|
-
image?: string | null;
|
|
11
|
-
caption: string;
|
|
12
|
-
primary?: CreationSuccessAction;
|
|
13
|
-
secondary?: CreationSuccessAction;
|
|
14
|
-
onAgain: () => void;
|
|
15
|
-
againLabel: string;
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
declare function CreationSuccess({ name, image, caption, primary, secondary, onAgain, againLabel, children }: CreationSuccessProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
export { CreationSuccess, type CreationSuccessAction, type CreationSuccessProps };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
interface CreationSuccessAction {
|
|
5
|
-
href: string;
|
|
6
|
-
label: string;
|
|
7
|
-
}
|
|
8
|
-
interface CreationSuccessProps {
|
|
9
|
-
name: string;
|
|
10
|
-
image?: string | null;
|
|
11
|
-
caption: string;
|
|
12
|
-
primary?: CreationSuccessAction;
|
|
13
|
-
secondary?: CreationSuccessAction;
|
|
14
|
-
onAgain: () => void;
|
|
15
|
-
againLabel: string;
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
declare function CreationSuccess({ name, image, caption, primary, secondary, onAgain, againLabel, children }: CreationSuccessProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
export { CreationSuccess, type CreationSuccessAction, type CreationSuccessProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/creation-success.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Check, ImageIcon } from \"lucide-react\";\nimport Link from \"./link.js\";\nimport Image from \"./image.js\";\nimport { Button } from \"./button.js\";\n\nexport interface CreationSuccessAction {\n href: string;\n label: string;\n}\n\nexport interface CreationSuccessProps {\n name: string;\n image?: string | null;\n caption: string;\n primary?: CreationSuccessAction;\n secondary?: CreationSuccessAction;\n onAgain: () => void;\n againLabel: string;\n children?: ReactNode;\n}\n\nexport function CreationSuccess({ name, image, caption, primary, secondary, onAgain, againLabel, children }: CreationSuccessProps) {\n return (\n <div className=\"flex w-full flex-col items-center gap-6 py-2 text-center\">\n <div className=\"relative\">\n <div className=\"relative h-40 w-40 overflow-hidden rounded-3xl border border-border bg-muted shadow-lg\">\n {image ? (\n <Image src={image} alt={name} fill sizes=\"160px\" unoptimized className=\"object-cover\" />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center text-muted-foreground/40\">\n <ImageIcon className=\"h-10 w-10\" />\n </div>\n )}\n </div>\n <span className=\"absolute -bottom-2 -right-2 flex h-9 w-9 items-center justify-center rounded-full bg-emerald-500 text-white ring-4 ring-background\">\n <Check className=\"h-5 w-5\" strokeWidth={3} />\n </span>\n </div>\n\n <div className=\"w-full min-w-0 space-y-1\">\n <p className=\"line-clamp-2 break-words text-xl font-bold\">{name}</p>\n <p className=\"text-sm text-muted-foreground\">{caption}</p>\n </div>\n\n <div className=\"flex w-full flex-col gap-2\">\n {(primary || secondary) && (\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n {primary && (\n <Button asChild className=\"flex-1\">\n <Link href={primary.href}>{primary.label}</Link>\n </Button>\n )}\n {secondary && (\n <Button asChild variant=\"outline\" className=\"flex-1\">\n <Link href={secondary.href}>{secondary.label}</Link>\n </Button>\n )}\n </div>\n )}\n <Button variant=\"ghost\" size=\"sm\" className=\"text-muted-foreground\" onClick={onAgain}>\n {againLabel}\n </Button>\n </div>\n\n {children}\n </div>\n );\n}\n"],"mappings":";AA2BM,SAGM,KAHN;AAxBN,SAAS,OAAO,iBAAiB;AACjC,OAAO,UAAU;AACjB,OAAO,WAAW;AAClB,SAAS,cAAc;AAkBhB,SAAS,gBAAgB,EAAE,MAAM,OAAO,SAAS,SAAS,WAAW,SAAS,YAAY,SAAS,GAAyB;AACjI,SACE,qBAAC,SAAI,WAAU,4DACb;AAAA,yBAAC,SAAI,WAAU,YACb;AAAA,0BAAC,SAAI,WAAU,0FACZ,kBACC,oBAAC,SAAM,KAAK,OAAO,KAAK,MAAM,MAAI,MAAC,OAAM,SAAQ,aAAW,MAAC,WAAU,gBAAe,IAEtF,oBAAC,SAAI,WAAU,2EACb,8BAAC,aAAU,WAAU,aAAY,GACnC,GAEJ;AAAA,MACA,oBAAC,UAAK,WAAU,sIACd,8BAAC,SAAM,WAAU,WAAU,aAAa,GAAG,GAC7C;AAAA,OACF;AAAA,IAEA,qBAAC,SAAI,WAAU,4BACb;AAAA,0BAAC,OAAE,WAAU,8CAA8C,gBAAK;AAAA,MAChE,oBAAC,OAAE,WAAU,iCAAiC,mBAAQ;AAAA,OACxD;AAAA,IAEA,qBAAC,SAAI,WAAU,8BACX;AAAA,kBAAW,cACX,qBAAC,SAAI,WAAU,mCACZ;AAAA,mBACC,oBAAC,UAAO,SAAO,MAAC,WAAU,UACxB,8BAAC,QAAK,MAAM,QAAQ,MAAO,kBAAQ,OAAM,GAC3C;AAAA,QAED,aACC,oBAAC,UAAO,SAAO,MAAC,SAAQ,WAAU,WAAU,UAC1C,8BAAC,QAAK,MAAM,UAAU,MAAO,oBAAU,OAAM,GAC/C;AAAA,SAEJ;AAAA,MAEF,oBAAC,UAAO,SAAQ,SAAQ,MAAK,MAAK,WAAU,yBAAwB,SAAS,SAC1E,sBACH;AAAA,OACF;AAAA,IAEC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var transaction_done_exports = {};
|
|
21
|
-
__export(transaction_done_exports, {
|
|
22
|
-
TransactionDone: () => TransactionDone
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(transaction_done_exports);
|
|
25
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
-
var import_marketplace_dialog_primitives = require("./marketplace-dialog-primitives.js");
|
|
27
|
-
var import_explorer_url = require("../utils/explorer-url.js");
|
|
28
|
-
function TransactionDone({ tx, name, title, description, footer }) {
|
|
29
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
30
|
-
import_marketplace_dialog_primitives.MarketplaceSuccessState,
|
|
31
|
-
{
|
|
32
|
-
name,
|
|
33
|
-
title,
|
|
34
|
-
description,
|
|
35
|
-
txHash: tx.txHash,
|
|
36
|
-
explorerUrl: import_explorer_url.EXPLORER_URL,
|
|
37
|
-
footer,
|
|
38
|
-
onDone: tx.reset
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
TransactionDone
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=transaction-done.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/transaction-done.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { MarketplaceSuccessState } from \"./marketplace-dialog-primitives.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDoneProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"txHash\" | \"reset\">;\n name: string;\n title: string;\n description: ReactNode;\n footer?: ReactNode;\n}\n\nexport function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps) {\n return (\n <MarketplaceSuccessState\n name={name}\n title={title}\n description={description}\n txHash={tx.txHash}\n explorerUrl={EXPLORER_URL}\n footer={footer}\n onDone={tx.reset}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBI;AAdJ,2CAAwC;AACxC,0BAA6B;AAWtB,SAAS,gBAAgB,EAAE,IAAI,MAAM,OAAO,aAAa,OAAO,GAAyB;AAC9F,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,GAAG;AAAA,MACX,aAAa;AAAA,MACb;AAAA,MACA,QAAQ,GAAG;AAAA;AAAA,EACb;AAEJ;","names":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { useTransaction } from '../utils/use-transaction.cjs';
|
|
4
|
-
import '@medialane/sdk/starknet';
|
|
5
|
-
import './fast-mint/types.cjs';
|
|
6
|
-
import 'starknet';
|
|
7
|
-
import '@medialane/sdk';
|
|
8
|
-
|
|
9
|
-
interface TransactionDoneProps {
|
|
10
|
-
tx: Pick<ReturnType<typeof useTransaction>, "txHash" | "reset">;
|
|
11
|
-
name: string;
|
|
12
|
-
title: string;
|
|
13
|
-
description: ReactNode;
|
|
14
|
-
footer?: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
declare function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps): react_jsx_runtime.JSX.Element;
|
|
17
|
-
|
|
18
|
-
export { TransactionDone, type TransactionDoneProps };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { useTransaction } from '../utils/use-transaction.js';
|
|
4
|
-
import '@medialane/sdk/starknet';
|
|
5
|
-
import './fast-mint/types.js';
|
|
6
|
-
import 'starknet';
|
|
7
|
-
import '@medialane/sdk';
|
|
8
|
-
|
|
9
|
-
interface TransactionDoneProps {
|
|
10
|
-
tx: Pick<ReturnType<typeof useTransaction>, "txHash" | "reset">;
|
|
11
|
-
name: string;
|
|
12
|
-
title: string;
|
|
13
|
-
description: ReactNode;
|
|
14
|
-
footer?: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
declare function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps): react_jsx_runtime.JSX.Element;
|
|
17
|
-
|
|
18
|
-
export { TransactionDone, type TransactionDoneProps };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { MarketplaceSuccessState } from "./marketplace-dialog-primitives.js";
|
|
4
|
-
import { EXPLORER_URL } from "../utils/explorer-url.js";
|
|
5
|
-
function TransactionDone({ tx, name, title, description, footer }) {
|
|
6
|
-
return /* @__PURE__ */ jsx(
|
|
7
|
-
MarketplaceSuccessState,
|
|
8
|
-
{
|
|
9
|
-
name,
|
|
10
|
-
title,
|
|
11
|
-
description,
|
|
12
|
-
txHash: tx.txHash,
|
|
13
|
-
explorerUrl: EXPLORER_URL,
|
|
14
|
-
footer,
|
|
15
|
-
onDone: tx.reset
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
TransactionDone
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=transaction-done.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/transaction-done.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { MarketplaceSuccessState } from \"./marketplace-dialog-primitives.js\";\nimport { EXPLORER_URL } from \"../utils/explorer-url.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDoneProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"txHash\" | \"reset\">;\n name: string;\n title: string;\n description: ReactNode;\n footer?: ReactNode;\n}\n\nexport function TransactionDone({ tx, name, title, description, footer }: TransactionDoneProps) {\n return (\n <MarketplaceSuccessState\n name={name}\n title={title}\n description={description}\n txHash={tx.txHash}\n explorerUrl={EXPLORER_URL}\n footer={footer}\n onDone={tx.reset}\n />\n );\n}\n"],"mappings":";AAiBI;AAdJ,SAAS,+BAA+B;AACxC,SAAS,oBAAoB;AAWtB,SAAS,gBAAgB,EAAE,IAAI,MAAM,OAAO,aAAa,OAAO,GAAyB;AAC9F,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,QAAQ,GAAG;AAAA,MACX,aAAa;AAAA,MACb;AAAA,MACA,QAAQ,GAAG;AAAA;AAAA,EACb;AAEJ;","names":[]}
|