@rozoai/intent-pay 0.1.38-beta.3 → 0.1.38-beta.4

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 (59) 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 +2 -2
  10. package/build/payment/createPaymentPayload.d.ts +3 -3
  11. package/build/payment/paymentFsm.d.ts +2 -25
  12. package/build/provider/PayContext.d.ts +3 -3
  13. package/build/src/components/Common/AmountInput/index.js +1 -1
  14. package/build/src/components/Common/AmountInput/index.js.map +1 -1
  15. package/build/src/components/Common/ConnectorList/index.js +3 -2
  16. package/build/src/components/Common/ConnectorList/index.js.map +1 -1
  17. package/build/src/components/Common/TokenChainLogo/index.js +3 -26
  18. package/build/src/components/Common/TokenChainLogo/index.js.map +1 -1
  19. package/build/src/components/Pages/PayWithToken/index.js +4 -15
  20. package/build/src/components/Pages/PayWithToken/index.js.map +1 -1
  21. package/build/src/components/Pages/SelectDepositAddressChain/index.js +17 -6
  22. package/build/src/components/Pages/SelectDepositAddressChain/index.js.map +1 -1
  23. package/build/src/components/Pages/SelectMethod/index.js.map +1 -1
  24. package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js +26 -64
  25. package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js.map +1 -1
  26. package/build/src/components/Pages/Stellar/PayWithStellarToken/index.js +38 -40
  27. package/build/src/components/Pages/Stellar/PayWithStellarToken/index.js.map +1 -1
  28. package/build/src/components/Pages/WaitingDepositAddress/index.js +33 -110
  29. package/build/src/components/Pages/WaitingDepositAddress/index.js.map +1 -1
  30. package/build/src/components/RozoPayModal/index.js +31 -3
  31. package/build/src/components/RozoPayModal/index.js.map +1 -1
  32. package/build/src/components/Spinners/TokenLogoSpinner/index.js +2 -5
  33. package/build/src/components/Spinners/TokenLogoSpinner/index.js.map +1 -1
  34. package/build/src/hooks/useDepositAddressOptions.js +9 -19
  35. package/build/src/hooks/useDepositAddressOptions.js.map +1 -1
  36. package/build/src/hooks/usePaymentState.js +72 -195
  37. package/build/src/hooks/usePaymentState.js.map +1 -1
  38. package/build/src/hooks/useRozoPay.js +2 -4
  39. package/build/src/hooks/useRozoPay.js.map +1 -1
  40. package/build/src/hooks/useSolanaPaymentOptions.js +12 -45
  41. package/build/src/hooks/useSolanaPaymentOptions.js.map +1 -1
  42. package/build/src/hooks/useStellarPaymentOptions.js +10 -40
  43. package/build/src/hooks/useStellarPaymentOptions.js.map +1 -1
  44. package/build/src/hooks/useTokenOptions.js +3 -4
  45. package/build/src/hooks/useTokenOptions.js.map +1 -1
  46. package/build/src/hooks/useWalletPaymentOptions.js +21 -54
  47. package/build/src/hooks/useWalletPaymentOptions.js.map +1 -1
  48. package/build/src/payment/createPaymentPayload.js +13 -38
  49. package/build/src/payment/createPaymentPayload.js.map +1 -1
  50. package/build/src/payment/paymentEffects.js +5 -4
  51. package/build/src/payment/paymentEffects.js.map +1 -1
  52. package/build/src/payment/paymentFsm.js.map +1 -1
  53. package/build/src/utils/format.js +13 -82
  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/format.d.ts +3 -44
  58. package/build/utils/token.d.ts +2 -6
  59. 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
  * Round a number to a given number of decimal places
@@ -25,6 +25,8 @@ export declare function roundUsd(usd: number, round?: "up" | "down" | "nearest")
25
25
  * Round a token amount to `displayDecimals` precision
26
26
  */
27
27
  export declare function roundTokenAmount(amount: bigint | BigIntStr, token: RozoPayToken, round?: "up" | "down" | "nearest"): string;
28
+ /** Strip trailing zeros from a decimal token amount string. e.g. "0.01600" → "0.016" */
29
+ export declare function trimTokenAmount(amount: string): string;
28
30
  /**
29
31
  * Round a token amount in units to `displayDecimals` precision
30
32
  */
@@ -47,46 +49,3 @@ export declare function usdToRoundedTokenAmount(usd: number, token: RozoPayToken
47
49
  * @returns The formatted USD amount
48
50
  */
49
51
  export declare function tokenAmountToRoundedUsd(amount: bigint | BigIntStr, token: RozoPayToken, round?: "up" | "down" | "nearest"): string;
50
- /**
51
- * Build a Stellar SEP-0007 `pay` URI that opens a Stellar wallet with the
52
- * destination, amount, asset, and optional memo pre-filled.
53
- *
54
- * Native XLM uses asset_code=XLM with no asset_issuer. Custom assets use the
55
- * token address (issuer) and token symbol parsed from the Rozo token object.
56
- */
57
- export declare function generateStellarDeepLink({ amountUnits, recipientAddress, token, memo, }: {
58
- amountUnits: string;
59
- recipientAddress: string;
60
- token: Token;
61
- memo?: string | null;
62
- }): string;
63
- /**
64
- * Convert a `RozoPayTokenAmount.amount` value to a full-precision, human-readable
65
- * decimal string suitable for sending to the backend (checkout/create-payment
66
- * payloads, on-chain transfer amounts, etc).
67
- *
68
- * `amount` is documented as `BigIntStr` (integer base units, e.g. lamports/wei)
69
- * but some endpoints (e.g. Solana tRPC payment options) have been observed to
70
- * return an already-human-readable decimal string instead (e.g. "0.012985327").
71
- * `BigInt()` throws on decimal strings, so this detects the shape first:
72
- * - Contains a "." → already a decimal token amount, pass through as-is.
73
- * - Otherwise → integer base units, convert via `formatUnits`.
74
- */
75
- export declare function tokenBaseAmountToDecimalString(amount: bigint | string, decimals: number): string;
76
- /**
77
- * Inverse of `tokenBaseAmountToDecimalString`: convert a
78
- * `RozoPayTokenAmount.amount` value to an integer base-units bigint, suitable
79
- * for on-chain transfer instructions (e.g. lamports for SOL, raw SPL/ERC20
80
- * transfer amounts).
81
- *
82
- * Same shape ambiguity as above — detects a decimal string (already
83
- * human-readable) and converts it up to base units via `parseUnits`;
84
- * otherwise assumes the string is already an integer base-units amount.
85
- */
86
- /**
87
- * Strip trailing zeros from a non-native token amount string for display.
88
- * "0.0200" → "0.02", "1.5000" → "1.5", "1.0" → "1"
89
- * Only for display — never use for calculations or on-chain amounts.
90
- */
91
- export declare function trimTokenAmount(amount: string): string;
92
- 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.38-beta.3",
3
+ "version": "0.1.38-beta.4",
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": [
@@ -48,7 +48,7 @@
48
48
  "@reown/appkit": "^1.7.0",
49
49
  "@rollup/plugin-image": "^3.0.3",
50
50
  "@rollup/plugin-typescript": "^12.1.2",
51
- "@rozoai/intent-common": "0.1.24-beta.2",
51
+ "@rozoai/intent-common": "0.1.25",
52
52
  "@solana/spl-memo": "^0.2.5",
53
53
  "@solana/spl-token": "^0.4.14",
54
54
  "@solana/wallet-adapter-base": "^0.9.27",