{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/xlm/types.ts"],"names":[],"mappings":";;;AAAA,2DAAiD;AAEjD,uDAAwE;AACxE,2CAAgD;AAEhD,0CAIgB;AAEhB;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAEhF;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;AACrC,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAEY,QAAA,gBAAgB,GAAG,IAAA,sBAAM,EAAC;IACrC,GAAG,0BAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAC1C;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,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"]}