1 |
|
2 |
|
3 |
|
4 | import { u8aToU8a } from '@polkadot/util';
|
5 | import { sr25519Sign as wasmSign } from '@polkadot/wasm-crypto';
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export function sr25519Sign(message, {
|
12 | publicKey,
|
13 | secretKey
|
14 | }) {
|
15 | if ((publicKey == null ? void 0 : publicKey.length) !== 32) {
|
16 | throw new Error('Expected a valid publicKey, 32-bytes');
|
17 | } else if ((secretKey == null ? void 0 : secretKey.length) !== 64) {
|
18 | throw new Error('Expected a valid secretKey, 64-bytes');
|
19 | }
|
20 | return wasmSign(publicKey, secretKey, u8aToU8a(message));
|
21 | } |
\ | No newline at end of file |