@ledgerhq/context-module 0.0.0-fix-rn-ble-20250502084951 → 0.0.0-hid-candidate-20250523130730

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/cjs/package.json +12 -12
  2. package/lib/cjs/src/config/di/configModuleFactory.js +1 -1
  3. package/lib/cjs/src/config/di/configModuleFactory.js.map +3 -3
  4. package/lib/cjs/src/di.js +1 -1
  5. package/lib/cjs/src/di.js.map +2 -2
  6. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +1 -1
  7. package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +3 -3
  8. package/lib/cjs/src/nft/di/nftModuleFactory.js +1 -1
  9. package/lib/cjs/src/nft/di/nftModuleFactory.js.map +3 -3
  10. package/lib/cjs/src/pki/di/pkiModuleFactory.js +1 -1
  11. package/lib/cjs/src/pki/di/pkiModuleFactory.js.map +3 -3
  12. package/lib/cjs/src/token/di/tokenModuleFactory.js +1 -1
  13. package/lib/cjs/src/token/di/tokenModuleFactory.js.map +3 -3
  14. package/lib/cjs/src/transaction/di/transactionModuleFactory.js +1 -1
  15. package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +3 -3
  16. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +1 -1
  17. package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +3 -3
  18. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +1 -1
  19. package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +3 -3
  20. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js +1 -1
  21. package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js.map +3 -3
  22. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js +1 -1
  23. package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js.map +2 -2
  24. package/lib/cjs/src/web3-check/di/web3CheckModuleFactory.js +1 -1
  25. package/lib/cjs/src/web3-check/di/web3CheckModuleFactory.js.map +3 -3
  26. package/lib/esm/package.json +12 -12
  27. package/lib/esm/src/config/di/configModuleFactory.js +1 -1
  28. package/lib/esm/src/config/di/configModuleFactory.js.map +3 -3
  29. package/lib/esm/src/di.js +1 -1
  30. package/lib/esm/src/di.js.map +2 -2
  31. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +1 -1
  32. package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +3 -3
  33. package/lib/esm/src/nft/di/nftModuleFactory.js +1 -1
  34. package/lib/esm/src/nft/di/nftModuleFactory.js.map +3 -3
  35. package/lib/esm/src/pki/di/pkiModuleFactory.js +1 -1
  36. package/lib/esm/src/pki/di/pkiModuleFactory.js.map +3 -3
  37. package/lib/esm/src/token/di/tokenModuleFactory.js +1 -1
  38. package/lib/esm/src/token/di/tokenModuleFactory.js.map +3 -3
  39. package/lib/esm/src/transaction/di/transactionModuleFactory.js +1 -1
  40. package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +3 -3
  41. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +1 -1
  42. package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +3 -3
  43. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +1 -1
  44. package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +3 -3
  45. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js +1 -1
  46. package/lib/esm/src/uniswap/di/uniswapModuleFactory.js.map +3 -3
  47. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js +1 -1
  48. package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js.map +2 -2
  49. package/lib/esm/src/web3-check/di/web3CheckModuleFactory.js +1 -1
  50. package/lib/esm/src/web3-check/di/web3CheckModuleFactory.js.map +3 -3
  51. package/lib/types/src/config/di/configModuleFactory.d.ts.map +1 -1
  52. package/lib/types/src/di.d.ts.map +1 -1
  53. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -1
  54. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  55. package/package.json +13 -13
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/context-module",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
@@ -20,9 +20,9 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "prebuild": "rimraf lib",
23
- "build": "pnpm lmdk-build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
23
+ "build": "pnpm ldmk-tool build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
24
24
  "dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
25
- "watch:builds": "pnpm lmdk-watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
25
+ "watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
26
26
  "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
27
27
  "lint": "eslint",
28
28
  "lint:fix": "pnpm lint --fix",
@@ -36,21 +36,21 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@ledgerhq/device-management-kit": "workspace:*",
39
- "@ledgerhq/esbuild-tools": "workspace:*",
39
+ "@ledgerhq/ldmk-tool": "workspace:*",
40
40
  "@ledgerhq/eslint-config-dsdk": "workspace:*",
41
41
  "@ledgerhq/prettier-config-dsdk": "workspace:*",
42
42
  "@ledgerhq/tsconfig-dsdk": "workspace:*",
43
43
  "@ledgerhq/vitest-config-dmk": "workspace:*",
44
- "@types/crypto-js": "^4.2.2",
45
- "ts-node": "^10.9.2"
44
+ "@types/crypto-js": "catalog:",
45
+ "ts-node": "catalog:"
46
46
  },
47
47
  "dependencies": {
48
- "axios": "^1.8.2",
49
- "crypto-js": "^4.2.0",
50
- "ethers": "6.13.4",
51
- "inversify": "^6.2.2",
52
- "purify-ts": "^2.1.0",
53
- "reflect-metadata": "^0.2.2"
48
+ "axios": "catalog:",
49
+ "crypto-js": "catalog:",
50
+ "ethers": "catalog:",
51
+ "inversify": "catalog:",
52
+ "purify-ts": "catalog:",
53
+ "reflect-metadata": "catalog:"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@ledgerhq/device-management-kit": "workspace:*"
@@ -1,2 +1,2 @@
1
- "use strict";var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(n,o)=>{for(var e in o)r(n,e,{get:o[e],enumerable:!0})},m=(n,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of u(o))!g.call(n,t)&&t!==e&&r(n,t,{get:()=>o[t],enumerable:!(i=d(o,t))||i.enumerable});return n};var p=n=>m(r({},"__esModule",{value:!0}),n);var a={};l(a,{configModuleFactory:()=>M});module.exports=p(a);var f=require("inversify"),C=require("./configTypes");const M=n=>new f.ContainerModule((o,e,i,t)=>{o(C.configTypes.Config).toConstantValue(n)});0&&(module.exports={configModuleFactory});
1
+ "use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(t,o)=>{for(var e in o)i(t,e,{get:o[e],enumerable:!0})},u=(t,o,e,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of l(o))!m.call(t,n)&&n!==e&&i(t,n,{get:()=>o[n],enumerable:!(f=g(o,n))||f.enumerable});return t};var d=t=>u(i({},"__esModule",{value:!0}),t);var a={};p(a,{configModuleFactory:()=>M});module.exports=d(a);var r=require("inversify"),C=require("./configTypes");const M=t=>new r.ContainerModule(({bind:o})=>{o(C.configTypes.Config).toConstantValue(t)});0&&(module.exports={configModuleFactory});
2
2
  //# sourceMappingURL=configModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/config/di/configModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAIhCC,EAA4B,yBAErB,MAAMH,EAAuBI,GAClC,IAAI,kBAAgB,CAACC,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAA0B,cAAY,MAAM,EAAE,gBAAgBD,CAAM,CACtE,CAAC",
6
- "names": ["configModuleFactory_exports", "__export", "configModuleFactory", "__toCommonJS", "import_inversify", "import_configTypes", "config", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule(({ bind }) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAIhCC,EAA4B,yBAErB,MAAMH,EAAuBI,GAClC,IAAI,kBAAgB,CAAC,CAAE,KAAAC,CAAK,IAAM,CAChCA,EAA0B,cAAY,MAAM,EAAE,gBAAgBD,CAAM,CACtE,CAAC",
6
+ "names": ["configModuleFactory_exports", "__export", "configModuleFactory", "__toCommonJS", "import_inversify", "import_configTypes", "config", "bind"]
7
7
  }
package/lib/cjs/src/di.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var k=(r,o)=>{for(var e in o)n(r,e,{get:o[e],enumerable:!0})},x=(r,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of g(o))!s.call(r,t)&&t!==e&&n(r,t,{get:()=>o[t],enumerable:!(a=C(o,t))||a.enumerable});return r};var w=r=>x(n({},"__esModule",{value:!0}),r);var P={};k(P,{makeContainer:()=>A});module.exports=w(P);var m=require("inversify"),i=require("./config/di/configModuleFactory"),c=require("./external-plugin/di/externalPluginModuleFactory"),f=require("./nft/di/nftModuleFactory"),p=require("./pki/di/pkiModuleFactory"),u=require("./token/di/tokenModuleFactory"),d=require("./transaction/di/transactionModuleFactory"),l=require("./trusted-name/di/trustedNameModuleFactory"),M=require("./typed-data/di/typedDataModuleFactory"),y=require("./uniswap/di/uniswapModuleFactory"),F=require("./web3-check/di/web3CheckModuleFactory");const A=({config:r})=>{const o=new m.Container;return o.load((0,i.configModuleFactory)(r),(0,c.externalPluginModuleFactory)(),(0,f.nftModuleFactory)(),(0,u.tokenModuleFactory)(),(0,d.transactionModuleFactory)(),(0,l.trustedNameModuleFactory)(),(0,M.typedDataModuleFactory)(),(0,p.nanoPkiModuleFactory)(),(0,y.uniswapModuleFactory)(),(0,F.web3CheckModuleFactory)()),o};0&&(module.exports={makeContainer});
1
+ "use strict";var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var k=(r,o)=>{for(var e in o)n(r,e,{get:o[e],enumerable:!0})},x=(r,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of g(o))!s.call(r,t)&&t!==e&&n(r,t,{get:()=>o[t],enumerable:!(a=C(o,t))||a.enumerable});return r};var w=r=>x(n({},"__esModule",{value:!0}),r);var P={};k(P,{makeContainer:()=>A});module.exports=w(P);var m=require("inversify"),i=require("./config/di/configModuleFactory"),c=require("./external-plugin/di/externalPluginModuleFactory"),f=require("./nft/di/nftModuleFactory"),p=require("./pki/di/pkiModuleFactory"),u=require("./token/di/tokenModuleFactory"),d=require("./transaction/di/transactionModuleFactory"),l=require("./trusted-name/di/trustedNameModuleFactory"),y=require("./typed-data/di/typedDataModuleFactory"),M=require("./uniswap/di/uniswapModuleFactory"),F=require("./web3-check/di/web3CheckModuleFactory");const A=({config:r})=>{const o=new m.Container;return o.loadSync((0,i.configModuleFactory)(r),(0,c.externalPluginModuleFactory)(),(0,f.nftModuleFactory)(),(0,u.tokenModuleFactory)(),(0,d.transactionModuleFactory)(),(0,l.trustedNameModuleFactory)(),(0,y.typedDataModuleFactory)(),(0,p.nanoPkiModuleFactory)(),(0,M.uniswapModuleFactory)(),(0,F.web3CheckModuleFactory)()),o};0&&(module.exports={makeContainer});
2
2
  //# sourceMappingURL=di.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/di.ts"],
4
- "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/pki/di/pkiModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionModuleFactory } from \"@/transaction/di/transactionModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/uniswap/di/uniswapModuleFactory\";\nimport { web3CheckModuleFactory } from \"@/web3-check/di/web3CheckModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.load(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n transactionModuleFactory(),\n trustedNameModuleFactory(),\n typedDataModuleFactory(),\n nanoPkiModuleFactory(),\n uniswapModuleFactory(),\n web3CheckModuleFactory(),\n );\n\n return container;\n};\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0B,qBAE1BC,EAAoC,2CAEpCC,EAA4C,4DAC5CC,EAAiC,qCACjCC,EAAqC,qCACrCC,EAAmC,yCACnCC,EAAyC,qDACzCC,EAAyC,sDACzCC,EAAuC,kDACvCC,EAAqC,6CACrCC,EAAuC,kDAMhC,MAAMZ,EAAgB,CAAC,CAAE,OAAAa,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAI,YAEtB,OAAAA,EAAU,QACR,uBAAoBD,CAAM,KAC1B,+BAA4B,KAC5B,oBAAiB,KACjB,sBAAmB,KACnB,4BAAyB,KACzB,4BAAyB,KACzB,0BAAuB,KACvB,wBAAqB,KACrB,wBAAqB,KACrB,0BAAuB,CACzB,EAEOC,CACT",
4
+ "sourcesContent": ["import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/pki/di/pkiModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionModuleFactory } from \"@/transaction/di/transactionModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/uniswap/di/uniswapModuleFactory\";\nimport { web3CheckModuleFactory } from \"@/web3-check/di/web3CheckModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.loadSync(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n transactionModuleFactory(),\n trustedNameModuleFactory(),\n typedDataModuleFactory(),\n nanoPkiModuleFactory(),\n uniswapModuleFactory(),\n web3CheckModuleFactory(),\n );\n\n return container;\n};\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0B,qBAE1BC,EAAoC,2CAEpCC,EAA4C,4DAC5CC,EAAiC,qCACjCC,EAAqC,qCACrCC,EAAmC,yCACnCC,EAAyC,qDACzCC,EAAyC,sDACzCC,EAAuC,kDACvCC,EAAqC,6CACrCC,EAAuC,kDAMhC,MAAMZ,EAAgB,CAAC,CAAE,OAAAa,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAI,YAEtB,OAAAA,EAAU,YACR,uBAAoBD,CAAM,KAC1B,+BAA4B,KAC5B,oBAAiB,KACjB,sBAAmB,KACnB,4BAAyB,KACzB,4BAAyB,KACzB,0BAAuB,KACvB,wBAAqB,KACrB,wBAAqB,KACrB,0BAAuB,CACzB,EAEOC,CACT",
6
6
  "names": ["di_exports", "__export", "makeContainer", "__toCommonJS", "import_inversify", "import_configModuleFactory", "import_externalPluginModuleFactory", "import_nftModuleFactory", "import_pkiModuleFactory", "import_tokenModuleFactory", "import_transactionModuleFactory", "import_trustedNameModuleFactory", "import_typedDataModuleFactory", "import_uniswapModuleFactory", "import_web3CheckModuleFactory", "config", "container"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var g=(t,o)=>{for(var r in o)a(t,r,{get:o[r],enumerable:!0})},P=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of p(o))!d.call(t,e)&&e!==r&&a(t,e,{get:()=>o[e],enumerable:!(n=m(o,e))||n.enumerable});return t};var c=t=>P(a({},"__esModule",{value:!0}),t);var E={};g(E,{externalPluginModuleFactory:()=>f});module.exports=c(E);var i=require("inversify"),u=require("../../external-plugin/data/HttpExternalPluginDataSource"),l=require("../../external-plugin/di/externalPluginTypes"),x=require("../../external-plugin/domain/ExternalPluginContextLoader");const f=()=>new i.ContainerModule((t,o,r,n)=>{t(l.externalPluginTypes.ExternalPluginDataSource).to(u.HttpExternalPluginDataSource),t(l.externalPluginTypes.ExternalPluginContextLoader).to(x.ExternalPluginContextLoader)});0&&(module.exports={externalPluginModuleFactory});
1
+ "use strict";var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var P=(t,o)=>{for(var e in o)n(t,e,{get:o[e],enumerable:!0})},c=(t,o,e,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of p(o))!g.call(t,r)&&r!==e&&n(t,r,{get:()=>o[r],enumerable:!(l=m(o,r))||l.enumerable});return t};var f=t=>c(n({},"__esModule",{value:!0}),t);var d={};P(d,{externalPluginModuleFactory:()=>E});module.exports=f(d);var i=require("inversify"),u=require("../../external-plugin/data/HttpExternalPluginDataSource"),a=require("../../external-plugin/di/externalPluginTypes"),x=require("../../external-plugin/domain/ExternalPluginContextLoader");const E=()=>new i.ContainerModule(({bind:t})=>{t(a.externalPluginTypes.ExternalPluginDataSource).to(u.HttpExternalPluginDataSource),t(a.externalPluginTypes.ExternalPluginContextLoader).to(x.ExternalPluginContextLoader)});0&&(module.exports={externalPluginModuleFactory});
2
2
  //# sourceMappingURL=externalPluginModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/external-plugin/di/externalPluginModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpExternalPluginDataSource } from \"@/external-plugin/data/HttpExternalPluginDataSource\";\nimport { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { ExternalPluginContextLoader } from \"@/external-plugin/domain/ExternalPluginContextLoader\";\n\nexport const externalPluginModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(externalPluginTypes.ExternalPluginDataSource).to(\n HttpExternalPluginDataSource,\n );\n bind(externalPluginTypes.ExternalPluginContextLoader).to(\n ExternalPluginContextLoader,\n );\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6C,+DAC7CC,EAAoC,oDACpCC,EAA4C,gEAErC,MAAML,EAA8B,IACzC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,sBAAoB,wBAAwB,EAAE,GACjD,8BACF,EACAA,EAAK,sBAAoB,2BAA2B,EAAE,GACpD,6BACF,CACF,CAAC",
6
- "names": ["externalPluginModuleFactory_exports", "__export", "externalPluginModuleFactory", "__toCommonJS", "import_inversify", "import_HttpExternalPluginDataSource", "import_externalPluginTypes", "import_ExternalPluginContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpExternalPluginDataSource } from \"@/external-plugin/data/HttpExternalPluginDataSource\";\nimport { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { ExternalPluginContextLoader } from \"@/external-plugin/domain/ExternalPluginContextLoader\";\n\nexport const externalPluginModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(externalPluginTypes.ExternalPluginDataSource).to(\n HttpExternalPluginDataSource,\n );\n bind(externalPluginTypes.ExternalPluginContextLoader).to(\n ExternalPluginContextLoader,\n );\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6C,+DAC7CC,EAAoC,oDACpCC,EAA4C,gEAErC,MAAML,EAA8B,IACzC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,sBAAoB,wBAAwB,EAAE,GACjD,8BACF,EACAA,EAAK,sBAAoB,2BAA2B,EAAE,GACpD,6BACF,CACF,CAAC",
6
+ "names": ["externalPluginModuleFactory_exports", "__export", "externalPluginModuleFactory", "__toCommonJS", "import_inversify", "import_HttpExternalPluginDataSource", "import_externalPluginTypes", "import_ExternalPluginContextLoader", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var N=(t,o)=>{for(var r in o)f(t,r,{get:o[r],enumerable:!0})},s=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of u(o))!c.call(t,e)&&e!==r&&f(t,e,{get:()=>o[e],enumerable:!(n=d(o,e))||n.enumerable});return t};var x=t=>s(f({},"__esModule",{value:!0}),t);var _={};N(_,{nftModuleFactory:()=>C});module.exports=x(_);var m=require("inversify"),i=require("../../nft/data/HttpNftDataSource"),a=require("../../nft/di/nftTypes"),p=require("../../nft/domain/NftContextLoader");const C=()=>new m.ContainerModule((t,o,r,n)=>{t(a.nftTypes.NftDataSource).to(i.HttpNftDataSource),t(a.nftTypes.NftContextLoader).to(p.NftContextLoader)});0&&(module.exports={nftModuleFactory});
1
+ "use strict";var f=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var d=(t,o)=>{for(var e in o)f(t,e,{get:o[e],enumerable:!0})},x=(t,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of u(o))!N.call(t,r)&&r!==e&&f(t,r,{get:()=>o[r],enumerable:!(m=i(o,r))||m.enumerable});return t};var C=t=>x(f({},"__esModule",{value:!0}),t);var s={};d(s,{nftModuleFactory:()=>l});module.exports=C(s);var n=require("inversify"),p=require("../../nft/data/HttpNftDataSource"),a=require("../../nft/di/nftTypes"),c=require("../../nft/domain/NftContextLoader");const l=()=>new n.ContainerModule(({bind:t})=>{t(a.nftTypes.NftDataSource).to(p.HttpNftDataSource),t(a.nftTypes.NftContextLoader).to(c.NftContextLoader)});0&&(module.exports={nftModuleFactory});
2
2
  //# sourceMappingURL=nftModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/nft/di/nftModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpNftDataSource } from \"@/nft/data/HttpNftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\n\nexport const nftModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(nftTypes.NftDataSource).to(HttpNftDataSource);\n bind(nftTypes.NftContextLoader).to(NftContextLoader);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAkC,wCAClCC,EAAyB,6BACzBC,EAAiC,yCAE1B,MAAML,EAAmB,IAC9B,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,WAAS,aAAa,EAAE,GAAG,mBAAiB,EACjDA,EAAK,WAAS,gBAAgB,EAAE,GAAG,kBAAgB,CACrD,CAAC",
6
- "names": ["nftModuleFactory_exports", "__export", "nftModuleFactory", "__toCommonJS", "import_inversify", "import_HttpNftDataSource", "import_nftTypes", "import_NftContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpNftDataSource } from \"@/nft/data/HttpNftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\n\nexport const nftModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(nftTypes.NftDataSource).to(HttpNftDataSource);\n bind(nftTypes.NftContextLoader).to(NftContextLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAkC,wCAClCC,EAAyB,6BACzBC,EAAiC,yCAE1B,MAAML,EAAmB,IAC9B,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,WAAS,aAAa,EAAE,GAAG,mBAAiB,EACjDA,EAAK,WAAS,gBAAgB,EAAE,GAAG,kBAAgB,CACrD,CAAC",
6
+ "names": ["nftModuleFactory_exports", "__export", "nftModuleFactory", "__toCommonJS", "import_inversify", "import_HttpNftDataSource", "import_nftTypes", "import_NftContextLoader", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var k=(t,o)=>{for(var i in o)a(t,i,{get:o[i],enumerable:!0})},C=(t,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of u(o))!d.call(t,e)&&e!==i&&a(t,e,{get:()=>o[e],enumerable:!(r=p(o,e))||r.enumerable});return t};var P=t=>C(a({},"__esModule",{value:!0}),t);var s={};k(s,{nanoPkiModuleFactory:()=>l});module.exports=P(s);var n=require("inversify"),c=require("../../pki/data/HttpPkiCertificateDataSource"),m=require("../../pki/domain/DefaultPkiCertificateLoader"),f=require("./pkiTypes");const l=()=>new n.ContainerModule((t,o,i,r)=>{t(f.pkiTypes.PkiCertificateDataSource).to(c.HttpPkiCertificateDataSource),t(f.pkiTypes.PkiCertificateLoader).to(m.DefaultPkiCertificateLoader)});0&&(module.exports={nanoPkiModuleFactory});
1
+ "use strict";var i=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var C=(t,o)=>{for(var r in o)i(t,r,{get:o[r],enumerable:!0})},P=(t,o,r,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of n(o))!u.call(t,e)&&e!==r&&i(t,e,{get:()=>o[e],enumerable:!(f=k(o,e))||f.enumerable});return t};var d=t=>P(i({},"__esModule",{value:!0}),t);var D={};C(D,{nanoPkiModuleFactory:()=>l});module.exports=d(D);var c=require("inversify"),m=require("../../pki/data/HttpPkiCertificateDataSource"),p=require("../../pki/domain/DefaultPkiCertificateLoader"),a=require("./pkiTypes");const l=()=>new c.ContainerModule(({bind:t})=>{t(a.pkiTypes.PkiCertificateDataSource).to(m.HttpPkiCertificateDataSource),t(a.pkiTypes.PkiCertificateLoader).to(p.DefaultPkiCertificateLoader)});0&&(module.exports={nanoPkiModuleFactory});
2
2
  //# sourceMappingURL=pkiModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/pki/di/pkiModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpPkiCertificateDataSource } from \"@/pki/data/HttpPkiCertificateDataSource\";\nimport { DefaultPkiCertificateLoader } from \"@/pki/domain/DefaultPkiCertificateLoader\";\n\nimport { pkiTypes } from \"./pkiTypes\";\n\nexport const nanoPkiModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(pkiTypes.PkiCertificateDataSource).to(HttpPkiCertificateDataSource);\n bind(pkiTypes.PkiCertificateLoader).to(DefaultPkiCertificateLoader);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6C,mDAC7CC,EAA4C,oDAE5CC,EAAyB,sBAElB,MAAML,EAAuB,IAClC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,WAAS,wBAAwB,EAAE,GAAG,8BAA4B,EACvEA,EAAK,WAAS,oBAAoB,EAAE,GAAG,6BAA2B,CACpE,CAAC",
6
- "names": ["pkiModuleFactory_exports", "__export", "nanoPkiModuleFactory", "__toCommonJS", "import_inversify", "import_HttpPkiCertificateDataSource", "import_DefaultPkiCertificateLoader", "import_pkiTypes", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpPkiCertificateDataSource } from \"@/pki/data/HttpPkiCertificateDataSource\";\nimport { DefaultPkiCertificateLoader } from \"@/pki/domain/DefaultPkiCertificateLoader\";\n\nimport { pkiTypes } from \"./pkiTypes\";\n\nexport const nanoPkiModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(pkiTypes.PkiCertificateDataSource).to(HttpPkiCertificateDataSource);\n bind(pkiTypes.PkiCertificateLoader).to(DefaultPkiCertificateLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA6C,mDAC7CC,EAA4C,oDAE5CC,EAAyB,sBAElB,MAAML,EAAuB,IAClC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,WAAS,wBAAwB,EAAE,GAAG,8BAA4B,EACvEA,EAAK,WAAS,oBAAoB,EAAE,GAAG,6BAA2B,CACpE,CAAC",
6
+ "names": ["pkiModuleFactory_exports", "__export", "nanoPkiModuleFactory", "__toCommonJS", "import_inversify", "import_HttpPkiCertificateDataSource", "import_DefaultPkiCertificateLoader", "import_pkiTypes", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(o,t)=>{for(var e in t)a(o,e,{get:t[e],enumerable:!0})},f=(o,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!T.call(o,r)&&r!==e&&a(o,r,{get:()=>t[r],enumerable:!(n=k(t,r))||n.enumerable});return o};var s=o=>f(a({},"__esModule",{value:!0}),o);var C={};c(C,{tokenModuleFactory:()=>x});module.exports=s(C);var i=require("inversify"),p=require("../../token/data/HttpTokenDataSource"),m=require("../../token/di/tokenTypes"),d=require("../../token/domain/TokenContextLoader");const x=()=>new i.ContainerModule((o,t,e,n)=>{o(m.tokenTypes.TokenDataSource).to(p.HttpTokenDataSource),o(m.tokenTypes.TokenContextLoader).to(d.TokenContextLoader)});0&&(module.exports={tokenModuleFactory});
1
+ "use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var u=(o,t)=>{for(var r in t)n(o,r,{get:t[r],enumerable:!0})},d=(o,t,r,m)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of f(t))!i.call(o,e)&&e!==r&&n(o,e,{get:()=>t[e],enumerable:!(m=c(t,e))||m.enumerable});return o};var x=o=>d(n({},"__esModule",{value:!0}),o);var l={};u(l,{tokenModuleFactory:()=>C});module.exports=x(l);var p=require("inversify"),k=require("../../token/data/HttpTokenDataSource"),a=require("../../token/di/tokenTypes"),T=require("../../token/domain/TokenContextLoader");const C=()=>new p.ContainerModule(({bind:o})=>{o(a.tokenTypes.TokenDataSource).to(k.HttpTokenDataSource),o(a.tokenTypes.TokenContextLoader).to(T.TokenContextLoader)});0&&(module.exports={tokenModuleFactory});
2
2
  //# sourceMappingURL=tokenModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/token/di/tokenModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTokenDataSource } from \"@/token/data/HttpTokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport { TokenContextLoader } from \"@/token/domain/TokenContextLoader\";\n\nexport const tokenModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(tokenTypes.TokenDataSource).to(HttpTokenDataSource);\n bind(tokenTypes.TokenContextLoader).to(TokenContextLoader);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAoC,4CACpCC,EAA2B,iCAC3BC,EAAmC,6CAE5B,MAAML,EAAqB,IAChC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,aAAW,eAAe,EAAE,GAAG,qBAAmB,EACvDA,EAAK,aAAW,kBAAkB,EAAE,GAAG,oBAAkB,CAC3D,CAAC",
6
- "names": ["tokenModuleFactory_exports", "__export", "tokenModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTokenDataSource", "import_tokenTypes", "import_TokenContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTokenDataSource } from \"@/token/data/HttpTokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport { TokenContextLoader } from \"@/token/domain/TokenContextLoader\";\n\nexport const tokenModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(tokenTypes.TokenDataSource).to(HttpTokenDataSource);\n bind(tokenTypes.TokenContextLoader).to(TokenContextLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAoC,4CACpCC,EAA2B,iCAC3BC,EAAmC,6CAE5B,MAAML,EAAqB,IAChC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,aAAW,eAAe,EAAE,GAAG,qBAAmB,EACvDA,EAAK,aAAW,kBAAkB,EAAE,GAAG,oBAAkB,CAC3D,CAAC",
6
+ "names": ["tokenModuleFactory_exports", "__export", "tokenModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTokenDataSource", "import_tokenTypes", "import_TokenContextLoader", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var e=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var T=(o,t)=>{for(var r in t)e(o,r,{get:t[r],enumerable:!0})},f=(o,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of d(t))!u.call(o,n)&&n!==r&&e(o,n,{get:()=>t[n],enumerable:!(a=p(t,n))||a.enumerable});return o};var x=o=>f(e({},"__esModule",{value:!0}),o);var _={};T(_,{transactionModuleFactory:()=>C});module.exports=x(_);var c=require("inversify"),s=require("../../transaction/data/HttpTransactionDataSource"),i=require("../../transaction/di/transactionTypes"),m=require("../../transaction/domain/TransactionContextLoader");const C=()=>new c.ContainerModule((o,t,r,a)=>{o(i.transactionTypes.TransactionDataSource).to(s.HttpTransactionDataSource),o(i.transactionTypes.TransactionContextLoader).to(m.TransactionContextLoader)});0&&(module.exports={transactionModuleFactory});
1
+ "use strict";var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(o,t)=>{for(var a in t)n(o,a,{get:t[a],enumerable:!0})},d=(o,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of T(t))!f.call(o,r)&&r!==a&&n(o,r,{get:()=>t[r],enumerable:!(c=p(t,r))||c.enumerable});return o};var x=o=>d(n({},"__esModule",{value:!0}),o);var l={};u(l,{transactionModuleFactory:()=>C});module.exports=x(l);var i=require("inversify"),m=require("../../transaction/data/HttpTransactionDataSource"),e=require("../../transaction/di/transactionTypes"),s=require("../../transaction/domain/TransactionContextLoader");const C=()=>new i.ContainerModule(({bind:o})=>{o(e.transactionTypes.TransactionDataSource).to(m.HttpTransactionDataSource),o(e.transactionTypes.TransactionContextLoader).to(s.TransactionContextLoader)});0&&(module.exports={transactionModuleFactory});
2
2
  //# sourceMappingURL=transactionModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/transaction/di/transactionModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTransactionDataSource } from \"@/transaction/data/HttpTransactionDataSource\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\nimport { TransactionContextLoader } from \"@/transaction/domain/TransactionContextLoader\";\n\nexport const transactionModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(transactionTypes.TransactionDataSource).to(HttpTransactionDataSource);\n bind(transactionTypes.TransactionContextLoader).to(\n TransactionContextLoader,\n );\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,wDAC1CC,EAAiC,6CACjCC,EAAyC,yDAElC,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,2BAAyB,EACzEA,EAAK,mBAAiB,wBAAwB,EAAE,GAC9C,0BACF,CACF,CAAC",
6
- "names": ["transactionModuleFactory_exports", "__export", "transactionModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTransactionDataSource", "import_transactionTypes", "import_TransactionContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTransactionDataSource } from \"@/transaction/data/HttpTransactionDataSource\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\nimport { TransactionContextLoader } from \"@/transaction/domain/TransactionContextLoader\";\n\nexport const transactionModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(transactionTypes.TransactionDataSource).to(HttpTransactionDataSource);\n bind(transactionTypes.TransactionContextLoader).to(\n TransactionContextLoader,\n );\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,wDAC1CC,EAAiC,6CACjCC,EAAyC,yDAElC,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,2BAAyB,EACzEA,EAAK,mBAAiB,wBAAwB,EAAE,GAC9C,0BACF,CACF,CAAC",
6
+ "names": ["transactionModuleFactory_exports", "__export", "transactionModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTransactionDataSource", "import_transactionTypes", "import_TransactionContextLoader", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var m=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var N=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)m(t,o,{get:e[o],enumerable:!0})},c=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!N.call(t,r)&&r!==o&&m(t,r,{get:()=>e[r],enumerable:!(a=i(e,r))||a.enumerable});return t};var f=t=>c(m({},"__esModule",{value:!0}),t);var C={};T(C,{trustedNameModuleFactory:()=>x});module.exports=f(C);var u=require("inversify"),n=require("../../trusted-name/data/HttpTrustedNameDataSource"),d=require("../../trusted-name/di/trustedNameTypes"),s=require("../../trusted-name/domain/TrustedNameContextLoader");const x=()=>new u.ContainerModule((t,e,o,a)=>{t(d.trustedNameTypes.TrustedNameDataSource).to(n.HttpTrustedNameDataSource),t(d.trustedNameTypes.TrustedNameContextLoader).to(s.TrustedNameContextLoader)});0&&(module.exports={trustedNameModuleFactory});
1
+ "use strict";var a=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},f=(t,e,r,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of n(e))!T.call(t,o)&&o!==r&&a(t,o,{get:()=>e[o],enumerable:!(u=N(e,o))||u.enumerable});return t};var i=t=>f(a({},"__esModule",{value:!0}),t);var C={};c(C,{trustedNameModuleFactory:()=>x});module.exports=i(C);var d=require("inversify"),s=require("../../trusted-name/data/HttpTrustedNameDataSource"),m=require("../../trusted-name/di/trustedNameTypes"),p=require("../../trusted-name/domain/TrustedNameContextLoader");const x=()=>new d.ContainerModule(({bind:t})=>{t(m.trustedNameTypes.TrustedNameDataSource).to(s.HttpTrustedNameDataSource),t(m.trustedNameTypes.TrustedNameContextLoader).to(p.TrustedNameContextLoader)});0&&(module.exports={trustedNameModuleFactory});
2
2
  //# sourceMappingURL=trustedNameModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/trusted-name/di/trustedNameModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\nexport const trustedNameModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(trustedNameTypes.TrustedNameDataSource).to(HttpTrustedNameDataSource);\n bind(trustedNameTypes.TrustedNameContextLoader).to(\n TrustedNameContextLoader,\n );\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,yDAC1CC,EAAiC,8CACjCC,EAAyC,0DAElC,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,2BAAyB,EACzEA,EAAK,mBAAiB,wBAAwB,EAAE,GAC9C,0BACF,CACF,CAAC",
6
- "names": ["trustedNameModuleFactory_exports", "__export", "trustedNameModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTrustedNameDataSource", "import_trustedNameTypes", "import_TrustedNameContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\nexport const trustedNameModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(trustedNameTypes.TrustedNameDataSource).to(HttpTrustedNameDataSource);\n bind(trustedNameTypes.TrustedNameContextLoader).to(\n TrustedNameContextLoader,\n );\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAA0C,yDAC1CC,EAAiC,8CACjCC,EAAyC,0DAElC,MAAML,EAA2B,IACtC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,mBAAiB,qBAAqB,EAAE,GAAG,2BAAyB,EACzEA,EAAK,mBAAiB,wBAAwB,EAAE,GAC9C,0BACF,CACF,CAAC",
6
+ "names": ["trustedNameModuleFactory_exports", "__export", "trustedNameModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTrustedNameDataSource", "import_trustedNameTypes", "import_TrustedNameContextLoader", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var f=(t,o)=>{for(var a in o)p(t,a,{get:o[a],enumerable:!0})},T=(t,o,a,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of i(o))!u.call(t,e)&&e!==a&&p(t,e,{get:()=>o[e],enumerable:!(r=y(o,e))||r.enumerable});return t};var c=t=>T(p({},"__esModule",{value:!0}),t);var s={};f(s,{typedDataModuleFactory:()=>l});module.exports=c(s);var n=require("inversify"),D=require("../../typed-data/data/HttpTypedDataDataSource"),d=require("../../typed-data/di/typedDataTypes"),m=require("../../typed-data/domain/DefaultTypedDataContextLoader");const l=()=>new n.ContainerModule((t,o,a,r)=>{t(d.typedDataTypes.TypedDataDataSource).to(D.HttpTypedDataDataSource),t(d.typedDataTypes.TypedDataContextLoader).to(m.DefaultTypedDataContextLoader)});0&&(module.exports={typedDataModuleFactory});
1
+ "use strict";var r=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var T=(t,o)=>{for(var e in o)r(t,e,{get:o[e],enumerable:!0})},c=(t,o,e,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of n(o))!u.call(t,a)&&a!==e&&r(t,a,{get:()=>o[a],enumerable:!(d=f(o,a))||d.enumerable});return t};var i=t=>c(r({},"__esModule",{value:!0}),t);var x={};T(x,{typedDataModuleFactory:()=>l});module.exports=i(x);var D=require("inversify"),m=require("../../typed-data/data/HttpTypedDataDataSource"),p=require("../../typed-data/di/typedDataTypes"),y=require("../../typed-data/domain/DefaultTypedDataContextLoader");const l=()=>new D.ContainerModule(({bind:t})=>{t(p.typedDataTypes.TypedDataDataSource).to(m.HttpTypedDataDataSource),t(p.typedDataTypes.TypedDataContextLoader).to(y.DefaultTypedDataContextLoader)});0&&(module.exports={typedDataModuleFactory});
2
2
  //# sourceMappingURL=typedDataModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/typed-data/di/typedDataModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTypedDataDataSource } from \"@/typed-data/data/HttpTypedDataDataSource\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\nexport const typedDataModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(typedDataTypes.TypedDataDataSource).to(HttpTypedDataDataSource);\n bind(typedDataTypes.TypedDataContextLoader).to(\n DefaultTypedDataContextLoader,\n );\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAwC,qDACxCC,EAA+B,0CAC/BC,EAA8C,6DAEvC,MAAML,EAAyB,IACpC,IAAI,kBAAgB,CAACM,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,iBAAe,mBAAmB,EAAE,GAAG,yBAAuB,EACnEA,EAAK,iBAAe,sBAAsB,EAAE,GAC1C,+BACF,CACF,CAAC",
6
- "names": ["typedDataModuleFactory_exports", "__export", "typedDataModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTypedDataDataSource", "import_typedDataTypes", "import_DefaultTypedDataContextLoader", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTypedDataDataSource } from \"@/typed-data/data/HttpTypedDataDataSource\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\nexport const typedDataModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(typedDataTypes.TypedDataDataSource).to(HttpTypedDataDataSource);\n bind(typedDataTypes.TypedDataContextLoader).to(\n DefaultTypedDataContextLoader,\n );\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAwC,qDACxCC,EAA+B,0CAC/BC,EAA8C,6DAEvC,MAAML,EAAyB,IACpC,IAAI,kBAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAK,iBAAe,mBAAmB,EAAE,GAAG,yBAAuB,EACnEA,EAAK,iBAAe,sBAAsB,EAAE,GAC1C,+BACF,CACF,CAAC",
6
+ "names": ["typedDataModuleFactory_exports", "__export", "typedDataModuleFactory", "__toCommonJS", "import_inversify", "import_HttpTypedDataDataSource", "import_typedDataTypes", "import_DefaultTypedDataContextLoader", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(o,e)=>{for(var r in e)n(o,r,{get:e[r],enumerable:!0})},w=(o,e,r,m)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of D(e))!s.call(o,t)&&t!==r&&n(o,t,{get:()=>e[t],enumerable:!(m=c(e,t))||m.enumerable});return o};var C=o=>w(n({},"__esModule",{value:!0}),o);var l={};f(l,{uniswapModuleFactory:()=>S});module.exports=C(l);var i=require("inversify"),d=require("../../uniswap/data/DefaultCommandDecoderDataSource"),p=require("../../uniswap/data/EthersAbiDecoderDataSource"),u=require("../../uniswap/domain/UniswapContextLoader"),a=require("./uniswapTypes");const S=()=>new i.ContainerModule((o,e,r,m)=>{o(a.uniswapTypes.AbiDecoderDataSource).to(p.EthersAbiDecoderDataSource),o(a.uniswapTypes.CommandDecoderDataSource).to(d.DefaultCommandDecoderDataSource),o(a.uniswapTypes.UniswapContextLoader).to(u.UniswapContextLoader)});0&&(module.exports={uniswapModuleFactory});
1
+ "use strict";var m=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var f=(o,e)=>{for(var t in e)m(o,t,{get:e[t],enumerable:!0})},w=(o,e,t,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!s.call(o,r)&&r!==t&&m(o,r,{get:()=>e[r],enumerable:!(p=D(e,r))||p.enumerable});return o};var C=o=>w(m({},"__esModule",{value:!0}),o);var l={};f(l,{uniswapModuleFactory:()=>S});module.exports=C(l);var c=require("inversify"),i=require("../../uniswap/data/DefaultCommandDecoderDataSource"),n=require("../../uniswap/data/EthersAbiDecoderDataSource"),u=require("../../uniswap/domain/UniswapContextLoader"),a=require("./uniswapTypes");const S=()=>new c.ContainerModule(({bind:o})=>{o(a.uniswapTypes.AbiDecoderDataSource).to(n.EthersAbiDecoderDataSource),o(a.uniswapTypes.CommandDecoderDataSource).to(i.DefaultCommandDecoderDataSource),o(a.uniswapTypes.UniswapContextLoader).to(u.UniswapContextLoader)});0&&(module.exports={uniswapModuleFactory});
2
2
  //# sourceMappingURL=uniswapModuleFactory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/uniswap/di/uniswapModuleFactory.ts"],
4
- "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { DefaultCommandDecoderDataSource } from \"@/uniswap/data/DefaultCommandDecoderDataSource\";\nimport { EthersAbiDecoderDataSource } from \"@/uniswap/data/EthersAbiDecoderDataSource\";\nimport { UniswapContextLoader } from \"@/uniswap/domain/UniswapContextLoader\";\n\nimport { uniswapTypes } from \"./uniswapTypes\";\n\nexport const uniswapModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(uniswapTypes.AbiDecoderDataSource).to(EthersAbiDecoderDataSource);\n bind(uniswapTypes.CommandDecoderDataSource).to(\n DefaultCommandDecoderDataSource,\n );\n bind(uniswapTypes.UniswapContextLoader).to(UniswapContextLoader);\n });\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAgD,0DAChDC,EAA2C,qDAC3CC,EAAqC,iDAErCC,EAA6B,0BAEtB,MAAMN,EAAuB,IAClC,IAAI,kBAAgB,CAACO,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAK,eAAa,oBAAoB,EAAE,GAAG,4BAA0B,EACrEA,EAAK,eAAa,wBAAwB,EAAE,GAC1C,iCACF,EACAA,EAAK,eAAa,oBAAoB,EAAE,GAAG,sBAAoB,CACjE,CAAC",
6
- "names": ["uniswapModuleFactory_exports", "__export", "uniswapModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultCommandDecoderDataSource", "import_EthersAbiDecoderDataSource", "import_UniswapContextLoader", "import_uniswapTypes", "bind", "_unbind", "_isBound", "_rebind"]
4
+ "sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { DefaultCommandDecoderDataSource } from \"@/uniswap/data/DefaultCommandDecoderDataSource\";\nimport { EthersAbiDecoderDataSource } from \"@/uniswap/data/EthersAbiDecoderDataSource\";\nimport { UniswapContextLoader } from \"@/uniswap/domain/UniswapContextLoader\";\n\nimport { uniswapTypes } from \"./uniswapTypes\";\n\nexport const uniswapModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(uniswapTypes.AbiDecoderDataSource).to(EthersAbiDecoderDataSource);\n bind(uniswapTypes.CommandDecoderDataSource).to(\n DefaultCommandDecoderDataSource,\n );\n bind(uniswapTypes.UniswapContextLoader).to(UniswapContextLoader);\n });\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAgC,qBAEhCC,EAAgD,0DAChDC,EAA2C,qDAC3CC,EAAqC,iDAErCC,EAA6B,0BAEtB,MAAMN,EAAuB,IAClC,IAAI,kBAAgB,CAAC,CAAE,KAAAO,CAAK,IAAM,CAChCA,EAAK,eAAa,oBAAoB,EAAE,GAAG,4BAA0B,EACrEA,EAAK,eAAa,wBAAwB,EAAE,GAC1C,iCACF,EACAA,EAAK,eAAa,oBAAoB,EAAE,GAAG,sBAAoB,CACjE,CAAC",
6
+ "names": ["uniswapModuleFactory_exports", "__export", "uniswapModuleFactory", "__toCommonJS", "import_inversify", "import_DefaultCommandDecoderDataSource", "import_EthersAbiDecoderDataSource", "import_UniswapContextLoader", "import_uniswapTypes", "bind"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var s=require("ethers"),r=require("purify-ts"),f=require("../../shared/model/ClearSignContext"),e=require("../../uniswap/constants/uniswap"),l=require("../../uniswap/data/DefaultCommandDecoderDataSource"),x=require("../../uniswap/data/EthersAbiDecoderDataSource"),p=require("./UniswapContextLoader");describe("UniswapContextLoader",()=>{const t={decode:vi.fn()},o={getTokenInfosPayload:vi.fn()};let c;describe("load",()=>{describe("with tokenDataSourceMock",()=>{beforeEach(()=>{vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve((0,r.Right)(`payload-${a}`))),c=new p.UniswapContextLoader(new l.DefaultCommandDecoderDataSource(new x.EthersAbiDecoderDataSource),o)}),it("should return the external plugin context and the decoded contexts",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4855b000000000000000000000000000000000000000000000000000000000000000300060c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000000b0b8122abd8412900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bb9f599ce614feb2e1bbe58f180f370d05b39344e002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000017cc6042605381c158d2adab487434bde79aa61c000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000b0b8122abd84129c001a053efc49d03b694742500f49aa09df2360bd7e297fa730c745e0d4320b42fc33fa01ca1c85a46c561f624830fffbae2441ba0f2d54eb5b0f17e0e3561d10db0b7ee"},n=await c.load(a);expect(n).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0xb9f599ce614feb2e1bbe58f180f370d05b39344e"},{type:"token",payload:"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}])}),it("should return the external plugin context and the decoded contexts with a permit",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000030a010c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000016000000000000000000000000055747be9f9f5beb232ad59fe7af013b81d95fd5e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000066c32b0d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000ef1c6e67703c7bd7107eed8303fbe6ec2554bf6b00000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000410d756f55acf289e9754faf91bba0a704b5c7c0aa4b1dfd551115ccbe4c7f290234e1a14265e1da0bc872a23627d997fe37a689c290d519f7b8c9bdde1b79108e1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000030ba49cbff5a00000000000000000000000000000000000000000000000089677c957272141800000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc200271055747be9f9f5beb232ad59fe7af013b81d95fd5e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000030ba49cbff5a000c001a0e406d9c91c8b46d959fcd31a28518a77bb248ebb316c5fab7b98335cce922f2aa0462cb970c32a8dbfe71c57b888c43b9ed04fce41d169dbfcc745445587adb771"},n=await c.load(a);expect(n).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"},{type:"token",payload:"payload-0x55747be9f9f5beb232ad59fe7af013b81d95fd5e"}])}),it("should return an empty array if the transaction is not supported",async()=>{const a={};vi.spyOn(t,"decode").mockReturnValue([]);const n=await c.load(a);expect(n).toEqual([])}),it("should return an empty array if a command is not supported",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4bef600000000000000000000000000000000000000000000000000000000000000050b0105040c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000078e6708e70aed0f000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000059a16770000000000000000000000000000000000000000000000000078e6708e70aed0f00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f4c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c4700000000000000000000000000000000000000000000000000000000003938700000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006f939b43d65be049b7533907db08e80ba6969f450000000000000000000000000000000000000000000000000000000059682f0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000006f939b43d65be049b7533907db08e80ba6969f4500000000000000000000000000000000000000000000000000000000000000000cc080a07c86dd5813ec1f3725c402f8bea6105546d1093c59676023b971f1d83f61bd4ea02a353bf3028cabcbe68c5dc8906752bafe55afc86b6344edb3ffd8a3650332e8"},n=await c.load(a);expect(n).toEqual([])})}),describe("with mocked ethers parseTransaction",()=>{beforeEach(()=>{vi.resetAllMocks(),c=new p.UniswapContextLoader(t,o)}),it("should return an array with contexts if 2 chain swaps are supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01","0x04","0x02"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x04",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x02",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(4,{address:"0x03",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0x01"},{type:"token",payload:"payload-0x04"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"}])}),it("should return an array with contexts if 1 chain swap with a non swap command",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0b0004",["0x0001","0x0002","0x0003"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x04"]),vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.WRAP_ETH,"0x0001",66),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x02",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x03",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(4,{address:"0x04",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0x01"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"},{type:"token",payload:"payload-0x04"}])}),it("should return an array with contexts if one token is not found",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01","0x02"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(o,"getTokenInfosPayload").mockResolvedValueOnce((0,r.Left)("error")),vi.spyOn(o,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x02",chainId:66}),expect(o.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x03",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"error",error:"error"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"}])}),it("should return an empty array if the if 2 chain swaps are not supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(t,"decode").mockReturnValueOnce(["0x01","0x02"]),vi.spyOn(t,"decode").mockReturnValueOnce(["0x03","0x04"]);const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])}),it("should return an empty array if no command are returned from parseTransaction",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:[""]});const n=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if no inputs are returned from parseTransaction",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x08",[]]});const n=await c.load(a);expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if parseTransaction throws an error",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockImplementation(()=>{throw new Error});const n=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if the swap is with multiple pool versions",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x080900",["0x00","0x01","0x02"]]}),vi.spyOn(t,"decode").mockReturnValue(["0x01","0x02"]);const d=await c.load(a);expect(t.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x00",66),expect(t.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x01",66),expect(t.decode).toHaveBeenNthCalledWith(3,e.UniswapSupportedCommand.V3_SWAP_EXACT_IN,"0x02",66),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])}),it("should return an empty array if the selector is not supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:"0x00000000",chainId:66},n=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if the length of the commands and inputs are different",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001"]]});const d=await c.load(a);expect(t.decode).not.toHaveBeenCalled(),expect(o.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])})})})});
1
+ "use strict";var s=require("ethers"),r=require("purify-ts"),f=require("../../shared/model/ClearSignContext"),e=require("../../uniswap/constants/uniswap"),p=require("../../uniswap/data/DefaultCommandDecoderDataSource"),x=require("../../uniswap/data/EthersAbiDecoderDataSource"),l=require("./UniswapContextLoader");describe("UniswapContextLoader",()=>{const o={decode:vi.fn()},t={getTokenInfosPayload:vi.fn()};let c;describe("load",()=>{describe("with tokenDataSourceMock",()=>{beforeEach(()=>{vi.spyOn(t,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve((0,r.Right)(`payload-${a}`))),c=new l.UniswapContextLoader(new p.DefaultCommandDecoderDataSource(new x.EthersAbiDecoderDataSource),t)}),it("should return the external plugin context and the decoded contexts",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4855b000000000000000000000000000000000000000000000000000000000000000300060c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000a18f07d736b90be5500000000000000000000000000000000000000000000000000000000b0b8122abd8412900000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bb9f599ce614feb2e1bbe58f180f370d05b39344e002710c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000017cc6042605381c158d2adab487434bde79aa61c000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000b0b8122abd84129c001a053efc49d03b694742500f49aa09df2360bd7e297fa730c745e0d4320b42fc33fa01ca1c85a46c561f624830fffbae2441ba0f2d54eb5b0f17e0e3561d10db0b7ee"},n=await c.load(a);expect(n).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0xb9f599ce614feb2e1bbe58f180f370d05b39344e"},{type:"token",payload:"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}])}),it("should return the external plugin context and the decoded contexts with a permit",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000030a010c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000016000000000000000000000000055747be9f9f5beb232ad59fe7af013b81d95fd5e000000000000000000000000ffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000066c32b0d0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000ef1c6e67703c7bd7107eed8303fbe6ec2554bf6b00000000000000000000000000000000000000000000000000000000669b9ec100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000410d756f55acf289e9754faf91bba0a704b5c7c0aa4b1dfd551115ccbe4c7f290234e1a14265e1da0bc872a23627d997fe37a689c290d519f7b8c9bdde1b79108e1b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000030ba49cbff5a00000000000000000000000000000000000000000000000089677c957272141800000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc200271055747be9f9f5beb232ad59fe7af013b81d95fd5e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000030ba49cbff5a000c001a0e406d9c91c8b46d959fcd31a28518a77bb248ebb316c5fab7b98335cce922f2aa0462cb970c32a8dbfe71c57b888c43b9ed04fce41d169dbfcc745445587adb771"},n=await c.load(a);expect(n).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"},{type:"token",payload:"payload-0x55747be9f9f5beb232ad59fe7af013b81d95fd5e"}])}),it("should return an empty array if the transaction is not supported",async()=>{const a={};vi.spyOn(o,"decode").mockReturnValue([]);const n=await c.load(a);expect(n).toEqual([])}),it("should return an empty array if a command is not supported",async()=>{const a={chainId:1,data:"0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000067a4bef600000000000000000000000000000000000000000000000000000000000000050b0105040c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000078e6708e70aed0f000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000059a16770000000000000000000000000000000000000000000000000078e6708e70aed0f00000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f4c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000027213e28d7fda5c57fe9e5dd923818dbccf71c4700000000000000000000000000000000000000000000000000000000003938700000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000006f939b43d65be049b7533907db08e80ba6969f450000000000000000000000000000000000000000000000000000000059682f0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000006f939b43d65be049b7533907db08e80ba6969f4500000000000000000000000000000000000000000000000000000000000000000cc080a07c86dd5813ec1f3725c402f8bea6105546d1093c59676023b971f1d83f61bd4ea02a353bf3028cabcbe68c5dc8906752bafe55afc86b6344edb3ffd8a3650332e8"},n=await c.load(a);expect(n).toEqual([])})}),describe("with mocked ethers parseTransaction",()=>{beforeEach(()=>{vi.resetAllMocks(),c=new l.UniswapContextLoader(o,t)}),it("should return an array with contexts if 2 chain swaps are supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(o,"decode").mockReturnValueOnce(["0x01","0x04","0x02"]).mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(t,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(o.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(o.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x04",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x02",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(4,{address:"0x03",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0x01"},{type:"token",payload:"payload-0x04"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"}])}),it("should return an array with contexts if 1 chain swap with a non swap command",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0b0004",["0x0001","0x0002","0x0003"]]}),vi.spyOn(o,"decode").mockReturnValueOnce(["0x01"]).mockReturnValueOnce(["0x02","0x03"]).mockReturnValueOnce(["0x04"]),vi.spyOn(t,"getTokenInfosPayload").mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(o.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.WRAP_ETH,"0x0001",66),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x02",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x03",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(4,{address:"0x04",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"token",payload:"payload-0x01"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"},{type:"token",payload:"payload-0x04"}])}),it("should return an array with contexts if one token is not found",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(o,"decode").mockReturnValueOnce(["0x01","0x02"]).mockReturnValueOnce(["0x02","0x03"]),vi.spyOn(t,"getTokenInfosPayload").mockResolvedValueOnce((0,r.Left)("error")).mockImplementation(({address:i})=>Promise.resolve((0,r.Right)(`payload-${i}`)));const d=await c.load(a);expect(o.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(o.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(1,{address:"0x01",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(2,{address:"0x02",chainId:66}),expect(t.getTokenInfosPayload).toHaveBeenNthCalledWith(3,{address:"0x03",chainId:66}),expect(d).toEqual([{type:f.ClearSignContextType.EXTERNAL_PLUGIN,payload:"07556e69737761703fc91a3afd70395cd496c647d5a6cc9d4b2b7fad3593564c3044022014391e8f355867a57fe88f6a5a4dbcb8bf8f888a9db3ff3449caf72d120396bd02200c13d9c3f79400fe0aa0434ac54d59b79503c9964a4abc3e8cd22763e0242935"},{type:"error",error:"error"},{type:"token",payload:"payload-0x02"},{type:"token",payload:"payload-0x03"}])}),it("should return an empty array if the if 2 chain swaps are not supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001","0x0002"]]}),vi.spyOn(o,"decode").mockReturnValueOnce(["0x01","0x02"]),vi.spyOn(o,"decode").mockReturnValueOnce(["0x03","0x04"]);const d=await c.load(a);expect(o.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x0001",66),expect(o.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x0002",66),expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])}),it("should return an empty array if no command are returned from parseTransaction",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:[""]});const n=await c.load(a);expect(o.decode).not.toHaveBeenCalled(),expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if no inputs are returned from parseTransaction",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x08",[]]});const n=await c.load(a);expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if parseTransaction throws an error",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR};vi.spyOn(s.Interface.prototype,"parseTransaction").mockImplementation(()=>{throw new Error});const n=await c.load(a);expect(o.decode).not.toHaveBeenCalled(),expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if the swap is with multiple pool versions",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x080900",["0x00","0x01","0x02"]]}),vi.spyOn(o,"decode").mockReturnValue(["0x01","0x02"]);const d=await c.load(a);expect(o.decode).toHaveBeenNthCalledWith(1,e.UniswapSupportedCommand.V2_SWAP_EXACT_IN,"0x00",66),expect(o.decode).toHaveBeenNthCalledWith(2,e.UniswapSupportedCommand.V2_SWAP_EXACT_OUT,"0x01",66),expect(o.decode).toHaveBeenNthCalledWith(3,e.UniswapSupportedCommand.V3_SWAP_EXACT_IN,"0x02",66),expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])}),it("should return an empty array if the selector is not supported",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:"0x00000000",chainId:66},n=await c.load(a);expect(o.decode).not.toHaveBeenCalled(),expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(n).toEqual([])}),it("should return an empty array if the length of the commands and inputs are different",async()=>{const a={to:e.UNISWAP_UNIVERSAL_ROUTER_ADDRESS,data:e.UNISWAP_EXECUTE_SELECTOR,chainId:66};vi.spyOn(s.Interface.prototype,"parseTransaction").mockReturnValue({args:["0x0809",["0x0001"]]});const d=await c.load(a);expect(o.decode).not.toHaveBeenCalled(),expect(t.getTokenInfosPayload).not.toHaveBeenCalled(),expect(d).toEqual([])})})})});
2
2
  //# sourceMappingURL=UniswapContextLoader.test.js.map