UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

1 lines 853 B
{"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/utils/account.ts"],"names":[],"mappings":";;;AAIO,MAAM,wBAAwB,GAAG,CACtC,OAA0B,EAC1B,MAAc,EACd,EAAE;IACF,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,OAAO;YACL,GAAG,OAAO;YACV,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE;YACR,IAAI,EAAE;gBACJ,EAAE,EAAE,MAAM;aACX;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,wBAAwB,4BAmBnC","sourcesContent":["import type { SnapId } from '@metamask/snaps-sdk';\n\nimport type { SimulationAccount } from '../options';\n\nexport const addSnapMetadataToAccount = (\n account: SimulationAccount,\n snapId: SnapId,\n) => {\n if (!account.owned) {\n return {\n ...account,\n metadata: {},\n };\n }\n\n return {\n ...account,\n metadata: {\n snap: {\n id: snapId,\n },\n },\n };\n};\n"]}