@hwlt/era-connect 0.2.0 → 0.4.0
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/README.md +6 -6
- package/cardano/package.json +6 -0
- package/cosmos/package.json +6 -0
- package/dist/{btc-DfQ0q79G.d.ts → btc-B8LfSEkv.d.ts} +11 -2
- package/dist/{btc-VyJKXq7d.js → btc-B_Nq2H4T.js} +16 -7
- package/dist/btc-B_Nq2H4T.js.map +1 -0
- package/dist/{btc-Fr6Jz4Fi.cjs → btc-ByzjzUKs.cjs} +19 -10
- package/dist/btc-ByzjzUKs.cjs.map +1 -0
- package/dist/{btc-Dn6_Y12c.d.cts → btc-C4dVkxHb.d.cts} +11 -2
- package/dist/btc.cjs +2 -2
- package/dist/btc.d.cts +1 -1
- package/dist/btc.d.ts +1 -1
- package/dist/btc.js +2 -2
- package/dist/cardano-BCT55gwf.js +95 -0
- package/dist/cardano-BCT55gwf.js.map +1 -0
- package/dist/cardano-CzYswGzK.cjs +106 -0
- package/dist/cardano-CzYswGzK.cjs.map +1 -0
- package/dist/cardano-Do1ahUlK.d.cts +62 -0
- package/dist/cardano-OzjWZHh6.d.ts +62 -0
- package/dist/cardano.cjs +10 -0
- package/dist/cardano.d.cts +3 -0
- package/dist/cardano.d.ts +3 -0
- package/dist/cardano.js +3 -0
- package/dist/cosmos-BYrhIqRk.d.cts +77 -0
- package/dist/cosmos-DDsgtUki.cjs +113 -0
- package/dist/cosmos-DDsgtUki.cjs.map +1 -0
- package/dist/cosmos-DqyjA6lg.d.ts +77 -0
- package/dist/cosmos-jUHNxgWC.js +102 -0
- package/dist/cosmos-jUHNxgWC.js.map +1 -0
- package/dist/cosmos.cjs +10 -0
- package/dist/cosmos.d.cts +3 -0
- package/dist/cosmos.d.ts +3 -0
- package/dist/cosmos.js +3 -0
- package/dist/derive-BayrpfJk.cjs +188 -0
- package/dist/derive-BayrpfJk.cjs.map +1 -0
- package/dist/derive-CK9Nc9Jc.js +123 -0
- package/dist/derive-CK9Nc9Jc.js.map +1 -0
- package/dist/{evm-kJb3-oiR.js → evm-CI1cuZsp.js} +3 -2
- package/dist/{evm-kJb3-oiR.js.map → evm-CI1cuZsp.js.map} +1 -1
- package/dist/{evm-BHj_2OTG.cjs → evm-yfKOc2dy.cjs} +6 -5
- package/dist/{evm-BHj_2OTG.cjs.map → evm-yfKOc2dy.cjs.map} +1 -1
- package/dist/evm.cjs +2 -2
- package/dist/evm.js +2 -2
- package/dist/index.cjs +156 -116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -9
- package/dist/index.d.ts +68 -9
- package/dist/index.js +125 -94
- package/dist/index.js.map +1 -1
- package/dist/keypath-Bvv_cfHt.js +75 -0
- package/dist/keypath-Bvv_cfHt.js.map +1 -0
- package/dist/keypath-pzm_YIfN.cjs +116 -0
- package/dist/keypath-pzm_YIfN.cjs.map +1 -0
- package/dist/{messages-BzcdWlg1.cjs → messages-BZXDY29v.cjs} +2 -2
- package/dist/{messages-BzcdWlg1.cjs.map → messages-BZXDY29v.cjs.map} +1 -1
- package/dist/{messages-17Oup0-Z.js → messages-DbnXy3dC.js} +2 -2
- package/dist/{messages-17Oup0-Z.js.map → messages-DbnXy3dC.js.map} +1 -1
- package/dist/{shared-B8Wc7ViU.js → shared-Bbgejrus.js} +2 -73
- package/dist/shared-Bbgejrus.js.map +1 -0
- package/dist/{shared-nISrEktU.cjs → shared-Cu2yynP9.cjs} +13 -114
- package/dist/shared-Cu2yynP9.cjs.map +1 -0
- package/dist/{solana-DdEn24X4.cjs → solana-BoQBy0hu.cjs} +6 -5
- package/dist/{solana-DdEn24X4.cjs.map → solana-BoQBy0hu.cjs.map} +1 -1
- package/dist/{solana-C7JQEAec.js → solana-BukH3AI3.js} +3 -2
- package/dist/{solana-C7JQEAec.js.map → solana-BukH3AI3.js.map} +1 -1
- package/dist/solana.cjs +2 -2
- package/dist/solana.js +2 -2
- package/dist/sui-6WX6VPlW.d.cts +49 -0
- package/dist/sui-BtbPG6Xt.js +71 -0
- package/dist/sui-BtbPG6Xt.js.map +1 -0
- package/dist/sui-CYRn331O.cjs +82 -0
- package/dist/sui-CYRn331O.cjs.map +1 -0
- package/dist/sui-DI0ruW7E.d.ts +49 -0
- package/dist/sui.cjs +10 -0
- package/dist/sui.d.cts +3 -0
- package/dist/sui.d.ts +3 -0
- package/dist/sui.js +3 -0
- package/dist/{ton-5Uvi5ifg.js → ton-BSPKU5B9.js} +3 -2
- package/dist/{ton-5Uvi5ifg.js.map → ton-BSPKU5B9.js.map} +1 -1
- package/dist/{ton-DUJGXdGa.cjs → ton-CI2s9puH.cjs} +6 -5
- package/dist/{ton-DUJGXdGa.cjs.map → ton-CI2s9puH.cjs.map} +1 -1
- package/dist/ton.cjs +2 -2
- package/dist/ton.js +2 -2
- package/dist/{tron-CQIEqjCA.cjs → tron-B9wXdzlA.cjs} +7 -6
- package/dist/{tron-CQIEqjCA.cjs.map → tron-B9wXdzlA.cjs.map} +1 -1
- package/dist/{tron-Bo9HnvVE.js → tron-fufBDNuQ.js} +4 -3
- package/dist/{tron-Bo9HnvVE.js.map → tron-fufBDNuQ.js.map} +1 -1
- package/dist/tron.cjs +3 -3
- package/dist/tron.js +3 -3
- package/dist/verify.cjs +335 -4
- package/dist/verify.cjs.map +1 -1
- package/dist/verify.d.cts +86 -1
- package/dist/verify.d.ts +86 -1
- package/dist/verify.js +333 -6
- package/dist/verify.js.map +1 -1
- package/dist/xrp-BXAeK4iH.d.cts +32 -0
- package/dist/xrp-BrHXUnX5.cjs +52 -0
- package/dist/xrp-BrHXUnX5.cjs.map +1 -0
- package/dist/xrp-C8LJO5b-.js +47 -0
- package/dist/xrp-C8LJO5b-.js.map +1 -0
- package/dist/xrp-DqCXGYEk.d.ts +32 -0
- package/dist/xrp.cjs +9 -0
- package/dist/xrp.d.cts +3 -0
- package/dist/xrp.d.ts +3 -0
- package/dist/xrp.js +3 -0
- package/package.json +49 -1
- package/sui/package.json +6 -0
- package/xrp/package.json +6 -0
- package/dist/btc-Fr6Jz4Fi.cjs.map +0 -1
- package/dist/btc-VyJKXq7d.js.map +0 -1
- package/dist/shared-B8Wc7ViU.js.map +0 -1
- package/dist/shared-nISrEktU.cjs.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, i as ExpectedReply, r as EraConnectConfig } from "./shared-CI8zhQiE.cjs";
|
|
2
|
+
//#region src/chains/cardano.d.ts
|
|
3
|
+
/** One transaction input the device must sign for. */
|
|
4
|
+
interface CardanoUtxoRef {
|
|
5
|
+
/** 32-byte hash of the transaction that created the UTXO. */
|
|
6
|
+
readonly transactionHash: Uint8Array;
|
|
7
|
+
readonly index: number;
|
|
8
|
+
/** Full signing path for this input, e.g. `m/1852'/1815'/0'/0/0`. */
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly xfp: string | number;
|
|
11
|
+
/** Lovelace amount as a decimal string — device display. */
|
|
12
|
+
readonly amount?: string;
|
|
13
|
+
/** Bech32 address of the UTXO — device display. */
|
|
14
|
+
readonly address?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A certificate/withdrawal key the transaction additionally needs a witness from. */
|
|
17
|
+
interface CardanoCertKeyRef {
|
|
18
|
+
/** Full signing path, e.g. the stake key `m/1852'/1815'/0'/2/0`. */
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly xfp: string | number;
|
|
21
|
+
/** 28-byte key hash — device display/matching. */
|
|
22
|
+
readonly keyHash?: Uint8Array;
|
|
23
|
+
}
|
|
24
|
+
interface CardanoSignRequestProps {
|
|
25
|
+
readonly requestId?: Uint8Array | string;
|
|
26
|
+
/**
|
|
27
|
+
* The FULL transaction CBOR (`[body, witness_set, is_valid, aux_data]`) as
|
|
28
|
+
* your Cardano tooling serializes it. The device extracts the body (first
|
|
29
|
+
* array element) and signs its BLAKE2b-256 hash.
|
|
30
|
+
*/
|
|
31
|
+
readonly signData: Uint8Array;
|
|
32
|
+
/** At least one; the device signs once per UNIQUE path across utxos + certKeys. */
|
|
33
|
+
readonly utxos: readonly CardanoUtxoRef[];
|
|
34
|
+
readonly certKeys?: readonly CardanoCertKeyRef[];
|
|
35
|
+
readonly origin?: string;
|
|
36
|
+
}
|
|
37
|
+
interface CardanoWitness {
|
|
38
|
+
/** 32-byte verification key. */
|
|
39
|
+
readonly vkey: Uint8Array;
|
|
40
|
+
/** 64-byte Ed25519 signature over the tx-body BLAKE2b-256 hash. */
|
|
41
|
+
readonly signature: Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
interface CardanoSignatureResult {
|
|
44
|
+
readonly requestId: Uint8Array;
|
|
45
|
+
/** The witness-set CBOR verbatim (`{0: #6.258([[vkey, sig]…])}`) — merge it into your tx. */
|
|
46
|
+
readonly witnessSet: Uint8Array;
|
|
47
|
+
/** The `[vkey, signature]` pairs parsed out of the witness set. */
|
|
48
|
+
readonly witnesses: readonly CardanoWitness[];
|
|
49
|
+
}
|
|
50
|
+
declare class CardanoChain {
|
|
51
|
+
private readonly context;
|
|
52
|
+
constructor(config?: EraConnectConfig);
|
|
53
|
+
/** Build a `cardano-sign-request` (2202). Reply: `cardano-signature` (2203). */
|
|
54
|
+
generateSignRequest(props: CardanoSignRequestProps): SignRequest<CardanoSignatureResult>;
|
|
55
|
+
/** Parse a `cardano-signature` standalone. Prefer `SignRequest.scanner().parse()`. */
|
|
56
|
+
parseSignature(input: Ur | string, expect?: ExpectedReply): CardanoSignatureResult;
|
|
57
|
+
}
|
|
58
|
+
/** `[vkey, signature]` pairs from a witness-set CBOR `{0: #6.258([...])}` (the set tag is optional). */
|
|
59
|
+
declare function parseWitnessSet(witnessSet: Uint8Array): CardanoWitness[];
|
|
60
|
+
//#endregion
|
|
61
|
+
export { CardanoUtxoRef as a, CardanoSignatureResult as i, CardanoChain as n, CardanoWitness as o, CardanoSignRequestProps as r, parseWitnessSet as s, CardanoCertKeyRef as t };
|
|
62
|
+
//# sourceMappingURL=cardano-Do1ahUlK.d.cts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, i as ExpectedReply, r as EraConnectConfig } from "./shared-CI8zhQiE.js";
|
|
2
|
+
//#region src/chains/cardano.d.ts
|
|
3
|
+
/** One transaction input the device must sign for. */
|
|
4
|
+
interface CardanoUtxoRef {
|
|
5
|
+
/** 32-byte hash of the transaction that created the UTXO. */
|
|
6
|
+
readonly transactionHash: Uint8Array;
|
|
7
|
+
readonly index: number;
|
|
8
|
+
/** Full signing path for this input, e.g. `m/1852'/1815'/0'/0/0`. */
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly xfp: string | number;
|
|
11
|
+
/** Lovelace amount as a decimal string — device display. */
|
|
12
|
+
readonly amount?: string;
|
|
13
|
+
/** Bech32 address of the UTXO — device display. */
|
|
14
|
+
readonly address?: string;
|
|
15
|
+
}
|
|
16
|
+
/** A certificate/withdrawal key the transaction additionally needs a witness from. */
|
|
17
|
+
interface CardanoCertKeyRef {
|
|
18
|
+
/** Full signing path, e.g. the stake key `m/1852'/1815'/0'/2/0`. */
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly xfp: string | number;
|
|
21
|
+
/** 28-byte key hash — device display/matching. */
|
|
22
|
+
readonly keyHash?: Uint8Array;
|
|
23
|
+
}
|
|
24
|
+
interface CardanoSignRequestProps {
|
|
25
|
+
readonly requestId?: Uint8Array | string;
|
|
26
|
+
/**
|
|
27
|
+
* The FULL transaction CBOR (`[body, witness_set, is_valid, aux_data]`) as
|
|
28
|
+
* your Cardano tooling serializes it. The device extracts the body (first
|
|
29
|
+
* array element) and signs its BLAKE2b-256 hash.
|
|
30
|
+
*/
|
|
31
|
+
readonly signData: Uint8Array;
|
|
32
|
+
/** At least one; the device signs once per UNIQUE path across utxos + certKeys. */
|
|
33
|
+
readonly utxos: readonly CardanoUtxoRef[];
|
|
34
|
+
readonly certKeys?: readonly CardanoCertKeyRef[];
|
|
35
|
+
readonly origin?: string;
|
|
36
|
+
}
|
|
37
|
+
interface CardanoWitness {
|
|
38
|
+
/** 32-byte verification key. */
|
|
39
|
+
readonly vkey: Uint8Array;
|
|
40
|
+
/** 64-byte Ed25519 signature over the tx-body BLAKE2b-256 hash. */
|
|
41
|
+
readonly signature: Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
interface CardanoSignatureResult {
|
|
44
|
+
readonly requestId: Uint8Array;
|
|
45
|
+
/** The witness-set CBOR verbatim (`{0: #6.258([[vkey, sig]…])}`) — merge it into your tx. */
|
|
46
|
+
readonly witnessSet: Uint8Array;
|
|
47
|
+
/** The `[vkey, signature]` pairs parsed out of the witness set. */
|
|
48
|
+
readonly witnesses: readonly CardanoWitness[];
|
|
49
|
+
}
|
|
50
|
+
declare class CardanoChain {
|
|
51
|
+
private readonly context;
|
|
52
|
+
constructor(config?: EraConnectConfig);
|
|
53
|
+
/** Build a `cardano-sign-request` (2202). Reply: `cardano-signature` (2203). */
|
|
54
|
+
generateSignRequest(props: CardanoSignRequestProps): SignRequest<CardanoSignatureResult>;
|
|
55
|
+
/** Parse a `cardano-signature` standalone. Prefer `SignRequest.scanner().parse()`. */
|
|
56
|
+
parseSignature(input: Ur | string, expect?: ExpectedReply): CardanoSignatureResult;
|
|
57
|
+
}
|
|
58
|
+
/** `[vkey, signature]` pairs from a witness-set CBOR `{0: #6.258([...])}` (the set tag is optional). */
|
|
59
|
+
declare function parseWitnessSet(witnessSet: Uint8Array): CardanoWitness[];
|
|
60
|
+
//#endregion
|
|
61
|
+
export { CardanoUtxoRef as a, CardanoSignatureResult as i, CardanoChain as n, CardanoWitness as o, CardanoSignRequestProps as r, parseWitnessSet as s, CardanoCertKeyRef as t };
|
|
62
|
+
//# sourceMappingURL=cardano-OzjWZHh6.d.ts.map
|
package/dist/cardano.cjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_shared = require("./shared-Cu2yynP9.cjs");
|
|
3
|
+
const require_cardano = require("./cardano-CzYswGzK.cjs");
|
|
4
|
+
exports.AnimatedUr = require_shared.AnimatedUr;
|
|
5
|
+
exports.CardanoChain = require_cardano.CardanoChain;
|
|
6
|
+
exports.EraSdkError = require_shared.EraSdkError;
|
|
7
|
+
exports.TypedUrScanner = require_shared.TypedUrScanner;
|
|
8
|
+
exports.Ur = require_shared.Ur;
|
|
9
|
+
exports.UrScanner = require_shared.UrScanner;
|
|
10
|
+
exports.parseWitnessSet = require_cardano.parseWitnessSet;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, c as TypedUrScanner, d as EraErrorCode, f as EraSdkError, i as ExpectedReply, l as UrScanner, p as AnimatedUr, r as EraConnectConfig } from "./shared-CI8zhQiE.cjs";
|
|
2
|
+
import { a as CardanoUtxoRef, i as CardanoSignatureResult, n as CardanoChain, o as CardanoWitness, r as CardanoSignRequestProps, s as parseWitnessSet, t as CardanoCertKeyRef } from "./cardano-Do1ahUlK.cjs";
|
|
3
|
+
export { AnimatedUr, type CardanoCertKeyRef, CardanoChain, type CardanoSignRequestProps, type CardanoSignatureResult, type CardanoUtxoRef, type CardanoWitness, type EraConnectConfig, type EraErrorCode, EraSdkError, type ExpectedReply, type SignRequest, TypedUrScanner, Ur, UrScanner, parseWitnessSet };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, c as TypedUrScanner, d as EraErrorCode, f as EraSdkError, i as ExpectedReply, l as UrScanner, p as AnimatedUr, r as EraConnectConfig } from "./shared-CI8zhQiE.js";
|
|
2
|
+
import { a as CardanoUtxoRef, i as CardanoSignatureResult, n as CardanoChain, o as CardanoWitness, r as CardanoSignRequestProps, s as parseWitnessSet, t as CardanoCertKeyRef } from "./cardano-OzjWZHh6.js";
|
|
3
|
+
export { AnimatedUr, type CardanoCertKeyRef, CardanoChain, type CardanoSignRequestProps, type CardanoSignatureResult, type CardanoUtxoRef, type CardanoWitness, type EraConnectConfig, type EraErrorCode, EraSdkError, type ExpectedReply, type SignRequest, TypedUrScanner, Ur, UrScanner, parseWitnessSet };
|
package/dist/cardano.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { K as EraSdkError, _ as Ur, d as UrScanner, f as AnimatedUr, u as TypedUrScanner } from "./shared-Bbgejrus.js";
|
|
2
|
+
import { n as parseWitnessSet, t as CardanoChain } from "./cardano-BCT55gwf.js";
|
|
3
|
+
export { AnimatedUr, CardanoChain, EraSdkError, TypedUrScanner, Ur, UrScanner, parseWitnessSet };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, i as ExpectedReply, r as EraConnectConfig } from "./shared-CI8zhQiE.cjs";
|
|
2
|
+
//#region src/chains/cosmos.d.ts
|
|
3
|
+
/** `cosmos-sign-request` dataType (CBOR key 3). */
|
|
4
|
+
declare const CosmosDataType: {
|
|
5
|
+
/** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */
|
|
6
|
+
readonly amino: 1;
|
|
7
|
+
/** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */
|
|
8
|
+
readonly direct: 2;
|
|
9
|
+
/** SIGN_MODE_TEXTUAL (rare). */
|
|
10
|
+
readonly textual: 3;
|
|
11
|
+
/** ADR-036 arbitrary-message signing. */
|
|
12
|
+
readonly message: 4;
|
|
13
|
+
};
|
|
14
|
+
type CosmosDataType = (typeof CosmosDataType)[keyof typeof CosmosDataType];
|
|
15
|
+
interface CosmosSignRequestProps {
|
|
16
|
+
readonly requestId?: Uint8Array | string;
|
|
17
|
+
/** SignDoc bytes: canonical Amino JSON (UTF-8) or protobuf SignDoc. */
|
|
18
|
+
readonly signData: Uint8Array;
|
|
19
|
+
readonly dataType: CosmosDataType;
|
|
20
|
+
/** Full signing path, e.g. `m/44'/118'/0'/0/0`. */
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly xfp: string | number;
|
|
23
|
+
/** Bech32 signer address — device display. */
|
|
24
|
+
readonly address?: string;
|
|
25
|
+
readonly origin?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Ethermint-family chains (Injective, Evmos, Dymension, …) sign with
|
|
29
|
+
* keccak-256 over Ethereum-style keys (`m/44'/60'/...`) and travel as an
|
|
30
|
+
* `evm-sign-request` instead.
|
|
31
|
+
*/
|
|
32
|
+
interface EthermintSignRequestProps {
|
|
33
|
+
readonly requestId?: Uint8Array | string;
|
|
34
|
+
readonly signData: Uint8Array;
|
|
35
|
+
/** Amino or Direct — the SignDoc encoding. */
|
|
36
|
+
readonly dataType: typeof CosmosDataType.amino | typeof CosmosDataType.direct;
|
|
37
|
+
/** e.g. `m/44'/60'/0'/0/0`. */
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly xfp: string | number;
|
|
40
|
+
/** The `0x…` signer address string — travels as its ASCII bytes on this wire. */
|
|
41
|
+
readonly address?: string;
|
|
42
|
+
readonly origin?: string;
|
|
43
|
+
}
|
|
44
|
+
interface CosmosSignatureResult {
|
|
45
|
+
readonly requestId: Uint8Array;
|
|
46
|
+
/** 64-byte compact secp256k1 signature (r || s). */
|
|
47
|
+
readonly signature: Uint8Array;
|
|
48
|
+
/** 33-byte compressed public key (absent on the `evm-signature` reply shape). */
|
|
49
|
+
readonly publicKey: Uint8Array | undefined;
|
|
50
|
+
}
|
|
51
|
+
declare class CosmosChain {
|
|
52
|
+
static readonly DataType: {
|
|
53
|
+
/** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */
|
|
54
|
+
readonly amino: 1;
|
|
55
|
+
/** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */
|
|
56
|
+
readonly direct: 2;
|
|
57
|
+
/** SIGN_MODE_TEXTUAL (rare). */
|
|
58
|
+
readonly textual: 3;
|
|
59
|
+
/** ADR-036 arbitrary-message signing. */
|
|
60
|
+
readonly message: 4;
|
|
61
|
+
};
|
|
62
|
+
private readonly context;
|
|
63
|
+
constructor(config?: EraConnectConfig);
|
|
64
|
+
/** Build a `cosmos-sign-request` (4101). Reply: `cosmos-signature` (4102). */
|
|
65
|
+
generateSignRequest(props: CosmosSignRequestProps): SignRequest<CosmosSignatureResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Build an `evm-sign-request` (4101, the Ethermint shape) for
|
|
68
|
+
* Injective/Evmos/Dymension-style chains. Reply: `evm-signature` (4102).
|
|
69
|
+
* The digest on these chains is keccak-256 — see `verifyCosmosSignature`.
|
|
70
|
+
*/
|
|
71
|
+
generateEthermintSignRequest(props: EthermintSignRequestProps): SignRequest<CosmosSignatureResult>;
|
|
72
|
+
/** Parse a `cosmos-signature`/`evm-signature` standalone. */
|
|
73
|
+
parseSignature(input: Ur | string, expect?: ExpectedReply): CosmosSignatureResult;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { EthermintSignRequestProps as a, CosmosSignatureResult as i, CosmosDataType as n, CosmosSignRequestProps as r, CosmosChain as t };
|
|
77
|
+
//# sourceMappingURL=cosmos-BYrhIqRk.d.cts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
const require_shared = require("./shared-Cu2yynP9.cjs");
|
|
2
|
+
const require_keypath = require("./keypath-pzm_YIfN.cjs");
|
|
3
|
+
//#region src/chains/cosmos.ts
|
|
4
|
+
/** `cosmos-sign-request` dataType (CBOR key 3). */
|
|
5
|
+
const CosmosDataType = {
|
|
6
|
+
/** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */
|
|
7
|
+
amino: 1,
|
|
8
|
+
/** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */
|
|
9
|
+
direct: 2,
|
|
10
|
+
/** SIGN_MODE_TEXTUAL (rare). */
|
|
11
|
+
textual: 3,
|
|
12
|
+
/** ADR-036 arbitrary-message signing. */
|
|
13
|
+
message: 4
|
|
14
|
+
};
|
|
15
|
+
const COSMOS_REPLY_TYPES = ["cosmos-signature"];
|
|
16
|
+
const ETHERMINT_REPLY_TYPES = ["evm-signature"];
|
|
17
|
+
/** EvmSignDataType on the wire: 2 = Amino SignDoc, 3 = Direct SignDoc. */
|
|
18
|
+
const ETHERMINT_WIRE_TYPE = {
|
|
19
|
+
1: 2,
|
|
20
|
+
2: 3
|
|
21
|
+
};
|
|
22
|
+
var CosmosChain = class {
|
|
23
|
+
constructor(config) {
|
|
24
|
+
this.context = require_shared.resolveContext(config);
|
|
25
|
+
}
|
|
26
|
+
/** Build a `cosmos-sign-request` (4101). Reply: `cosmos-signature` (4102). */
|
|
27
|
+
generateSignRequest(props) {
|
|
28
|
+
const requestId = require_shared.resolveRequestId(this.context, props.requestId);
|
|
29
|
+
const path = require_keypath.parsePath(props.path);
|
|
30
|
+
const xfp = require_keypath.normalizeXfp(props.xfp);
|
|
31
|
+
if (props.signData.length === 0) throw new require_shared.EraSdkError("invalid-props", "signData must not be empty");
|
|
32
|
+
const entries = [
|
|
33
|
+
[1, require_shared.cbTag(37, require_shared.cbBytes(requestId))],
|
|
34
|
+
[2, require_shared.cbBytes(props.signData)],
|
|
35
|
+
[3, require_shared.cbUint(props.dataType)],
|
|
36
|
+
[4, require_shared.cbArray([require_keypath.keypath304(path, xfp)])]
|
|
37
|
+
];
|
|
38
|
+
if (props.address !== void 0) entries.push([5, require_shared.cbArray([require_shared.cbText(props.address)])]);
|
|
39
|
+
entries.push([6, require_shared.cbText(props.origin ?? this.context.origin)]);
|
|
40
|
+
const ur = new require_shared.Ur("cosmos-sign-request", require_shared.cborEncode(require_shared.cbMap(entries)));
|
|
41
|
+
return require_shared.makeSignRequest({
|
|
42
|
+
ur,
|
|
43
|
+
requestId,
|
|
44
|
+
replyTypes: COSMOS_REPLY_TYPES,
|
|
45
|
+
context: this.context,
|
|
46
|
+
parse: (reply) => parseCosmosSignature(reply, requestId, [...COSMOS_REPLY_TYPES])
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Build an `evm-sign-request` (4101, the Ethermint shape) for
|
|
51
|
+
* Injective/Evmos/Dymension-style chains. Reply: `evm-signature` (4102).
|
|
52
|
+
* The digest on these chains is keccak-256 — see `verifyCosmosSignature`.
|
|
53
|
+
*/
|
|
54
|
+
generateEthermintSignRequest(props) {
|
|
55
|
+
const requestId = require_shared.resolveRequestId(this.context, props.requestId);
|
|
56
|
+
const path = require_keypath.parsePath(props.path);
|
|
57
|
+
const xfp = require_keypath.normalizeXfp(props.xfp);
|
|
58
|
+
if (props.signData.length === 0) throw new require_shared.EraSdkError("invalid-props", "signData must not be empty");
|
|
59
|
+
const wireType = ETHERMINT_WIRE_TYPE[props.dataType];
|
|
60
|
+
if (wireType === void 0) throw new require_shared.EraSdkError("invalid-props", "Ethermint requests are Amino or Direct only");
|
|
61
|
+
const entries = [
|
|
62
|
+
[1, require_shared.cbTag(37, require_shared.cbBytes(requestId))],
|
|
63
|
+
[2, require_shared.cbBytes(props.signData)],
|
|
64
|
+
[3, require_shared.cbUint(wireType)],
|
|
65
|
+
[4, require_shared.cbUint(0)],
|
|
66
|
+
[5, require_keypath.keypath304(path, xfp)]
|
|
67
|
+
];
|
|
68
|
+
if (props.address !== void 0) entries.push([6, require_shared.cbBytes(require_shared.utf8Encode(props.address))]);
|
|
69
|
+
entries.push([7, require_shared.cbText(props.origin ?? this.context.origin)]);
|
|
70
|
+
const ur = new require_shared.Ur("evm-sign-request", require_shared.cborEncode(require_shared.cbMap(entries)));
|
|
71
|
+
return require_shared.makeSignRequest({
|
|
72
|
+
ur,
|
|
73
|
+
requestId,
|
|
74
|
+
replyTypes: ETHERMINT_REPLY_TYPES,
|
|
75
|
+
context: this.context,
|
|
76
|
+
parse: (reply) => parseCosmosSignature(reply, requestId, [...ETHERMINT_REPLY_TYPES])
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** Parse a `cosmos-signature`/`evm-signature` standalone. */
|
|
80
|
+
parseSignature(input, expect) {
|
|
81
|
+
return parseCosmosSignature(require_shared.toUr(input), expect?.requestId === void 0 ? void 0 : require_shared.normalizeRequestId(expect.requestId), ["cosmos-signature", "evm-signature"]);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
CosmosChain.DataType = CosmosDataType;
|
|
85
|
+
function parseCosmosSignature(ur, expectedRequestId, replyTypes) {
|
|
86
|
+
require_shared.requireUrType(ur, replyTypes, "cosmos-signature");
|
|
87
|
+
const map = require_shared.requireReplyMap(ur, ur.type);
|
|
88
|
+
const requestId = require_shared.requireRequestIdEcho(map, 1, expectedRequestId, ur.type);
|
|
89
|
+
const signature = require_shared.asBytes(require_shared.mapGet(map, 2));
|
|
90
|
+
if (!signature || signature.length !== 64) throw new require_shared.EraSdkError("malformed-reply", `${ur.type} signature is ${signature?.length ?? 0} bytes, expected 64 (compact r||s)`);
|
|
91
|
+
const publicKey = require_shared.asBytes(require_shared.mapGet(map, 3));
|
|
92
|
+
if (publicKey !== void 0 && publicKey.length !== 33) throw new require_shared.EraSdkError("malformed-reply", `${ur.type} public key is not 33 bytes`);
|
|
93
|
+
return {
|
|
94
|
+
requestId,
|
|
95
|
+
signature,
|
|
96
|
+
publicKey
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
Object.defineProperty(exports, "CosmosChain", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function() {
|
|
103
|
+
return CosmosChain;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "CosmosDataType", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function() {
|
|
109
|
+
return CosmosDataType;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=cosmos-DDsgtUki.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmos-DDsgtUki.cjs","names":["resolveContext","resolveRequestId","parsePath","normalizeXfp","EraSdkError","cbTag","cbBytes","cbUint","cbArray","keypath304","cbText","UrValue","cborEncode","cbMap","makeSignRequest","utf8Encode","toUr","normalizeRequestId","requireReplyMap","requireRequestIdEcho","asBytes","mapGet"],"sources":["../src/chains/cosmos.ts"],"sourcesContent":["import { cborEncode } from '../cbor/encode';\nimport type { CborValue } from '../cbor/model';\nimport { asBytes, cbArray, cbBytes, cbMap, cbTag, cbText, cbUint, mapGet } from '../cbor/model';\nimport { utf8Encode } from '../core/bytes';\nimport { EraSdkError } from '../core/errors';\nimport { normalizeRequestId } from '../core/rand';\nimport { keypath304, normalizeXfp, parsePath } from '../registry/keypath';\nimport type { Ur } from '../ur/ur';\nimport { Ur as UrValue } from '../ur/ur';\nimport type { ChainContext, EraConnectConfig, ExpectedReply, SignRequest } from './shared';\nimport {\n makeSignRequest,\n requireReplyMap,\n requireRequestIdEcho,\n requireUrType,\n resolveContext,\n resolveRequestId,\n toUr,\n} from './shared';\n\n/** `cosmos-sign-request` dataType (CBOR key 3). */\nexport const CosmosDataType = {\n /** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */\n amino: 1,\n /** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */\n direct: 2,\n /** SIGN_MODE_TEXTUAL (rare). */\n textual: 3,\n /** ADR-036 arbitrary-message signing. */\n message: 4,\n} as const;\nexport type CosmosDataType = (typeof CosmosDataType)[keyof typeof CosmosDataType];\n\nexport interface CosmosSignRequestProps {\n readonly requestId?: Uint8Array | string;\n /** SignDoc bytes: canonical Amino JSON (UTF-8) or protobuf SignDoc. */\n readonly signData: Uint8Array;\n readonly dataType: CosmosDataType;\n /** Full signing path, e.g. `m/44'/118'/0'/0/0`. */\n readonly path: string;\n readonly xfp: string | number;\n /** Bech32 signer address — device display. */\n readonly address?: string;\n readonly origin?: string;\n}\n\n/**\n * Ethermint-family chains (Injective, Evmos, Dymension, …) sign with\n * keccak-256 over Ethereum-style keys (`m/44'/60'/...`) and travel as an\n * `evm-sign-request` instead.\n */\nexport interface EthermintSignRequestProps {\n readonly requestId?: Uint8Array | string;\n readonly signData: Uint8Array;\n /** Amino or Direct — the SignDoc encoding. */\n readonly dataType: typeof CosmosDataType.amino | typeof CosmosDataType.direct;\n /** e.g. `m/44'/60'/0'/0/0`. */\n readonly path: string;\n readonly xfp: string | number;\n /** The `0x…` signer address string — travels as its ASCII bytes on this wire. */\n readonly address?: string;\n readonly origin?: string;\n}\n\nexport interface CosmosSignatureResult {\n readonly requestId: Uint8Array;\n /** 64-byte compact secp256k1 signature (r || s). */\n readonly signature: Uint8Array;\n /** 33-byte compressed public key (absent on the `evm-signature` reply shape). */\n readonly publicKey: Uint8Array | undefined;\n}\n\nconst COSMOS_REPLY_TYPES = ['cosmos-signature'] as const;\nconst ETHERMINT_REPLY_TYPES = ['evm-signature'] as const;\n\n/** EvmSignDataType on the wire: 2 = Amino SignDoc, 3 = Direct SignDoc. */\nconst ETHERMINT_WIRE_TYPE: Record<number, number> = { 1: 2, 2: 3 };\n\nexport class CosmosChain {\n static readonly DataType = CosmosDataType;\n\n private readonly context: ChainContext;\n\n constructor(config?: EraConnectConfig) {\n this.context = resolveContext(config);\n }\n\n /** Build a `cosmos-sign-request` (4101). Reply: `cosmos-signature` (4102). */\n generateSignRequest(props: CosmosSignRequestProps): SignRequest<CosmosSignatureResult> {\n const requestId = resolveRequestId(this.context, props.requestId);\n const path = parsePath(props.path);\n const xfp = normalizeXfp(props.xfp);\n if (props.signData.length === 0) {\n throw new EraSdkError('invalid-props', 'signData must not be empty');\n }\n\n const entries: [number, CborValue][] = [\n [1, cbTag(37, cbBytes(requestId))],\n [2, cbBytes(props.signData)],\n [3, cbUint(props.dataType)],\n [4, cbArray([keypath304(path, xfp)])],\n ];\n if (props.address !== undefined) entries.push([5, cbArray([cbText(props.address)])]);\n entries.push([6, cbText(props.origin ?? this.context.origin)]);\n\n const ur = new UrValue('cosmos-sign-request', cborEncode(cbMap(entries)));\n return makeSignRequest({\n ur,\n requestId,\n replyTypes: COSMOS_REPLY_TYPES,\n context: this.context,\n parse: (reply) => parseCosmosSignature(reply, requestId, [...COSMOS_REPLY_TYPES]),\n });\n }\n\n /**\n * Build an `evm-sign-request` (4101, the Ethermint shape) for\n * Injective/Evmos/Dymension-style chains. Reply: `evm-signature` (4102).\n * The digest on these chains is keccak-256 — see `verifyCosmosSignature`.\n */\n generateEthermintSignRequest(\n props: EthermintSignRequestProps,\n ): SignRequest<CosmosSignatureResult> {\n const requestId = resolveRequestId(this.context, props.requestId);\n const path = parsePath(props.path);\n const xfp = normalizeXfp(props.xfp);\n if (props.signData.length === 0) {\n throw new EraSdkError('invalid-props', 'signData must not be empty');\n }\n const wireType = ETHERMINT_WIRE_TYPE[props.dataType];\n if (wireType === undefined) {\n throw new EraSdkError('invalid-props', 'Ethermint requests are Amino or Direct only');\n }\n\n const entries: [number, CborValue][] = [\n [1, cbTag(37, cbBytes(requestId))],\n [2, cbBytes(props.signData)],\n [3, cbUint(wireType)],\n [4, cbUint(0)], // customChainId — 0, the chain resolves from the SignDoc\n [5, keypath304(path, xfp)],\n ];\n if (props.address !== undefined) {\n entries.push([6, cbBytes(utf8Encode(props.address))]); // ASCII of the 0x string\n }\n entries.push([7, cbText(props.origin ?? this.context.origin)]);\n\n const ur = new UrValue('evm-sign-request', cborEncode(cbMap(entries)));\n return makeSignRequest({\n ur,\n requestId,\n replyTypes: ETHERMINT_REPLY_TYPES,\n context: this.context,\n parse: (reply) => parseCosmosSignature(reply, requestId, [...ETHERMINT_REPLY_TYPES]),\n });\n }\n\n /** Parse a `cosmos-signature`/`evm-signature` standalone. */\n parseSignature(input: Ur | string, expect?: ExpectedReply): CosmosSignatureResult {\n return parseCosmosSignature(\n toUr(input),\n expect?.requestId === undefined ? undefined : normalizeRequestId(expect.requestId),\n ['cosmos-signature', 'evm-signature'],\n );\n }\n}\n\nfunction parseCosmosSignature(\n ur: Ur,\n expectedRequestId: Uint8Array | undefined,\n replyTypes: string[],\n): CosmosSignatureResult {\n requireUrType(ur, replyTypes, 'cosmos-signature');\n const map = requireReplyMap(ur, ur.type);\n const requestId = requireRequestIdEcho(map, 1, expectedRequestId, ur.type);\n const signature = asBytes(mapGet(map, 2));\n if (!signature || signature.length !== 64) {\n throw new EraSdkError(\n 'malformed-reply',\n `${ur.type} signature is ${signature?.length ?? 0} bytes, expected 64 (compact r||s)`,\n );\n }\n const publicKey = asBytes(mapGet(map, 3));\n if (publicKey !== undefined && publicKey.length !== 33) {\n throw new EraSdkError('malformed-reply', `${ur.type} public key is not 33 bytes`);\n }\n return { requestId, signature, publicKey };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, i as ExpectedReply, r as EraConnectConfig } from "./shared-CI8zhQiE.js";
|
|
2
|
+
//#region src/chains/cosmos.d.ts
|
|
3
|
+
/** `cosmos-sign-request` dataType (CBOR key 3). */
|
|
4
|
+
declare const CosmosDataType: {
|
|
5
|
+
/** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */
|
|
6
|
+
readonly amino: 1;
|
|
7
|
+
/** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */
|
|
8
|
+
readonly direct: 2;
|
|
9
|
+
/** SIGN_MODE_TEXTUAL (rare). */
|
|
10
|
+
readonly textual: 3;
|
|
11
|
+
/** ADR-036 arbitrary-message signing. */
|
|
12
|
+
readonly message: 4;
|
|
13
|
+
};
|
|
14
|
+
type CosmosDataType = (typeof CosmosDataType)[keyof typeof CosmosDataType];
|
|
15
|
+
interface CosmosSignRequestProps {
|
|
16
|
+
readonly requestId?: Uint8Array | string;
|
|
17
|
+
/** SignDoc bytes: canonical Amino JSON (UTF-8) or protobuf SignDoc. */
|
|
18
|
+
readonly signData: Uint8Array;
|
|
19
|
+
readonly dataType: CosmosDataType;
|
|
20
|
+
/** Full signing path, e.g. `m/44'/118'/0'/0/0`. */
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly xfp: string | number;
|
|
23
|
+
/** Bech32 signer address — device display. */
|
|
24
|
+
readonly address?: string;
|
|
25
|
+
readonly origin?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Ethermint-family chains (Injective, Evmos, Dymension, …) sign with
|
|
29
|
+
* keccak-256 over Ethereum-style keys (`m/44'/60'/...`) and travel as an
|
|
30
|
+
* `evm-sign-request` instead.
|
|
31
|
+
*/
|
|
32
|
+
interface EthermintSignRequestProps {
|
|
33
|
+
readonly requestId?: Uint8Array | string;
|
|
34
|
+
readonly signData: Uint8Array;
|
|
35
|
+
/** Amino or Direct — the SignDoc encoding. */
|
|
36
|
+
readonly dataType: typeof CosmosDataType.amino | typeof CosmosDataType.direct;
|
|
37
|
+
/** e.g. `m/44'/60'/0'/0/0`. */
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly xfp: string | number;
|
|
40
|
+
/** The `0x…` signer address string — travels as its ASCII bytes on this wire. */
|
|
41
|
+
readonly address?: string;
|
|
42
|
+
readonly origin?: string;
|
|
43
|
+
}
|
|
44
|
+
interface CosmosSignatureResult {
|
|
45
|
+
readonly requestId: Uint8Array;
|
|
46
|
+
/** 64-byte compact secp256k1 signature (r || s). */
|
|
47
|
+
readonly signature: Uint8Array;
|
|
48
|
+
/** 33-byte compressed public key (absent on the `evm-signature` reply shape). */
|
|
49
|
+
readonly publicKey: Uint8Array | undefined;
|
|
50
|
+
}
|
|
51
|
+
declare class CosmosChain {
|
|
52
|
+
static readonly DataType: {
|
|
53
|
+
/** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */
|
|
54
|
+
readonly amino: 1;
|
|
55
|
+
/** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */
|
|
56
|
+
readonly direct: 2;
|
|
57
|
+
/** SIGN_MODE_TEXTUAL (rare). */
|
|
58
|
+
readonly textual: 3;
|
|
59
|
+
/** ADR-036 arbitrary-message signing. */
|
|
60
|
+
readonly message: 4;
|
|
61
|
+
};
|
|
62
|
+
private readonly context;
|
|
63
|
+
constructor(config?: EraConnectConfig);
|
|
64
|
+
/** Build a `cosmos-sign-request` (4101). Reply: `cosmos-signature` (4102). */
|
|
65
|
+
generateSignRequest(props: CosmosSignRequestProps): SignRequest<CosmosSignatureResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Build an `evm-sign-request` (4101, the Ethermint shape) for
|
|
68
|
+
* Injective/Evmos/Dymension-style chains. Reply: `evm-signature` (4102).
|
|
69
|
+
* The digest on these chains is keccak-256 — see `verifyCosmosSignature`.
|
|
70
|
+
*/
|
|
71
|
+
generateEthermintSignRequest(props: EthermintSignRequestProps): SignRequest<CosmosSignatureResult>;
|
|
72
|
+
/** Parse a `cosmos-signature`/`evm-signature` standalone. */
|
|
73
|
+
parseSignature(input: Ur | string, expect?: ExpectedReply): CosmosSignatureResult;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { EthermintSignRequestProps as a, CosmosSignatureResult as i, CosmosDataType as n, CosmosSignRequestProps as r, CosmosChain as t };
|
|
77
|
+
//# sourceMappingURL=cosmos-DqyjA6lg.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { A as utf8Encode, B as cbMap, H as cbText, K as EraSdkError, L as cbArray, N as asBytes, U as cbUint, V as cbTag, W as mapGet, _ as Ur, c as resolveRequestId, h as normalizeRequestId, i as requireRequestIdEcho, l as toUr, n as makeSignRequest, o as requireUrType, r as requireReplyMap, s as resolveContext, x as cborEncode, z as cbBytes } from "./shared-Bbgejrus.js";
|
|
2
|
+
import { i as parsePath, n as keypath304, r as normalizeXfp } from "./keypath-Bvv_cfHt.js";
|
|
3
|
+
//#region src/chains/cosmos.ts
|
|
4
|
+
/** `cosmos-sign-request` dataType (CBOR key 3). */
|
|
5
|
+
const CosmosDataType = {
|
|
6
|
+
/** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */
|
|
7
|
+
amino: 1,
|
|
8
|
+
/** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */
|
|
9
|
+
direct: 2,
|
|
10
|
+
/** SIGN_MODE_TEXTUAL (rare). */
|
|
11
|
+
textual: 3,
|
|
12
|
+
/** ADR-036 arbitrary-message signing. */
|
|
13
|
+
message: 4
|
|
14
|
+
};
|
|
15
|
+
const COSMOS_REPLY_TYPES = ["cosmos-signature"];
|
|
16
|
+
const ETHERMINT_REPLY_TYPES = ["evm-signature"];
|
|
17
|
+
/** EvmSignDataType on the wire: 2 = Amino SignDoc, 3 = Direct SignDoc. */
|
|
18
|
+
const ETHERMINT_WIRE_TYPE = {
|
|
19
|
+
1: 2,
|
|
20
|
+
2: 3
|
|
21
|
+
};
|
|
22
|
+
var CosmosChain = class {
|
|
23
|
+
constructor(config) {
|
|
24
|
+
this.context = resolveContext(config);
|
|
25
|
+
}
|
|
26
|
+
/** Build a `cosmos-sign-request` (4101). Reply: `cosmos-signature` (4102). */
|
|
27
|
+
generateSignRequest(props) {
|
|
28
|
+
const requestId = resolveRequestId(this.context, props.requestId);
|
|
29
|
+
const path = parsePath(props.path);
|
|
30
|
+
const xfp = normalizeXfp(props.xfp);
|
|
31
|
+
if (props.signData.length === 0) throw new EraSdkError("invalid-props", "signData must not be empty");
|
|
32
|
+
const entries = [
|
|
33
|
+
[1, cbTag(37, cbBytes(requestId))],
|
|
34
|
+
[2, cbBytes(props.signData)],
|
|
35
|
+
[3, cbUint(props.dataType)],
|
|
36
|
+
[4, cbArray([keypath304(path, xfp)])]
|
|
37
|
+
];
|
|
38
|
+
if (props.address !== void 0) entries.push([5, cbArray([cbText(props.address)])]);
|
|
39
|
+
entries.push([6, cbText(props.origin ?? this.context.origin)]);
|
|
40
|
+
const ur = new Ur("cosmos-sign-request", cborEncode(cbMap(entries)));
|
|
41
|
+
return makeSignRequest({
|
|
42
|
+
ur,
|
|
43
|
+
requestId,
|
|
44
|
+
replyTypes: COSMOS_REPLY_TYPES,
|
|
45
|
+
context: this.context,
|
|
46
|
+
parse: (reply) => parseCosmosSignature(reply, requestId, [...COSMOS_REPLY_TYPES])
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Build an `evm-sign-request` (4101, the Ethermint shape) for
|
|
51
|
+
* Injective/Evmos/Dymension-style chains. Reply: `evm-signature` (4102).
|
|
52
|
+
* The digest on these chains is keccak-256 — see `verifyCosmosSignature`.
|
|
53
|
+
*/
|
|
54
|
+
generateEthermintSignRequest(props) {
|
|
55
|
+
const requestId = resolveRequestId(this.context, props.requestId);
|
|
56
|
+
const path = parsePath(props.path);
|
|
57
|
+
const xfp = normalizeXfp(props.xfp);
|
|
58
|
+
if (props.signData.length === 0) throw new EraSdkError("invalid-props", "signData must not be empty");
|
|
59
|
+
const wireType = ETHERMINT_WIRE_TYPE[props.dataType];
|
|
60
|
+
if (wireType === void 0) throw new EraSdkError("invalid-props", "Ethermint requests are Amino or Direct only");
|
|
61
|
+
const entries = [
|
|
62
|
+
[1, cbTag(37, cbBytes(requestId))],
|
|
63
|
+
[2, cbBytes(props.signData)],
|
|
64
|
+
[3, cbUint(wireType)],
|
|
65
|
+
[4, cbUint(0)],
|
|
66
|
+
[5, keypath304(path, xfp)]
|
|
67
|
+
];
|
|
68
|
+
if (props.address !== void 0) entries.push([6, cbBytes(utf8Encode(props.address))]);
|
|
69
|
+
entries.push([7, cbText(props.origin ?? this.context.origin)]);
|
|
70
|
+
const ur = new Ur("evm-sign-request", cborEncode(cbMap(entries)));
|
|
71
|
+
return makeSignRequest({
|
|
72
|
+
ur,
|
|
73
|
+
requestId,
|
|
74
|
+
replyTypes: ETHERMINT_REPLY_TYPES,
|
|
75
|
+
context: this.context,
|
|
76
|
+
parse: (reply) => parseCosmosSignature(reply, requestId, [...ETHERMINT_REPLY_TYPES])
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** Parse a `cosmos-signature`/`evm-signature` standalone. */
|
|
80
|
+
parseSignature(input, expect) {
|
|
81
|
+
return parseCosmosSignature(toUr(input), expect?.requestId === void 0 ? void 0 : normalizeRequestId(expect.requestId), ["cosmos-signature", "evm-signature"]);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
CosmosChain.DataType = CosmosDataType;
|
|
85
|
+
function parseCosmosSignature(ur, expectedRequestId, replyTypes) {
|
|
86
|
+
requireUrType(ur, replyTypes, "cosmos-signature");
|
|
87
|
+
const map = requireReplyMap(ur, ur.type);
|
|
88
|
+
const requestId = requireRequestIdEcho(map, 1, expectedRequestId, ur.type);
|
|
89
|
+
const signature = asBytes(mapGet(map, 2));
|
|
90
|
+
if (!signature || signature.length !== 64) throw new EraSdkError("malformed-reply", `${ur.type} signature is ${signature?.length ?? 0} bytes, expected 64 (compact r||s)`);
|
|
91
|
+
const publicKey = asBytes(mapGet(map, 3));
|
|
92
|
+
if (publicKey !== void 0 && publicKey.length !== 33) throw new EraSdkError("malformed-reply", `${ur.type} public key is not 33 bytes`);
|
|
93
|
+
return {
|
|
94
|
+
requestId,
|
|
95
|
+
signature,
|
|
96
|
+
publicKey
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { CosmosDataType as n, CosmosChain as t };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=cosmos-jUHNxgWC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmos-jUHNxgWC.js","names":["UrValue"],"sources":["../src/chains/cosmos.ts"],"sourcesContent":["import { cborEncode } from '../cbor/encode';\nimport type { CborValue } from '../cbor/model';\nimport { asBytes, cbArray, cbBytes, cbMap, cbTag, cbText, cbUint, mapGet } from '../cbor/model';\nimport { utf8Encode } from '../core/bytes';\nimport { EraSdkError } from '../core/errors';\nimport { normalizeRequestId } from '../core/rand';\nimport { keypath304, normalizeXfp, parsePath } from '../registry/keypath';\nimport type { Ur } from '../ur/ur';\nimport { Ur as UrValue } from '../ur/ur';\nimport type { ChainContext, EraConnectConfig, ExpectedReply, SignRequest } from './shared';\nimport {\n makeSignRequest,\n requireReplyMap,\n requireRequestIdEcho,\n requireUrType,\n resolveContext,\n resolveRequestId,\n toUr,\n} from './shared';\n\n/** `cosmos-sign-request` dataType (CBOR key 3). */\nexport const CosmosDataType = {\n /** SIGN_MODE_LEGACY_AMINO_JSON — `signData` is the canonical JSON (UTF-8 bytes). */\n amino: 1,\n /** SIGN_MODE_DIRECT — `signData` is the protobuf-encoded SignDoc. */\n direct: 2,\n /** SIGN_MODE_TEXTUAL (rare). */\n textual: 3,\n /** ADR-036 arbitrary-message signing. */\n message: 4,\n} as const;\nexport type CosmosDataType = (typeof CosmosDataType)[keyof typeof CosmosDataType];\n\nexport interface CosmosSignRequestProps {\n readonly requestId?: Uint8Array | string;\n /** SignDoc bytes: canonical Amino JSON (UTF-8) or protobuf SignDoc. */\n readonly signData: Uint8Array;\n readonly dataType: CosmosDataType;\n /** Full signing path, e.g. `m/44'/118'/0'/0/0`. */\n readonly path: string;\n readonly xfp: string | number;\n /** Bech32 signer address — device display. */\n readonly address?: string;\n readonly origin?: string;\n}\n\n/**\n * Ethermint-family chains (Injective, Evmos, Dymension, …) sign with\n * keccak-256 over Ethereum-style keys (`m/44'/60'/...`) and travel as an\n * `evm-sign-request` instead.\n */\nexport interface EthermintSignRequestProps {\n readonly requestId?: Uint8Array | string;\n readonly signData: Uint8Array;\n /** Amino or Direct — the SignDoc encoding. */\n readonly dataType: typeof CosmosDataType.amino | typeof CosmosDataType.direct;\n /** e.g. `m/44'/60'/0'/0/0`. */\n readonly path: string;\n readonly xfp: string | number;\n /** The `0x…` signer address string — travels as its ASCII bytes on this wire. */\n readonly address?: string;\n readonly origin?: string;\n}\n\nexport interface CosmosSignatureResult {\n readonly requestId: Uint8Array;\n /** 64-byte compact secp256k1 signature (r || s). */\n readonly signature: Uint8Array;\n /** 33-byte compressed public key (absent on the `evm-signature` reply shape). */\n readonly publicKey: Uint8Array | undefined;\n}\n\nconst COSMOS_REPLY_TYPES = ['cosmos-signature'] as const;\nconst ETHERMINT_REPLY_TYPES = ['evm-signature'] as const;\n\n/** EvmSignDataType on the wire: 2 = Amino SignDoc, 3 = Direct SignDoc. */\nconst ETHERMINT_WIRE_TYPE: Record<number, number> = { 1: 2, 2: 3 };\n\nexport class CosmosChain {\n static readonly DataType = CosmosDataType;\n\n private readonly context: ChainContext;\n\n constructor(config?: EraConnectConfig) {\n this.context = resolveContext(config);\n }\n\n /** Build a `cosmos-sign-request` (4101). Reply: `cosmos-signature` (4102). */\n generateSignRequest(props: CosmosSignRequestProps): SignRequest<CosmosSignatureResult> {\n const requestId = resolveRequestId(this.context, props.requestId);\n const path = parsePath(props.path);\n const xfp = normalizeXfp(props.xfp);\n if (props.signData.length === 0) {\n throw new EraSdkError('invalid-props', 'signData must not be empty');\n }\n\n const entries: [number, CborValue][] = [\n [1, cbTag(37, cbBytes(requestId))],\n [2, cbBytes(props.signData)],\n [3, cbUint(props.dataType)],\n [4, cbArray([keypath304(path, xfp)])],\n ];\n if (props.address !== undefined) entries.push([5, cbArray([cbText(props.address)])]);\n entries.push([6, cbText(props.origin ?? this.context.origin)]);\n\n const ur = new UrValue('cosmos-sign-request', cborEncode(cbMap(entries)));\n return makeSignRequest({\n ur,\n requestId,\n replyTypes: COSMOS_REPLY_TYPES,\n context: this.context,\n parse: (reply) => parseCosmosSignature(reply, requestId, [...COSMOS_REPLY_TYPES]),\n });\n }\n\n /**\n * Build an `evm-sign-request` (4101, the Ethermint shape) for\n * Injective/Evmos/Dymension-style chains. Reply: `evm-signature` (4102).\n * The digest on these chains is keccak-256 — see `verifyCosmosSignature`.\n */\n generateEthermintSignRequest(\n props: EthermintSignRequestProps,\n ): SignRequest<CosmosSignatureResult> {\n const requestId = resolveRequestId(this.context, props.requestId);\n const path = parsePath(props.path);\n const xfp = normalizeXfp(props.xfp);\n if (props.signData.length === 0) {\n throw new EraSdkError('invalid-props', 'signData must not be empty');\n }\n const wireType = ETHERMINT_WIRE_TYPE[props.dataType];\n if (wireType === undefined) {\n throw new EraSdkError('invalid-props', 'Ethermint requests are Amino or Direct only');\n }\n\n const entries: [number, CborValue][] = [\n [1, cbTag(37, cbBytes(requestId))],\n [2, cbBytes(props.signData)],\n [3, cbUint(wireType)],\n [4, cbUint(0)], // customChainId — 0, the chain resolves from the SignDoc\n [5, keypath304(path, xfp)],\n ];\n if (props.address !== undefined) {\n entries.push([6, cbBytes(utf8Encode(props.address))]); // ASCII of the 0x string\n }\n entries.push([7, cbText(props.origin ?? this.context.origin)]);\n\n const ur = new UrValue('evm-sign-request', cborEncode(cbMap(entries)));\n return makeSignRequest({\n ur,\n requestId,\n replyTypes: ETHERMINT_REPLY_TYPES,\n context: this.context,\n parse: (reply) => parseCosmosSignature(reply, requestId, [...ETHERMINT_REPLY_TYPES]),\n });\n }\n\n /** Parse a `cosmos-signature`/`evm-signature` standalone. */\n parseSignature(input: Ur | string, expect?: ExpectedReply): CosmosSignatureResult {\n return parseCosmosSignature(\n toUr(input),\n expect?.requestId === undefined ? undefined : normalizeRequestId(expect.requestId),\n ['cosmos-signature', 'evm-signature'],\n );\n }\n}\n\nfunction parseCosmosSignature(\n ur: Ur,\n expectedRequestId: Uint8Array | undefined,\n replyTypes: string[],\n): CosmosSignatureResult {\n requireUrType(ur, replyTypes, 'cosmos-signature');\n const map = requireReplyMap(ur, ur.type);\n const requestId = requireRequestIdEcho(map, 1, expectedRequestId, ur.type);\n const signature = asBytes(mapGet(map, 2));\n if (!signature || signature.length !== 64) {\n throw new EraSdkError(\n 'malformed-reply',\n `${ur.type} signature is ${signature?.length ?? 0} bytes, expected 64 (compact r||s)`,\n );\n }\n const publicKey = asBytes(mapGet(map, 3));\n if (publicKey !== undefined && publicKey.length !== 33) {\n throw new EraSdkError('malformed-reply', `${ur.type} public key is not 33 bytes`);\n }\n return { requestId, signature, publicKey };\n}\n"],"mappings":"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"}
|
package/dist/cosmos.cjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_shared = require("./shared-Cu2yynP9.cjs");
|
|
3
|
+
const require_cosmos = require("./cosmos-DDsgtUki.cjs");
|
|
4
|
+
exports.AnimatedUr = require_shared.AnimatedUr;
|
|
5
|
+
exports.CosmosChain = require_cosmos.CosmosChain;
|
|
6
|
+
exports.CosmosDataType = require_cosmos.CosmosDataType;
|
|
7
|
+
exports.EraSdkError = require_shared.EraSdkError;
|
|
8
|
+
exports.TypedUrScanner = require_shared.TypedUrScanner;
|
|
9
|
+
exports.Ur = require_shared.Ur;
|
|
10
|
+
exports.UrScanner = require_shared.UrScanner;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, c as TypedUrScanner, d as EraErrorCode, f as EraSdkError, i as ExpectedReply, l as UrScanner, p as AnimatedUr, r as EraConnectConfig } from "./shared-CI8zhQiE.cjs";
|
|
2
|
+
import { a as EthermintSignRequestProps, i as CosmosSignatureResult, n as CosmosDataType, r as CosmosSignRequestProps, t as CosmosChain } from "./cosmos-BYrhIqRk.cjs";
|
|
3
|
+
export { AnimatedUr, CosmosChain, CosmosDataType, type CosmosSignRequestProps, type CosmosSignatureResult, type EraConnectConfig, type EraErrorCode, EraSdkError, type EthermintSignRequestProps, type ExpectedReply, type SignRequest, TypedUrScanner, Ur, UrScanner };
|
package/dist/cosmos.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { _ as Ur, a as SignRequest, c as TypedUrScanner, d as EraErrorCode, f as EraSdkError, i as ExpectedReply, l as UrScanner, p as AnimatedUr, r as EraConnectConfig } from "./shared-CI8zhQiE.js";
|
|
2
|
+
import { a as EthermintSignRequestProps, i as CosmosSignatureResult, n as CosmosDataType, r as CosmosSignRequestProps, t as CosmosChain } from "./cosmos-DqyjA6lg.js";
|
|
3
|
+
export { AnimatedUr, CosmosChain, CosmosDataType, type CosmosSignRequestProps, type CosmosSignatureResult, type EraConnectConfig, type EraErrorCode, EraSdkError, type EthermintSignRequestProps, type ExpectedReply, type SignRequest, TypedUrScanner, Ur, UrScanner };
|
package/dist/cosmos.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { K as EraSdkError, _ as Ur, d as UrScanner, f as AnimatedUr, u as TypedUrScanner } from "./shared-Bbgejrus.js";
|
|
2
|
+
import { n as CosmosDataType, t as CosmosChain } from "./cosmos-jUHNxgWC.js";
|
|
3
|
+
export { AnimatedUr, CosmosChain, CosmosDataType, EraSdkError, TypedUrScanner, Ur, UrScanner };
|