@metamask/snaps-utils
Version:
A collection of utilities for MetaMask Snaps
1 lines • 1.59 kB
Source Map (JSON)
{"version":3,"file":"name-lookup.mjs","sourceRoot":"","sources":["../../src/handlers/name-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,MAAM,EACN,KAAK,EACN,8BAA8B;AAE/B,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAC5C,QAAQ,EAAE,MAAM,EAAE;IAClB,cAAc,EAAE,MAAM,EAAE;CACzB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,QAAQ,EAAE,MAAM,EAAE;IAClB,eAAe,EAAE,MAAM,EAAE;IACzB,UAAU,EAAE,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;IACpD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACnE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;IACnD,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACpE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAChD,KAAK,CAAC,CAAC,+BAA+B,EAAE,8BAA8B,CAAC,CAAC,CACzE,CAAC","sourcesContent":["import {\n array,\n nullable,\n object,\n size,\n string,\n union,\n} from '@metamask/superstruct';\n\nexport const AddressResolutionStruct = object({\n protocol: string(),\n resolvedDomain: string(),\n});\n\nexport const DomainResolutionStruct = object({\n protocol: string(),\n resolvedAddress: string(),\n domainName: string(),\n});\n\nexport const AddressResolutionResponseStruct = object({\n resolvedDomains: size(array(AddressResolutionStruct), 1, Infinity),\n});\n\nexport const DomainResolutionResponseStruct = object({\n resolvedAddresses: size(array(DomainResolutionStruct), 1, Infinity),\n});\n\nexport const OnNameLookupResponseStruct = nullable(\n union([AddressResolutionResponseStruct, DomainResolutionResponseStruct]),\n);\n"]}