@rozoai/intent-pay 0.1.40-beta.1 → 0.1.40-beta.3

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.
Files changed (60) hide show
  1. package/build/components/Common/TokenChainLogo/index.d.ts +1 -7
  2. package/build/components/Spinners/TokenLogoSpinner/index.d.ts +1 -6
  3. package/build/hooks/useDepositAddressOptions.d.ts +2 -3
  4. package/build/hooks/usePaymentState.d.ts +5 -11
  5. package/build/hooks/useRozoPay.d.ts +4 -4
  6. package/build/hooks/useSolanaPaymentOptions.d.ts +1 -1
  7. package/build/hooks/useStellarPaymentOptions.d.ts +1 -1
  8. package/build/hooks/useWalletPaymentOptions.d.ts +7 -12
  9. package/build/package.json.js +1 -1
  10. package/build/payment/createPaymentPayload.d.ts +3 -3
  11. package/build/payment/paymentEffects.d.ts +17 -0
  12. package/build/payment/paymentFsm.d.ts +4 -25
  13. package/build/provider/PayContext.d.ts +3 -3
  14. package/build/src/components/Common/ConnectorList/index.js +3 -2
  15. package/build/src/components/Common/ConnectorList/index.js.map +1 -1
  16. package/build/src/components/Common/TokenChainLogo/index.js +3 -26
  17. package/build/src/components/Common/TokenChainLogo/index.js.map +1 -1
  18. package/build/src/components/Pages/PayWithToken/index.js +14 -26
  19. package/build/src/components/Pages/PayWithToken/index.js.map +1 -1
  20. package/build/src/components/Pages/SelectDepositAddressChain/index.js +17 -6
  21. package/build/src/components/Pages/SelectDepositAddressChain/index.js.map +1 -1
  22. package/build/src/components/Pages/SelectMethod/index.js.map +1 -1
  23. package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js +30 -65
  24. package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js.map +1 -1
  25. package/build/src/components/Pages/Stellar/PayWithStellarToken/index.js +44 -47
  26. package/build/src/components/Pages/Stellar/PayWithStellarToken/index.js.map +1 -1
  27. package/build/src/components/Pages/WaitingDepositAddress/index.js +43 -121
  28. package/build/src/components/Pages/WaitingDepositAddress/index.js.map +1 -1
  29. package/build/src/components/RozoPayModal/index.js.map +1 -1
  30. package/build/src/components/Spinners/TokenLogoSpinner/index.js +2 -5
  31. package/build/src/components/Spinners/TokenLogoSpinner/index.js.map +1 -1
  32. package/build/src/hooks/useDepositAddressOptions.js +9 -19
  33. package/build/src/hooks/useDepositAddressOptions.js.map +1 -1
  34. package/build/src/hooks/usePaymentState.js +70 -164
  35. package/build/src/hooks/usePaymentState.js.map +1 -1
  36. package/build/src/hooks/useRozoPay.js +2 -4
  37. package/build/src/hooks/useRozoPay.js.map +1 -1
  38. package/build/src/hooks/useSolanaPaymentOptions.js +13 -45
  39. package/build/src/hooks/useSolanaPaymentOptions.js.map +1 -1
  40. package/build/src/hooks/useStellarPaymentOptions.js +11 -40
  41. package/build/src/hooks/useStellarPaymentOptions.js.map +1 -1
  42. package/build/src/hooks/useTokenOptions.js +3 -4
  43. package/build/src/hooks/useTokenOptions.js.map +1 -1
  44. package/build/src/hooks/useWalletPaymentOptions.js +22 -54
  45. package/build/src/hooks/useWalletPaymentOptions.js.map +1 -1
  46. package/build/src/payment/createPaymentPayload.js +53 -40
  47. package/build/src/payment/createPaymentPayload.js.map +1 -1
  48. package/build/src/payment/paymentEffects.js +33 -17
  49. package/build/src/payment/paymentEffects.js.map +1 -1
  50. package/build/src/payment/paymentFsm.js.map +1 -1
  51. package/build/src/utils/feeCache.js +24 -12
  52. package/build/src/utils/feeCache.js.map +1 -1
  53. package/build/src/utils/format.js +2 -69
  54. package/build/src/utils/format.js.map +1 -1
  55. package/build/src/utils/token.js +5 -21
  56. package/build/src/utils/token.js.map +1 -1
  57. package/build/utils/feeCache.d.ts +30 -2
  58. package/build/utils/format.d.ts +1 -38
  59. package/build/utils/token.d.ts +2 -6
  60. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { BigIntStr, RozoPayToken, type Token } from "@rozoai/intent-common";
1
+ import { BigIntStr, RozoPayToken } from "@rozoai/intent-common";
2
2
  export declare const USD_DECIMALS = 2;
3
3
  /**
4
4
  * Fallback for `token.displayDecimals` when absent. Mirrors
@@ -64,40 +64,3 @@ export declare function usdToRoundedTokenAmount(usd: number, token: RozoPayToken
64
64
  * @returns The formatted USD amount
65
65
  */
66
66
  export declare function tokenAmountToRoundedUsd(amount: bigint | BigIntStr, token: RozoPayToken, round?: "up" | "down" | "nearest"): string;
67
- /**
68
- * Build a Stellar SEP-0007 `pay` URI that opens a Stellar wallet with the
69
- * destination, amount, asset, and optional memo pre-filled.
70
- *
71
- * Native XLM uses asset_code=XLM with no asset_issuer. Custom assets use the
72
- * token address (issuer) and token symbol parsed from the Rozo token object.
73
- */
74
- export declare function generateStellarDeepLink({ amountUnits, recipientAddress, token, memo, }: {
75
- amountUnits: string;
76
- recipientAddress: string;
77
- token: Token;
78
- memo?: string | null;
79
- }): string;
80
- /**
81
- * Convert a `RozoPayTokenAmount.amount` value to a full-precision, human-readable
82
- * decimal string suitable for sending to the backend (checkout/create-payment
83
- * payloads, on-chain transfer amounts, etc).
84
- *
85
- * `amount` is documented as `BigIntStr` (integer base units, e.g. lamports/wei)
86
- * but some endpoints (e.g. Solana tRPC payment options) have been observed to
87
- * return an already-human-readable decimal string instead (e.g. "0.012985327").
88
- * `BigInt()` throws on decimal strings, so this detects the shape first:
89
- * - Contains a "." → already a decimal token amount, pass through as-is.
90
- * - Otherwise → integer base units, convert via `formatUnits`.
91
- */
92
- export declare function tokenBaseAmountToDecimalString(amount: bigint | string, decimals: number): string;
93
- /**
94
- * Inverse of `tokenBaseAmountToDecimalString`: convert a
95
- * `RozoPayTokenAmount.amount` value to an integer base-units bigint, suitable
96
- * for on-chain transfer instructions (e.g. lamports for SOL, raw SPL/ERC20
97
- * transfer amounts).
98
- *
99
- * Same shape ambiguity as above — detects a decimal string (already
100
- * human-readable) and converts it up to base units via `parseUnits`;
101
- * otherwise assumes the string is already an integer base-units amount.
102
- */
103
- export declare function tokenAmountToBaseUnits(amount: bigint | BigIntStr, decimals: number): bigint;
@@ -1,11 +1,7 @@
1
- import { isNativeToken, Token, TokenSymbol } from "@rozoai/intent-common";
2
- export { isNativeToken };
1
+ import { Token, TokenSymbol } from "@rozoai/intent-common";
3
2
  /**
4
3
  * Converts preferredSymbol array to preferredTokens array.
5
- * Explicit preferredSymbol values are respected as given (USDC, USDT, EURC,
6
- * or native ETH/BNB/POL/SOL/XLM). When neither preferredSymbol nor
7
- * preferredTokens is provided, defaults to stablecoins plus native tokens
8
- * so native options aren't silently filtered out of the default request.
4
+ * Only USDC, USDT, and EURC symbols are allowed.
9
5
  * Finds tokens matching the symbols across supported chains (Base, Polygon, Ethereum, Solana, Stellar).
10
6
  */
11
7
  export declare function convertPreferredSymbolsToTokens(symbols: TokenSymbol[] | undefined, existingPreferredTokens: Token[] | undefined): Token[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rozoai/intent-pay",
3
- "version": "0.1.40-beta.1",
3
+ "version": "0.1.40-beta.3",
4
4
  "private": false,
5
5
  "description": "Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.",
6
6
  "keywords": [
@@ -49,7 +49,7 @@
49
49
  "@reown/appkit": "^1.7.0",
50
50
  "@rollup/plugin-image": "^3.0.3",
51
51
  "@rollup/plugin-typescript": "^12.1.2",
52
- "@rozoai/intent-common": "0.1.27-beta.1",
52
+ "@rozoai/intent-common": "0.1.27-beta.2",
53
53
  "@solana/spl-memo": "^0.2.5",
54
54
  "@solana/spl-token": "^0.4.14",
55
55
  "@solana/wallet-adapter-base": "^0.9.27",