@goodwidget/ai-credits-widget 0.1.6 → 0.1.8
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/README.md +1 -1
- package/dist/{chunk-V7CAVLPS.js → chunk-635NKGPL.js} +2287 -1830
- package/dist/chunk-635NKGPL.js.map +1 -0
- package/dist/element.cjs +2291 -1867
- package/dist/element.cjs.map +1 -1
- package/dist/element.js +1 -1
- package/dist/index.cjs +2292 -1868
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/dist/mocked/index.cjs +2334 -1891
- package/dist/mocked/index.cjs.map +1 -1
- package/dist/mocked/index.d.cts +10 -5
- package/dist/mocked/index.d.ts +10 -5
- package/dist/mocked/index.js +42 -23
- package/dist/mocked/index.js.map +1 -1
- package/dist/register.cjs +2352 -1924
- package/dist/register.cjs.map +1 -1
- package/dist/{widgetRuntimeContract-DyvLXMBy.d.cts → widgetRuntimeContract-Bcb5Ej6O.d.cts} +103 -47
- package/dist/{widgetRuntimeContract-DyvLXMBy.d.ts → widgetRuntimeContract-Bcb5Ej6O.d.ts} +103 -47
- package/package.json +4 -4
- package/dist/chunk-V7CAVLPS.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AiCreditsWidgetEnvironment, a as AiCreditsPaySuccessDetail, b as AiCreditsPayErrorDetail, c as AiCreditsBackendClient, d as AiCreditsChainClient, e as AccountRef, f as AiCreditsWidgetAdapterResult, g as AiCreditsWidgetProps } from './widgetRuntimeContract-
|
|
2
|
-
export { h as AccountEnrichment, i as AccountStatusResponse, i as AccountView, j as AiCreditsQuote, k as AiCreditsWidgetAdapterActions, l as AiCreditsWidgetAdapterFactory, m as AiCreditsWidgetAdapterFactoryInput, n as AiCreditsWidgetAdapterState, o as AiCreditsWidgetStatus, p as AiCreditsWidgetTab,
|
|
1
|
+
import { A as AiCreditsWidgetEnvironment, a as AiCreditsPaySuccessDetail, b as AiCreditsPayErrorDetail, c as AiCreditsBackendClient, d as AiCreditsChainClient, e as AccountRef, f as AiCreditsWidgetAdapterResult, g as AiCreditsWidgetProps } from './widgetRuntimeContract-Bcb5Ej6O.cjs';
|
|
2
|
+
export { h as AccountEnrichment, i as AccountStatusResponse, i as AccountView, j as AiCreditsQuote, k as AiCreditsWidgetAdapterActions, l as AiCreditsWidgetAdapterFactory, m as AiCreditsWidgetAdapterFactoryInput, n as AiCreditsWidgetAdapterState, o as AiCreditsWidgetStatus, p as AiCreditsWidgetTab, C as CELO_GOODID_ADDRESS, D as DEFAULT_BASE_RPC_URL, q as DEFAULT_CELO_RPC_URL, r as DEFAULT_DISCOUNT_CONFIG, s as DiscountConfig, E as Eip712SigningPayload, G as GdCreditEntry, P as ProductionAiCreditsBackendClient, S as SignerOperatorStatus, U as UnavailableAiCreditsBackendClient, t as buildAccountView, u as createBackendClient, v as createChainClient, w as enrichAccountView, x as totalCreditUsdFromProfile, y as totalCreditUsdFromStatus } from './widgetRuntimeContract-Bcb5Ej6O.cjs';
|
|
3
3
|
import { Address } from 'viem';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import '@goodwidget/ui';
|
|
@@ -15,21 +15,21 @@ type AiCreditsIntegration = typeof aiCreditsIntegration;
|
|
|
15
15
|
|
|
16
16
|
declare function usdToCredits(usd: string): string;
|
|
17
17
|
|
|
18
|
-
type
|
|
18
|
+
type SignerKeyEntry = {
|
|
19
19
|
privateKey?: string;
|
|
20
20
|
operatorSignature?: string;
|
|
21
21
|
operatorConsented?: boolean;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
type DeepLinkParams = {
|
|
25
|
-
|
|
25
|
+
signerAddress: string;
|
|
26
26
|
operatorSignature: string;
|
|
27
27
|
};
|
|
28
28
|
type DeepLinkParseResult = {
|
|
29
29
|
status: 'absent';
|
|
30
30
|
} | {
|
|
31
31
|
status: 'partial';
|
|
32
|
-
present: '
|
|
32
|
+
present: 'signerAddress' | 'operatorSignature';
|
|
33
33
|
} | {
|
|
34
34
|
status: 'invalid';
|
|
35
35
|
reason: string;
|
|
@@ -39,7 +39,7 @@ type DeepLinkParseResult = {
|
|
|
39
39
|
source: 'url' | 'storage';
|
|
40
40
|
};
|
|
41
41
|
declare const DEEP_LINK_MANUAL_FALLBACK_HINT = "Generate or import a signer key manually to continue.";
|
|
42
|
-
declare function
|
|
42
|
+
declare function isValidSignerAddress(value: string): boolean;
|
|
43
43
|
declare function isValidOperatorSignature(value: string): boolean;
|
|
44
44
|
declare function deepLinkManualFallbackMessage(reason: string): string;
|
|
45
45
|
declare function readStoredDeepLinkParams(): DeepLinkParams | null;
|
|
@@ -71,6 +71,6 @@ interface UseAiCreditsAdapterOptions {
|
|
|
71
71
|
}
|
|
72
72
|
declare function useAiCreditsAdapter({ environment, backendUrl, baseRpcUrl, celoRpcUrl, fundingVaultAddress, vaultAddress, goodIdAddress, goodIdReturnUrl, onPaySuccess, onPayError, backendClient: backendClientOverride, chainClient: chainClientOverride, skipVaultPaymentValidation, prepareSettlement, }: UseAiCreditsAdapterOptions): AiCreditsWidgetAdapterResult;
|
|
73
73
|
|
|
74
|
-
declare function AiCreditsWidget({ provider, connectOverride, showWalletControls, disconnectOverride, disconnectLabel, disconnectIcon, environment, backendUrl, baseRpcUrl, celoRpcUrl, fundingVaultAddress, vaultAddress, goodIdAddress, themeOverrides, config, defaultTheme, onPaySuccess, onPayError, adapterFactory, adapterOptions, testId, }: AiCreditsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
74
|
+
declare function AiCreditsWidget({ provider, connectOverride, showWalletControls, disconnectOverride, disconnectLabel, disconnectIcon, addressOverride, chainIdOverride, switchChainOverride, availableChainIdsOverride, environment, backendUrl, baseRpcUrl, celoRpcUrl, fundingVaultAddress, vaultAddress, goodIdAddress, themeOverrides, config, defaultTheme, onPaySuccess, onPayError, adapterFactory, adapterOptions, testId, }: AiCreditsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
75
75
|
|
|
76
|
-
export { AccountRef, AiCreditsBackendClient, AiCreditsChainClient, type AiCreditsIntegration, AiCreditsPayErrorDetail, AiCreditsPaySuccessDetail, AiCreditsWidget, AiCreditsWidgetAdapterResult, AiCreditsWidgetEnvironment, AiCreditsWidgetProps,
|
|
76
|
+
export { AccountRef, AiCreditsBackendClient, AiCreditsChainClient, type AiCreditsIntegration, AiCreditsPayErrorDetail, AiCreditsPaySuccessDetail, AiCreditsWidget, AiCreditsWidgetAdapterResult, AiCreditsWidgetEnvironment, AiCreditsWidgetProps, DEEP_LINK_MANUAL_FALLBACK_HINT, type DeepLinkParams, type DeepLinkParseResult, type SignerKeyEntry, type UseAiCreditsAdapterOptions, aiCreditsIntegration, clearDeepLinkArtifacts, clearStoredDeepLinkParams, deepLinkManualFallbackMessage, isValidOperatorSignature, isValidSignerAddress, parseDeepLinkParams, readStoredDeepLinkParams, resolveDeepLinkParams, storeDeepLinkParams, usdToCredits, useAiCreditsAdapter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AiCreditsWidgetEnvironment, a as AiCreditsPaySuccessDetail, b as AiCreditsPayErrorDetail, c as AiCreditsBackendClient, d as AiCreditsChainClient, e as AccountRef, f as AiCreditsWidgetAdapterResult, g as AiCreditsWidgetProps } from './widgetRuntimeContract-
|
|
2
|
-
export { h as AccountEnrichment, i as AccountStatusResponse, i as AccountView, j as AiCreditsQuote, k as AiCreditsWidgetAdapterActions, l as AiCreditsWidgetAdapterFactory, m as AiCreditsWidgetAdapterFactoryInput, n as AiCreditsWidgetAdapterState, o as AiCreditsWidgetStatus, p as AiCreditsWidgetTab,
|
|
1
|
+
import { A as AiCreditsWidgetEnvironment, a as AiCreditsPaySuccessDetail, b as AiCreditsPayErrorDetail, c as AiCreditsBackendClient, d as AiCreditsChainClient, e as AccountRef, f as AiCreditsWidgetAdapterResult, g as AiCreditsWidgetProps } from './widgetRuntimeContract-Bcb5Ej6O.js';
|
|
2
|
+
export { h as AccountEnrichment, i as AccountStatusResponse, i as AccountView, j as AiCreditsQuote, k as AiCreditsWidgetAdapterActions, l as AiCreditsWidgetAdapterFactory, m as AiCreditsWidgetAdapterFactoryInput, n as AiCreditsWidgetAdapterState, o as AiCreditsWidgetStatus, p as AiCreditsWidgetTab, C as CELO_GOODID_ADDRESS, D as DEFAULT_BASE_RPC_URL, q as DEFAULT_CELO_RPC_URL, r as DEFAULT_DISCOUNT_CONFIG, s as DiscountConfig, E as Eip712SigningPayload, G as GdCreditEntry, P as ProductionAiCreditsBackendClient, S as SignerOperatorStatus, U as UnavailableAiCreditsBackendClient, t as buildAccountView, u as createBackendClient, v as createChainClient, w as enrichAccountView, x as totalCreditUsdFromProfile, y as totalCreditUsdFromStatus } from './widgetRuntimeContract-Bcb5Ej6O.js';
|
|
3
3
|
import { Address } from 'viem';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import '@goodwidget/ui';
|
|
@@ -15,21 +15,21 @@ type AiCreditsIntegration = typeof aiCreditsIntegration;
|
|
|
15
15
|
|
|
16
16
|
declare function usdToCredits(usd: string): string;
|
|
17
17
|
|
|
18
|
-
type
|
|
18
|
+
type SignerKeyEntry = {
|
|
19
19
|
privateKey?: string;
|
|
20
20
|
operatorSignature?: string;
|
|
21
21
|
operatorConsented?: boolean;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
type DeepLinkParams = {
|
|
25
|
-
|
|
25
|
+
signerAddress: string;
|
|
26
26
|
operatorSignature: string;
|
|
27
27
|
};
|
|
28
28
|
type DeepLinkParseResult = {
|
|
29
29
|
status: 'absent';
|
|
30
30
|
} | {
|
|
31
31
|
status: 'partial';
|
|
32
|
-
present: '
|
|
32
|
+
present: 'signerAddress' | 'operatorSignature';
|
|
33
33
|
} | {
|
|
34
34
|
status: 'invalid';
|
|
35
35
|
reason: string;
|
|
@@ -39,7 +39,7 @@ type DeepLinkParseResult = {
|
|
|
39
39
|
source: 'url' | 'storage';
|
|
40
40
|
};
|
|
41
41
|
declare const DEEP_LINK_MANUAL_FALLBACK_HINT = "Generate or import a signer key manually to continue.";
|
|
42
|
-
declare function
|
|
42
|
+
declare function isValidSignerAddress(value: string): boolean;
|
|
43
43
|
declare function isValidOperatorSignature(value: string): boolean;
|
|
44
44
|
declare function deepLinkManualFallbackMessage(reason: string): string;
|
|
45
45
|
declare function readStoredDeepLinkParams(): DeepLinkParams | null;
|
|
@@ -71,6 +71,6 @@ interface UseAiCreditsAdapterOptions {
|
|
|
71
71
|
}
|
|
72
72
|
declare function useAiCreditsAdapter({ environment, backendUrl, baseRpcUrl, celoRpcUrl, fundingVaultAddress, vaultAddress, goodIdAddress, goodIdReturnUrl, onPaySuccess, onPayError, backendClient: backendClientOverride, chainClient: chainClientOverride, skipVaultPaymentValidation, prepareSettlement, }: UseAiCreditsAdapterOptions): AiCreditsWidgetAdapterResult;
|
|
73
73
|
|
|
74
|
-
declare function AiCreditsWidget({ provider, connectOverride, showWalletControls, disconnectOverride, disconnectLabel, disconnectIcon, environment, backendUrl, baseRpcUrl, celoRpcUrl, fundingVaultAddress, vaultAddress, goodIdAddress, themeOverrides, config, defaultTheme, onPaySuccess, onPayError, adapterFactory, adapterOptions, testId, }: AiCreditsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
74
|
+
declare function AiCreditsWidget({ provider, connectOverride, showWalletControls, disconnectOverride, disconnectLabel, disconnectIcon, addressOverride, chainIdOverride, switchChainOverride, availableChainIdsOverride, environment, backendUrl, baseRpcUrl, celoRpcUrl, fundingVaultAddress, vaultAddress, goodIdAddress, themeOverrides, config, defaultTheme, onPaySuccess, onPayError, adapterFactory, adapterOptions, testId, }: AiCreditsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
75
75
|
|
|
76
|
-
export { AccountRef, AiCreditsBackendClient, AiCreditsChainClient, type AiCreditsIntegration, AiCreditsPayErrorDetail, AiCreditsPaySuccessDetail, AiCreditsWidget, AiCreditsWidgetAdapterResult, AiCreditsWidgetEnvironment, AiCreditsWidgetProps,
|
|
76
|
+
export { AccountRef, AiCreditsBackendClient, AiCreditsChainClient, type AiCreditsIntegration, AiCreditsPayErrorDetail, AiCreditsPaySuccessDetail, AiCreditsWidget, AiCreditsWidgetAdapterResult, AiCreditsWidgetEnvironment, AiCreditsWidgetProps, DEEP_LINK_MANUAL_FALLBACK_HINT, type DeepLinkParams, type DeepLinkParseResult, type SignerKeyEntry, type UseAiCreditsAdapterOptions, aiCreditsIntegration, clearDeepLinkArtifacts, clearStoredDeepLinkParams, deepLinkManualFallbackMessage, isValidOperatorSignature, isValidSignerAddress, parseDeepLinkParams, readStoredDeepLinkParams, resolveDeepLinkParams, storeDeepLinkParams, usdToCredits, useAiCreditsAdapter };
|
package/dist/index.js
CHANGED
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
createChainClient,
|
|
18
18
|
deepLinkManualFallbackMessage,
|
|
19
19
|
enrichAccountView,
|
|
20
|
-
isValidBuyerAddress,
|
|
21
20
|
isValidOperatorSignature,
|
|
21
|
+
isValidSignerAddress,
|
|
22
22
|
parseDeepLinkParams,
|
|
23
23
|
readStoredDeepLinkParams,
|
|
24
24
|
resolveDeepLinkParams,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
totalCreditUsdFromStatus,
|
|
28
28
|
usdToCredits,
|
|
29
29
|
useAiCreditsAdapter
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-635NKGPL.js";
|
|
31
31
|
export {
|
|
32
32
|
AiCreditsWidget,
|
|
33
33
|
CELO_GOODID_ADDRESS,
|
|
@@ -45,8 +45,8 @@ export {
|
|
|
45
45
|
createChainClient,
|
|
46
46
|
deepLinkManualFallbackMessage,
|
|
47
47
|
enrichAccountView,
|
|
48
|
-
isValidBuyerAddress,
|
|
49
48
|
isValidOperatorSignature,
|
|
49
|
+
isValidSignerAddress,
|
|
50
50
|
parseDeepLinkParams,
|
|
51
51
|
readStoredDeepLinkParams,
|
|
52
52
|
resolveDeepLinkParams,
|