@avalabs/evm-module 0.0.15 → 0.0.16

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 (31) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/.turbo/turbo-test.log +26 -7
  4. package/CHANGELOG.md +9 -0
  5. package/dist/index.cjs +27 -8
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +5 -2
  8. package/dist/index.d.ts +5 -2
  9. package/dist/index.js +26 -9
  10. package/dist/index.js.map +1 -1
  11. package/manifest.json +1 -1
  12. package/package.json +5 -5
  13. package/src/handlers/eth-send-transaction/eth-send-transaction.test.ts +1 -1
  14. package/src/handlers/eth-send-transaction/eth-send-transaction.ts +3 -3
  15. package/src/handlers/eth-sign/eth-sign.test.ts +217 -0
  16. package/src/handlers/eth-sign/eth-sign.ts +137 -0
  17. package/src/handlers/eth-sign/schemas/eth-sign-typed-data.ts +65 -0
  18. package/src/handlers/eth-sign/schemas/eth-sign.ts +9 -0
  19. package/src/handlers/eth-sign/schemas/parse-request-params/fixture.ts +47 -0
  20. package/src/handlers/eth-sign/schemas/parse-request-params/parse-request-params.test.ts +284 -0
  21. package/src/handlers/eth-sign/schemas/parse-request-params/parse-request-params.ts +94 -0
  22. package/src/handlers/eth-sign/schemas/parse-request-params.ts +90 -0
  23. package/src/handlers/eth-sign/schemas/personal-sign.ts +12 -0
  24. package/src/handlers/eth-sign/schemas/shared.ts +5 -0
  25. package/src/handlers/eth-sign/utils/beautify-message/beautify-message.test.ts +29 -0
  26. package/src/handlers/eth-sign/utils/beautify-message/beautify-message.ts +134 -0
  27. package/src/handlers/eth-sign/utils/is-typed-data-valid.ts +26 -0
  28. package/src/handlers/eth-sign/utils/typeguards.ts +10 -0
  29. package/src/index.ts +1 -0
  30. package/src/module.ts +12 -0
  31. package/tsconfig.json +6 -1
package/src/module.ts CHANGED
@@ -20,6 +20,7 @@ import { ethSendTransaction } from './handlers/eth-send-transaction/eth-send-tra
20
20
  import { getBalances } from './handlers/get-balances/get-balances';
21
21
  import { getEnv } from './env';
22
22
  import { EvmGlacierService } from './services/glacier-service/glacier-service';
23
+ import { ethSign } from './handlers/eth-sign/eth-sign';
23
24
 
24
25
  export class EvmModule implements Module {
25
26
  #glacierService: EvmGlacierService;
@@ -98,6 +99,17 @@ export class EvmModule implements Module {
98
99
  network,
99
100
  approvalController: this.#approvalController,
100
101
  });
102
+ case RpcMethod.PERSONAL_SIGN:
103
+ case RpcMethod.ETH_SIGN:
104
+ case RpcMethod.SIGN_TYPED_DATA:
105
+ case RpcMethod.SIGN_TYPED_DATA_V1:
106
+ case RpcMethod.SIGN_TYPED_DATA_V3:
107
+ case RpcMethod.SIGN_TYPED_DATA_V4:
108
+ return ethSign({
109
+ request,
110
+ network,
111
+ approvalController: this.#approvalController,
112
+ });
101
113
  default:
102
114
  return { error: rpcErrors.methodNotSupported(`Method ${request.method} not supported`) };
103
115
  }
package/tsconfig.json CHANGED
@@ -5,5 +5,10 @@
5
5
  "declaration": false,
6
6
  "incremental": false // Need to turn off because of tsup dts
7
7
  },
8
- "include": ["src"]
8
+ "include": ["src"],
9
+ "references": [
10
+ {
11
+ "path": "../../packages-internal/utils/tsconfig.json"
12
+ }
13
+ ]
9
14
  }