Repository Public
1// Maya Protocol (MAYAChain) native cross-chain swaps — price discovery only (docs/swap/providers/maya.md).2// MAYAChain is a THORChain fork: same quote endpoint shape, same 1e8 fixed point, same memo grammar. The engine lives in3// thorchain.ts; this file holds what differs, verified live on 2026-11-10 against MAYANode 1.135.4:4// - endpoints under /mayachain, errors answered as HTTP 200 `{ "error": … }`5// - its own pools (BTC, ETH, Arbitrum for the chains the wallet has; DASH, ZEC, ADA, RUNE, CACAO have no wallet network)6// - streaming swaps exist only when asked for (no advanced swap queue): every quote asks for `streaming_interval=3&streaming_quantity=0`7// - the memo limit is checked against the swap output BEFORE the outbound fee (x/mayachain/swap_current.go), while the8// quote derives it from the amount AFTER that fee: the recipient's real floor is limit − outbound fee, and that is what9// this adapter reports as `minAmountOut`.10import type { SwapProvider } from '../types.ts';11import type { ProviderEnv } from './index.ts';12import { createNativeSwapProvider, type NativeSwapConfig } from './thorchain.ts';1314/** Public MAYANode listed by the official docs (https://docs.mayaprotocol.com/mayachain-dev-docs/concepts/connecting-to-mayachain). */15export const MAYA_API = 'https://mayanode.mayachain.info/mayachain';16export const MAYA_API_VERSION = '1.135.4'; // /mayachain/version on 2026-11-1017/** Blocks between sub-swaps requested for every quote (the value used in the protocol's own streaming examples is a free choice; 3 ≈ 18 s). */18export const MAYA_STREAMING_INTERVAL = 3;1920export const MAYA_CONFIG: NativeSwapConfig = {21 id: 'maya', name: 'Maya Protocol', docs: 'https://docs.mayaprotocol.com/mayachain-dev-docs/introduction/swapping-guide/quickstart-guide', api: MAYA_API,22 chains: { BTC: 'bitcoin', ETH: 'ethereum', ARB: 'arbitrum' },23 // GET /mayachain/pools on 2026-11-10, status "Available", on a chain the wallet has. Staged pools (ETH.PEPE, ARB.ARB, ARB.DAI…) are not listed.24 pools: [25 'BTC.BTC', 'ETH.ETH', 'ARB.ETH',26 'ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48', 'ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7',27 'ARB.USDC-0XAF88D065E77C8CC2239327C5EDB3A432268E5831', 'ARB.USDT-0XFD086BC7CD5C481DCC9C85EBE478A1C0B69FCBB9',28 'ARB.WBTC-0X2F2A2543B76A4166549F7AAB2E75BEF0AEFC5B0F',29 'ETH.WSTETH-0X7F39C581F595B53C5CB19BD0B3F8DA6C935E2CA0', 'ARB.WSTETH-0X5979D7B546E38E414F7E9822514BE443A4800529', // wstETH, in the registry since v530 ],31 // short codes MAYANode writes in quote memos (observed live; common/asset.go)32 shortCodes: { b: 'BTC.BTC', e: 'ETH.ETH', a: 'ARB.ETH' },33 // `router` in GET /mayachain/inbound_addresses, identical on mayanode.mayachain.info and api-maya.liquify.com on 2026-11-1034 routers: {35 ethereum: '0xe3985E6b61b814F7Cdb188766562ba71b446B46d',36 arbitrum: '0x700E97ef07219440487840Dc472E7120A7FF11F4',37 },38 streaming: { interval: MAYA_STREAMING_INTERVAL },39 limitIsNetOfOutboundFee: false,40};4142export function createMayaProvider(_env: ProviderEnv = {}): SwapProvider {43 return createNativeSwapProvider(MAYA_CONFIG);44}45