@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.
- package/.turbo/turbo-build.log +10 -10
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +26 -7
- package/CHANGELOG.md +9 -0
- package/dist/index.cjs +27 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +26 -9
- package/dist/index.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +5 -5
- package/src/handlers/eth-send-transaction/eth-send-transaction.test.ts +1 -1
- package/src/handlers/eth-send-transaction/eth-send-transaction.ts +3 -3
- package/src/handlers/eth-sign/eth-sign.test.ts +217 -0
- package/src/handlers/eth-sign/eth-sign.ts +137 -0
- package/src/handlers/eth-sign/schemas/eth-sign-typed-data.ts +65 -0
- package/src/handlers/eth-sign/schemas/eth-sign.ts +9 -0
- package/src/handlers/eth-sign/schemas/parse-request-params/fixture.ts +47 -0
- package/src/handlers/eth-sign/schemas/parse-request-params/parse-request-params.test.ts +284 -0
- package/src/handlers/eth-sign/schemas/parse-request-params/parse-request-params.ts +94 -0
- package/src/handlers/eth-sign/schemas/parse-request-params.ts +90 -0
- package/src/handlers/eth-sign/schemas/personal-sign.ts +12 -0
- package/src/handlers/eth-sign/schemas/shared.ts +5 -0
- package/src/handlers/eth-sign/utils/beautify-message/beautify-message.test.ts +29 -0
- package/src/handlers/eth-sign/utils/beautify-message/beautify-message.ts +134 -0
- package/src/handlers/eth-sign/utils/is-typed-data-valid.ts +26 -0
- package/src/handlers/eth-sign/utils/typeguards.ts +10 -0
- package/src/index.ts +1 -0
- package/src/module.ts +12 -0
- 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
|
}
|