@strimz/shared-config 0.1.0 → 0.2.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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chains.ts","../src/tokens.ts","../src/tiers.ts","../src/webhooks.ts","../src/api-keys.ts","../src/agents.ts","../src/cctp.ts"],"names":[],"mappings":";;;AAaO,IAAM,oBAAA,GAAuB;AAC7B,IAAM,oBAAA,GAAuB;AAEpC,IAAM,WAAA,GAAc;AAAA,EAClB,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ,MAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAEO,IAAM,aAAoB,WAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,aAAA;AAAA,EACN,cAAA,EAAgB,WAAA;AAAA,EAChB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAE,IAAA,EAAM,CAAC,iCAAiC,CAAA,EAAE;AAAA,IACrD,MAAA,EAAQ,EAAE,IAAA,EAAM,CAAC,iCAAiC,CAAA;AAAE,GACtD;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,SAAA;AAAA,MACN,GAAA,EAAK;AAAA;AACP,GACF;AAAA,EACA,OAAA,EAAS;AACX,CAAC;AAEM,IAAM,aAAoB,WAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,KAAA;AAAA,EACN,cAAA,EAAgB,WAAA;AAAA,EAChB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAE,IAAA,EAAM,CAAC,yBAAyB,CAAA,EAAE;AAAA,IAC7C,MAAA,EAAQ,EAAE,IAAA,EAAM,CAAC,yBAAyB,CAAA;AAAE,GAC9C;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS;AAAA,MACP,IAA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B;AAAA,EAC7B,QAAA,EAAU,CAAA;AAAA,EACV,SAAA,EAAW,CAAA;AAAA,EACX,QAAA,EAAU,CAAA;AAAA,EACV,QAAA,EAAU,CAAA;AAAA,EACV,KAAA,EAAO,CAAA;AAAA,EACP,MAAA,EAAQ,CAAA;AAAA,EACR,IAAA,EAAM,CAAA;AAAA,EACN,OAAA,EAAS,CAAA;AAAA,EACT,GAAA,EAAK;AACP;AAIO,IAAM,4BAAA,GAA2D;AAAA,EACtE,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF;AAEO,SAAS,iBAAiB,GAAA,EAAsC;AACrE,EAAA,OAAO,eAAe,GAAG,CAAA;AAC3B","file":"index.js","sourcesContent":["/**\n * Arc blockchain definitions.\n *\n * Arc is Circle's stablecoin-native L1 where gas is paid in USDC.\n * - Testnet is live (chain id 5042002).\n * - Mainnet beta is expected in 2026; the mainnet entry is a placeholder\n * until Circle publishes the production chain id and RPC endpoint.\n *\n * @see https://docs.arc.network\n */\n\nimport { defineChain, type Chain } from 'viem'\n\nexport const ARC_TESTNET_CHAIN_ID = 5042002 as const\nexport const ARC_MAINNET_CHAIN_ID = 5040001 as const\n\nconst NATIVE_USDC = {\n name: 'USD Coin',\n symbol: 'USDC',\n decimals: 6,\n} as const\n\nexport const arcTestnet: Chain = defineChain({\n id: ARC_TESTNET_CHAIN_ID,\n name: 'Arc Testnet',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.testnet.arc.network'] },\n public: { http: ['https://rpc.testnet.arc.network'] },\n },\n blockExplorers: {\n default: {\n name: 'ArcScan',\n url: 'https://testnet.arcscan.app',\n },\n },\n testnet: true,\n})\n\nexport const arcMainnet: Chain = defineChain({\n id: ARC_MAINNET_CHAIN_ID,\n name: 'Arc',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.arc.network'] },\n public: { http: ['https://rpc.arc.network'] },\n },\n blockExplorers: {\n default: {\n name: 'ArcScan',\n url: 'https://arcscan.app',\n },\n },\n testnet: false,\n})\n\nexport type ArcEnvironment = 'testnet' | 'mainnet'\n\nexport const ARC_CHAINS: Record<ArcEnvironment, Chain> = {\n testnet: arcTestnet,\n mainnet: arcMainnet,\n}\n\nexport function getArcChain(env: ArcEnvironment): Chain {\n return ARC_CHAINS[env]\n}\n\nexport function isArcChain(chainId: number): boolean {\n return chainId === ARC_TESTNET_CHAIN_ID || chainId === ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Token registry for Arc.\n *\n * USDC and EURC are first-class payment tokens — they can be requested in a\n * payment session and used as a subscription currency.\n *\n * USYC is yield-bearing and is treated as a treasury asset only — merchants\n * can hold and earn yield, but a payer cannot pay in USYC.\n */\n\nimport type { Address } from 'viem'\nimport { ARC_TESTNET_CHAIN_ID, ARC_MAINNET_CHAIN_ID, type ArcEnvironment } from './chains.js'\n\nexport type TokenSymbol = 'USDC' | 'EURC' | 'USYC'\n\n/** Tokens accepted as direct payment by Strimz. USYC is excluded by design. */\nexport type PaymentToken = Extract<TokenSymbol, 'USDC' | 'EURC'>\n\nexport const PAYMENT_TOKENS: readonly PaymentToken[] = ['USDC', 'EURC'] as const\n\nexport interface TokenDescriptor {\n symbol: TokenSymbol\n name: string\n decimals: number\n /** Whether the token is accepted as direct payment. */\n paymentEligible: boolean\n /** Whether the token is yield-bearing. */\n yieldBearing: boolean\n}\n\nexport interface TokenAddress {\n symbol: TokenSymbol\n address: Address\n chainId: number\n}\n\nexport const TOKENS: Record<TokenSymbol, TokenDescriptor> = {\n USDC: {\n symbol: 'USDC',\n name: 'USD Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n EURC: {\n symbol: 'EURC',\n name: 'Euro Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n USYC: {\n symbol: 'USYC',\n name: 'US Yield Coin',\n decimals: 6,\n paymentEligible: false,\n yieldBearing: true,\n },\n}\n\n/**\n * Native, Circle-issued addresses on Arc.\n * The same address is reused across testnet and mainnet for native tokens\n * since Arc preserves canonical addresses across environments where possible.\n */\nexport const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address>> = {\n testnet: {\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n mainnet: {\n // Mainnet addresses pending Arc mainnet beta launch; placeholders mirror\n // testnet for now and must be replaced when Circle publishes the canonical\n // mainnet token registry.\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n}\n\nexport function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {\n return TOKEN_ADDRESSES[env][symbol]\n}\n\nexport function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {\n return (TOKENS as Record<string, TokenDescriptor>)[symbol]\n}\n\nexport function isPaymentToken(symbol: string): symbol is PaymentToken {\n return PAYMENT_TOKENS.includes(symbol as PaymentToken)\n}\n\nexport function chainIdFor(env: ArcEnvironment): number {\n return env === 'testnet' ? ARC_TESTNET_CHAIN_ID : ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Strimz pricing tiers.\n *\n * Fees are expressed in basis points (bps): 100 bps = 1%.\n * The subscription premium is added to the per-transaction rate when the\n * payment is recurring (i.e. originated from a SubscriptionPlan).\n */\n\nexport type MerchantTier = 'free' | 'growth' | 'business' | 'enterprise'\n\nexport interface TierDefinition {\n id: MerchantTier\n name: string\n /** Monthly fee in USD cents (0 for free, null for custom enterprise). */\n monthlyFeeUsdCents: number | null\n /** Per-transaction fee on one-shot payments, in basis points. */\n oneShotFeeBps: number | null\n /** Per-transaction premium added on subscription payments, in basis points. */\n subscriptionPremiumBps: number | null\n /** Monthly transaction volume cap in USD cents. `null` for unlimited. */\n monthlyVolumeCapUsdCents: number | null\n /** Whether the \"Powered by Strimz\" badge can be removed from checkout. */\n whiteLabelEligible: boolean\n /** Whether the tier includes priority support. */\n prioritySupport: boolean\n}\n\nexport const TIERS: Record<MerchantTier, TierDefinition> = {\n free: {\n id: 'free',\n name: 'Free',\n monthlyFeeUsdCents: 0,\n oneShotFeeBps: 150, // 1.5%\n subscriptionPremiumBps: 20, // +0.2% on recurring => 1.7% effective\n monthlyVolumeCapUsdCents: 1_000_000, // $10,000\n whiteLabelEligible: false,\n prioritySupport: false,\n },\n growth: {\n id: 'growth',\n name: 'Growth',\n monthlyFeeUsdCents: 4_900, // $49\n oneShotFeeBps: 80, // 0.8%\n subscriptionPremiumBps: 20, // 1.0% effective\n monthlyVolumeCapUsdCents: 10_000_000, // $100,000\n whiteLabelEligible: true,\n prioritySupport: false,\n },\n business: {\n id: 'business',\n name: 'Business',\n monthlyFeeUsdCents: 19_900, // $199\n oneShotFeeBps: 50, // 0.5%\n subscriptionPremiumBps: 20, // 0.7% effective\n monthlyVolumeCapUsdCents: 100_000_000, // $1,000,000\n whiteLabelEligible: true,\n prioritySupport: true,\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n monthlyFeeUsdCents: null,\n oneShotFeeBps: null,\n subscriptionPremiumBps: null,\n monthlyVolumeCapUsdCents: null,\n whiteLabelEligible: true,\n prioritySupport: true,\n },\n}\n\nexport const DEFAULT_TIER: MerchantTier = 'free'\n\nexport function getTier(id: MerchantTier): TierDefinition {\n return TIERS[id]\n}\n\n/**\n * Effective fee in bps for a given tier and payment kind.\n * Returns `null` for the enterprise tier (custom-priced).\n */\nexport function effectiveFeeBps(\n tier: MerchantTier,\n kind: 'one_shot' | 'subscription',\n): number | null {\n const def = TIERS[tier]\n if (def.oneShotFeeBps === null) return null\n if (kind === 'one_shot') return def.oneShotFeeBps\n return def.oneShotFeeBps + (def.subscriptionPremiumBps ?? 0)\n}\n","/**\n * Webhook event names.\n *\n * Wire format is `<resource>.<action>`. Every event payload is versioned at\n * the envelope level so additive changes do not break consumers.\n */\n\nexport const WEBHOOK_EVENTS = {\n payment: {\n created: 'payment.created',\n completed: 'payment.completed',\n failed: 'payment.failed',\n },\n subscription: {\n created: 'subscription.created',\n charged: 'subscription.charged',\n chargeFailed: 'subscription.charge_failed',\n recoveryAttempt: 'subscription.recovery_attempt',\n recoveryOutcome: 'subscription.recovery_outcome',\n cancelled: 'subscription.cancelled',\n lapsed: 'subscription.lapsed',\n },\n refund: {\n created: 'refund.created',\n completed: 'refund.completed',\n failed: 'refund.failed',\n },\n invoice: {\n created: 'invoice.created',\n paid: 'invoice.paid',\n overdue: 'invoice.overdue',\n },\n agent: {\n actionExecuted: 'agent.action_executed',\n jobProposed: 'agent.job_proposed',\n jobCompleted: 'agent.job_completed',\n jobDisputed: 'agent.job_disputed',\n },\n compliance: {\n walletFlagged: 'compliance.wallet_flagged',\n walletBlocked: 'compliance.wallet_blocked',\n },\n} as const\n\nexport type WebhookEventName =\n | (typeof WEBHOOK_EVENTS.payment)[keyof typeof WEBHOOK_EVENTS.payment]\n | (typeof WEBHOOK_EVENTS.subscription)[keyof typeof WEBHOOK_EVENTS.subscription]\n | (typeof WEBHOOK_EVENTS.refund)[keyof typeof WEBHOOK_EVENTS.refund]\n | (typeof WEBHOOK_EVENTS.invoice)[keyof typeof WEBHOOK_EVENTS.invoice]\n | (typeof WEBHOOK_EVENTS.agent)[keyof typeof WEBHOOK_EVENTS.agent]\n | (typeof WEBHOOK_EVENTS.compliance)[keyof typeof WEBHOOK_EVENTS.compliance]\n\nexport const ALL_WEBHOOK_EVENTS: readonly WebhookEventName[] = [\n ...Object.values(WEBHOOK_EVENTS.payment),\n ...Object.values(WEBHOOK_EVENTS.subscription),\n ...Object.values(WEBHOOK_EVENTS.refund),\n ...Object.values(WEBHOOK_EVENTS.invoice),\n ...Object.values(WEBHOOK_EVENTS.agent),\n ...Object.values(WEBHOOK_EVENTS.compliance),\n] as const\n\n/** Exponential backoff schedule for webhook delivery, in seconds. */\nexport const WEBHOOK_RETRY_SCHEDULE_SECONDS: readonly number[] = [\n 60, // 1 minute\n 300, // 5 minutes\n 1_800, // 30 minutes\n 7_200, // 2 hours\n 86_400, // 24 hours\n] as const\n\nexport const WEBHOOK_MAX_ATTEMPTS = WEBHOOK_RETRY_SCHEDULE_SECONDS.length + 1\n\n/** Webhook signatures older than this are rejected to prevent replay. */\nexport const WEBHOOK_SIGNATURE_TOLERANCE_SECONDS = 300\n\n/** HTTP header carrying the HMAC signature. */\nexport const WEBHOOK_SIGNATURE_HEADER = 'strimz-signature'\n\n/** HTTP header carrying the unique delivery id (idempotency key for the receiver). */\nexport const WEBHOOK_DELIVERY_ID_HEADER = 'strimz-delivery-id'\n","/**\n * API key prefix conventions.\n *\n * Prefix tells you immediately which environment a key targets and whether it\n * is safe to expose to the client. Secret keys are server-side only; publishable\n * keys can ship in browser bundles.\n */\n\nexport type ApiKeyMode = 'test' | 'live'\nexport type ApiKeyKind = 'secret' | 'publishable'\n\nexport const API_KEY_PREFIXES = {\n secret: {\n test: 'sk_test_',\n live: 'sk_live_',\n },\n publishable: {\n test: 'pk_test_',\n live: 'pk_live_',\n },\n} as const satisfies Record<ApiKeyKind, Record<ApiKeyMode, string>>\n\n/** Length of the random portion of a key, before prefix. Base62, 256 bits of entropy. */\nexport const API_KEY_RANDOM_BYTES = 32\n\nexport function prefixFor(kind: ApiKeyKind, mode: ApiKeyMode): string {\n return API_KEY_PREFIXES[kind][mode]\n}\n\nexport function modeFromKey(key: string): ApiKeyMode | null {\n if (key.startsWith('sk_test_') || key.startsWith('pk_test_')) return 'test'\n if (key.startsWith('sk_live_') || key.startsWith('pk_live_')) return 'live'\n return null\n}\n\nexport function kindFromKey(key: string): ApiKeyKind | null {\n if (key.startsWith('sk_')) return 'secret'\n if (key.startsWith('pk_')) return 'publishable'\n return null\n}\n\n/** Number of leading characters of a key safe to display in dashboards/logs. */\nexport const API_KEY_PREFIX_DISPLAY_LENGTH = 12\n","/**\n * Strimz AutoPay Agent — feature flags and defaults.\n *\n * The agent is composed of independent capabilities that can be enabled or\n * disabled per merchant. Defaults are conservative; merchants opt in to\n * value-moving capabilities (recovery retries, treasury auto-convert).\n */\n\nexport type AgentCapability =\n | 'identity'\n | 'recovery'\n | 'routing'\n | 'cashflow'\n | 'commerce'\n | 'pricing_intelligence'\n\nexport interface AgentCapabilityDescriptor {\n id: AgentCapability\n name: string\n /** Whether the capability moves money or signs transactions. */\n valueMoving: boolean\n /** Default enabled state for a newly created merchant. */\n defaultEnabled: boolean\n}\n\nexport const AGENT_CAPABILITIES: Record<AgentCapability, AgentCapabilityDescriptor> = {\n identity: {\n id: 'identity',\n name: 'Agent Identity (ERC-8004)',\n valueMoving: false,\n defaultEnabled: true,\n },\n recovery: {\n id: 'recovery',\n name: 'Subscription Recovery',\n valueMoving: true,\n defaultEnabled: false,\n },\n routing: {\n id: 'routing',\n name: 'Cross-Chain Payment Routing',\n valueMoving: true,\n defaultEnabled: false,\n },\n cashflow: {\n id: 'cashflow',\n name: 'Treasury Cash Flow Insights',\n valueMoving: false,\n defaultEnabled: false,\n },\n commerce: {\n id: 'commerce',\n name: 'Agentic B2B Commerce (ERC-8183)',\n valueMoving: true,\n defaultEnabled: false,\n },\n pricing_intelligence: {\n id: 'pricing_intelligence',\n name: 'Subscription Pricing Intelligence',\n valueMoving: false,\n defaultEnabled: false,\n },\n}\n\nexport type GracePeriodHours = 24 | 48 | 72\n\nexport const RECOVERY_GRACE_PERIODS: readonly GracePeriodHours[] = [24, 48, 72] as const\n\nexport type RecoveryRetryStrategy = 'once' | 'twice' | 'until_grace_ends'\n\nexport interface AgentDefaultConfig {\n recovery: {\n gracePeriodHours: GracePeriodHours\n strategy: RecoveryRetryStrategy\n }\n cashflow: {\n digestEnabled: boolean\n anomalySensitivity: 'low' | 'medium' | 'high'\n autoConvertToYield: boolean\n }\n commerce: {\n requireHumanApprovalAboveUsdCents: number\n }\n}\n\nexport const AGENT_DEFAULTS: AgentDefaultConfig = {\n recovery: {\n gracePeriodHours: 48,\n strategy: 'twice',\n },\n cashflow: {\n digestEnabled: false,\n anomalySensitivity: 'medium',\n autoConvertToYield: false,\n },\n commerce: {\n requireHumanApprovalAboveUsdCents: 100_000, // $1,000\n },\n}\n\n/** Time-to-live for the agent activity log, in days. */\nexport const AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90\n","/**\n * Circle CCTP V2 contract addresses for Arc.\n *\n * CCTP lets a payer hold USDC on any supported chain (Ethereum, Base, Polygon,\n * Arbitrum, Solana, etc.) and pay a Strimz merchant who receives Arc USDC.\n *\n * @see https://developers.circle.com/stablecoins/cctp-getting-started\n */\n\nimport type { Address } from 'viem'\nimport type { ArcEnvironment } from './chains.js'\n\nexport interface CCTPContractSet {\n tokenMessengerV2: Address\n messageTransmitterV2: Address\n gatewayWallet: Address\n gatewayMinter: Address\n /** CCTP domain identifier for the destination chain. */\n domainId: number\n}\n\nexport const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet> = {\n testnet: {\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n mainnet: {\n // Pending Circle's mainnet publication of CCTP V2 addresses for Arc.\n // Mirror testnet as a placeholder so type signatures stay non-null.\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n}\n\n/** CCTP domain ids for source chains a payer can bridge from. */\nexport const CCTP_DOMAIN_IDS = {\n ethereum: 0,\n avalanche: 1,\n optimism: 2,\n arbitrum: 3,\n noble: 4,\n solana: 5,\n base: 6,\n polygon: 7,\n arc: 26,\n} as const\n\nexport type CCTPSourceChain = keyof typeof CCTP_DOMAIN_IDS\n\nexport const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[] = [\n 'ethereum',\n 'avalanche',\n 'optimism',\n 'arbitrum',\n 'base',\n 'polygon',\n 'solana',\n] as const\n\nexport function getCctpContracts(env: ArcEnvironment): CCTPContractSet {\n return CCTP_CONTRACTS[env]\n}\n"]}
1
+ {"version":3,"sources":["../src/chains.ts","../src/tokens.ts","../src/tiers.ts","../src/webhooks.ts","../src/api-keys.ts","../src/agents.ts","../src/cctp.ts"],"names":[],"mappings":";;;AAaO,IAAM,oBAAA,GAAuB;AAC7B,IAAM,oBAAA,GAAuB;AAEpC,IAAM,WAAA,GAAc;AAAA,EAClB,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,MAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAEO,IAAM,aAAoB,WAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,aAAA;AAAA,EACN,cAAA,EAAgB,WAAA;AAAA,EAChB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAE,IAAA,EAAM,CAAC,4BAA4B,CAAA,EAAE;AAAA,IAChD,MAAA,EAAQ,EAAE,IAAA,EAAM,CAAC,4BAA4B,CAAA;AAAE,GACjD;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,sBAAA;AAAA,MACN,GAAA,EAAK;AAAA;AACP,GACF;AAAA,EACA,OAAA,EAAS;AACX,CAAC;AAEM,IAAM,aAAoB,WAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,KAAA;AAAA,EACN,cAAA,EAAgB,WAAA;AA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AAA,EACA,QAAA,EAAU;AAAA,IACR,iCAAA,EAAmC;AAAA;AAAA;AAEvC;AAGO,IAAM,iCAAA,GAAoC;;;AChF1C,IAAM,cAAA,GAA0D;AAAA,EACrE,OAAA,EAAS;AAAA,IACP,gBAAA,EAAkB,4CAAA;AAAA,IAClB,oBAAA,EAAsB,4CAAA;AAAA,IACtB,aAAA,EAAe,4CAAA;AAAA,IACf,aAAA,EAAe,4CAAA;AAAA,IACf,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,OAAA,EAAS;AAAA;AAAA;AAAA,IAGP,gBAAA,EAAkB,4CAAA;AAAA,IAClB,oBAAA,EAAsB,4CAAA;AAAA,IACtB,aAAA,EAAe,4CAAA;AAAA,IACf,aAAA,EAAe,4CAAA;AAAA,IACf,QAAA,EAAU;AAAA;AAEd;AAGO,IAAM,eAAA,GAAkB;AAAA,EAC7B,QAAA,EAAU,CAAA;AAAA,EACV,SAAA,EAAW,CAAA;AAAA,EACX,QAAA,EAAU,CAAA;AAAA,EACV,QAAA,EAAU,CAAA;AAAA,EACV,KAAA,EAAO,CAAA;AAAA,EACP,MAAA,EAAQ,CAAA;AAAA,EACR,IAAA,EAAM,CAAA;AAAA,EACN,OAAA,EAAS,CAAA;AAAA,EACT,GAAA,EAAK;AACP;AAIO,IAAM,4BAAA,GAA2D;AAAA,EACtE,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF;AAEO,SAAS,iBAAiB,GAAA,EAAsC;AACrE,EAAA,OAAO,cAAA,CAAe,mBAAA,CAAoB,GAAG,CAAC,CAAA;AAChD","file":"index.js","sourcesContent":["/**\n * Arc blockchain definitions.\n *\n * Arc is Circle's stablecoin-native L1 where gas is paid in USDC.\n * - Testnet is live (chain id 5042002).\n * - Mainnet beta is expected in 2026; the mainnet entry is a placeholder\n * until Circle publishes the production chain id and RPC endpoint.\n *\n * @see https://docs.arc.network\n */\n\nimport { defineChain, type Chain } from 'viem'\n\nexport const ARC_TESTNET_CHAIN_ID = 5042002 as const\nexport const ARC_MAINNET_CHAIN_ID = 5042 as const\n\nconst NATIVE_USDC = {\n name: 'USDC',\n symbol: 'USDC',\n decimals: 18,\n} as const\n\nexport const arcTestnet: Chain = defineChain({\n id: ARC_TESTNET_CHAIN_ID,\n name: 'Arc Testnet',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.testnet.arc.io'] },\n public: { http: ['https://rpc.testnet.arc.io'] },\n },\n blockExplorers: {\n default: {\n name: 'Arc Testnet Explorer',\n url: 'https://explorer.testnet.arc.io',\n },\n },\n testnet: true,\n})\n\nexport const arcMainnet: Chain = defineChain({\n id: ARC_MAINNET_CHAIN_ID,\n name: 'Arc',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.mainnet.arc.io'] },\n public: { http: ['https://rpc.mainnet.arc.io'] },\n },\n blockExplorers: {\n default: {\n name: 'Arc Explorer',\n url: 'https://explorer.arc.io',\n },\n },\n testnet: false,\n})\n\nexport type ArcEnvironment = 'testnet' | 'mainnet'\n\nexport const ARC_CHAINS: Record<ArcEnvironment, Chain> = {\n testnet: arcTestnet,\n mainnet: arcMainnet,\n}\n\nexport const ARC_ENVIRONMENTS: readonly ArcEnvironment[] = ['testnet', 'mainnet'] as const\n\nexport function isArcEnvironment(value: unknown): value is ArcEnvironment {\n return typeof value === 'string' && (ARC_ENVIRONMENTS as readonly string[]).includes(value)\n}\n\nexport function parseArcEnvironment(value: unknown): ArcEnvironment {\n if (isArcEnvironment(value)) return value\n throw new Error(\n `unknown Arc environment ${JSON.stringify(value)}: expected one of ${ARC_ENVIRONMENTS.join(', ')}`,\n )\n}\n\nexport function getArcChain(env: ArcEnvironment): Chain {\n return ARC_CHAINS[parseArcEnvironment(env)]\n}\n\nexport function getArcExplorerUrl(env: ArcEnvironment): string {\n const explorer = getArcChain(env).blockExplorers?.default.url\n if (!explorer) throw new Error(`Arc ${env} has no block explorer configured`)\n return explorer\n}\n\nexport function arcExplorerTxUrl(env: ArcEnvironment, txHash: string): string {\n return `${getArcExplorerUrl(env)}/tx/${txHash}`\n}\n\nexport function arcEnvironmentForChainId(chainId: number): ArcEnvironment {\n const env = ARC_ENVIRONMENTS.find((candidate) => ARC_CHAINS[candidate].id === chainId)\n if (!env) {\n throw new Error(\n `chain id ${chainId} is not an Arc chain: expected ${ARC_TESTNET_CHAIN_ID} (testnet) or ${ARC_MAINNET_CHAIN_ID} (mainnet)`,\n )\n }\n return env\n}\n\nexport function assertArcChainId(env: ArcEnvironment, rpcChainId: number): void {\n const expected = getArcChain(env).id\n if (rpcChainId !== expected) {\n throw new Error(\n `ARC_RPC_URL serves chain id ${rpcChainId}, but ARC_ENVIRONMENT=${env} expects chain id ${expected}`,\n )\n }\n}\n\nexport function isArcChain(chainId: number): boolean {\n return chainId === ARC_TESTNET_CHAIN_ID || chainId === ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Token registry for Arc.\n *\n * USDC and EURC are first-class payment tokens. They can be requested in a\n * payment session and used as a subscription currency.\n *\n * USYC is yield-bearing and is treated as a treasury asset only. Merchants\n * can hold it and earn yield, but a payer cannot pay in USYC.\n */\n\nimport type { Address } from 'viem'\nimport { getArcChain, parseArcEnvironment, type ArcEnvironment } from './chains.js'\n\nexport type TokenSymbol = 'USDC' | 'EURC' | 'USYC'\n\n/** Tokens accepted as direct payment by Strimz. USYC is excluded by design. */\nexport type PaymentToken = Extract<TokenSymbol, 'USDC' | 'EURC'>\n\nexport const PAYMENT_TOKENS: readonly PaymentToken[] = ['USDC', 'EURC'] as const\n\nexport interface TokenDescriptor {\n symbol: TokenSymbol\n name: string\n decimals: number\n /** Whether the token is accepted as direct payment. */\n paymentEligible: boolean\n /** Whether the token is yield-bearing. */\n yieldBearing: boolean\n}\n\nexport interface TokenAddress {\n symbol: TokenSymbol\n address: Address\n chainId: number\n}\n\nexport const TOKENS: Record<TokenSymbol, TokenDescriptor> = {\n USDC: {\n symbol: 'USDC',\n name: 'USD Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n EURC: {\n symbol: 'EURC',\n name: 'Euro Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n USYC: {\n symbol: 'USYC',\n name: 'US Yield Coin',\n decimals: 6,\n paymentEligible: false,\n yieldBearing: true,\n },\n}\n\n/**\n * Native, Circle-issued addresses on Arc.\n * The same address is reused across testnet and mainnet for native tokens\n * since Arc preserves canonical addresses across environments where possible.\n */\nexport const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address>> = {\n testnet: {\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n mainnet: {\n // Mainnet addresses pending Arc mainnet beta launch; placeholders mirror\n // testnet for now and must be replaced when Circle publishes the canonical\n // mainnet token registry.\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1',\n USYC: '0x8a5D989Bbb96929F689B0200f435f53dA42bF490',\n },\n}\n\nexport function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {\n return TOKEN_ADDRESSES[parseArcEnvironment(env)][symbol]\n}\n\nexport function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {\n return (TOKENS as Record<string, TokenDescriptor>)[symbol]\n}\n\nexport function isPaymentToken(symbol: string): symbol is PaymentToken {\n return PAYMENT_TOKENS.includes(symbol as PaymentToken)\n}\n\nexport function chainIdFor(env: ArcEnvironment): number {\n return getArcChain(env).id\n}\n","/**\n * Strimz pricing tiers.\n *\n * Fees are expressed in basis points (bps): 100 bps = 1%.\n * The subscription premium is added to the per-transaction rate when the\n * payment is recurring (i.e. originated from a SubscriptionPlan).\n */\n\nexport type MerchantTier = 'free' | 'growth' | 'business' | 'enterprise'\n\nexport interface TierDefinition {\n id: MerchantTier\n name: string\n /** Monthly fee in USD cents (0 for free, null for custom enterprise). */\n monthlyFeeUsdCents: number | null\n /** Per-transaction fee on one-shot payments, in basis points. */\n oneShotFeeBps: number | null\n /** Per-transaction premium added on subscription payments, in basis points. */\n subscriptionPremiumBps: number | null\n /** Monthly transaction volume cap in USD cents. `null` for unlimited. */\n monthlyVolumeCapUsdCents: number | null\n /** Whether the \"Powered by Strimz\" badge can be removed from checkout. */\n whiteLabelEligible: boolean\n /** Whether the tier includes priority support. */\n prioritySupport: boolean\n}\n\nexport const TIERS: Record<MerchantTier, TierDefinition> = {\n free: {\n id: 'free',\n name: 'Free',\n monthlyFeeUsdCents: 0,\n oneShotFeeBps: 150, // 1.5%\n subscriptionPremiumBps: 20, // +0.2% on recurring => 1.7% effective\n monthlyVolumeCapUsdCents: 1_000_000, // $10,000\n whiteLabelEligible: false,\n prioritySupport: false,\n },\n growth: {\n id: 'growth',\n name: 'Growth',\n monthlyFeeUsdCents: 4_900, // $49\n oneShotFeeBps: 80, // 0.8%\n subscriptionPremiumBps: 20, // 1.0% effective\n monthlyVolumeCapUsdCents: 10_000_000, // $100,000\n whiteLabelEligible: true,\n prioritySupport: false,\n },\n business: {\n id: 'business',\n name: 'Business',\n monthlyFeeUsdCents: 19_900, // $199\n oneShotFeeBps: 50, // 0.5%\n subscriptionPremiumBps: 20, // 0.7% effective\n monthlyVolumeCapUsdCents: 100_000_000, // $1,000,000\n whiteLabelEligible: true,\n prioritySupport: true,\n },\n enterprise: {\n id: 'enterprise',\n name: 'Enterprise',\n monthlyFeeUsdCents: null,\n oneShotFeeBps: null,\n subscriptionPremiumBps: null,\n monthlyVolumeCapUsdCents: null,\n whiteLabelEligible: true,\n prioritySupport: true,\n },\n}\n\nexport const DEFAULT_TIER: MerchantTier = 'free'\n\nexport function getTier(id: MerchantTier): TierDefinition {\n return TIERS[id]\n}\n\n/**\n * Effective fee in bps for a given tier and payment kind.\n * Returns `null` for the enterprise tier (custom-priced).\n */\nexport function effectiveFeeBps(\n tier: MerchantTier,\n kind: 'one_shot' | 'subscription',\n): number | null {\n const def = TIERS[tier]\n if (def.oneShotFeeBps === null) return null\n if (kind === 'one_shot') return def.oneShotFeeBps\n return def.oneShotFeeBps + (def.subscriptionPremiumBps ?? 0)\n}\n","/**\n * Webhook event names.\n *\n * Wire format is `<resource>.<action>`. Every event payload is versioned at\n * the envelope level so additive changes do not break consumers.\n */\n\nexport const WEBHOOK_EVENTS = {\n payment: {\n created: 'payment.created',\n completed: 'payment.completed',\n failed: 'payment.failed',\n },\n subscription: {\n created: 'subscription.created',\n charged: 'subscription.charged',\n chargeFailed: 'subscription.charge_failed',\n recoveryAttempt: 'subscription.recovery_attempt',\n recoveryOutcome: 'subscription.recovery_outcome',\n cancelled: 'subscription.cancelled',\n lapsed: 'subscription.lapsed',\n },\n refund: {\n created: 'refund.created',\n completed: 'refund.completed',\n failed: 'refund.failed',\n },\n invoice: {\n created: 'invoice.created',\n paid: 'invoice.paid',\n overdue: 'invoice.overdue',\n },\n agent: {\n actionExecuted: 'agent.action_executed',\n jobProposed: 'agent.job_proposed',\n jobCompleted: 'agent.job_completed',\n jobDisputed: 'agent.job_disputed',\n },\n compliance: {\n walletFlagged: 'compliance.wallet_flagged',\n walletBlocked: 'compliance.wallet_blocked',\n },\n} as const\n\nexport type WebhookEventName =\n | (typeof WEBHOOK_EVENTS.payment)[keyof typeof WEBHOOK_EVENTS.payment]\n | (typeof WEBHOOK_EVENTS.subscription)[keyof typeof WEBHOOK_EVENTS.subscription]\n | (typeof WEBHOOK_EVENTS.refund)[keyof typeof WEBHOOK_EVENTS.refund]\n | (typeof WEBHOOK_EVENTS.invoice)[keyof typeof WEBHOOK_EVENTS.invoice]\n | (typeof WEBHOOK_EVENTS.agent)[keyof typeof WEBHOOK_EVENTS.agent]\n | (typeof WEBHOOK_EVENTS.compliance)[keyof typeof WEBHOOK_EVENTS.compliance]\n\nexport const ALL_WEBHOOK_EVENTS: readonly WebhookEventName[] = [\n ...Object.values(WEBHOOK_EVENTS.payment),\n ...Object.values(WEBHOOK_EVENTS.subscription),\n ...Object.values(WEBHOOK_EVENTS.refund),\n ...Object.values(WEBHOOK_EVENTS.invoice),\n ...Object.values(WEBHOOK_EVENTS.agent),\n ...Object.values(WEBHOOK_EVENTS.compliance),\n] as const\n\n/** Exponential backoff schedule for webhook delivery, in seconds. */\nexport const WEBHOOK_RETRY_SCHEDULE_SECONDS: readonly number[] = [\n 60, // 1 minute\n 300, // 5 minutes\n 1_800, // 30 minutes\n 7_200, // 2 hours\n 86_400, // 24 hours\n] as const\n\nexport const WEBHOOK_MAX_ATTEMPTS = WEBHOOK_RETRY_SCHEDULE_SECONDS.length + 1\n\n/** Webhook signatures older than this are rejected to prevent replay. */\nexport const WEBHOOK_SIGNATURE_TOLERANCE_SECONDS = 300\n\n/** HTTP header carrying the HMAC signature. */\nexport const WEBHOOK_SIGNATURE_HEADER = 'strimz-signature'\n\n/** HTTP header carrying the unique delivery id (idempotency key for the receiver). */\nexport const WEBHOOK_DELIVERY_ID_HEADER = 'strimz-delivery-id'\n","/**\n * API key prefix conventions.\n *\n * Prefix tells you immediately which environment a key targets and whether it\n * is safe to expose to the client. Secret keys are server-side only; publishable\n * keys can ship in browser bundles.\n */\n\nexport type ApiKeyMode = 'test' | 'live'\nexport type ApiKeyKind = 'secret' | 'publishable'\n\nexport const API_KEY_PREFIXES = {\n secret: {\n test: 'sk_test_',\n live: 'sk_live_',\n },\n publishable: {\n test: 'pk_test_',\n live: 'pk_live_',\n },\n} as const satisfies Record<ApiKeyKind, Record<ApiKeyMode, string>>\n\n/** Length of the random portion of a key, before prefix. Base62, 256 bits of entropy. */\nexport const API_KEY_RANDOM_BYTES = 32\n\nexport function prefixFor(kind: ApiKeyKind, mode: ApiKeyMode): string {\n return API_KEY_PREFIXES[kind][mode]\n}\n\nexport function modeFromKey(key: string): ApiKeyMode | null {\n if (key.startsWith('sk_test_') || key.startsWith('pk_test_')) return 'test'\n if (key.startsWith('sk_live_') || key.startsWith('pk_live_')) return 'live'\n return null\n}\n\nexport function kindFromKey(key: string): ApiKeyKind | null {\n if (key.startsWith('sk_')) return 'secret'\n if (key.startsWith('pk_')) return 'publishable'\n return null\n}\n\n/** Number of leading characters of a key safe to display in dashboards/logs. */\nexport const API_KEY_PREFIX_DISPLAY_LENGTH = 12\n","/**\n * Strimz AutoPay Agent feature flags and defaults.\n *\n * The agent is composed of independent capabilities that can be enabled or\n * disabled per merchant. Defaults are conservative. Merchants opt in to\n * value-moving capabilities (recovery retries, treasury auto-convert).\n */\n\nexport type AgentCapability =\n | 'identity'\n | 'recovery'\n | 'routing'\n | 'cashflow'\n | 'commerce'\n | 'pricing_intelligence'\n\nexport interface AgentCapabilityDescriptor {\n id: AgentCapability\n name: string\n /** Whether the capability moves money or signs transactions. */\n valueMoving: boolean\n /** Default enabled state for a newly created merchant. */\n defaultEnabled: boolean\n}\n\nexport const AGENT_CAPABILITIES: Record<AgentCapability, AgentCapabilityDescriptor> = {\n identity: {\n id: 'identity',\n name: 'Agent Identity (ERC-8004)',\n valueMoving: false,\n defaultEnabled: true,\n },\n recovery: {\n id: 'recovery',\n name: 'Subscription Recovery',\n valueMoving: true,\n defaultEnabled: false,\n },\n routing: {\n id: 'routing',\n name: 'Cross-Chain Payment Routing',\n valueMoving: true,\n defaultEnabled: false,\n },\n cashflow: {\n id: 'cashflow',\n name: 'Treasury Cash Flow Insights',\n valueMoving: false,\n defaultEnabled: false,\n },\n commerce: {\n id: 'commerce',\n name: 'Agentic B2B Commerce (ERC-8183)',\n valueMoving: true,\n defaultEnabled: false,\n },\n pricing_intelligence: {\n id: 'pricing_intelligence',\n name: 'Subscription Pricing Intelligence',\n valueMoving: false,\n defaultEnabled: false,\n },\n}\n\nexport type GracePeriodHours = 24 | 48 | 72\n\nexport const RECOVERY_GRACE_PERIODS: readonly GracePeriodHours[] = [24, 48, 72] as const\n\nexport type RecoveryRetryStrategy = 'once' | 'twice' | 'until_grace_ends'\n\nexport interface AgentDefaultConfig {\n recovery: {\n gracePeriodHours: GracePeriodHours\n strategy: RecoveryRetryStrategy\n }\n cashflow: {\n digestEnabled: boolean\n anomalySensitivity: 'low' | 'medium' | 'high'\n autoConvertToYield: boolean\n }\n commerce: {\n requireHumanApprovalAboveUsdCents: number\n }\n}\n\nexport const AGENT_DEFAULTS: AgentDefaultConfig = {\n recovery: {\n gracePeriodHours: 48,\n strategy: 'twice',\n },\n cashflow: {\n digestEnabled: false,\n anomalySensitivity: 'medium',\n autoConvertToYield: false,\n },\n commerce: {\n requireHumanApprovalAboveUsdCents: 100_000, // $1,000\n },\n}\n\n/** Time-to-live for the agent activity log, in days. */\nexport const AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90\n","/**\n * Circle CCTP V2 contract addresses for Arc.\n *\n * CCTP lets a payer hold USDC on any supported chain (Ethereum, Base, Polygon,\n * Arbitrum, Solana, etc.) and pay a Strimz merchant who receives Arc USDC.\n *\n * @see https://developers.circle.com/stablecoins/cctp-getting-started\n */\n\nimport type { Address } from 'viem'\nimport { parseArcEnvironment, type ArcEnvironment } from './chains.js'\n\nexport interface CCTPContractSet {\n tokenMessengerV2: Address\n messageTransmitterV2: Address\n gatewayWallet: Address\n gatewayMinter: Address\n /** CCTP domain identifier for the destination chain. */\n domainId: number\n}\n\nexport const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet> = {\n testnet: {\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n mainnet: {\n // Pending Circle's mainnet publication of CCTP V2 addresses for Arc.\n // Testnet values are mirrored as a placeholder so type signatures stay non-null.\n tokenMessengerV2: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',\n messageTransmitterV2: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',\n gatewayWallet: '0x77777777Dcc4d5A8B6E418Fd04D8997ef11000eE',\n gatewayMinter: '0x2222222d7164433c4C09B0b0D809a9b52C04C205',\n domainId: 26,\n },\n}\n\n/** CCTP domain ids for source chains a payer can bridge from. */\nexport const CCTP_DOMAIN_IDS = {\n ethereum: 0,\n avalanche: 1,\n optimism: 2,\n arbitrum: 3,\n noble: 4,\n solana: 5,\n base: 6,\n polygon: 7,\n arc: 26,\n} as const\n\nexport type CCTPSourceChain = keyof typeof CCTP_DOMAIN_IDS\n\nexport const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[] = [\n 'ethereum',\n 'avalanche',\n 'optimism',\n 'arbitrum',\n 'base',\n 'polygon',\n 'solana',\n] as const\n\nexport function getCctpContracts(env: ArcEnvironment): CCTPContractSet {\n return CCTP_CONTRACTS[parseArcEnvironment(env)]\n}\n"]}
package/dist/tokens.cjs CHANGED
@@ -4,44 +4,61 @@ var viem = require('viem');
4
4
 
5
5
  // src/chains.ts
6
6
  var ARC_TESTNET_CHAIN_ID = 5042002;
7
- var ARC_MAINNET_CHAIN_ID = 5040001;
7
+ var ARC_MAINNET_CHAIN_ID = 5042;
8
8
  var NATIVE_USDC = {
9
- name: "USD Coin",
9
+ name: "USDC",
10
10
  symbol: "USDC",
11
- decimals: 6
11
+ decimals: 18
12
12
  };
13
- viem.defineChain({
13
+ var arcTestnet = viem.defineChain({
14
14
  id: ARC_TESTNET_CHAIN_ID,
15
15
  name: "Arc Testnet",
16
16
  nativeCurrency: NATIVE_USDC,
17
17
  rpcUrls: {
18
- default: { http: ["https://rpc.testnet.arc.network"] },
19
- public: { http: ["https://rpc.testnet.arc.network"] }
18
+ default: { http: ["https://rpc.testnet.arc.io"] },
19
+ public: { http: ["https://rpc.testnet.arc.io"] }
20
20
  },
21
21
  blockExplorers: {
22
22
  default: {
23
- name: "ArcScan",
24
- url: "https://testnet.arcscan.app"
23
+ name: "Arc Testnet Explorer",
24
+ url: "https://explorer.testnet.arc.io"
25
25
  }
26
26
  },
27
27
  testnet: true
28
28
  });
29
- viem.defineChain({
29
+ var arcMainnet = viem.defineChain({
30
30
  id: ARC_MAINNET_CHAIN_ID,
31
31
  name: "Arc",
32
32
  nativeCurrency: NATIVE_USDC,
33
33
  rpcUrls: {
34
- default: { http: ["https://rpc.arc.network"] },
35
- public: { http: ["https://rpc.arc.network"] }
34
+ default: { http: ["https://rpc.mainnet.arc.io"] },
35
+ public: { http: ["https://rpc.mainnet.arc.io"] }
36
36
  },
37
37
  blockExplorers: {
38
38
  default: {
39
- name: "ArcScan",
40
- url: "https://arcscan.app"
39
+ name: "Arc Explorer",
40
+ url: "https://explorer.arc.io"
41
41
  }
42
42
  },
43
43
  testnet: false
44
44
  });
45
+ var ARC_CHAINS = {
46
+ testnet: arcTestnet,
47
+ mainnet: arcMainnet
48
+ };
49
+ var ARC_ENVIRONMENTS = ["testnet", "mainnet"];
50
+ function isArcEnvironment(value) {
51
+ return typeof value === "string" && ARC_ENVIRONMENTS.includes(value);
52
+ }
53
+ function parseArcEnvironment(value) {
54
+ if (isArcEnvironment(value)) return value;
55
+ throw new Error(
56
+ `unknown Arc environment ${JSON.stringify(value)}: expected one of ${ARC_ENVIRONMENTS.join(", ")}`
57
+ );
58
+ }
59
+ function getArcChain(env) {
60
+ return ARC_CHAINS[parseArcEnvironment(env)];
61
+ }
45
62
 
46
63
  // src/tokens.ts
47
64
  var PAYMENT_TOKENS = ["USDC", "EURC"];
@@ -79,12 +96,12 @@ var TOKEN_ADDRESSES = {
79
96
  // testnet for now and must be replaced when Circle publishes the canonical
80
97
  // mainnet token registry.
81
98
  USDC: "0x3600000000000000000000000000000000000000",
82
- EURC: "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a",
83
- USYC: "0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C"
99
+ EURC: "0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1",
100
+ USYC: "0x8a5D989Bbb96929F689B0200f435f53dA42bF490"
84
101
  }
85
102
  };
86
103
  function getTokenAddress(env, symbol) {
87
- return TOKEN_ADDRESSES[env][symbol];
104
+ return TOKEN_ADDRESSES[parseArcEnvironment(env)][symbol];
88
105
  }
89
106
  function getTokenBySymbol(symbol) {
90
107
  return TOKENS[symbol];
@@ -93,7 +110,7 @@ function isPaymentToken(symbol) {
93
110
  return PAYMENT_TOKENS.includes(symbol);
94
111
  }
95
112
  function chainIdFor(env) {
96
- return env === "testnet" ? ARC_TESTNET_CHAIN_ID : ARC_MAINNET_CHAIN_ID;
113
+ return getArcChain(env).id;
97
114
  }
98
115
 
99
116
  exports.PAYMENT_TOKENS = PAYMENT_TOKENS;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chains.ts","../src/tokens.ts"],"names":["defineChain"],"mappings":";;;;;AAaO,IAAM,oBAAA,GAAuB,OAAA;AAC7B,IAAM,oBAAA,GAAuB,OAAA;AAEpC,IAAM,WAAA,GAAc;AAAA,EAClB,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ,MAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAEiCA,gBAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,aAAA;AAAA,EACN,cAAA,EAAgB,WAAA;AAAA,EAChB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAE,IAAA,EAAM,CAAC,iCAAiC,CAAA,EAAE;AAAA,IACrD,MAAA,EAAQ,EAAE,IAAA,EAAM,CAAC,iCAAiC,CAAA;AAAE,GACtD;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,SAAA;AAAA,MACN,GAAA,EAAK;AAAA;AACP,GACF;AAAA,EACA,OAAA,EAAS;AACX,CAAC;AAEgCA,gBAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,K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,EAAM;AAAA;AAEV;AAEO,SAAS,eAAA,CAAgB,KAAqB,MAAA,EAA8B;AACjF,EAAA,OAAO,eAAA,CAAgB,GAAG,CAAA,CAAE,MAAM,CAAA;AACpC;AAEO,SAAS,iBAAiB,MAAA,EAA6C;AAC5E,EAAA,OAAQ,OAA2C,MAAM,CAAA;AAC3D;AAEO,SAAS,eAAe,MAAA,EAAwC;AACrE,EAAA,OAAO,cAAA,CAAe,SAAS,MAAsB,CAAA;AACvD;AAEO,SAAS,WAAW,GAAA,EAA6B;AACtD,EAAA,OAAO,GAAA,KAAQ,YAAY,oBAAA,GAAuB,oBAAA;AACpD","file":"tokens.cjs","sourcesContent":["/**\n * Arc blockchain definitions.\n *\n * Arc is Circle's stablecoin-native L1 where gas is paid in USDC.\n * - Testnet is live (chain id 5042002).\n * - Mainnet beta is expected in 2026; the mainnet entry is a placeholder\n * until Circle publishes the production chain id and RPC endpoint.\n *\n * @see https://docs.arc.network\n */\n\nimport { defineChain, type Chain } from 'viem'\n\nexport const ARC_TESTNET_CHAIN_ID = 5042002 as const\nexport const ARC_MAINNET_CHAIN_ID = 5040001 as const\n\nconst NATIVE_USDC = {\n name: 'USD Coin',\n symbol: 'USDC',\n decimals: 6,\n} as const\n\nexport const arcTestnet: Chain = defineChain({\n id: ARC_TESTNET_CHAIN_ID,\n name: 'Arc Testnet',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.testnet.arc.network'] },\n public: { http: ['https://rpc.testnet.arc.network'] },\n },\n blockExplorers: {\n default: {\n name: 'ArcScan',\n url: 'https://testnet.arcscan.app',\n },\n },\n testnet: true,\n})\n\nexport const arcMainnet: Chain = defineChain({\n id: ARC_MAINNET_CHAIN_ID,\n name: 'Arc',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.arc.network'] },\n public: { http: ['https://rpc.arc.network'] },\n },\n blockExplorers: {\n default: {\n name: 'ArcScan',\n url: 'https://arcscan.app',\n },\n },\n testnet: false,\n})\n\nexport type ArcEnvironment = 'testnet' | 'mainnet'\n\nexport const ARC_CHAINS: Record<ArcEnvironment, Chain> = {\n testnet: arcTestnet,\n mainnet: arcMainnet,\n}\n\nexport function getArcChain(env: ArcEnvironment): Chain {\n return ARC_CHAINS[env]\n}\n\nexport function isArcChain(chainId: number): boolean {\n return chainId === ARC_TESTNET_CHAIN_ID || chainId === ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Token registry for Arc.\n *\n * USDC and EURC are first-class payment tokens — they can be requested in a\n * payment session and used as a subscription currency.\n *\n * USYC is yield-bearing and is treated as a treasury asset only — merchants\n * can hold and earn yield, but a payer cannot pay in USYC.\n */\n\nimport type { Address } from 'viem'\nimport { ARC_TESTNET_CHAIN_ID, ARC_MAINNET_CHAIN_ID, type ArcEnvironment } from './chains.js'\n\nexport type TokenSymbol = 'USDC' | 'EURC' | 'USYC'\n\n/** Tokens accepted as direct payment by Strimz. USYC is excluded by design. */\nexport type PaymentToken = Extract<TokenSymbol, 'USDC' | 'EURC'>\n\nexport const PAYMENT_TOKENS: readonly PaymentToken[] = ['USDC', 'EURC'] as const\n\nexport interface TokenDescriptor {\n symbol: TokenSymbol\n name: string\n decimals: number\n /** Whether the token is accepted as direct payment. */\n paymentEligible: boolean\n /** Whether the token is yield-bearing. */\n yieldBearing: boolean\n}\n\nexport interface TokenAddress {\n symbol: TokenSymbol\n address: Address\n chainId: number\n}\n\nexport const TOKENS: Record<TokenSymbol, TokenDescriptor> = {\n USDC: {\n symbol: 'USDC',\n name: 'USD Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n EURC: {\n symbol: 'EURC',\n name: 'Euro Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n USYC: {\n symbol: 'USYC',\n name: 'US Yield Coin',\n decimals: 6,\n paymentEligible: false,\n yieldBearing: true,\n },\n}\n\n/**\n * Native, Circle-issued addresses on Arc.\n * The same address is reused across testnet and mainnet for native tokens\n * since Arc preserves canonical addresses across environments where possible.\n */\nexport const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address>> = {\n testnet: {\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n mainnet: {\n // Mainnet addresses pending Arc mainnet beta launch; placeholders mirror\n // testnet for now and must be replaced when Circle publishes the canonical\n // mainnet token registry.\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n}\n\nexport function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {\n return TOKEN_ADDRESSES[env][symbol]\n}\n\nexport function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {\n return (TOKENS as Record<string, TokenDescriptor>)[symbol]\n}\n\nexport function isPaymentToken(symbol: string): symbol is PaymentToken {\n return PAYMENT_TOKENS.includes(symbol as PaymentToken)\n}\n\nexport function chainIdFor(env: ArcEnvironment): number {\n return env === 'testnet' ? ARC_TESTNET_CHAIN_ID : ARC_MAINNET_CHAIN_ID\n}\n"]}
1
+ {"version":3,"sources":["../src/chains.ts","../src/tokens.ts"],"names":["defineChain"],"mappings":";;;;;AAaO,IAAM,oBAAA,GAAuB,OAAA;AAC7B,IAAM,oBAAA,GAAuB,IAAA;AAEpC,IAAM,WAAA,GAAc;AAAA,EAClB,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,MAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAEO,IAAM,aAAoBA,gBAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EACJ,IAAA,EAAM,aAAA;AAAA,EACN,cAAA,EAAgB,WAAA;AAAA,EAChB,OAAA,EAAS;AAAA,IACP,OAAA,EAAS,EAAE,IAAA,EAAM,CAA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,MAAA,EAAwC;AACrE,EAAA,OAAO,cAAA,CAAe,SAAS,MAAsB,CAAA;AACvD;AAEO,SAAS,WAAW,GAAA,EAA6B;AACtD,EAAA,OAAO,WAAA,CAAY,GAAG,CAAA,CAAE,EAAA;AAC1B","file":"tokens.cjs","sourcesContent":["/**\n * Arc blockchain definitions.\n *\n * Arc is Circle's stablecoin-native L1 where gas is paid in USDC.\n * - Testnet is live (chain id 5042002).\n * - Mainnet beta is expected in 2026; the mainnet entry is a placeholder\n * until Circle publishes the production chain id and RPC endpoint.\n *\n * @see https://docs.arc.network\n */\n\nimport { defineChain, type Chain } from 'viem'\n\nexport const ARC_TESTNET_CHAIN_ID = 5042002 as const\nexport const ARC_MAINNET_CHAIN_ID = 5042 as const\n\nconst NATIVE_USDC = {\n name: 'USDC',\n symbol: 'USDC',\n decimals: 18,\n} as const\n\nexport const arcTestnet: Chain = defineChain({\n id: ARC_TESTNET_CHAIN_ID,\n name: 'Arc Testnet',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.testnet.arc.io'] },\n public: { http: ['https://rpc.testnet.arc.io'] },\n },\n blockExplorers: {\n default: {\n name: 'Arc Testnet Explorer',\n url: 'https://explorer.testnet.arc.io',\n },\n },\n testnet: true,\n})\n\nexport const arcMainnet: Chain = defineChain({\n id: ARC_MAINNET_CHAIN_ID,\n name: 'Arc',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.mainnet.arc.io'] },\n public: { http: ['https://rpc.mainnet.arc.io'] },\n },\n blockExplorers: {\n default: {\n name: 'Arc Explorer',\n url: 'https://explorer.arc.io',\n },\n },\n testnet: false,\n})\n\nexport type ArcEnvironment = 'testnet' | 'mainnet'\n\nexport const ARC_CHAINS: Record<ArcEnvironment, Chain> = {\n testnet: arcTestnet,\n mainnet: arcMainnet,\n}\n\nexport const ARC_ENVIRONMENTS: readonly ArcEnvironment[] = ['testnet', 'mainnet'] as const\n\nexport function isArcEnvironment(value: unknown): value is ArcEnvironment {\n return typeof value === 'string' && (ARC_ENVIRONMENTS as readonly string[]).includes(value)\n}\n\nexport function parseArcEnvironment(value: unknown): ArcEnvironment {\n if (isArcEnvironment(value)) return value\n throw new Error(\n `unknown Arc environment ${JSON.stringify(value)}: expected one of ${ARC_ENVIRONMENTS.join(', ')}`,\n )\n}\n\nexport function getArcChain(env: ArcEnvironment): Chain {\n return ARC_CHAINS[parseArcEnvironment(env)]\n}\n\nexport function getArcExplorerUrl(env: ArcEnvironment): string {\n const explorer = getArcChain(env).blockExplorers?.default.url\n if (!explorer) throw new Error(`Arc ${env} has no block explorer configured`)\n return explorer\n}\n\nexport function arcExplorerTxUrl(env: ArcEnvironment, txHash: string): string {\n return `${getArcExplorerUrl(env)}/tx/${txHash}`\n}\n\nexport function arcEnvironmentForChainId(chainId: number): ArcEnvironment {\n const env = ARC_ENVIRONMENTS.find((candidate) => ARC_CHAINS[candidate].id === chainId)\n if (!env) {\n throw new Error(\n `chain id ${chainId} is not an Arc chain: expected ${ARC_TESTNET_CHAIN_ID} (testnet) or ${ARC_MAINNET_CHAIN_ID} (mainnet)`,\n )\n }\n return env\n}\n\nexport function assertArcChainId(env: ArcEnvironment, rpcChainId: number): void {\n const expected = getArcChain(env).id\n if (rpcChainId !== expected) {\n throw new Error(\n `ARC_RPC_URL serves chain id ${rpcChainId}, but ARC_ENVIRONMENT=${env} expects chain id ${expected}`,\n )\n }\n}\n\nexport function isArcChain(chainId: number): boolean {\n return chainId === ARC_TESTNET_CHAIN_ID || chainId === ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Token registry for Arc.\n *\n * USDC and EURC are first-class payment tokens. They can be requested in a\n * payment session and used as a subscription currency.\n *\n * USYC is yield-bearing and is treated as a treasury asset only. Merchants\n * can hold it and earn yield, but a payer cannot pay in USYC.\n */\n\nimport type { Address } from 'viem'\nimport { getArcChain, parseArcEnvironment, type ArcEnvironment } from './chains.js'\n\nexport type TokenSymbol = 'USDC' | 'EURC' | 'USYC'\n\n/** Tokens accepted as direct payment by Strimz. USYC is excluded by design. */\nexport type PaymentToken = Extract<TokenSymbol, 'USDC' | 'EURC'>\n\nexport const PAYMENT_TOKENS: readonly PaymentToken[] = ['USDC', 'EURC'] as const\n\nexport interface TokenDescriptor {\n symbol: TokenSymbol\n name: string\n decimals: number\n /** Whether the token is accepted as direct payment. */\n paymentEligible: boolean\n /** Whether the token is yield-bearing. */\n yieldBearing: boolean\n}\n\nexport interface TokenAddress {\n symbol: TokenSymbol\n address: Address\n chainId: number\n}\n\nexport const TOKENS: Record<TokenSymbol, TokenDescriptor> = {\n USDC: {\n symbol: 'USDC',\n name: 'USD Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n EURC: {\n symbol: 'EURC',\n name: 'Euro Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n USYC: {\n symbol: 'USYC',\n name: 'US Yield Coin',\n decimals: 6,\n paymentEligible: false,\n yieldBearing: true,\n },\n}\n\n/**\n * Native, Circle-issued addresses on Arc.\n * The same address is reused across testnet and mainnet for native tokens\n * since Arc preserves canonical addresses across environments where possible.\n */\nexport const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address>> = {\n testnet: {\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n mainnet: {\n // Mainnet addresses pending Arc mainnet beta launch; placeholders mirror\n // testnet for now and must be replaced when Circle publishes the canonical\n // mainnet token registry.\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1',\n USYC: '0x8a5D989Bbb96929F689B0200f435f53dA42bF490',\n },\n}\n\nexport function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {\n return TOKEN_ADDRESSES[parseArcEnvironment(env)][symbol]\n}\n\nexport function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {\n return (TOKENS as Record<string, TokenDescriptor>)[symbol]\n}\n\nexport function isPaymentToken(symbol: string): symbol is PaymentToken {\n return PAYMENT_TOKENS.includes(symbol as PaymentToken)\n}\n\nexport function chainIdFor(env: ArcEnvironment): number {\n return getArcChain(env).id\n}\n"]}
package/dist/tokens.d.cts CHANGED
@@ -4,11 +4,11 @@ import { ArcEnvironment } from './chains.cjs';
4
4
  /**
5
5
  * Token registry for Arc.
6
6
  *
7
- * USDC and EURC are first-class payment tokens — they can be requested in a
7
+ * USDC and EURC are first-class payment tokens. They can be requested in a
8
8
  * payment session and used as a subscription currency.
9
9
  *
10
- * USYC is yield-bearing and is treated as a treasury asset only — merchants
11
- * can hold and earn yield, but a payer cannot pay in USYC.
10
+ * USYC is yield-bearing and is treated as a treasury asset only. Merchants
11
+ * can hold it and earn yield, but a payer cannot pay in USYC.
12
12
  */
13
13
 
14
14
  type TokenSymbol = 'USDC' | 'EURC' | 'USYC';
package/dist/tokens.d.ts CHANGED
@@ -4,11 +4,11 @@ import { ArcEnvironment } from './chains.js';
4
4
  /**
5
5
  * Token registry for Arc.
6
6
  *
7
- * USDC and EURC are first-class payment tokens — they can be requested in a
7
+ * USDC and EURC are first-class payment tokens. They can be requested in a
8
8
  * payment session and used as a subscription currency.
9
9
  *
10
- * USYC is yield-bearing and is treated as a treasury asset only — merchants
11
- * can hold and earn yield, but a payer cannot pay in USYC.
10
+ * USYC is yield-bearing and is treated as a treasury asset only. Merchants
11
+ * can hold it and earn yield, but a payer cannot pay in USYC.
12
12
  */
13
13
 
14
14
  type TokenSymbol = 'USDC' | 'EURC' | 'USYC';
package/dist/tokens.js CHANGED
@@ -2,44 +2,61 @@ import { defineChain } from 'viem';
2
2
 
3
3
  // src/chains.ts
4
4
  var ARC_TESTNET_CHAIN_ID = 5042002;
5
- var ARC_MAINNET_CHAIN_ID = 5040001;
5
+ var ARC_MAINNET_CHAIN_ID = 5042;
6
6
  var NATIVE_USDC = {
7
- name: "USD Coin",
7
+ name: "USDC",
8
8
  symbol: "USDC",
9
- decimals: 6
9
+ decimals: 18
10
10
  };
11
- defineChain({
11
+ var arcTestnet = defineChain({
12
12
  id: ARC_TESTNET_CHAIN_ID,
13
13
  name: "Arc Testnet",
14
14
  nativeCurrency: NATIVE_USDC,
15
15
  rpcUrls: {
16
- default: { http: ["https://rpc.testnet.arc.network"] },
17
- public: { http: ["https://rpc.testnet.arc.network"] }
16
+ default: { http: ["https://rpc.testnet.arc.io"] },
17
+ public: { http: ["https://rpc.testnet.arc.io"] }
18
18
  },
19
19
  blockExplorers: {
20
20
  default: {
21
- name: "ArcScan",
22
- url: "https://testnet.arcscan.app"
21
+ name: "Arc Testnet Explorer",
22
+ url: "https://explorer.testnet.arc.io"
23
23
  }
24
24
  },
25
25
  testnet: true
26
26
  });
27
- defineChain({
27
+ var arcMainnet = defineChain({
28
28
  id: ARC_MAINNET_CHAIN_ID,
29
29
  name: "Arc",
30
30
  nativeCurrency: NATIVE_USDC,
31
31
  rpcUrls: {
32
- default: { http: ["https://rpc.arc.network"] },
33
- public: { http: ["https://rpc.arc.network"] }
32
+ default: { http: ["https://rpc.mainnet.arc.io"] },
33
+ public: { http: ["https://rpc.mainnet.arc.io"] }
34
34
  },
35
35
  blockExplorers: {
36
36
  default: {
37
- name: "ArcScan",
38
- url: "https://arcscan.app"
37
+ name: "Arc Explorer",
38
+ url: "https://explorer.arc.io"
39
39
  }
40
40
  },
41
41
  testnet: false
42
42
  });
43
+ var ARC_CHAINS = {
44
+ testnet: arcTestnet,
45
+ mainnet: arcMainnet
46
+ };
47
+ var ARC_ENVIRONMENTS = ["testnet", "mainnet"];
48
+ function isArcEnvironment(value) {
49
+ return typeof value === "string" && ARC_ENVIRONMENTS.includes(value);
50
+ }
51
+ function parseArcEnvironment(value) {
52
+ if (isArcEnvironment(value)) return value;
53
+ throw new Error(
54
+ `unknown Arc environment ${JSON.stringify(value)}: expected one of ${ARC_ENVIRONMENTS.join(", ")}`
55
+ );
56
+ }
57
+ function getArcChain(env) {
58
+ return ARC_CHAINS[parseArcEnvironment(env)];
59
+ }
43
60
 
44
61
  // src/tokens.ts
45
62
  var PAYMENT_TOKENS = ["USDC", "EURC"];
@@ -77,12 +94,12 @@ var TOKEN_ADDRESSES = {
77
94
  // testnet for now and must be replaced when Circle publishes the canonical
78
95
  // mainnet token registry.
79
96
  USDC: "0x3600000000000000000000000000000000000000",
80
- EURC: "0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a",
81
- USYC: "0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C"
97
+ EURC: "0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1",
98
+ USYC: "0x8a5D989Bbb96929F689B0200f435f53dA42bF490"
82
99
  }
83
100
  };
84
101
  function getTokenAddress(env, symbol) {
85
- return TOKEN_ADDRESSES[env][symbol];
102
+ return TOKEN_ADDRESSES[parseArcEnvironment(env)][symbol];
86
103
  }
87
104
  function getTokenBySymbol(symbol) {
88
105
  return TOKENS[symbol];
@@ -91,7 +108,7 @@ function isPaymentToken(symbol) {
91
108
  return PAYMENT_TOKENS.includes(symbol);
92
109
  }
93
110
  function chainIdFor(env) {
94
- return env === "testnet" ? ARC_TESTNET_CHAIN_ID : ARC_MAINNET_CHAIN_ID;
111
+ return getArcChain(env).id;
95
112
  }
96
113
 
97
114
  export { PAYMENT_TOKENS, TOKENS, TOKEN_ADDRESSES, chainIdFor, getTokenAddress, getTokenBySymbol, isPaymentToken };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/chains.ts","../src/tokens.ts"],"names":[],"mappings":";;;AAaO,IAAM,oBAAA,GAAuB,OAAA;AAC7B,IAAM,oBAAA,GAAuB,OAAA;AAEpC,IAAM,WAAA,GAAc;AAAA,EAClB,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ,MAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAEiC,WAAA,CAAY;AAAA,EAC3C,EAAA,EAAI,oBAAA;AAAA,EAC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AChB;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,MAAA,EAAQ,MAAA;AAAA,IACR,IAAA,EAAM,eAAA;AAAA,IACN,QAAA,EAAU,CAAA;AAAA,IACV,eAAA,EAAiB,KAAA;AAAA,IACjB,YAAA,EAAc;AAAA;AAElB;AAOO,IAAM,eAAA,GAAwE;AAAA,EACnF,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA,IAIP,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM;AAAA;AAEV;AAEO,SAAS,eAAA,CAAgB,KAAqB,MAAA,EAA8B;AACjF,EAAA,OAAO,eAAA,CAAgB,GAAG,CAAA,CAAE,MAAM,CAAA;AACpC;AAEO,SAAS,iBAAiB,MAAA,EAA6C;AAC5E,EAAA,OAAQ,OAA2C,MAAM,CAAA;AAC3D;AAEO,SAAS,eAAe,MAAA,EAAwC;AACrE,EAAA,OAAO,cAAA,CAAe,SAAS,MAAsB,CAAA;AACvD;AAEO,SAAS,WAAW,GAAA,EAA6B;AACtD,EAAA,OAAO,GAAA,KAAQ,YAAY,oBAAA,GAAuB,oBAAA;AACpD","file":"tokens.js","sourcesContent":["/**\n * Arc blockchain definitions.\n *\n * Arc is Circle's stablecoin-native L1 where gas is paid in USDC.\n * - Testnet is live (chain id 5042002).\n * - Mainnet beta is expected in 2026; the mainnet entry is a placeholder\n * until Circle publishes the production chain id and RPC endpoint.\n *\n * @see https://docs.arc.network\n */\n\nimport { defineChain, type Chain } from 'viem'\n\nexport const ARC_TESTNET_CHAIN_ID = 5042002 as const\nexport const ARC_MAINNET_CHAIN_ID = 5040001 as const\n\nconst NATIVE_USDC = {\n name: 'USD Coin',\n symbol: 'USDC',\n decimals: 6,\n} as const\n\nexport const arcTestnet: Chain = defineChain({\n id: ARC_TESTNET_CHAIN_ID,\n name: 'Arc Testnet',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.testnet.arc.network'] },\n public: { http: ['https://rpc.testnet.arc.network'] },\n },\n blockExplorers: {\n default: {\n name: 'ArcScan',\n url: 'https://testnet.arcscan.app',\n },\n },\n testnet: true,\n})\n\nexport const arcMainnet: Chain = defineChain({\n id: ARC_MAINNET_CHAIN_ID,\n name: 'Arc',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.arc.network'] },\n public: { http: ['https://rpc.arc.network'] },\n },\n blockExplorers: {\n default: {\n name: 'ArcScan',\n url: 'https://arcscan.app',\n },\n },\n testnet: false,\n})\n\nexport type ArcEnvironment = 'testnet' | 'mainnet'\n\nexport const ARC_CHAINS: Record<ArcEnvironment, Chain> = {\n testnet: arcTestnet,\n mainnet: arcMainnet,\n}\n\nexport function getArcChain(env: ArcEnvironment): Chain {\n return ARC_CHAINS[env]\n}\n\nexport function isArcChain(chainId: number): boolean {\n return chainId === ARC_TESTNET_CHAIN_ID || chainId === ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Token registry for Arc.\n *\n * USDC and EURC are first-class payment tokens — they can be requested in a\n * payment session and used as a subscription currency.\n *\n * USYC is yield-bearing and is treated as a treasury asset only — merchants\n * can hold and earn yield, but a payer cannot pay in USYC.\n */\n\nimport type { Address } from 'viem'\nimport { ARC_TESTNET_CHAIN_ID, ARC_MAINNET_CHAIN_ID, type ArcEnvironment } from './chains.js'\n\nexport type TokenSymbol = 'USDC' | 'EURC' | 'USYC'\n\n/** Tokens accepted as direct payment by Strimz. USYC is excluded by design. */\nexport type PaymentToken = Extract<TokenSymbol, 'USDC' | 'EURC'>\n\nexport const PAYMENT_TOKENS: readonly PaymentToken[] = ['USDC', 'EURC'] as const\n\nexport interface TokenDescriptor {\n symbol: TokenSymbol\n name: string\n decimals: number\n /** Whether the token is accepted as direct payment. */\n paymentEligible: boolean\n /** Whether the token is yield-bearing. */\n yieldBearing: boolean\n}\n\nexport interface TokenAddress {\n symbol: TokenSymbol\n address: Address\n chainId: number\n}\n\nexport const TOKENS: Record<TokenSymbol, TokenDescriptor> = {\n USDC: {\n symbol: 'USDC',\n name: 'USD Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n EURC: {\n symbol: 'EURC',\n name: 'Euro Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n USYC: {\n symbol: 'USYC',\n name: 'US Yield Coin',\n decimals: 6,\n paymentEligible: false,\n yieldBearing: true,\n },\n}\n\n/**\n * Native, Circle-issued addresses on Arc.\n * The same address is reused across testnet and mainnet for native tokens\n * since Arc preserves canonical addresses across environments where possible.\n */\nexport const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address>> = {\n testnet: {\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n mainnet: {\n // Mainnet addresses pending Arc mainnet beta launch; placeholders mirror\n // testnet for now and must be replaced when Circle publishes the canonical\n // mainnet token registry.\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n}\n\nexport function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {\n return TOKEN_ADDRESSES[env][symbol]\n}\n\nexport function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {\n return (TOKENS as Record<string, TokenDescriptor>)[symbol]\n}\n\nexport function isPaymentToken(symbol: string): symbol is PaymentToken {\n return PAYMENT_TOKENS.includes(symbol as PaymentToken)\n}\n\nexport function chainIdFor(env: ArcEnvironment): number {\n return env === 'testnet' ? ARC_TESTNET_CHAIN_ID : ARC_MAINNET_CHAIN_ID\n}\n"]}
1
+ {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A;AAAA,IACN,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA,IAIP,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM,4CAAA;AAAA,IACN,IAAA,EAAM;AAAA;AAEV;AAEO,SAAS,eAAA,CAAgB,KAAqB,MAAA,EAA8B;AACjF,EAAA,OAAO,eAAA,CAAgB,mBAAA,CAAoB,GAAG,CAAC,EAAE,MAAM,CAAA;AACzD;AAEO,SAAS,iBAAiB,MAAA,EAA6C;AAC5E,EAAA,OAAQ,OAA2C,MAAM,CAAA;AAC3D;AAEO,SAAS,eAAe,MAAA,EAAwC;AACrE,EAAA,OAAO,cAAA,CAAe,SAAS,MAAsB,CAAA;AACvD;AAEO,SAAS,WAAW,GAAA,EAA6B;AACtD,EAAA,OAAO,WAAA,CAAY,GAAG,CAAA,CAAE,EAAA;AAC1B","file":"tokens.js","sourcesContent":["/**\n * Arc blockchain definitions.\n *\n * Arc is Circle's stablecoin-native L1 where gas is paid in USDC.\n * - Testnet is live (chain id 5042002).\n * - Mainnet beta is expected in 2026; the mainnet entry is a placeholder\n * until Circle publishes the production chain id and RPC endpoint.\n *\n * @see https://docs.arc.network\n */\n\nimport { defineChain, type Chain } from 'viem'\n\nexport const ARC_TESTNET_CHAIN_ID = 5042002 as const\nexport const ARC_MAINNET_CHAIN_ID = 5042 as const\n\nconst NATIVE_USDC = {\n name: 'USDC',\n symbol: 'USDC',\n decimals: 18,\n} as const\n\nexport const arcTestnet: Chain = defineChain({\n id: ARC_TESTNET_CHAIN_ID,\n name: 'Arc Testnet',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.testnet.arc.io'] },\n public: { http: ['https://rpc.testnet.arc.io'] },\n },\n blockExplorers: {\n default: {\n name: 'Arc Testnet Explorer',\n url: 'https://explorer.testnet.arc.io',\n },\n },\n testnet: true,\n})\n\nexport const arcMainnet: Chain = defineChain({\n id: ARC_MAINNET_CHAIN_ID,\n name: 'Arc',\n nativeCurrency: NATIVE_USDC,\n rpcUrls: {\n default: { http: ['https://rpc.mainnet.arc.io'] },\n public: { http: ['https://rpc.mainnet.arc.io'] },\n },\n blockExplorers: {\n default: {\n name: 'Arc Explorer',\n url: 'https://explorer.arc.io',\n },\n },\n testnet: false,\n})\n\nexport type ArcEnvironment = 'testnet' | 'mainnet'\n\nexport const ARC_CHAINS: Record<ArcEnvironment, Chain> = {\n testnet: arcTestnet,\n mainnet: arcMainnet,\n}\n\nexport const ARC_ENVIRONMENTS: readonly ArcEnvironment[] = ['testnet', 'mainnet'] as const\n\nexport function isArcEnvironment(value: unknown): value is ArcEnvironment {\n return typeof value === 'string' && (ARC_ENVIRONMENTS as readonly string[]).includes(value)\n}\n\nexport function parseArcEnvironment(value: unknown): ArcEnvironment {\n if (isArcEnvironment(value)) return value\n throw new Error(\n `unknown Arc environment ${JSON.stringify(value)}: expected one of ${ARC_ENVIRONMENTS.join(', ')}`,\n )\n}\n\nexport function getArcChain(env: ArcEnvironment): Chain {\n return ARC_CHAINS[parseArcEnvironment(env)]\n}\n\nexport function getArcExplorerUrl(env: ArcEnvironment): string {\n const explorer = getArcChain(env).blockExplorers?.default.url\n if (!explorer) throw new Error(`Arc ${env} has no block explorer configured`)\n return explorer\n}\n\nexport function arcExplorerTxUrl(env: ArcEnvironment, txHash: string): string {\n return `${getArcExplorerUrl(env)}/tx/${txHash}`\n}\n\nexport function arcEnvironmentForChainId(chainId: number): ArcEnvironment {\n const env = ARC_ENVIRONMENTS.find((candidate) => ARC_CHAINS[candidate].id === chainId)\n if (!env) {\n throw new Error(\n `chain id ${chainId} is not an Arc chain: expected ${ARC_TESTNET_CHAIN_ID} (testnet) or ${ARC_MAINNET_CHAIN_ID} (mainnet)`,\n )\n }\n return env\n}\n\nexport function assertArcChainId(env: ArcEnvironment, rpcChainId: number): void {\n const expected = getArcChain(env).id\n if (rpcChainId !== expected) {\n throw new Error(\n `ARC_RPC_URL serves chain id ${rpcChainId}, but ARC_ENVIRONMENT=${env} expects chain id ${expected}`,\n )\n }\n}\n\nexport function isArcChain(chainId: number): boolean {\n return chainId === ARC_TESTNET_CHAIN_ID || chainId === ARC_MAINNET_CHAIN_ID\n}\n","/**\n * Token registry for Arc.\n *\n * USDC and EURC are first-class payment tokens. They can be requested in a\n * payment session and used as a subscription currency.\n *\n * USYC is yield-bearing and is treated as a treasury asset only. Merchants\n * can hold it and earn yield, but a payer cannot pay in USYC.\n */\n\nimport type { Address } from 'viem'\nimport { getArcChain, parseArcEnvironment, type ArcEnvironment } from './chains.js'\n\nexport type TokenSymbol = 'USDC' | 'EURC' | 'USYC'\n\n/** Tokens accepted as direct payment by Strimz. USYC is excluded by design. */\nexport type PaymentToken = Extract<TokenSymbol, 'USDC' | 'EURC'>\n\nexport const PAYMENT_TOKENS: readonly PaymentToken[] = ['USDC', 'EURC'] as const\n\nexport interface TokenDescriptor {\n symbol: TokenSymbol\n name: string\n decimals: number\n /** Whether the token is accepted as direct payment. */\n paymentEligible: boolean\n /** Whether the token is yield-bearing. */\n yieldBearing: boolean\n}\n\nexport interface TokenAddress {\n symbol: TokenSymbol\n address: Address\n chainId: number\n}\n\nexport const TOKENS: Record<TokenSymbol, TokenDescriptor> = {\n USDC: {\n symbol: 'USDC',\n name: 'USD Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n EURC: {\n symbol: 'EURC',\n name: 'Euro Coin',\n decimals: 6,\n paymentEligible: true,\n yieldBearing: false,\n },\n USYC: {\n symbol: 'USYC',\n name: 'US Yield Coin',\n decimals: 6,\n paymentEligible: false,\n yieldBearing: true,\n },\n}\n\n/**\n * Native, Circle-issued addresses on Arc.\n * The same address is reused across testnet and mainnet for native tokens\n * since Arc preserves canonical addresses across environments where possible.\n */\nexport const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address>> = {\n testnet: {\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0x89B50855Aa3bE2F677cD6303Cec089B5F319D72a',\n USYC: '0xe9185F0c5F296Ed1797AaE4238D26CCaBEadb86C',\n },\n mainnet: {\n // Mainnet addresses pending Arc mainnet beta launch; placeholders mirror\n // testnet for now and must be replaced when Circle publishes the canonical\n // mainnet token registry.\n USDC: '0x3600000000000000000000000000000000000000',\n EURC: '0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1',\n USYC: '0x8a5D989Bbb96929F689B0200f435f53dA42bF490',\n },\n}\n\nexport function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {\n return TOKEN_ADDRESSES[parseArcEnvironment(env)][symbol]\n}\n\nexport function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {\n return (TOKENS as Record<string, TokenDescriptor>)[symbol]\n}\n\nexport function isPaymentToken(symbol: string): symbol is PaymentToken {\n return PAYMENT_TOKENS.includes(symbol as PaymentToken)\n}\n\nexport function chainIdFor(env: ArcEnvironment): number {\n return getArcChain(env).id\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strimz/shared-config",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Single source of truth for chain definitions, token registry, fee tiers, webhook events, and agent flags.",
5
5
  "license": "MIT",
6
6
  "author": "Strimz <hello@strimz.finance>",
@@ -83,14 +83,16 @@
83
83
  "eslint": "^9.18.0",
84
84
  "tsup": "^8.3.5",
85
85
  "typescript": "^5.7.3",
86
+ "vitest": "^2.1.8",
86
87
  "@strimz/eslint-config": "0.0.0",
87
88
  "@strimz/tsconfig": "0.0.0"
88
89
  },
89
90
  "scripts": {
90
91
  "build": "tsup",
91
92
  "dev": "tsup --watch",
92
- "lint": "eslint .",
93
+ "lint": "eslint . --max-warnings 0",
93
94
  "typecheck": "tsc --noEmit",
95
+ "test": "vitest run",
94
96
  "clean": "rm -rf dist .turbo *.tsbuildinfo"
95
97
  }
96
98
  }
package/src/agents.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Strimz AutoPay Agent — feature flags and defaults.
2
+ * Strimz AutoPay Agent feature flags and defaults.
3
3
  *
4
4
  * The agent is composed of independent capabilities that can be enabled or
5
- * disabled per merchant. Defaults are conservative; merchants opt in to
5
+ * disabled per merchant. Defaults are conservative. Merchants opt in to
6
6
  * value-moving capabilities (recovery retries, treasury auto-convert).
7
7
  */
8
8
 
package/src/cctp.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import type { Address } from 'viem'
11
- import type { ArcEnvironment } from './chains.js'
11
+ import { parseArcEnvironment, type ArcEnvironment } from './chains.js'
12
12
 
13
13
  export interface CCTPContractSet {
14
14
  tokenMessengerV2: Address
@@ -29,11 +29,11 @@ export const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet> = {
29
29
  },
30
30
  mainnet: {
31
31
  // Pending Circle's mainnet publication of CCTP V2 addresses for Arc.
32
- // Mirror testnet as a placeholder so type signatures stay non-null.
33
- tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',
34
- messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',
35
- gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',
36
- gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',
32
+ // Testnet values are mirrored as a placeholder so type signatures stay non-null.
33
+ tokenMessengerV2: '0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d',
34
+ messageTransmitterV2: '0x81D40F21F12A8F0E3252Bccb954D722d4c464B64',
35
+ gatewayWallet: '0x77777777Dcc4d5A8B6E418Fd04D8997ef11000eE',
36
+ gatewayMinter: '0x2222222d7164433c4C09B0b0D809a9b52C04C205',
37
37
  domainId: 26,
38
38
  },
39
39
  }
@@ -64,5 +64,5 @@ export const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[] = [
64
64
  ] as const
65
65
 
66
66
  export function getCctpContracts(env: ArcEnvironment): CCTPContractSet {
67
- return CCTP_CONTRACTS[env]
67
+ return CCTP_CONTRACTS[parseArcEnvironment(env)]
68
68
  }
package/src/chains.ts CHANGED
@@ -12,12 +12,12 @@
12
12
  import { defineChain, type Chain } from 'viem'
13
13
 
14
14
  export const ARC_TESTNET_CHAIN_ID = 5042002 as const
15
- export const ARC_MAINNET_CHAIN_ID = 5040001 as const
15
+ export const ARC_MAINNET_CHAIN_ID = 5042 as const
16
16
 
17
17
  const NATIVE_USDC = {
18
- name: 'USD Coin',
18
+ name: 'USDC',
19
19
  symbol: 'USDC',
20
- decimals: 6,
20
+ decimals: 18,
21
21
  } as const
22
22
 
23
23
  export const arcTestnet: Chain = defineChain({
@@ -25,13 +25,13 @@ export const arcTestnet: Chain = defineChain({
25
25
  name: 'Arc Testnet',
26
26
  nativeCurrency: NATIVE_USDC,
27
27
  rpcUrls: {
28
- default: { http: ['https://rpc.testnet.arc.network'] },
29
- public: { http: ['https://rpc.testnet.arc.network'] },
28
+ default: { http: ['https://rpc.testnet.arc.io'] },
29
+ public: { http: ['https://rpc.testnet.arc.io'] },
30
30
  },
31
31
  blockExplorers: {
32
32
  default: {
33
- name: 'ArcScan',
34
- url: 'https://testnet.arcscan.app',
33
+ name: 'Arc Testnet Explorer',
34
+ url: 'https://explorer.testnet.arc.io',
35
35
  },
36
36
  },
37
37
  testnet: true,
@@ -42,13 +42,13 @@ export const arcMainnet: Chain = defineChain({
42
42
  name: 'Arc',
43
43
  nativeCurrency: NATIVE_USDC,
44
44
  rpcUrls: {
45
- default: { http: ['https://rpc.arc.network'] },
46
- public: { http: ['https://rpc.arc.network'] },
45
+ default: { http: ['https://rpc.mainnet.arc.io'] },
46
+ public: { http: ['https://rpc.mainnet.arc.io'] },
47
47
  },
48
48
  blockExplorers: {
49
49
  default: {
50
- name: 'ArcScan',
51
- url: 'https://arcscan.app',
50
+ name: 'Arc Explorer',
51
+ url: 'https://explorer.arc.io',
52
52
  },
53
53
  },
54
54
  testnet: false,
@@ -61,8 +61,50 @@ export const ARC_CHAINS: Record<ArcEnvironment, Chain> = {
61
61
  mainnet: arcMainnet,
62
62
  }
63
63
 
64
+ export const ARC_ENVIRONMENTS: readonly ArcEnvironment[] = ['testnet', 'mainnet'] as const
65
+
66
+ export function isArcEnvironment(value: unknown): value is ArcEnvironment {
67
+ return typeof value === 'string' && (ARC_ENVIRONMENTS as readonly string[]).includes(value)
68
+ }
69
+
70
+ export function parseArcEnvironment(value: unknown): ArcEnvironment {
71
+ if (isArcEnvironment(value)) return value
72
+ throw new Error(
73
+ `unknown Arc environment ${JSON.stringify(value)}: expected one of ${ARC_ENVIRONMENTS.join(', ')}`,
74
+ )
75
+ }
76
+
64
77
  export function getArcChain(env: ArcEnvironment): Chain {
65
- return ARC_CHAINS[env]
78
+ return ARC_CHAINS[parseArcEnvironment(env)]
79
+ }
80
+
81
+ export function getArcExplorerUrl(env: ArcEnvironment): string {
82
+ const explorer = getArcChain(env).blockExplorers?.default.url
83
+ if (!explorer) throw new Error(`Arc ${env} has no block explorer configured`)
84
+ return explorer
85
+ }
86
+
87
+ export function arcExplorerTxUrl(env: ArcEnvironment, txHash: string): string {
88
+ return `${getArcExplorerUrl(env)}/tx/${txHash}`
89
+ }
90
+
91
+ export function arcEnvironmentForChainId(chainId: number): ArcEnvironment {
92
+ const env = ARC_ENVIRONMENTS.find((candidate) => ARC_CHAINS[candidate].id === chainId)
93
+ if (!env) {
94
+ throw new Error(
95
+ `chain id ${chainId} is not an Arc chain: expected ${ARC_TESTNET_CHAIN_ID} (testnet) or ${ARC_MAINNET_CHAIN_ID} (mainnet)`,
96
+ )
97
+ }
98
+ return env
99
+ }
100
+
101
+ export function assertArcChainId(env: ArcEnvironment, rpcChainId: number): void {
102
+ const expected = getArcChain(env).id
103
+ if (rpcChainId !== expected) {
104
+ throw new Error(
105
+ `ARC_RPC_URL serves chain id ${rpcChainId}, but ARC_ENVIRONMENT=${env} expects chain id ${expected}`,
106
+ )
107
+ }
66
108
  }
67
109
 
68
110
  export function isArcChain(chainId: number): boolean {