{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/xlm/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gCAAgC;AAEjD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,8BAA8B;AACxE,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAEhD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,yBAAe;AAEhB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;AACrC,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;IACrC,GAAG,oBAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;IAC1C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import { object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n  CaipChainIdStruct,\n  KeyringAccountStruct,\n  XlmAccountType,\n} from '../api';\n\n/**\n * Stellar account addresses use strkey encoding: non-muxed accounts start with `G`\n * and are 56 characters long.\n *\n * TODO: Add checksum validation.\n */\nexport const XlmAddressStruct = definePattern('XlmAddress', /^G[A-Z2-7]{55}$/u);\n\n/**\n * Supported Stellar methods.\n */\nexport enum XlmMethod {\n  SignMessage = 'signMessage',\n  SignTransaction = 'signTransaction',\n}\n\nexport const XlmAccountStruct = object({\n  ...KeyringAccountStruct.schema,\n  /**\n   * Account address.\n   */\n  address: XlmAddressStruct,\n  /**\n   * Account type.\n   */\n  type: literal(`${XlmAccountType.Account}`),\n  /**\n   * Account supported scopes (CAIP-2 chain IDs).\n   */\n  scopes: nonempty(array(CaipChainIdStruct)),\n  /**\n   * Account supported methods.\n   */\n  methods: array(enums(Object.values(XlmMethod))),\n});\n\nexport type XlmAccount = Infer<typeof XlmAccountStruct>;\n"]}