@dexterai/x402 3.7.7 → 3.7.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/dist/client/index.cjs +1 -1
- package/dist/client/index.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/server/index.cjs +7 -7
- package/dist/server/index.d.cts +7 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.js +10 -10
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
package/dist/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var S=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var s in e)S(t,s,{get:e[s],enumerable:!0})},v=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of U(e))!W.call(t,r)&&r!==s&&S(t,r,{get:()=>e[r],enumerable:!(n=M(e,r))||n.enumerable});return t};var P=t=>v(S({},"__esModule",{value:!0}),t);var Y={};y(Y,{fromAtomicUnits:()=>B,getChainDisplayName:()=>I,getChainFamily:()=>d,getChainName:()=>g,getExplorerUrl:()=>K,toAtomicUnits:()=>D});module.exports=P(Y);var T="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",x="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",_="solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";var i="eip155:8453",c="eip155:84532",p="eip155:42161",E="eip155:137",l="eip155:10",A="eip155:43114",h="eip155:56",m="eip155:1187947933",u="eip155:324705682",f="eip155:1";var F="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",$="0x55d398326f99059fF775485246999027B3197955",C="0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",q={[h]:C,[i]:F,[c]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[p]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[E]:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",[l]:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",[A]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[m]:"0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20",[u]:"0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",[f]:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},X={[$]:{symbol:"USDT",decimals:18},[C]:{symbol:"USDC",decimals:18}};var z={[h]:56,[i]:8453,[c]:84532,[p]:42161,[E]:137,[l]:10,[A]:43114,[m]:1187947933,[u]:324705682,[f]:1},Z={[T]:"https://api.dexter.cash/api/solana/rpc",[x]:"https://api.devnet.solana.com",[_]:"https://api.testnet.solana.com"},j={[h]:"https://bsc-dataseed1.binance.org",[i]:"https://api.dexter.cash/api/base/rpc",[c]:"https://sepolia.base.org",[p]:"https://arb1.arbitrum.io/rpc",[E]:"https://polygon-rpc.com",[l]:"https://mainnet.optimism.io",[A]:"https://api.avax.network/ext/bc/C/rpc",[m]:"https://skale-base.skalenodes.com/v1/base",[u]:"https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha",[f]:"https://eth.llamarpc.com"};function D(t,e){if(!Number.isFinite(t))throw new Error(`toAtomicUnits: amount must be finite, got ${t}`);if(t<0)throw new Error(`toAtomicUnits: amount must be non-negative, got ${t}`);if(!Number.isInteger(e)||e<0)throw new Error(`toAtomicUnits: decimals must be a non-negative integer, got ${e}`);let s=V(Math.abs(t)),[n,r=""]=s.split("."),N=r.slice(0,e).padEnd(e,"0");return BigInt(n+N).toString()}function V(t){let e=t.toString();if(!/[eE]/.test(e))return e;let[s,n]=e.split(/[eE]/),r=parseInt(n,10),N=s.startsWith("-"),O=N?s.slice(1):s,[R,L=""]=O.split("."),o=R+L,a=R.length+r,b;return a<=0?b="0."+"0".repeat(-a)+o:a>=o.length?b=o+"0".repeat(a-o.length):b=o.slice(0,a)+"."+o.slice(a),(N?"-":"")+b}function B(t,e){let s=Math.pow(10,e);return Number(t)/s}function H(t){return t.startsWith("solana:")||t==="solana"}function J(t){return t.startsWith("eip155:")||["base","ethereum","arbitrum"].includes(t)}function d(t){return H(t)?"solana":J(t)?"evm":"unknown"}function g(t){return{[T]:"Solana",[x]:"Solana Devnet",[_]:"Solana Testnet",solana:"Solana","solana-devnet":"Solana Devnet","solana-testnet":"Solana Testnet",[i]:"Base",[c]:"Base Sepolia",[f]:"Ethereum",[p]:"Arbitrum",[E]:"Polygon",[l]:"Optimism",[A]:"Avalanche",[h]:"BSC",[m]:"SKALE Base",[u]:"SKALE Base Sepolia",base:"Base","base-sepolia":"Base Sepolia",ethereum:"Ethereum",arbitrum:"Arbitrum",polygon:"Polygon",optimism:"Optimism",avalanche:"Avalanche",bsc:"BSC","skale-base":"SKALE Base","skale-base-sepolia":"SKALE Base Sepolia"}[t]||t}function I(t,e){let s=g(t);return s===t?e:s}function K(t,e){let s=d(e);if(s==="solana")return e.includes("devnet")||e===x?`https://solscan.io/tx/${t}?cluster=devnet`:`https://www.orbmarkets.io/tx/${t}`;if(s==="evm"){let n="8453";switch(e.startsWith("eip155:")?n=e.split(":")[1]:e==="ethereum"?n="1":e==="arbitrum"?n="42161":e==="polygon"?n="137":e==="optimism"?n="10":e==="avalanche"?n="43114":e==="bsc"?n="56":e==="skale-base"?n="1187947933":e==="skale-base-sepolia"&&(n="324705682"),n){case"8453":return`https://basescan.org/tx/${t}`;case"84532":return`https://sepolia.basescan.org/tx/${t}`;case"1":return`https://etherscan.io/tx/${t}`;case"42161":return`https://arbiscan.io/tx/${t}`;case"137":return`https://polygonscan.com/tx/${t}`;case"10":return`https://optimistic.etherscan.io/tx/${t}`;case"43114":return`https://snowtrace.io/tx/${t}`;case"56":return`https://bscscan.com/tx/${t}`;case"1187947933":return`https://elated-tan-skat.explorer.mainnet.skalenodes.com/tx/${t}`;case"324705682":return`https://base-sepolia-testnet.explorer.skalenodes.com/tx/${t}`;default:return`https://basescan.org/tx/${t}`}}return`https://solscan.io/tx/${t}`}0&&(module.exports={fromAtomicUnits,getChainDisplayName,getChainFamily,getChainName,getExplorerUrl,toAtomicUnits});
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var S="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",b="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",T="solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";var a="eip155:8453",i="eip155:84532",c="eip155:42161",p="eip155:137",E="eip155:10",l="eip155:43114",A="eip155:56",h="eip155:1187947933",m="eip155:324705682",u="eip155:1";var D="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",B="0x55d398326f99059fF775485246999027B3197955",g="0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",v={[A]:g,[a]:D,[i]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[c]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[p]:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",[E]:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",[l]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[h]:"0x85889c8c714505E0c94b30fcfcF64fE3Ac8FCb20",[m]:"0x2e08028E3C4c2356572E096d8EF835cD5C6030bD",[u]:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},P={[B]:{symbol:"USDT",decimals:18},[g]:{symbol:"USDC",decimals:18}};var F={[A]:56,[a]:8453,[i]:84532,[c]:42161,[p]:137,[E]:10,[l]:43114,[h]:1187947933,[m]:324705682,[u]:1},$={[S]:"https://api.dexter.cash/api/solana/rpc",[b]:"https://api.devnet.solana.com",[T]:"https://api.testnet.solana.com"},V={[A]:"https://bsc-dataseed1.binance.org",[a]:"https://api.dexter.cash/api/base/rpc",[i]:"https://sepolia.base.org",[c]:"https://arb1.arbitrum.io/rpc",[p]:"https://polygon-rpc.com",[E]:"https://mainnet.optimism.io",[l]:"https://api.avax.network/ext/bc/C/rpc",[h]:"https://skale-base.skalenodes.com/v1/base",[m]:"https://base-sepolia-testnet.skalenodes.com/v1/jubilant-horrible-ancha",[u]:"https://eth.llamarpc.com"};function I(t,e){if(!Number.isFinite(t))throw new Error(`toAtomicUnits: amount must be finite, got ${t}`);if(t<0)throw new Error(`toAtomicUnits: amount must be non-negative, got ${t}`);if(!Number.isInteger(e)||e<0)throw new Error(`toAtomicUnits: decimals must be a non-negative integer, got ${e}`);let n=K(Math.abs(t)),[s,x=""]=n.split("."),f=x.slice(0,e).padEnd(e,"0");return BigInt(s+f).toString()}function K(t){let e=t.toString();if(!/[eE]/.test(e))return e;let[n,s]=e.split(/[eE]/),x=parseInt(s,10),f=n.startsWith("-"),_=f?n.slice(1):n,[d,C=""]=_.split("."),r=d+C,o=d.length+x,N;return o<=0?N="0."+"0".repeat(-o)+r:o>=r.length?N=r+"0".repeat(o-r.length):N=r.slice(0,o)+"."+r.slice(o),(f?"-":"")+N}function L(t,e){let n=Math.pow(10,e);return Number(t)/n}function M(t){return t.startsWith("solana:")||t==="solana"}function U(t){return t.startsWith("eip155:")||["base","ethereum","arbitrum"].includes(t)}function O(t){return M(t)?"solana":U(t)?"evm":"unknown"}function R(t){return{[S]:"Solana",[b]:"Solana Devnet",[T]:"Solana Testnet",solana:"Solana","solana-devnet":"Solana Devnet","solana-testnet":"Solana Testnet",[a]:"Base",[i]:"Base Sepolia",[u]:"Ethereum",[c]:"Arbitrum",[p]:"Polygon",[E]:"Optimism",[l]:"Avalanche",[A]:"BSC",[h]:"SKALE Base",[m]:"SKALE Base Sepolia",base:"Base","base-sepolia":"Base Sepolia",ethereum:"Ethereum",arbitrum:"Arbitrum",polygon:"Polygon",optimism:"Optimism",avalanche:"Avalanche",bsc:"BSC","skale-base":"SKALE Base","skale-base-sepolia":"SKALE Base Sepolia"}[t]||t}function W(t,e){let n=R(t);return n===t?e:n}function y(t,e){let n=O(e);if(n==="solana")return e.includes("devnet")||e===b?`https://solscan.io/tx/${t}?cluster=devnet`:`https://www.orbmarkets.io/tx/${t}`;if(n==="evm"){let s="8453";switch(e.startsWith("eip155:")?s=e.split(":")[1]:e==="ethereum"?s="1":e==="arbitrum"?s="42161":e==="polygon"?s="137":e==="optimism"?s="10":e==="avalanche"?s="43114":e==="bsc"?s="56":e==="skale-base"?s="1187947933":e==="skale-base-sepolia"&&(s="324705682"),s){case"8453":return`https://basescan.org/tx/${t}`;case"84532":return`https://sepolia.basescan.org/tx/${t}`;case"1":return`https://etherscan.io/tx/${t}`;case"42161":return`https://arbiscan.io/tx/${t}`;case"137":return`https://polygonscan.com/tx/${t}`;case"10":return`https://optimistic.etherscan.io/tx/${t}`;case"43114":return`https://snowtrace.io/tx/${t}`;case"56":return`https://bscscan.com/tx/${t}`;case"1187947933":return`https://elated-tan-skat.explorer.mainnet.skalenodes.com/tx/${t}`;case"324705682":return`https://base-sepolia-testnet.explorer.skalenodes.com/tx/${t}`;default:return`https://basescan.org/tx/${t}`}}return`https://solscan.io/tx/${t}`}export{L as fromAtomicUnits,W as getChainDisplayName,O as getChainFamily,R as getChainName,y as getExplorerUrl,I as toAtomicUnits};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexterai/x402",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.8",
|
|
4
4
|
"description": "Full-stack x402 SDK - add paid API monetization to any endpoint. Express middleware, React hooks, Access Pass, dynamic pricing. Solana, Base, Polygon, Arbitrum, Optimism, Avalanche, SKALE.",
|
|
5
5
|
"author": "Dexter",
|
|
6
6
|
"license": "MIT",
|