uvd-x402-sdk 2.80.0 → 2.81.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/adapters/index.d.mts +3 -3
- package/dist/adapters/index.d.ts +3 -3
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/erc8128/index.d.mts +1 -1
- package/dist/erc8128/index.d.ts +1 -1
- package/dist/{index-CiRbsqXe.d.mts → index-BbveI6RT.d.mts} +2 -2
- package/dist/{index-DTXTOEby.d.ts → index-CmIus8r3.d.ts} +2 -2
- package/dist/{index-ZH10otHE.d.mts → index-D5uN1cIM.d.mts} +1 -1
- package/dist/{index-ZH10otHE.d.ts → index-D5uN1cIM.d.ts} +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/{ows-DTDixPzO.d.ts → ows-C-KmORG9.d.ts} +1 -1
- package/dist/{ows-CYIVd4xO.d.mts → ows-Z9v4GxOZ.d.mts} +1 -1
- package/dist/providers/algorand/index.d.mts +1 -1
- package/dist/providers/algorand/index.d.ts +1 -1
- package/dist/providers/evm/index.d.mts +1 -1
- package/dist/providers/evm/index.d.ts +1 -1
- package/dist/providers/near/index.d.mts +1 -1
- package/dist/providers/near/index.d.ts +1 -1
- package/dist/providers/solana/index.d.mts +1 -1
- package/dist/providers/solana/index.d.ts +1 -1
- package/dist/providers/stellar/index.d.mts +1 -1
- package/dist/providers/stellar/index.d.ts +1 -1
- package/dist/providers/sui/index.d.mts +1 -1
- package/dist/providers/sui/index.d.ts +1 -1
- package/dist/providers/xrpl/index.d.mts +1 -1
- package/dist/providers/xrpl/index.d.ts +1 -1
- package/dist/react/index.d.mts +30 -4
- package/dist/react/index.d.ts +30 -4
- package/dist/react/index.js +215 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +212 -3
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/picker/index.d.mts +77 -0
- package/dist/react/picker/index.d.ts +77 -0
- package/dist/react/picker/index.js +1152 -0
- package/dist/react/picker/index.js.map +1 -0
- package/dist/react/picker/index.mjs +1145 -0
- package/dist/react/picker/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/{validation-DsbfDAtV.d.ts → validation-Cjew3uCN.d.ts} +1 -1
- package/dist/{validation-De3bessL.d.mts → validation-GwdW_4v4.d.mts} +1 -1
- package/dist/{wallet-0cX9Pw2F.d.mts → wallet-w7BnImDG.d.mts} +1 -1
- package/dist/{wallet-0cX9Pw2F.d.ts → wallet-w7BnImDG.d.ts} +1 -1
- package/package.json +6 -1
- package/src/react/NetworkPicker.tsx +322 -0
- package/src/react/PaymentMethodPicker.tsx +110 -0
- package/src/react/index.tsx +10 -0
- package/src/react/picker.ts +38 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from '../ows-
|
|
3
|
-
import '../wallet-
|
|
1
|
+
import { X as X402Version, a as PaymentResult } from '../index-D5uN1cIM.mjs';
|
|
2
|
+
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from '../ows-Z9v4GxOZ.mjs';
|
|
3
|
+
import '../wallet-w7BnImDG.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* uvd-x402-sdk - Wagmi/Viem Adapter
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from '../ows-
|
|
3
|
-
import '../wallet-
|
|
1
|
+
import { X as X402Version, a as PaymentResult } from '../index-D5uN1cIM.js';
|
|
2
|
+
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from '../ows-C-KmORG9.js';
|
|
3
|
+
import '../wallet-w7BnImDG.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* uvd-x402-sdk - Wagmi/Viem Adapter
|
package/dist/backend/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SigningWalletAdapter } from '../wallet-
|
|
2
|
-
import {
|
|
1
|
+
import { S as SigningWalletAdapter } from '../wallet-w7BnImDG.mjs';
|
|
2
|
+
import { X as X402Version, h as X402Header, i as X402PayloadData } from '../index-D5uN1cIM.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Reading a facilitator refusal as DATA instead of prose.
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SigningWalletAdapter } from '../wallet-
|
|
2
|
-
import {
|
|
1
|
+
import { S as SigningWalletAdapter } from '../wallet-w7BnImDG.js';
|
|
2
|
+
import { X as X402Version, h as X402Header, i as X402PayloadData } from '../index-D5uN1cIM.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Reading a facilitator refusal as DATA instead of prose.
|
package/dist/erc8128/index.d.mts
CHANGED
package/dist/erc8128/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as X402ClientConfig, P as PaymentInfo, a as PaymentResult, d as WalletState, C as ChainConfig, e as X402Event, f as X402EventHandler, N as NetworkType, T as TokenType, g as TokenConfig } from './index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Main Client
|
|
@@ -274,4 +274,4 @@ declare function isTokenSupported(chainName: string, tokenType: TokenType): bool
|
|
|
274
274
|
*/
|
|
275
275
|
declare function getChainsByToken(tokenType: TokenType): ChainConfig[];
|
|
276
276
|
|
|
277
|
-
export { DEFAULT_CHAIN as D, SUPPORTED_CHAINS as S, X402Client as X, DEFAULT_FACILITATOR_URL as a,
|
|
277
|
+
export { DEFAULT_CHAIN as D, SUPPORTED_CHAINS as S, X402Client as X, DEFAULT_FACILITATOR_URL as a, getAlgorandChains as b, getChainById as c, getChainsByNetworkType as d, getChainsByToken as e, getEVMChainIds as f, getChainByName as g, getEnabledChains as h, getExplorerAddressUrl as i, getExplorerTxUrl as j, getNetworkType as k, getSVMChains as l, getSuiChains as m, getSupportedTokens as n, getTokenByAddress as o, getTokenConfig as p, getXRPLChains as q, isAlgorandChain as r, isChainSupported as s, isSVMChain as t, isSuiChain as u, isTokenSupported as v, isXRPLChain as w };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as X402ClientConfig, P as PaymentInfo, a as PaymentResult, d as WalletState, C as ChainConfig, e as X402Event, f as X402EventHandler, N as NetworkType, T as TokenType, g as TokenConfig } from './index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Main Client
|
|
@@ -274,4 +274,4 @@ declare function isTokenSupported(chainName: string, tokenType: TokenType): bool
|
|
|
274
274
|
*/
|
|
275
275
|
declare function getChainsByToken(tokenType: TokenType): ChainConfig[];
|
|
276
276
|
|
|
277
|
-
export { DEFAULT_CHAIN as D, SUPPORTED_CHAINS as S, X402Client as X, DEFAULT_FACILITATOR_URL as a,
|
|
277
|
+
export { DEFAULT_CHAIN as D, SUPPORTED_CHAINS as S, X402Client as X, DEFAULT_FACILITATOR_URL as a, getAlgorandChains as b, getChainById as c, getChainsByNetworkType as d, getChainsByToken as e, getEVMChainIds as f, getChainByName as g, getEnabledChains as h, getExplorerAddressUrl as i, getExplorerTxUrl as j, getNetworkType as k, getSVMChains as l, getSuiChains as m, getSupportedTokens as n, getTokenByAddress as o, getTokenConfig as p, getXRPLChains as q, isAlgorandChain as r, isChainSupported as s, isSVMChain as t, isSuiChain as u, isTokenSupported as v, isXRPLChain as w };
|
|
@@ -688,4 +688,4 @@ declare class X402Error extends Error {
|
|
|
688
688
|
constructor(message: string, code: X402ErrorCode, details?: unknown);
|
|
689
689
|
}
|
|
690
690
|
|
|
691
|
-
export { type AlgorandPaymentPayload as A, type
|
|
691
|
+
export { type AlgorandPaymentPayload as A, type X402EVMPayload as B, type ChainConfig as C, DEFAULT_CONFIG as D, type EIP712Domain as E, X402Error as F, type X402ErrorCode as G, type X402EventData as H, type X402NEARPayload as I, type X402Scheme as J, type X402SettlementAccountPayload as K, type X402SolanaPayload as L, type MultiPaymentConfig as M, type NetworkType as N, type X402StellarPayload as O, type PaymentInfo as P, type X402SuiPayload as Q, type X402XRPLPayload as R, type SolanaPaymentPayload as S, type TokenType as T, type USDCConfig as U, type XRPLPaymentPayload as V, type WalletAdapter as W, type X402Version as X, type PaymentResult as a, type X402ClientConfig as b, type NetworkBalance as c, type WalletState as d, type X402Event as e, type X402EventHandler as f, type TokenConfig as g, type X402Header as h, type X402PayloadData as i, type X402HeaderV1 as j, type X402PaymentOption as k, type X402HeaderV2 as l, type PaymentTokenMetadata as m, type X402HeaderName as n, type PaymentHeaders as o, CAIP2_IDENTIFIERS as p, CAIP2_TO_CHAIN as q, type EIP712Types as r, type EVMPaymentPayload as s, type NEARPaymentPayload as t, type NativeCurrency as u, type PaymentPayload as v, type PaymentRequest as w, type StellarPaymentPayload as x, type SuiPaymentPayload as y, type X402AlgorandPayload as z };
|
|
@@ -688,4 +688,4 @@ declare class X402Error extends Error {
|
|
|
688
688
|
constructor(message: string, code: X402ErrorCode, details?: unknown);
|
|
689
689
|
}
|
|
690
690
|
|
|
691
|
-
export { type AlgorandPaymentPayload as A, type
|
|
691
|
+
export { type AlgorandPaymentPayload as A, type X402EVMPayload as B, type ChainConfig as C, DEFAULT_CONFIG as D, type EIP712Domain as E, X402Error as F, type X402ErrorCode as G, type X402EventData as H, type X402NEARPayload as I, type X402Scheme as J, type X402SettlementAccountPayload as K, type X402SolanaPayload as L, type MultiPaymentConfig as M, type NetworkType as N, type X402StellarPayload as O, type PaymentInfo as P, type X402SuiPayload as Q, type X402XRPLPayload as R, type SolanaPaymentPayload as S, type TokenType as T, type USDCConfig as U, type XRPLPaymentPayload as V, type WalletAdapter as W, type X402Version as X, type PaymentResult as a, type X402ClientConfig as b, type NetworkBalance as c, type WalletState as d, type X402Event as e, type X402EventHandler as f, type TokenConfig as g, type X402Header as h, type X402PayloadData as i, type X402HeaderV1 as j, type X402PaymentOption as k, type X402HeaderV2 as l, type PaymentTokenMetadata as m, type X402HeaderName as n, type PaymentHeaders as o, CAIP2_IDENTIFIERS as p, CAIP2_TO_CHAIN as q, type EIP712Types as r, type EVMPaymentPayload as s, type NEARPaymentPayload as t, type NativeCurrency as u, type PaymentPayload as v, type PaymentRequest as w, type StellarPaymentPayload as x, type SuiPaymentPayload as y, type X402AlgorandPayload as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client,
|
|
2
|
-
export { D as DEFAULT_PAYMENT_HEADER, P as PAYMENT_HEADER_NAMES, b as buildTokenMetadata, c as caip2ToChain, a as chainToCAIP2, d as convertX402Header, e as createPaymentHeaders, f as createX402Header, g as createX402V1Header, h as createX402V2Header, i as decodeBase64Utf8, j as decodeX402Header, k as detectX402Version, l as encodeBase64Json, m as encodeBase64Utf8, n as encodeX402Header, o as generatePaymentOptions, p as getPaymentHeader, q as isCAIP2Format, r as parseNetworkIdentifier, s as paymentChallengeFrom, v as validateAmount, t as validateRecipient } from './validation-
|
|
3
|
-
export { A as AlgorandPaymentPayload,
|
|
4
|
-
import { S as SigningWalletAdapter } from './wallet-
|
|
5
|
-
export {
|
|
6
|
-
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from './ows-
|
|
1
|
+
export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client, b as getAlgorandChains, c as getChainById, g as getChainByName, d as getChainsByNetworkType, e as getChainsByToken, f as getEVMChainIds, h as getEnabledChains, i as getExplorerAddressUrl, j as getExplorerTxUrl, k as getNetworkType, l as getSVMChains, m as getSuiChains, n as getSupportedTokens, o as getTokenByAddress, p as getTokenConfig, q as getXRPLChains, r as isAlgorandChain, s as isChainSupported, t as isSVMChain, u as isSuiChain, v as isTokenSupported, w as isXRPLChain } from './index-BbveI6RT.mjs';
|
|
2
|
+
export { D as DEFAULT_PAYMENT_HEADER, P as PAYMENT_HEADER_NAMES, b as buildTokenMetadata, c as caip2ToChain, a as chainToCAIP2, d as convertX402Header, e as createPaymentHeaders, f as createX402Header, g as createX402V1Header, h as createX402V2Header, i as decodeBase64Utf8, j as decodeX402Header, k as detectX402Version, l as encodeBase64Json, m as encodeBase64Utf8, n as encodeX402Header, o as generatePaymentOptions, p as getPaymentHeader, q as isCAIP2Format, r as parseNetworkIdentifier, s as paymentChallengeFrom, v as validateAmount, t as validateRecipient } from './validation-GwdW_4v4.mjs';
|
|
3
|
+
export { A as AlgorandPaymentPayload, p as CAIP2_IDENTIFIERS, q as CAIP2_TO_CHAIN, C as ChainConfig, D as DEFAULT_CONFIG, E as EIP712Domain, r as EIP712Types, s as EVMPaymentPayload, M as MultiPaymentConfig, t as NEARPaymentPayload, u as NativeCurrency, c as NetworkBalance, N as NetworkType, o as PaymentHeaders, P as PaymentInfo, v as PaymentPayload, w as PaymentRequest, a as PaymentResult, m as PaymentTokenMetadata, S as SolanaPaymentPayload, x as StellarPaymentPayload, y as SuiPaymentPayload, g as TokenConfig, T as TokenType, U as USDCConfig, W as WalletAdapter, d as WalletState, z as X402AlgorandPayload, b as X402ClientConfig, B as X402EVMPayload, F as X402Error, G as X402ErrorCode, e as X402Event, H as X402EventData, f as X402EventHandler, h as X402Header, n as X402HeaderName, j as X402HeaderV1, l as X402HeaderV2, I as X402NEARPayload, i as X402PayloadData, k as X402PaymentOption, J as X402Scheme, K as X402SettlementAccountPayload, L as X402SolanaPayload, O as X402StellarPayload, Q as X402SuiPayload, X as X402Version, R as X402XRPLPayload, V as XRPLPaymentPayload } from './index-D5uN1cIM.mjs';
|
|
4
|
+
import { S as SigningWalletAdapter } from './wallet-w7BnImDG.mjs';
|
|
5
|
+
export { a as EIP3009Authorization, E as EIP3009Params } from './wallet-w7BnImDG.mjs';
|
|
6
|
+
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from './ows-Z9v4GxOZ.mjs';
|
|
7
7
|
export { AMBIGUOUS_LEASE_REASONS, DEFAULT_FACILITATOR_RETRIES, DEFAULT_RETRY_AFTER_SECONDS, FacilitatorClient, FacilitatorClientOptions, FacilitatorErrorInfo, FacilitatorFailureFields, FacilitatorFetchOptions, HonoMiddlewareOptions, MAX_RETRY_AFTER_SECONDS, ParsedFacilitatorErrorBody, PaymentAcceptance, PaymentMiddlewareOptions, PaymentPayloadV2, PaymentRequirementsV2, REPLAYABLE_LEASE_REASONS, ResourceInfoV2, SETTLEMENT_UNCONFIRMED, SettleRequestV2, VerifiedPaymentState, VerifyRequestV2, WRITER_LEASE_REASONS, WriterLeaseReason, X402_CORS_HEADERS, X402_HEADER_NAMES, buildPaymentRequirements, buildSettleRequest, buildSettleRequestForVersion, buildSettleRequestV2, buildVerifyRequest, buildVerifyRequestForVersion, buildVerifyRequestV2, create402Response, createHonoMiddleware, createPaymentMiddleware, extractPaymentFromHeaders, facilitatorFetch, getCorsHeaders, isAmbiguousLeaseReason, isReplayableLeaseReason, isSettlementUnconfirmed, parseFacilitatorErrorBody, parseRetryAfterSeconds, readFacilitatorError, resolveEnvelopeVersion, toPaymentRequirementsV2, toResourceInfoV2 } from './backend/index.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client,
|
|
2
|
-
export { D as DEFAULT_PAYMENT_HEADER, P as PAYMENT_HEADER_NAMES, b as buildTokenMetadata, c as caip2ToChain, a as chainToCAIP2, d as convertX402Header, e as createPaymentHeaders, f as createX402Header, g as createX402V1Header, h as createX402V2Header, i as decodeBase64Utf8, j as decodeX402Header, k as detectX402Version, l as encodeBase64Json, m as encodeBase64Utf8, n as encodeX402Header, o as generatePaymentOptions, p as getPaymentHeader, q as isCAIP2Format, r as parseNetworkIdentifier, s as paymentChallengeFrom, v as validateAmount, t as validateRecipient } from './validation-
|
|
3
|
-
export { A as AlgorandPaymentPayload,
|
|
4
|
-
import { S as SigningWalletAdapter } from './wallet-
|
|
5
|
-
export {
|
|
6
|
-
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from './ows-
|
|
1
|
+
export { D as DEFAULT_CHAIN, a as DEFAULT_FACILITATOR_URL, S as SUPPORTED_CHAINS, X as X402Client, b as getAlgorandChains, c as getChainById, g as getChainByName, d as getChainsByNetworkType, e as getChainsByToken, f as getEVMChainIds, h as getEnabledChains, i as getExplorerAddressUrl, j as getExplorerTxUrl, k as getNetworkType, l as getSVMChains, m as getSuiChains, n as getSupportedTokens, o as getTokenByAddress, p as getTokenConfig, q as getXRPLChains, r as isAlgorandChain, s as isChainSupported, t as isSVMChain, u as isSuiChain, v as isTokenSupported, w as isXRPLChain } from './index-CmIus8r3.js';
|
|
2
|
+
export { D as DEFAULT_PAYMENT_HEADER, P as PAYMENT_HEADER_NAMES, b as buildTokenMetadata, c as caip2ToChain, a as chainToCAIP2, d as convertX402Header, e as createPaymentHeaders, f as createX402Header, g as createX402V1Header, h as createX402V2Header, i as decodeBase64Utf8, j as decodeX402Header, k as detectX402Version, l as encodeBase64Json, m as encodeBase64Utf8, n as encodeX402Header, o as generatePaymentOptions, p as getPaymentHeader, q as isCAIP2Format, r as parseNetworkIdentifier, s as paymentChallengeFrom, v as validateAmount, t as validateRecipient } from './validation-Cjew3uCN.js';
|
|
3
|
+
export { A as AlgorandPaymentPayload, p as CAIP2_IDENTIFIERS, q as CAIP2_TO_CHAIN, C as ChainConfig, D as DEFAULT_CONFIG, E as EIP712Domain, r as EIP712Types, s as EVMPaymentPayload, M as MultiPaymentConfig, t as NEARPaymentPayload, u as NativeCurrency, c as NetworkBalance, N as NetworkType, o as PaymentHeaders, P as PaymentInfo, v as PaymentPayload, w as PaymentRequest, a as PaymentResult, m as PaymentTokenMetadata, S as SolanaPaymentPayload, x as StellarPaymentPayload, y as SuiPaymentPayload, g as TokenConfig, T as TokenType, U as USDCConfig, W as WalletAdapter, d as WalletState, z as X402AlgorandPayload, b as X402ClientConfig, B as X402EVMPayload, F as X402Error, G as X402ErrorCode, e as X402Event, H as X402EventData, f as X402EventHandler, h as X402Header, n as X402HeaderName, j as X402HeaderV1, l as X402HeaderV2, I as X402NEARPayload, i as X402PayloadData, k as X402PaymentOption, J as X402Scheme, K as X402SettlementAccountPayload, L as X402SolanaPayload, O as X402StellarPayload, Q as X402SuiPayload, X as X402Version, R as X402XRPLPayload, V as XRPLPaymentPayload } from './index-D5uN1cIM.js';
|
|
4
|
+
import { S as SigningWalletAdapter } from './wallet-w7BnImDG.js';
|
|
5
|
+
export { a as EIP3009Authorization, E as EIP3009Params } from './wallet-w7BnImDG.js';
|
|
6
|
+
export { E as EnvKeyAdapter, O as OWSWallet, a as OWSWalletAdapter } from './ows-C-KmORG9.js';
|
|
7
7
|
export { AMBIGUOUS_LEASE_REASONS, DEFAULT_FACILITATOR_RETRIES, DEFAULT_RETRY_AFTER_SECONDS, FacilitatorClient, FacilitatorClientOptions, FacilitatorErrorInfo, FacilitatorFailureFields, FacilitatorFetchOptions, HonoMiddlewareOptions, MAX_RETRY_AFTER_SECONDS, ParsedFacilitatorErrorBody, PaymentAcceptance, PaymentMiddlewareOptions, PaymentPayloadV2, PaymentRequirementsV2, REPLAYABLE_LEASE_REASONS, ResourceInfoV2, SETTLEMENT_UNCONFIRMED, SettleRequestV2, VerifiedPaymentState, VerifyRequestV2, WRITER_LEASE_REASONS, WriterLeaseReason, X402_CORS_HEADERS, X402_HEADER_NAMES, buildPaymentRequirements, buildSettleRequest, buildSettleRequestForVersion, buildSettleRequestV2, buildVerifyRequest, buildVerifyRequestForVersion, buildVerifyRequestV2, create402Response, createHonoMiddleware, createPaymentMiddleware, extractPaymentFromHeaders, facilitatorFetch, getCorsHeaders, isAmbiguousLeaseReason, isReplayableLeaseReason, isSettlementUnconfirmed, parseFacilitatorErrorBody, parseRetryAfterSeconds, readFacilitatorError, resolveEnvelopeVersion, toPaymentRequirementsV2, toResourceInfoV2 } from './backend/index.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Algorand Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Algorand Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, T as TokenType, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - EVM Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, T as TokenType, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - EVM Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - NEAR Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - NEAR Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - SVM Provider (Solana Virtual Machine)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - SVM Provider (Solana Virtual Machine)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Stellar Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Stellar Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Sui Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - Sui Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - XRPL (XRP Ledger) Provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletAdapter,
|
|
1
|
+
import { W as WalletAdapter, C as ChainConfig, P as PaymentInfo, X as X402Version } from '../../index-D5uN1cIM.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* uvd-x402-sdk - XRPL (XRP Ledger) Provider
|
package/dist/react/index.d.mts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { P as PaymentInfo, a as PaymentResult, N as NetworkType, b as X402ClientConfig, C as ChainConfig, c as NetworkBalance } from '../index-D5uN1cIM.mjs';
|
|
2
|
+
export { d as WalletState } from '../index-D5uN1cIM.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { g as getChainByName, X as X402Client } from '../index-BbveI6RT.mjs';
|
|
6
|
+
export { FAMILY_LABEL, NetworkOption, NetworkPicker, NetworkPickerProps, SIGNABLE_IN_BROWSER, buildNetworkOptions, resolveChain } from './picker/index.mjs';
|
|
7
|
+
|
|
8
|
+
/** One entry of the `accepts` array of a 402 response. */
|
|
9
|
+
interface PaymentAccept {
|
|
10
|
+
scheme: string;
|
|
11
|
+
network: string;
|
|
12
|
+
networkAliases?: string[];
|
|
13
|
+
extra?: Record<string, unknown>;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
interface PaymentMethodPickerProps {
|
|
17
|
+
/** The `accepts` array from the 402 response, untouched. */
|
|
18
|
+
accepts: readonly PaymentAccept[];
|
|
19
|
+
/** Recipients and amount, handed to `pay()` as-is. */
|
|
20
|
+
payment: PaymentInfo;
|
|
21
|
+
onPaid?: (result: PaymentResult) => void;
|
|
22
|
+
onError?: (error: Error) => void;
|
|
23
|
+
/** Restrict to some families. Omit to offer everything the resource accepts. */
|
|
24
|
+
families?: readonly NetworkType[];
|
|
25
|
+
layout?: 'carousel' | 'segmented' | 'list';
|
|
26
|
+
label?: string;
|
|
27
|
+
hint?: string;
|
|
28
|
+
payLabel?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
declare function PaymentMethodPicker({ accepts, payment, onPaid, onError, families, layout, label, hint, payLabel, className, }: PaymentMethodPickerProps): react_jsx_runtime.JSX.Element;
|
|
6
32
|
|
|
7
33
|
interface X402ProviderProps {
|
|
8
34
|
children: ReactNode;
|
|
@@ -70,4 +96,4 @@ declare function useNetworkBalances(): {
|
|
|
70
96
|
highestBalanceNetwork: null;
|
|
71
97
|
};
|
|
72
98
|
|
|
73
|
-
export { ChainConfig, NetworkBalance, PaymentInfo, PaymentResult, X402Provider, useBalance, useChains, useNetworkBalances, usePayment, useX402 };
|
|
99
|
+
export { ChainConfig, NetworkBalance, type PaymentAccept, PaymentInfo, PaymentMethodPicker, type PaymentMethodPickerProps, PaymentResult, X402Provider, useBalance, useChains, useNetworkBalances, usePayment, useX402 };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { P as PaymentInfo, a as PaymentResult, N as NetworkType, b as X402ClientConfig, C as ChainConfig, c as NetworkBalance } from '../index-D5uN1cIM.js';
|
|
2
|
+
export { d as WalletState } from '../index-D5uN1cIM.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { g as getChainByName, X as X402Client } from '../index-CmIus8r3.js';
|
|
6
|
+
export { FAMILY_LABEL, NetworkOption, NetworkPicker, NetworkPickerProps, SIGNABLE_IN_BROWSER, buildNetworkOptions, resolveChain } from './picker/index.js';
|
|
7
|
+
|
|
8
|
+
/** One entry of the `accepts` array of a 402 response. */
|
|
9
|
+
interface PaymentAccept {
|
|
10
|
+
scheme: string;
|
|
11
|
+
network: string;
|
|
12
|
+
networkAliases?: string[];
|
|
13
|
+
extra?: Record<string, unknown>;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
interface PaymentMethodPickerProps {
|
|
17
|
+
/** The `accepts` array from the 402 response, untouched. */
|
|
18
|
+
accepts: readonly PaymentAccept[];
|
|
19
|
+
/** Recipients and amount, handed to `pay()` as-is. */
|
|
20
|
+
payment: PaymentInfo;
|
|
21
|
+
onPaid?: (result: PaymentResult) => void;
|
|
22
|
+
onError?: (error: Error) => void;
|
|
23
|
+
/** Restrict to some families. Omit to offer everything the resource accepts. */
|
|
24
|
+
families?: readonly NetworkType[];
|
|
25
|
+
layout?: 'carousel' | 'segmented' | 'list';
|
|
26
|
+
label?: string;
|
|
27
|
+
hint?: string;
|
|
28
|
+
payLabel?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
declare function PaymentMethodPicker({ accepts, payment, onPaid, onError, families, layout, label, hint, payLabel, className, }: PaymentMethodPickerProps): react_jsx_runtime.JSX.Element;
|
|
6
32
|
|
|
7
33
|
interface X402ProviderProps {
|
|
8
34
|
children: ReactNode;
|
|
@@ -70,4 +96,4 @@ declare function useNetworkBalances(): {
|
|
|
70
96
|
highestBalanceNetwork: null;
|
|
71
97
|
};
|
|
72
98
|
|
|
73
|
-
export { ChainConfig, NetworkBalance, PaymentInfo, PaymentResult, X402Provider, useBalance, useChains, useNetworkBalances, usePayment, useX402 };
|
|
99
|
+
export { ChainConfig, NetworkBalance, type PaymentAccept, PaymentInfo, PaymentMethodPicker, type PaymentMethodPickerProps, PaymentResult, X402Provider, useBalance, useChains, useNetworkBalances, usePayment, useX402 };
|
package/dist/react/index.js
CHANGED
|
@@ -1764,6 +1764,215 @@ var X402Client = class {
|
|
|
1764
1764
|
}
|
|
1765
1765
|
}
|
|
1766
1766
|
};
|
|
1767
|
+
var SIGNABLE_IN_BROWSER = ["evm", "svm", "solana"];
|
|
1768
|
+
var FAMILY_LABEL = {
|
|
1769
|
+
evm: "EVM",
|
|
1770
|
+
svm: "Solana VM",
|
|
1771
|
+
solana: "Solana VM",
|
|
1772
|
+
stellar: "Stellar",
|
|
1773
|
+
near: "NEAR",
|
|
1774
|
+
algorand: "Algorand",
|
|
1775
|
+
sui: "Sui",
|
|
1776
|
+
xrpl: "XRP Ledger"
|
|
1777
|
+
};
|
|
1778
|
+
function cx(...parts) {
|
|
1779
|
+
return parts.filter(Boolean).join(" ");
|
|
1780
|
+
}
|
|
1781
|
+
function resolveChain(id, chains, aliases = []) {
|
|
1782
|
+
const names = [id, ...aliases].map((n) => String(n).toLowerCase());
|
|
1783
|
+
return chains.find((c) => names.includes(c.name.toLowerCase())) ?? chains.find((c) => names.some((n) => n === `eip155:${c.chainId}`)) ?? null;
|
|
1784
|
+
}
|
|
1785
|
+
function describeWhyDisabled(chain, family, signable) {
|
|
1786
|
+
if (!chain) return "Not configured in this build";
|
|
1787
|
+
if (chain.x402.enabled === false) return "Disabled for x402";
|
|
1788
|
+
if (!signable) return `No browser wallet bridge for ${FAMILY_LABEL[family] ?? family} yet`;
|
|
1789
|
+
return void 0;
|
|
1790
|
+
}
|
|
1791
|
+
function buildNetworkOptions(ids, chains, families) {
|
|
1792
|
+
const all = ids.map((id) => {
|
|
1793
|
+
const chain = resolveChain(id, chains);
|
|
1794
|
+
const family = chain?.networkType ?? "unknown";
|
|
1795
|
+
const signable = SIGNABLE_IN_BROWSER.includes(family);
|
|
1796
|
+
return {
|
|
1797
|
+
id,
|
|
1798
|
+
chain,
|
|
1799
|
+
label: chain?.displayName ?? id,
|
|
1800
|
+
family,
|
|
1801
|
+
selectable: signable && chain !== null && chain.x402.enabled !== false,
|
|
1802
|
+
disabledReason: describeWhyDisabled(chain, family, signable)
|
|
1803
|
+
};
|
|
1804
|
+
});
|
|
1805
|
+
return families ? all.filter((o) => families.includes(o.family)) : all;
|
|
1806
|
+
}
|
|
1807
|
+
function NetworkPicker({
|
|
1808
|
+
value,
|
|
1809
|
+
onChange,
|
|
1810
|
+
networks,
|
|
1811
|
+
families,
|
|
1812
|
+
disabled = false,
|
|
1813
|
+
label = "Payment network",
|
|
1814
|
+
hint,
|
|
1815
|
+
hideLabel = false,
|
|
1816
|
+
groupByFamily = false,
|
|
1817
|
+
layout = "carousel",
|
|
1818
|
+
className,
|
|
1819
|
+
decorate,
|
|
1820
|
+
classNames: cls = {}
|
|
1821
|
+
}) {
|
|
1822
|
+
const chains = react.useMemo(() => getEnabledChains(), []);
|
|
1823
|
+
const buttonRefs = react.useRef({});
|
|
1824
|
+
const options = react.useMemo(() => {
|
|
1825
|
+
const ids = networks ?? chains.filter((c) => c.x402.enabled !== false).map((c) => c.name);
|
|
1826
|
+
return buildNetworkOptions(ids, chains, families);
|
|
1827
|
+
}, [networks, chains, families]);
|
|
1828
|
+
const selectable = react.useMemo(
|
|
1829
|
+
() => disabled ? [] : options.filter((o) => o.selectable),
|
|
1830
|
+
[options, disabled]
|
|
1831
|
+
);
|
|
1832
|
+
const onKeyDown = react.useCallback(
|
|
1833
|
+
(event, id) => {
|
|
1834
|
+
const keys = ["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp"];
|
|
1835
|
+
if (!keys.includes(event.key) || selectable.length === 0) return;
|
|
1836
|
+
event.preventDefault();
|
|
1837
|
+
const step = event.key === "ArrowRight" || event.key === "ArrowDown" ? 1 : -1;
|
|
1838
|
+
const at = selectable.findIndex((o) => o.id === id);
|
|
1839
|
+
const next = selectable[(at + step + selectable.length) % selectable.length];
|
|
1840
|
+
if (!next) return;
|
|
1841
|
+
onChange(next.id);
|
|
1842
|
+
buttonRefs.current[next.id]?.focus();
|
|
1843
|
+
},
|
|
1844
|
+
[selectable, onChange]
|
|
1845
|
+
);
|
|
1846
|
+
const renderOption = (option) => {
|
|
1847
|
+
const isSelected = value === option.id;
|
|
1848
|
+
const usable = option.selectable && !disabled;
|
|
1849
|
+
const isFirstFallback = value === null && selectable[0]?.id === option.id;
|
|
1850
|
+
const extra = decorate?.(option);
|
|
1851
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1852
|
+
"button",
|
|
1853
|
+
{
|
|
1854
|
+
ref: (el) => {
|
|
1855
|
+
buttonRefs.current[option.id] = el;
|
|
1856
|
+
},
|
|
1857
|
+
type: "button",
|
|
1858
|
+
role: "radio",
|
|
1859
|
+
"aria-checked": isSelected,
|
|
1860
|
+
"aria-disabled": !usable,
|
|
1861
|
+
disabled: !usable,
|
|
1862
|
+
title: extra?.title ?? option.disabledReason,
|
|
1863
|
+
tabIndex: isSelected || isFirstFallback ? 0 : -1,
|
|
1864
|
+
onClick: () => usable && onChange(option.id),
|
|
1865
|
+
onKeyDown: (event) => onKeyDown(event, option.id),
|
|
1866
|
+
className: cx(
|
|
1867
|
+
"uvd-x402-picker__option",
|
|
1868
|
+
cls.option,
|
|
1869
|
+
isSelected && "is-selected",
|
|
1870
|
+
isSelected && cls.optionSelected,
|
|
1871
|
+
!usable && cls.optionDisabled
|
|
1872
|
+
),
|
|
1873
|
+
children: [
|
|
1874
|
+
extra?.icon,
|
|
1875
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("uvd-x402-picker__name", cls.name), children: extra?.label ?? option.label }),
|
|
1876
|
+
extra?.shortLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("uvd-x402-picker__name-short", cls.nameShort), children: extra.shortLabel }),
|
|
1877
|
+
option.disabledReason && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("uvd-x402-picker__reason", cls.reason), children: option.disabledReason })
|
|
1878
|
+
]
|
|
1879
|
+
},
|
|
1880
|
+
option.id
|
|
1881
|
+
);
|
|
1882
|
+
};
|
|
1883
|
+
const grouped = react.useMemo(() => {
|
|
1884
|
+
if (!groupByFamily) return null;
|
|
1885
|
+
const map = /* @__PURE__ */ new Map();
|
|
1886
|
+
for (const option of options) {
|
|
1887
|
+
const list = map.get(option.family) ?? [];
|
|
1888
|
+
list.push(option);
|
|
1889
|
+
map.set(option.family, list);
|
|
1890
|
+
}
|
|
1891
|
+
return [...map.entries()];
|
|
1892
|
+
}, [options, groupByFamily]);
|
|
1893
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1894
|
+
"div",
|
|
1895
|
+
{
|
|
1896
|
+
className: cx(
|
|
1897
|
+
"uvd-x402-picker",
|
|
1898
|
+
`uvd-x402-picker--${layout}`,
|
|
1899
|
+
cls.root,
|
|
1900
|
+
className
|
|
1901
|
+
),
|
|
1902
|
+
children: [
|
|
1903
|
+
!hideLabel && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: cx("uvd-x402-picker__label", cls.label), children: label }),
|
|
1904
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1905
|
+
"div",
|
|
1906
|
+
{
|
|
1907
|
+
role: "radiogroup",
|
|
1908
|
+
"aria-label": label,
|
|
1909
|
+
className: cx("uvd-x402-picker__group", cls.group),
|
|
1910
|
+
children: grouped ? grouped.map(([family, entries]) => /* @__PURE__ */ jsxRuntime.jsxs("section", { className: cx("uvd-x402-picker__family", cls.family), children: [
|
|
1911
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: cx("uvd-x402-picker__family-label", cls.familyLabel), children: FAMILY_LABEL[family] ?? family }),
|
|
1912
|
+
entries.map(renderOption)
|
|
1913
|
+
] }, family)) : options.map(renderOption)
|
|
1914
|
+
}
|
|
1915
|
+
),
|
|
1916
|
+
hint && /* @__PURE__ */ jsxRuntime.jsx("p", { className: cx("uvd-x402-picker__hint", cls.hint), children: hint })
|
|
1917
|
+
]
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
function PaymentMethodPicker({
|
|
1922
|
+
accepts,
|
|
1923
|
+
payment,
|
|
1924
|
+
onPaid,
|
|
1925
|
+
onError,
|
|
1926
|
+
families,
|
|
1927
|
+
layout = "carousel",
|
|
1928
|
+
label = "Payment network",
|
|
1929
|
+
hint,
|
|
1930
|
+
payLabel = "Pay",
|
|
1931
|
+
className
|
|
1932
|
+
}) {
|
|
1933
|
+
const { isConnected, connect, switchChain, network } = useX402();
|
|
1934
|
+
const { pay, isPaying } = usePayment();
|
|
1935
|
+
const [selected, setSelected] = react.useState(null);
|
|
1936
|
+
const networks = react.useMemo(() => accepts.map((a) => a.network), [accepts]);
|
|
1937
|
+
const confirm = react.useCallback(async () => {
|
|
1938
|
+
const accept = accepts.find((a) => a.network === selected);
|
|
1939
|
+
if (!accept) return;
|
|
1940
|
+
try {
|
|
1941
|
+
if (!isConnected) await connect(accept.network);
|
|
1942
|
+
if (network && network !== accept.network) await switchChain(accept.network);
|
|
1943
|
+
const result = await pay({ ...payment, accept });
|
|
1944
|
+
onPaid?.(result);
|
|
1945
|
+
} catch (error) {
|
|
1946
|
+
onError?.(error instanceof Error ? error : new Error(String(error)));
|
|
1947
|
+
}
|
|
1948
|
+
}, [accepts, selected, isConnected, connect, network, switchChain, pay, payment, onPaid, onError]);
|
|
1949
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ["uvd-x402-pay", className].filter(Boolean).join(" "), children: [
|
|
1950
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1951
|
+
NetworkPicker,
|
|
1952
|
+
{
|
|
1953
|
+
value: selected,
|
|
1954
|
+
onChange: setSelected,
|
|
1955
|
+
networks,
|
|
1956
|
+
families,
|
|
1957
|
+
disabled: isPaying,
|
|
1958
|
+
label,
|
|
1959
|
+
hint,
|
|
1960
|
+
groupByFamily: networks.length > 6,
|
|
1961
|
+
layout
|
|
1962
|
+
}
|
|
1963
|
+
),
|
|
1964
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1965
|
+
"button",
|
|
1966
|
+
{
|
|
1967
|
+
type: "button",
|
|
1968
|
+
disabled: !selected || isPaying,
|
|
1969
|
+
onClick: confirm,
|
|
1970
|
+
className: "uvd-x402-pay__confirm",
|
|
1971
|
+
children: isPaying ? "Paying..." : payLabel
|
|
1972
|
+
}
|
|
1973
|
+
)
|
|
1974
|
+
] });
|
|
1975
|
+
}
|
|
1767
1976
|
var X402Context = react.createContext(null);
|
|
1768
1977
|
function X402Provider({ children, config }) {
|
|
1769
1978
|
const [client] = react.useState(() => new X402Client(config));
|
|
@@ -2024,7 +2233,13 @@ function useNetworkBalances() {
|
|
|
2024
2233
|
};
|
|
2025
2234
|
}
|
|
2026
2235
|
|
|
2236
|
+
exports.FAMILY_LABEL = FAMILY_LABEL;
|
|
2237
|
+
exports.NetworkPicker = NetworkPicker;
|
|
2238
|
+
exports.PaymentMethodPicker = PaymentMethodPicker;
|
|
2239
|
+
exports.SIGNABLE_IN_BROWSER = SIGNABLE_IN_BROWSER;
|
|
2027
2240
|
exports.X402Provider = X402Provider;
|
|
2241
|
+
exports.buildNetworkOptions = buildNetworkOptions;
|
|
2242
|
+
exports.resolveChain = resolveChain;
|
|
2028
2243
|
exports.useBalance = useBalance;
|
|
2029
2244
|
exports.useChains = useChains;
|
|
2030
2245
|
exports.useNetworkBalances = useNetworkBalances;
|