multicoyn-sdk 0.1.0 → 0.1.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 (40) hide show
  1. package/dist/App.d.ts +2 -0
  2. package/dist/{ccip-Do0z8AZp.js → ccip-DjOOvUZr.js} +1 -1
  3. package/dist/{ccip-BXLlQVZi.cjs → ccip-DqoTg55K.cjs} +1 -1
  4. package/dist/components/MulticoynButton.d.ts +14 -0
  5. package/dist/components/PaymentModal.d.ts +16 -0
  6. package/dist/components/PaymentSummary.d.ts +7 -0
  7. package/dist/components/TokenSlider.d.ts +8 -0
  8. package/dist/components/icons/CloseIcon.d.ts +6 -0
  9. package/dist/components/icons/InfoIcon.d.ts +6 -0
  10. package/dist/components/icons/ProcessingIcon.d.ts +6 -0
  11. package/dist/components/icons/SearchIcon.d.ts +6 -0
  12. package/dist/components/icons/SuccessIcon.d.ts +6 -0
  13. package/dist/components/icons/index.d.ts +5 -0
  14. package/dist/components/index.d.ts +5 -0
  15. package/dist/components/types.d.ts +42 -0
  16. package/dist/config/abis.d.ts +189 -0
  17. package/dist/config/chains.d.ts +47 -0
  18. package/dist/config/contracts.d.ts +12 -0
  19. package/dist/config/wagmi.d.ts +2 -0
  20. package/dist/constants/payment.d.ts +38 -0
  21. package/dist/hooks/index.d.ts +6 -0
  22. package/dist/hooks/useERC20.d.ts +286 -0
  23. package/dist/hooks/useMultiTokenBalances.d.ts +10 -0
  24. package/dist/hooks/useMultiTokenPrices.d.ts +17 -0
  25. package/dist/hooks/usePaymentModal.d.ts +11 -0
  26. package/dist/hooks/usePaymentRouter.d.ts +254 -0
  27. package/dist/hooks/useTokenRegistry.d.ts +409 -0
  28. package/dist/{index-QyDcHjLV.js → index-B_5-qm4i.js} +394 -391
  29. package/dist/{index-C71hhSSX.cjs → index-CIr9hCZh.cjs} +20 -20
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.ts +11 -0
  32. package/dist/index.js +1 -1
  33. package/dist/lib/errors.d.ts +6 -0
  34. package/dist/lib/tokens.d.ts +9 -0
  35. package/dist/main.d.ts +1 -0
  36. package/dist/providers/PaymentContext.d.ts +11 -0
  37. package/dist/providers/PaymentProvider.d.ts +6 -0
  38. package/dist/providers/Web3Provider.d.ts +6 -0
  39. package/dist/providers/usePaymentConfig.d.ts +1 -0
  40. package/package.json +3 -3
package/dist/App.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare function App(): import("react/jsx-runtime").JSX.Element;
2
+ export default App;
@@ -1,4 +1,4 @@
1
- import { s as b, t as x, f as F, A as I, d as C, g as M, a as E, b as D, e as w, c as G, h as A, i as T, I as H, j as m, k as v, l as R, m as k, B as y, n as N, o as P, p as j, q as B, r as U, H as L, u as _ } from "./index-QyDcHjLV.js";
1
+ import { s as b, t as x, f as F, A as I, d as C, g as M, a as E, b as D, e as w, c as G, h as A, i as T, I as H, j as m, k as v, l as R, m as k, B as y, n as N, o as P, p as j, q as B, r as U, H as L, u as _ } from "./index-B_5-qm4i.js";
2
2
  function J(e) {
3
3
  const { abi: s, data: a } = e, r = b(a, 0, 4), t = s.find((n) => n.type === "function" && r === x(F(n)));
4
4
  if (!t)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C71hhSSX.cjs");function k(r){const{abi:n,data:a}=r,o=e.slice(a,0,4),t=n.find(s=>s.type==="function"&&o===e.toFunctionSelector(e.formatAbiItem(s)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(o,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(a,4)):void 0}}const h="/docs/contract/encodeErrorResult";function y(r){const{abi:n,errorName:a,args:o}=r;let t=n[0];if(a){const f=e.getAbiItem({abi:n,args:o,name:a});if(!f)throw new e.AbiErrorNotFoundError(a,{docsPath:h});t=f}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:h});const s=e.formatAbiItem(t),c=e.toFunctionSelector(s);let i="0x";if(o&&o.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:h});i=e.encodeAbiParameters(t.inputs,o)}return e.concatHex([c,i])}const m="/docs/contract/encodeFunctionResult";function L(r){const{abi:n,functionName:a,result:o}=r;let t=n[0];if(a){const c=e.getAbiItem({abi:n,name:a});if(!c)throw new e.AbiFunctionNotFoundError(a,{docsPath:m});t=c}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:m});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:m});const s=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[o];if(Array.isArray(o))return o;throw new e.InvalidArrayError(o)})();return e.encodeAbiParameters(t.outputs,s)}const b="x-batch-gateway:true";async function g(r){const{data:n,ccipRequest:a}=r,{args:[o]}=k({abi:e.batchGatewayAbi,data:n}),t=[],s=[];return await Promise.all(o.map(async(c,i)=>{try{s[i]=c.urls.includes(b)?await g({data:c.data,ccipRequest:a}):await a(c),t[i]=!1}catch(f){t[i]=!0,s[i]=F(f)}})),L({abi:e.batchGatewayAbi,functionName:"query",result:[t,s]})}function F(r){return r.name==="HttpRequestError"&&r.status?y({abi:e.batchGatewayAbi,errorName:"HttpError",args:[r.status,r.shortMessage]}):y({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in r?r.shortMessage:r.message]})}function O(r,n){if(!e.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});if(!e.isAddress(n,{strict:!1}))throw new e.InvalidAddressError({address:n});return r.toLowerCase()===n.toLowerCase()}class P extends e.BaseError{constructor({callbackSelector:n,cause:a,data:o,extraData:t,sender:s,urls:c}){super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],a.metaMessages?.length?"":[],"Offchain Gateway Call:",c&&[" Gateway URL(s):",...c.map(i=>` ${e.getUrl(i)}`)],` Sender: ${s}`,` Data: ${o}`,` Callback selector: ${n}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class S extends e.BaseError{constructor({result:n,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify(n)}`],name:"OffchainLookupResponseMalformedError"})}}class x extends e.BaseError{constructor({sender:n,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${n}`],name:"OffchainLookupSenderMismatchError"})}}const M="0x556f1830",E={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function N(r,{blockNumber:n,blockTag:a,data:o,to:t}){const{args:s}=e.decodeErrorResult({data:o,abi:[E]}),[c,i,f,u,d]=s,{ccipRead:l}=r,w=l&&typeof l?.request=="function"?l.request:A;try{if(!O(t,c))throw new x({sender:c,to:t});const p=i.includes(b)?await g({data:f,ccipRequest:w}):await w({data:f,sender:c,urls:i}),{data:R}=await e.call(r,{blockNumber:n,blockTag:a,data:e.concat([u,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,d])]),to:t});return R}catch(p){throw new P({callbackSelector:u,cause:p,data:o,extraData:d,sender:c,urls:i})}}async function A({data:r,sender:n,urls:a}){let o=new Error("An unknown error occurred.");for(let t=0;t<a.length;t++){const s=a[t],c=s.includes("{data}")?"GET":"POST",i=c==="POST"?{data:r,sender:n}:void 0,f=c==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(s.replace("{sender}",n.toLowerCase()).replace("{data}",r),{body:JSON.stringify(i),headers:f,method:c});let d;if(u.headers.get("Content-Type")?.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){o=new e.HttpRequestError({body:i,details:d?.error?e.stringify(d.error):u.statusText,headers:u.headers,status:u.status,url:s});continue}if(!e.isHex(d)){o=new S({result:d,url:s});continue}return d}catch(u){o=new e.HttpRequestError({body:i,details:u.message,url:s})}}throw o}exports.ccipRequest=A;exports.offchainLookup=N;exports.offchainLookupAbiItem=E;exports.offchainLookupSignature=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CIr9hCZh.cjs");function k(r){const{abi:n,data:a}=r,o=e.slice(a,0,4),t=n.find(s=>s.type==="function"&&o===e.toFunctionSelector(e.formatAbiItem(s)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(o,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(a,4)):void 0}}const h="/docs/contract/encodeErrorResult";function y(r){const{abi:n,errorName:a,args:o}=r;let t=n[0];if(a){const f=e.getAbiItem({abi:n,args:o,name:a});if(!f)throw new e.AbiErrorNotFoundError(a,{docsPath:h});t=f}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:h});const s=e.formatAbiItem(t),c=e.toFunctionSelector(s);let i="0x";if(o&&o.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:h});i=e.encodeAbiParameters(t.inputs,o)}return e.concatHex([c,i])}const m="/docs/contract/encodeFunctionResult";function L(r){const{abi:n,functionName:a,result:o}=r;let t=n[0];if(a){const c=e.getAbiItem({abi:n,name:a});if(!c)throw new e.AbiFunctionNotFoundError(a,{docsPath:m});t=c}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:m});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:m});const s=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[o];if(Array.isArray(o))return o;throw new e.InvalidArrayError(o)})();return e.encodeAbiParameters(t.outputs,s)}const b="x-batch-gateway:true";async function g(r){const{data:n,ccipRequest:a}=r,{args:[o]}=k({abi:e.batchGatewayAbi,data:n}),t=[],s=[];return await Promise.all(o.map(async(c,i)=>{try{s[i]=c.urls.includes(b)?await g({data:c.data,ccipRequest:a}):await a(c),t[i]=!1}catch(f){t[i]=!0,s[i]=F(f)}})),L({abi:e.batchGatewayAbi,functionName:"query",result:[t,s]})}function F(r){return r.name==="HttpRequestError"&&r.status?y({abi:e.batchGatewayAbi,errorName:"HttpError",args:[r.status,r.shortMessage]}):y({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in r?r.shortMessage:r.message]})}function O(r,n){if(!e.isAddress(r,{strict:!1}))throw new e.InvalidAddressError({address:r});if(!e.isAddress(n,{strict:!1}))throw new e.InvalidAddressError({address:n});return r.toLowerCase()===n.toLowerCase()}class P extends e.BaseError{constructor({callbackSelector:n,cause:a,data:o,extraData:t,sender:s,urls:c}){super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],a.metaMessages?.length?"":[],"Offchain Gateway Call:",c&&[" Gateway URL(s):",...c.map(i=>` ${e.getUrl(i)}`)],` Sender: ${s}`,` Data: ${o}`,` Callback selector: ${n}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class S extends e.BaseError{constructor({result:n,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(a)}`,`Response: ${e.stringify(n)}`],name:"OffchainLookupResponseMalformedError"})}}class x extends e.BaseError{constructor({sender:n,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${n}`],name:"OffchainLookupSenderMismatchError"})}}const M="0x556f1830",E={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function N(r,{blockNumber:n,blockTag:a,data:o,to:t}){const{args:s}=e.decodeErrorResult({data:o,abi:[E]}),[c,i,f,u,d]=s,{ccipRead:l}=r,w=l&&typeof l?.request=="function"?l.request:A;try{if(!O(t,c))throw new x({sender:c,to:t});const p=i.includes(b)?await g({data:f,ccipRequest:w}):await w({data:f,sender:c,urls:i}),{data:R}=await e.call(r,{blockNumber:n,blockTag:a,data:e.concat([u,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,d])]),to:t});return R}catch(p){throw new P({callbackSelector:u,cause:p,data:o,extraData:d,sender:c,urls:i})}}async function A({data:r,sender:n,urls:a}){let o=new Error("An unknown error occurred.");for(let t=0;t<a.length;t++){const s=a[t],c=s.includes("{data}")?"GET":"POST",i=c==="POST"?{data:r,sender:n}:void 0,f=c==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(s.replace("{sender}",n.toLowerCase()).replace("{data}",r),{body:JSON.stringify(i),headers:f,method:c});let d;if(u.headers.get("Content-Type")?.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){o=new e.HttpRequestError({body:i,details:d?.error?e.stringify(d.error):u.statusText,headers:u.headers,status:u.status,url:s});continue}if(!e.isHex(d)){o=new S({result:d,url:s});continue}return d}catch(u){o=new e.HttpRequestError({body:i,details:u.message,url:s})}}throw o}exports.ccipRequest=A;exports.offchainLookup=N;exports.offchainLookupAbiItem=E;exports.offchainLookupSignature=M;
@@ -0,0 +1,14 @@
1
+ import type { PaymentItem, PaymentResult } from "./types";
2
+ interface MulticoynButtonProps {
3
+ totalAmount: number;
4
+ merchantAddress: `0x${string}`;
5
+ currency?: string;
6
+ items: PaymentItem[];
7
+ settleInIDR?: boolean;
8
+ onPaymentComplete?: (result: PaymentResult) => void;
9
+ onPaymentError?: (error: Error) => void;
10
+ className?: string;
11
+ children?: React.ReactNode;
12
+ }
13
+ export declare function MulticoynButton({ totalAmount, merchantAddress, currency, items, settleInIDR, onPaymentComplete, onPaymentError, className, children, }: MulticoynButtonProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { Token, PaymentItem } from "./types";
2
+ interface PaymentModalProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ totalAmount: number;
6
+ currency?: string;
7
+ items: PaymentItem[];
8
+ tokens: Token[];
9
+ onPaymentSubmit: (tokens: Token[]) => void;
10
+ fee?: number;
11
+ transactionHash?: string;
12
+ isProcessing?: boolean;
13
+ isSuccess?: boolean;
14
+ }
15
+ export declare function PaymentModal({ isOpen, onClose, totalAmount, currency, items, tokens: initialTokens, onPaymentSubmit, fee, transactionHash, isProcessing: externalIsProcessing, isSuccess: externalIsSuccess, }: PaymentModalProps): import("react").ReactPortal | null;
16
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { PaymentItem } from "./types";
2
+ interface PaymentSummaryProps {
3
+ items: PaymentItem[];
4
+ fee?: number;
5
+ }
6
+ export declare function PaymentSummary({ items, fee }: PaymentSummaryProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Token } from "./types";
2
+ interface TokenSliderProps {
3
+ token: Token;
4
+ onChange: (percentage: number) => void;
5
+ totalAmount: number;
6
+ }
7
+ export declare function TokenSlider({ token, onChange, totalAmount, }: TokenSliderProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ interface CloseIconProps {
2
+ size?: number;
3
+ className?: string;
4
+ }
5
+ export declare function CloseIcon({ size, className }: CloseIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ interface InfoIconProps {
2
+ size?: number;
3
+ className?: string;
4
+ }
5
+ export declare function InfoIcon({ size, className }: InfoIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ interface ProcessingIconProps {
2
+ size?: number;
3
+ className?: string;
4
+ }
5
+ export declare function ProcessingIcon({ size, className, }: ProcessingIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ interface SearchIconProps {
2
+ size?: number;
3
+ className?: string;
4
+ }
5
+ export declare function SearchIcon({ size, className }: SearchIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ interface SuccessIconProps {
2
+ size?: number;
3
+ className?: string;
4
+ }
5
+ export declare function SuccessIcon({ size, className }: SuccessIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ export { CloseIcon } from "./CloseIcon";
2
+ export { SearchIcon } from "./SearchIcon";
3
+ export { InfoIcon } from "./InfoIcon";
4
+ export { ProcessingIcon } from "./ProcessingIcon";
5
+ export { SuccessIcon } from "./SuccessIcon";
@@ -0,0 +1,5 @@
1
+ export { MulticoynButton } from "./MulticoynButton";
2
+ export { PaymentModal } from "./PaymentModal";
3
+ export { TokenSlider } from "./TokenSlider";
4
+ export { PaymentSummary } from "./PaymentSummary";
5
+ export type { Token, PaymentItem, PaymentResult, MulticoynButtonProps, PaymentModalProps, } from "./types";
@@ -0,0 +1,42 @@
1
+ export interface Token {
2
+ id: string;
3
+ name: string;
4
+ symbol: string;
5
+ amount: number;
6
+ chain: string;
7
+ chainIcon?: string;
8
+ tokenIcon?: string;
9
+ percentage: number;
10
+ address: `0x${string}`;
11
+ decimals: number;
12
+ priceUSD: number;
13
+ isApproved?: boolean;
14
+ }
15
+ export interface PaymentItem {
16
+ name: string;
17
+ price: number;
18
+ }
19
+ export interface MulticoynButtonProps {
20
+ totalAmount: number;
21
+ currency?: string;
22
+ items: PaymentItem[];
23
+ tokens?: Token[];
24
+ onPaymentComplete?: (result: PaymentResult) => void;
25
+ onPaymentError?: (error: Error) => void;
26
+ className?: string;
27
+ children?: React.ReactNode;
28
+ }
29
+ export interface PaymentModalProps {
30
+ isOpen: boolean;
31
+ onClose: () => void;
32
+ totalAmount: number;
33
+ currency?: string;
34
+ items: PaymentItem[];
35
+ tokens: Token[];
36
+ onPaymentSubmit: () => void;
37
+ }
38
+ export interface PaymentResult {
39
+ success: boolean;
40
+ transactionId?: string;
41
+ tokens: Token[];
42
+ }
@@ -0,0 +1,189 @@
1
+ export declare const PAYMENT_ROUTER_ABI: ({
2
+ inputs: {
3
+ internalType: string;
4
+ name: string;
5
+ type: string;
6
+ }[];
7
+ stateMutability: string;
8
+ type: string;
9
+ name?: undefined;
10
+ anonymous?: undefined;
11
+ outputs?: undefined;
12
+ } | {
13
+ inputs: {
14
+ internalType: string;
15
+ name: string;
16
+ type: string;
17
+ }[];
18
+ name: string;
19
+ type: string;
20
+ stateMutability?: undefined;
21
+ anonymous?: undefined;
22
+ outputs?: undefined;
23
+ } | {
24
+ anonymous: boolean;
25
+ inputs: {
26
+ indexed: boolean;
27
+ internalType: string;
28
+ name: string;
29
+ type: string;
30
+ }[];
31
+ name: string;
32
+ type: string;
33
+ stateMutability?: undefined;
34
+ outputs?: undefined;
35
+ } | {
36
+ inputs: {
37
+ internalType: string;
38
+ name: string;
39
+ type: string;
40
+ }[];
41
+ name: string;
42
+ outputs: {
43
+ internalType: string;
44
+ name: string;
45
+ type: string;
46
+ }[];
47
+ stateMutability: string;
48
+ type: string;
49
+ anonymous?: undefined;
50
+ } | {
51
+ inputs: {
52
+ internalType: string;
53
+ name: string;
54
+ type: string;
55
+ }[];
56
+ name: string;
57
+ outputs: {
58
+ components: {
59
+ internalType: string;
60
+ name: string;
61
+ type: string;
62
+ }[];
63
+ internalType: string;
64
+ name: string;
65
+ type: string;
66
+ }[];
67
+ stateMutability: string;
68
+ type: string;
69
+ anonymous?: undefined;
70
+ } | {
71
+ stateMutability: string;
72
+ type: string;
73
+ inputs?: undefined;
74
+ name?: undefined;
75
+ anonymous?: undefined;
76
+ outputs?: undefined;
77
+ })[];
78
+ export declare const TOKEN_REGISTRY_ABI: ({
79
+ inputs: never[];
80
+ stateMutability: string;
81
+ type: string;
82
+ name?: undefined;
83
+ anonymous?: undefined;
84
+ outputs?: undefined;
85
+ } | {
86
+ inputs: {
87
+ internalType: string;
88
+ name: string;
89
+ type: string;
90
+ }[];
91
+ name: string;
92
+ type: string;
93
+ stateMutability?: undefined;
94
+ anonymous?: undefined;
95
+ outputs?: undefined;
96
+ } | {
97
+ anonymous: boolean;
98
+ inputs: {
99
+ indexed: boolean;
100
+ internalType: string;
101
+ name: string;
102
+ type: string;
103
+ }[];
104
+ name: string;
105
+ type: string;
106
+ stateMutability?: undefined;
107
+ outputs?: undefined;
108
+ } | {
109
+ inputs: {
110
+ internalType: string;
111
+ name: string;
112
+ type: string;
113
+ }[];
114
+ name: string;
115
+ outputs: {
116
+ internalType: string;
117
+ name: string;
118
+ type: string;
119
+ }[];
120
+ stateMutability: string;
121
+ type: string;
122
+ anonymous?: undefined;
123
+ } | {
124
+ inputs: {
125
+ internalType: string;
126
+ name: string;
127
+ type: string;
128
+ }[];
129
+ name: string;
130
+ outputs: {
131
+ components: {
132
+ internalType: string;
133
+ name: string;
134
+ type: string;
135
+ }[];
136
+ internalType: string;
137
+ name: string;
138
+ type: string;
139
+ }[];
140
+ stateMutability: string;
141
+ type: string;
142
+ anonymous?: undefined;
143
+ })[];
144
+ export declare const ERC20_ABI: ({
145
+ inputs: never[];
146
+ stateMutability: string;
147
+ type: string;
148
+ name?: undefined;
149
+ anonymous?: undefined;
150
+ outputs?: undefined;
151
+ } | {
152
+ inputs: {
153
+ internalType: string;
154
+ name: string;
155
+ type: string;
156
+ }[];
157
+ name: string;
158
+ type: string;
159
+ stateMutability?: undefined;
160
+ anonymous?: undefined;
161
+ outputs?: undefined;
162
+ } | {
163
+ anonymous: boolean;
164
+ inputs: {
165
+ indexed: boolean;
166
+ internalType: string;
167
+ name: string;
168
+ type: string;
169
+ }[];
170
+ name: string;
171
+ type: string;
172
+ stateMutability?: undefined;
173
+ outputs?: undefined;
174
+ } | {
175
+ inputs: {
176
+ internalType: string;
177
+ name: string;
178
+ type: string;
179
+ }[];
180
+ name: string;
181
+ outputs: {
182
+ internalType: string;
183
+ name: string;
184
+ type: string;
185
+ }[];
186
+ stateMutability: string;
187
+ type: string;
188
+ anonymous?: undefined;
189
+ })[];
@@ -0,0 +1,47 @@
1
+ export declare const liskSepolia: {
2
+ blockExplorers: {
3
+ readonly default: {
4
+ readonly name: "Blockscout";
5
+ readonly url: "https://sepolia-blockscout.lisk.com";
6
+ };
7
+ };
8
+ blockTime?: number | undefined | undefined;
9
+ contracts?: {
10
+ [x: string]: import("viem").ChainContract | {
11
+ [sourceId: number]: import("viem").ChainContract | undefined;
12
+ } | undefined;
13
+ ensRegistry?: import("viem").ChainContract | undefined;
14
+ ensUniversalResolver?: import("viem").ChainContract | undefined;
15
+ multicall3?: import("viem").ChainContract | undefined;
16
+ erc6492Verifier?: import("viem").ChainContract | undefined;
17
+ } | undefined;
18
+ ensTlds?: readonly string[] | undefined;
19
+ id: 4202;
20
+ name: "Lisk Sepolia";
21
+ nativeCurrency: {
22
+ readonly name: "Sepolia Ether";
23
+ readonly symbol: "ETH";
24
+ readonly decimals: 18;
25
+ };
26
+ experimental_preconfirmationTime?: number | undefined | undefined;
27
+ rpcUrls: {
28
+ readonly default: {
29
+ readonly http: readonly ["https://rpc.sepolia-api.lisk.com"];
30
+ };
31
+ };
32
+ sourceId?: number | undefined | undefined;
33
+ testnet: true;
34
+ custom?: Record<string, unknown> | undefined;
35
+ extendSchema?: Record<string, unknown> | undefined;
36
+ fees?: import("viem").ChainFees<undefined> | undefined;
37
+ formatters?: undefined;
38
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
39
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
40
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
41
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
42
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
43
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
44
+ }] | undefined;
45
+ serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
46
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
47
+ };
@@ -0,0 +1,12 @@
1
+ export declare const CONTRACTS: {
2
+ readonly PAYMENT_ROUTER: "0x7b3dfd5A3F3903237faC3D2de69d4c1915A09C9A";
3
+ readonly TOKEN_REGISTRY: "0x8515a560284AedE5D78Ff5b73f2CeCa247DCAab7";
4
+ };
5
+ export declare const TOKENS: {
6
+ readonly NATIVE: "0x0000000000000000000000000000000000000000";
7
+ readonly USDC: "0x5DD8eEF51d251a53D6368CfD79a88F3BC186514B";
8
+ readonly USDT: "0xc9013AD6e74A7dC418b2e601aaCD772044E59c22";
9
+ readonly DAI: "0xF84851B3A4253b74813112A5488E38E724731E2a";
10
+ readonly WBTC: "0x437f0b6328892ac36E01836aBc865d16c875D291";
11
+ readonly IDRX: "0x5324Cd3e781cf85Cf63253138Ef6c6E84143de7B";
12
+ };
@@ -0,0 +1,2 @@
1
+ import type { Config } from 'wagmi';
2
+ export declare const wagmiConfig: Config;
@@ -0,0 +1,38 @@
1
+ export declare const FEE_BASIS_POINTS = 30;
2
+ export declare const FEE_PERCENTAGE = 0.003;
3
+ export declare const MAX_TOKENS_PER_PAYMENT = 5;
4
+ export declare const USD_DECIMALS = 8;
5
+ export declare const USD_SCALE: number;
6
+ export declare const MAX_UINT256: bigint;
7
+ export declare const TOKEN_METADATA: {
8
+ readonly ETH: {
9
+ readonly symbol: "ETH";
10
+ readonly decimals: 18;
11
+ readonly name: "Ether";
12
+ };
13
+ readonly USDC: {
14
+ readonly symbol: "USDC";
15
+ readonly decimals: 6;
16
+ readonly name: "USD Coin";
17
+ };
18
+ readonly USDT: {
19
+ readonly symbol: "USDT";
20
+ readonly decimals: 6;
21
+ readonly name: "Tether USD";
22
+ };
23
+ readonly DAI: {
24
+ readonly symbol: "DAI";
25
+ readonly decimals: 18;
26
+ readonly name: "Dai Stablecoin";
27
+ };
28
+ readonly WBTC: {
29
+ readonly symbol: "WBTC";
30
+ readonly decimals: 8;
31
+ readonly name: "Wrapped Bitcoin";
32
+ };
33
+ readonly IDRX: {
34
+ readonly symbol: "IDRX";
35
+ readonly decimals: 18;
36
+ readonly name: "Indonesian Rupiah";
37
+ };
38
+ };
@@ -0,0 +1,6 @@
1
+ export { usePaymentModal } from "./usePaymentModal";
2
+ export { usePaymentRouter } from "./usePaymentRouter";
3
+ export { useTokenRegistry } from "./useTokenRegistry";
4
+ export { useERC20 } from "./useERC20";
5
+ export { useMultiTokenBalances } from "./useMultiTokenBalances";
6
+ export { useMultiTokenPrices } from "./useMultiTokenPrices";