@polkadot-api/polkadot-signer 0.1.4 → 0.1.5

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 (2) hide show
  1. package/dist/index.d.ts +34 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,10 +1,44 @@
1
1
  interface PolkadotSigner {
2
2
  publicKey: Uint8Array;
3
+ /**
4
+ * Signs a transaction (extrinsic) for broadcasting.
5
+ *
6
+ * @param callData The call data of the transaction (without the
7
+ * compact length prefix).
8
+ * @param signedExtensions Extensions that should be signed along with the
9
+ * extrinsic.
10
+ * The record's `key` represents the identifier,
11
+ * which is included both as the `key` and within
12
+ * the value for convenience. The `value`
13
+ * represents the `extra` portion, which is
14
+ * included in the extrinsic itself, while
15
+ * `additionalSigned` is the part that is signed
16
+ * but not included in the extrinsic.
17
+ * @param metadata The metadata in SCALE-encoded format. This can
18
+ * either be in `Opaque` form or just the raw
19
+ * metadata, starting with the appropriate
20
+ * metadata magic number and metadata version.
21
+ * @param atBlockNumber The block number at which the transaction has
22
+ * been created.
23
+ * @param hasher An optional hashing function to build the
24
+ * extrinsic with. Defaults to `Blake2b` with a
25
+ * 256-bit hash length.
26
+ * @returns A signed extrinsic ready to be broadcasted.
27
+ */
3
28
  signTx: (callData: Uint8Array, signedExtensions: Record<string, {
4
29
  identifier: string;
5
30
  value: Uint8Array;
6
31
  additionalSigned: Uint8Array;
7
32
  }>, metadata: Uint8Array, atBlockNumber: number, hasher?: (data: Uint8Array) => Uint8Array) => Promise<Uint8Array>;
33
+ /**
34
+ * Signs an arbitrary payload.
35
+ *
36
+ * The signer may enforce certain restrictions to ensure that raw bytes passed
37
+ * do not constitute, for instance, a valid extrinsic.
38
+ *
39
+ * @param data The payload to be signed.
40
+ * @returns A raw cryptographic signature.
41
+ */
8
42
  signBytes: (data: Uint8Array) => Promise<Uint8Array>;
9
43
  }
10
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polkadot-api/polkadot-signer",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "author": "Josep M Sobrepere (https://github.com/josepot)",
5
5
  "repository": {
6
6
  "type": "git",