@cardano-sdk/key-management 0.15.1 → 0.17.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/dist/cjs/Bip32Account.d.ts +19 -0
- package/dist/cjs/Bip32Account.d.ts.map +1 -0
- package/dist/cjs/Bip32Account.js +74 -0
- package/dist/cjs/Bip32Account.js.map +1 -0
- package/dist/cjs/InMemoryKeyAgent.d.ts +2 -2
- package/dist/cjs/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/cjs/InMemoryKeyAgent.js +3 -4
- package/dist/cjs/InMemoryKeyAgent.js.map +1 -1
- package/dist/cjs/KeyAgentBase.d.ts +4 -7
- package/dist/cjs/KeyAgentBase.d.ts.map +1 -1
- package/dist/cjs/KeyAgentBase.js +9 -50
- package/dist/cjs/KeyAgentBase.js.map +1 -1
- package/dist/cjs/cip8/cip30signData.d.ts +5 -3
- package/dist/cjs/cip8/cip30signData.d.ts.map +1 -1
- package/dist/cjs/cip8/cip30signData.js +6 -8
- package/dist/cjs/cip8/cip30signData.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +18 -16
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/types.js +3 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/util/KeyAgentTransactionSigner.d.ts.map +1 -1
- package/dist/cjs/util/KeyAgentTransactionSigner.js +3 -0
- package/dist/cjs/util/KeyAgentTransactionSigner.js.map +1 -1
- package/dist/cjs/util/createAsyncKeyAgent.d.ts.map +1 -1
- package/dist/cjs/util/createAsyncKeyAgent.js +15 -29
- package/dist/cjs/util/createAsyncKeyAgent.js.map +1 -1
- package/dist/cjs/util/createWitnesser.d.ts +3 -3
- package/dist/cjs/util/createWitnesser.d.ts.map +1 -1
- package/dist/cjs/util/createWitnesser.js +3 -3
- package/dist/cjs/util/createWitnesser.js.map +1 -1
- package/dist/cjs/util/ensureStakeKeys.d.ts +9 -3
- package/dist/cjs/util/ensureStakeKeys.d.ts.map +1 -1
- package/dist/cjs/util/ensureStakeKeys.js +8 -5
- package/dist/cjs/util/ensureStakeKeys.js.map +1 -1
- package/dist/cjs/util/index.d.ts +0 -1
- package/dist/cjs/util/index.d.ts.map +1 -1
- package/dist/cjs/util/index.js +0 -1
- package/dist/cjs/util/index.js.map +1 -1
- package/dist/cjs/util/key.d.ts +1 -0
- package/dist/cjs/util/key.d.ts.map +1 -1
- package/dist/cjs/util/key.js +3 -1
- package/dist/cjs/util/key.js.map +1 -1
- package/dist/cjs/util/ownSignatureKeyPaths.d.ts +3 -2
- package/dist/cjs/util/ownSignatureKeyPaths.d.ts.map +1 -1
- package/dist/cjs/util/ownSignatureKeyPaths.js +17 -8
- package/dist/cjs/util/ownSignatureKeyPaths.js.map +1 -1
- package/dist/cjs/util/stubSignTransaction.d.ts +3 -4
- package/dist/cjs/util/stubSignTransaction.d.ts.map +1 -1
- package/dist/cjs/util/stubSignTransaction.js +2 -3
- package/dist/cjs/util/stubSignTransaction.js.map +1 -1
- package/dist/esm/Bip32Account.d.ts +19 -0
- package/dist/esm/Bip32Account.d.ts.map +1 -0
- package/dist/esm/Bip32Account.js +47 -0
- package/dist/esm/Bip32Account.js.map +1 -0
- package/dist/esm/InMemoryKeyAgent.d.ts +2 -2
- package/dist/esm/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/esm/InMemoryKeyAgent.js +3 -4
- package/dist/esm/InMemoryKeyAgent.js.map +1 -1
- package/dist/esm/KeyAgentBase.d.ts +4 -7
- package/dist/esm/KeyAgentBase.d.ts.map +1 -1
- package/dist/esm/KeyAgentBase.js +9 -50
- package/dist/esm/KeyAgentBase.js.map +1 -1
- package/dist/esm/cip8/cip30signData.d.ts +5 -3
- package/dist/esm/cip8/cip30signData.d.ts.map +1 -1
- package/dist/esm/cip8/cip30signData.js +6 -8
- package/dist/esm/cip8/cip30signData.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +18 -16
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/util/KeyAgentTransactionSigner.d.ts.map +1 -1
- package/dist/esm/util/KeyAgentTransactionSigner.js +3 -0
- package/dist/esm/util/KeyAgentTransactionSigner.js.map +1 -1
- package/dist/esm/util/createAsyncKeyAgent.d.ts.map +1 -1
- package/dist/esm/util/createAsyncKeyAgent.js +15 -29
- package/dist/esm/util/createAsyncKeyAgent.js.map +1 -1
- package/dist/esm/util/createWitnesser.d.ts +3 -3
- package/dist/esm/util/createWitnesser.d.ts.map +1 -1
- package/dist/esm/util/createWitnesser.js +3 -3
- package/dist/esm/util/createWitnesser.js.map +1 -1
- package/dist/esm/util/ensureStakeKeys.d.ts +9 -3
- package/dist/esm/util/ensureStakeKeys.d.ts.map +1 -1
- package/dist/esm/util/ensureStakeKeys.js +8 -5
- package/dist/esm/util/ensureStakeKeys.js.map +1 -1
- package/dist/esm/util/index.d.ts +0 -1
- package/dist/esm/util/index.d.ts.map +1 -1
- package/dist/esm/util/index.js +0 -1
- package/dist/esm/util/index.js.map +1 -1
- package/dist/esm/util/key.d.ts +1 -0
- package/dist/esm/util/key.d.ts.map +1 -1
- package/dist/esm/util/key.js +1 -0
- package/dist/esm/util/key.js.map +1 -1
- package/dist/esm/util/ownSignatureKeyPaths.d.ts +3 -2
- package/dist/esm/util/ownSignatureKeyPaths.d.ts.map +1 -1
- package/dist/esm/util/ownSignatureKeyPaths.js +15 -7
- package/dist/esm/util/ownSignatureKeyPaths.js.map +1 -1
- package/dist/esm/util/stubSignTransaction.d.ts +3 -4
- package/dist/esm/util/stubSignTransaction.d.ts.map +1 -1
- package/dist/esm/util/stubSignTransaction.js +2 -3
- package/dist/esm/util/stubSignTransaction.js.map +1 -1
- package/package.json +8 -7
- package/dist/cjs/util/createAddressManager.d.ts +0 -14
- package/dist/cjs/util/createAddressManager.d.ts.map +0 -1
- package/dist/cjs/util/createAddressManager.js +0 -39
- package/dist/cjs/util/createAddressManager.js.map +0 -1
- package/dist/esm/util/createAddressManager.d.ts +0 -14
- package/dist/esm/util/createAddressManager.d.ts.map +0 -1
- package/dist/esm/util/createAddressManager.js +0 -34
- package/dist/esm/util/createAddressManager.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
+
import { AccountAddressDerivationPath, AccountKeyDerivationPath, AsyncKeyAgent, GroupedAddress } from './types';
|
|
3
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
4
|
+
declare type Bip32AccountProps = {
|
|
5
|
+
extendedAccountPublicKey: Crypto.Bip32PublicKeyHex;
|
|
6
|
+
accountIndex: number;
|
|
7
|
+
chainId: Cardano.ChainId;
|
|
8
|
+
};
|
|
9
|
+
export declare class Bip32Account {
|
|
10
|
+
readonly extendedAccountPublicKey: Crypto.Bip32PublicKey;
|
|
11
|
+
readonly chainId: Cardano.ChainId;
|
|
12
|
+
readonly accountIndex: number;
|
|
13
|
+
constructor({ extendedAccountPublicKey, chainId, accountIndex }: Bip32AccountProps);
|
|
14
|
+
derivePublicKey(derivationPath: AccountKeyDerivationPath): Promise<Crypto.Ed25519PublicKey>;
|
|
15
|
+
deriveAddress(paymentKeyDerivationPath: AccountAddressDerivationPath, stakeKeyDerivationIndex: number): Promise<GroupedAddress>;
|
|
16
|
+
static fromAsyncKeyAgent(keyAgent: AsyncKeyAgent): Promise<Bip32Account>;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Bip32Account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bip32Account.d.ts","sourceRoot":"","sources":["../../src/Bip32Account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,aAAa,EACb,cAAc,EAEf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,aAAK,iBAAiB,GAAG;IACvB,wBAAwB,EAAE,MAAM,CAAC,iBAAiB,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;CAC1B,CAAC;AAGF,qBAAa,YAAY;IACvB,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC,cAAc,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;gBAGlB,EAAE,wBAAwB,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,iBAAiB;IAM5E,eAAe,CAAC,cAAc,EAAE,wBAAwB;IAKxD,aAAa,CACjB,wBAAwB,EAAE,4BAA4B,EACtD,uBAAuB,EAAE,MAAM,GAC9B,OAAO,CAAC,cAAc,CAAC;WAyCb,iBAAiB,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAO/E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
+
import { KeyRole } from './types';
|
|
3
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
4
|
+
import { Hash28ByteBase16 } from '@cardano-sdk/crypto';
|
|
5
|
+
export class Bip32Account {
|
|
6
|
+
constructor({ extendedAccountPublicKey, chainId, accountIndex }) {
|
|
7
|
+
this.extendedAccountPublicKey = Crypto.Bip32PublicKey.fromHex(extendedAccountPublicKey);
|
|
8
|
+
this.chainId = chainId;
|
|
9
|
+
this.accountIndex = accountIndex;
|
|
10
|
+
}
|
|
11
|
+
async derivePublicKey(derivationPath) {
|
|
12
|
+
const key = await this.extendedAccountPublicKey.derive([derivationPath.role, derivationPath.index]);
|
|
13
|
+
return key.toRawKey();
|
|
14
|
+
}
|
|
15
|
+
async deriveAddress(paymentKeyDerivationPath, stakeKeyDerivationIndex) {
|
|
16
|
+
const stakeKeyDerivationPath = {
|
|
17
|
+
index: stakeKeyDerivationIndex,
|
|
18
|
+
role: KeyRole.Stake
|
|
19
|
+
};
|
|
20
|
+
const derivedPublicPaymentKey = await this.derivePublicKey({
|
|
21
|
+
index: paymentKeyDerivationPath.index,
|
|
22
|
+
role: Number(paymentKeyDerivationPath.type)
|
|
23
|
+
});
|
|
24
|
+
const derivedPublicPaymentKeyHash = await derivedPublicPaymentKey.hash();
|
|
25
|
+
const publicStakeKey = await this.derivePublicKey(stakeKeyDerivationPath);
|
|
26
|
+
const publicStakeKeyHash = await publicStakeKey.hash();
|
|
27
|
+
const stakeCredential = { hash: Hash28ByteBase16(publicStakeKeyHash.hex()), type: Cardano.CredentialType.KeyHash };
|
|
28
|
+
const address = Cardano.BaseAddress.fromCredentials(this.chainId.networkId, { hash: Hash28ByteBase16(derivedPublicPaymentKeyHash.hex()), type: Cardano.CredentialType.KeyHash }, stakeCredential).toAddress();
|
|
29
|
+
const rewardAccount = Cardano.RewardAddress.fromCredentials(this.chainId.networkId, stakeCredential).toAddress();
|
|
30
|
+
return {
|
|
31
|
+
accountIndex: this.accountIndex,
|
|
32
|
+
address: Cardano.PaymentAddress(address.toBech32()),
|
|
33
|
+
networkId: this.chainId.networkId,
|
|
34
|
+
rewardAccount: Cardano.RewardAccount(rewardAccount.toBech32()),
|
|
35
|
+
stakeKeyDerivationPath,
|
|
36
|
+
...paymentKeyDerivationPath
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static async fromAsyncKeyAgent(keyAgent) {
|
|
40
|
+
return new Bip32Account({
|
|
41
|
+
accountIndex: await keyAgent.getAccountIndex(),
|
|
42
|
+
chainId: await keyAgent.getChainId(),
|
|
43
|
+
extendedAccountPublicKey: await keyAgent.getExtendedAccountPublicKey()
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=Bip32Account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bip32Account.js","sourceRoot":"","sources":["../../src/Bip32Account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAKL,OAAO,EACR,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AASvD,MAAM,OAAO,YAAY;IAMvB,YAAY,EAAE,wBAAwB,EAAE,OAAO,EAAE,YAAY,EAAqB;QAChF,IAAI,CAAC,wBAAwB,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACxF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,cAAwC;QAC5D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;QACpG,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,wBAAsD,EACtD,uBAA+B;QAE/B,MAAM,sBAAsB,GAAG;YAC7B,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,OAAO,CAAC,KAAK;SACpB,CAAC;QAEF,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC;YACzD,KAAK,EAAE,wBA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YAAY,EAAE,MAAM,QAAQ,CAAC,eAAe,EAAE;YAC9C,OAAO,EAAE,MAAM,QAAQ,CAAC,UAAU,EAAE;YACpC,wBAAwB,EAAE,MAAM,QAAQ,CAAC,2BAA2B,EAAE;SACvE,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
-
import { AccountKeyDerivationPath, GetPassphrase, KeyAgent, KeyAgentDependencies, KeyPair, SerializableInMemoryKeyAgentData, SignBlobResult, SignTransactionOptions } from './types';
|
|
2
|
+
import { AccountKeyDerivationPath, GetPassphrase, KeyAgent, KeyAgentDependencies, KeyPair, SerializableInMemoryKeyAgentData, SignBlobResult, SignTransactionContext, SignTransactionOptions } from './types';
|
|
3
3
|
import { Cardano } from '@cardano-sdk/core';
|
|
4
4
|
import { HexBlob } from '@cardano-sdk/util';
|
|
5
5
|
import { KeyAgentBase } from './KeyAgentBase';
|
|
@@ -19,7 +19,7 @@ export declare class InMemoryKeyAgent extends KeyAgentBase implements KeyAgent {
|
|
|
19
19
|
signBlob({ index, role: type }: AccountKeyDerivationPath, blob: HexBlob): Promise<SignBlobResult>;
|
|
20
20
|
exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
21
21
|
static fromBip39MnemonicWords({ chainId, getPassphrase, mnemonicWords, mnemonic2ndFactorPassphrase, accountIndex }: FromBip39MnemonicWordsProps, dependencies: KeyAgentDependencies): Promise<InMemoryKeyAgent>;
|
|
22
|
-
signTransaction({ body, hash }: Cardano.TxBodyWithHash, { additionalKeyPaths }?: SignTransactionOptions
|
|
22
|
+
signTransaction({ body, hash }: Cardano.TxBodyWithHash, { txInKeyPathMap, knownAddresses }: SignTransactionContext, { additionalKeyPaths }?: SignTransactionOptions): Promise<Cardano.Signatures>;
|
|
23
23
|
exportExtendedKeyPair(derivationPath: number[]): Promise<KeyPair>;
|
|
24
24
|
}
|
|
25
25
|
//# sour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AAa,EACb,2BAAgC,EAChC,YAAgB,EACjB,EAAE,2BAA2B,EAC9B,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAAC,gBAAgB,CAAC;IA4BtB,eAAe,CACnB,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,cAAc,EACtC,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,sBAAsB,EAC1D,EAAE,kBAAuB,EAAE,GAAE,sBAA2B,GACvD,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;IAuBxB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAwBxE"}
|
|
@@ -69,14 +69,13 @@ export class InMemoryKeyAgent extends KeyAgentBase {
|
|
|
69
69
|
chainId,
|
|
70
70
|
encryptedRootPrivateKeyBytes: [...encryptedRootPrivateKey],
|
|
71
71
|
extendedAccountPublicKey,
|
|
72
|
-
getPassphrase
|
|
73
|
-
knownAddresses: []
|
|
72
|
+
getPassphrase
|
|
74
73
|
}, dependencies);
|
|
75
74
|
}
|
|
76
|
-
async signTransaction({ body, hash }, { additionalKeyPaths = [] } = {}) {
|
|
75
|
+
async signTransaction({ body, hash }, { txInKeyPathMap, knownAddresses }, { additionalKeyPaths = [] } = {}) {
|
|
77
76
|
const blob = HexBlob(hash);
|
|
78
77
|
const dRepKeyHash = (await Crypto.Ed25519PublicKey.fromHex(await this.derivePublicKey(DREP_KEY_DERIVATION_PATH)).hash()).hex();
|
|
79
|
-
const derivationPaths =
|
|
78
|
+
const derivationPaths = ownSignatureKeyPaths(body, knownAddresses, txInKeyPathMap, dRepKeyHash);
|
|
80
79
|
const keyPaths = uniqBy([...derivationPaths, ...additionalKeyPaths], ({ role, index }) => `${role}.${index}`);
|
|
81
80
|
return new Map(await Promise.all(keyPaths.map(async ({ role, index }) => {
|
|
82
81
|
const { publicKey, signature } = await this.signBlob({ index, role }, blob);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAKL,YAAY,
|
|
1
|
+
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,EAKL,YAAY,EAMb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,MAAM,EACN,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,MAAM,MAAM,eAAe,CAAC;AAcnC,MAAM,8BAA8B,GAAG,KAAK,EAAE,aAA4B,EAAE,EAAE;IAC5E,IAAI;QACF,OAAO,MAAM,aAAa,EAAE,CAAC;KAC9B;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;KAC3E;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAGhD,YAAY,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAyB,EAAE,YAAkC;QAC3G,KAAK,CAAC,EAAE,GAAG,gBAAgB,EAAE,UAAU,EAAE,YAAY,CAAC,QAAQ,EAAE,EAAE,YAAY,CAAC,CAAC;;QAHl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F,IAAI,qBAAiC,CAAC;IACtC,IAAI;QACF,qBAAqB,GAAG,MAAM,YAAY,CACxC,IAAI,UAAU,CAAE,IAAI,CAAC,gBAAqD,CAAC,4BAA4B,CAAC,EACxG,UAAU,CACX,CAAC;KACH;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;KACnF;IACD,OAAO,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
-
import { AccountAddressDerivationPath, AccountKeyDerivationPath, GroupedAddress, KeyAgent, KeyAgentDependencies, SerializableKeyAgentData, SignBlobResult, SignTransactionOptions } from './types';
|
|
2
|
+
import { AccountAddressDerivationPath, AccountKeyDerivationPath, GroupedAddress, KeyAgent, KeyAgentDependencies, SerializableKeyAgentData, SignBlobResult, SignTransactionContext, SignTransactionOptions } from './types';
|
|
3
3
|
import { Cardano } from '@cardano-sdk/core';
|
|
4
4
|
import { HexBlob } from '@cardano-sdk/util';
|
|
5
5
|
export declare abstract class KeyAgentBase implements KeyAgent {
|
|
6
6
|
#private;
|
|
7
|
-
protected readonly inputResolver: Cardano.InputResolver;
|
|
8
|
-
get knownAddresses(): GroupedAddress[];
|
|
9
|
-
set knownAddresses(addresses: GroupedAddress[]);
|
|
10
7
|
get serializableData(): SerializableKeyAgentData;
|
|
11
8
|
get extendedAccountPublicKey(): Crypto.Bip32PublicKeyHex;
|
|
12
9
|
get chainId(): Cardano.ChainId;
|
|
@@ -14,9 +11,9 @@ export declare abstract class KeyAgentBase implements KeyAgent {
|
|
|
14
11
|
get bip32Ed25519(): Crypto.Bip32Ed25519;
|
|
15
12
|
abstract signBlob(derivationPath: AccountKeyDerivationPath, blob: HexBlob): Promise<SignBlobResult>;
|
|
16
13
|
abstract exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
17
|
-
abstract signTransaction(txInternals: Cardano.TxBodyWithHash, signTransactionOptions?: SignTransactionOptions): Promise<Cardano.Signatures>;
|
|
18
|
-
constructor(serializableData: SerializableKeyAgentData, {
|
|
19
|
-
deriveAddress(
|
|
14
|
+
abstract signTransaction(txInternals: Cardano.TxBodyWithHash, context: SignTransactionContext, signTransactionOptions?: SignTransactionOptions): Promise<Cardano.Signatures>;
|
|
15
|
+
constructor(serializableData: SerializableKeyAgentData, { bip32Ed25519 }: KeyAgentDependencies);
|
|
16
|
+
deriveAddress(paymentKeyDerivationPath: AccountAddressDerivationPath, stakeKeyDerivationIndex: number): Promise<GroupedAddress>;
|
|
20
17
|
derivePublicKey(derivationPath: AccountKeyDerivationPath): Promise<Crypto.Ed25519PublicKeyHex>;
|
|
21
18
|
}
|
|
22
19
|
//# sourceMappingURL=KeyAgentBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyAgentBase.d.ts","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,cAAc,EACd,QAAQ,EACR,oBAAoB,
|
|
1
|
+
{"version":3,"file":"KeyAgentBase.d.ts","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,cAAc,EACd,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,8BAAsB,YAAa,YAAW,QAAQ;;IAKpD,IAAI,gBAAgB,IAAI,wBAAwB,CAE/C;IACD,IAAI,wBAAwB,IAAI,MAAM,CAAC,iBAAiB,CAEvD;IACD,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAE7B;IACD,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,IAAI,MAAM,CAAC,YAAY,CAEtC;IAED,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IACnG,QAAQ,CAAC,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;IACnE,QAAQ,CAAC,eAAe,CACtB,WAAW,EAAE,OAAO,CAAC,cAAc,EACnC,OAAO,EAAE,sBAAsB,EAC/B,sBAAsB,CAAC,EAAE,sBAAsB,GAC9C,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAElB,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,YAAY,EAAE,EAAE,oBAAoB;IAOxF,aAAa,CACjB,wBAAwB,EAAE,4BAA4B,EACtD,uBAAuB,EAAE,MAAM,GAC9B,OAAO,CAAC,cAAc,CAAC;IAIpB,eAAe,CAAC,cAAc,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAGrG"}
|
package/dist/esm/KeyAgentBase.js
CHANGED
|
@@ -9,23 +9,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _KeyAgentBase_serializableData, _KeyAgentBase_bip32Ed25519;
|
|
13
|
-
import {
|
|
14
|
-
import { Cardano } from '@cardano-sdk/core';
|
|
15
|
-
import { Hash28ByteBase16 } from '@cardano-sdk/crypto';
|
|
12
|
+
var _KeyAgentBase_serializableData, _KeyAgentBase_bip32Ed25519, _KeyAgentBase_account;
|
|
13
|
+
import { Bip32Account } from './Bip32Account';
|
|
16
14
|
export class KeyAgentBase {
|
|
17
|
-
constructor(serializableData, {
|
|
15
|
+
constructor(serializableData, { bip32Ed25519 }) {
|
|
18
16
|
_KeyAgentBase_serializableData.set(this, void 0);
|
|
19
17
|
_KeyAgentBase_bip32Ed25519.set(this, void 0);
|
|
18
|
+
_KeyAgentBase_account.set(this, void 0);
|
|
20
19
|
__classPrivateFieldSet(this, _KeyAgentBase_serializableData, serializableData, "f");
|
|
21
|
-
this.inputResolver = inputResolver;
|
|
22
20
|
__classPrivateFieldSet(this, _KeyAgentBase_bip32Ed25519, bip32Ed25519, "f");
|
|
23
|
-
|
|
24
|
-
get knownAddresses() {
|
|
25
|
-
return __classPrivateFieldGet(this, _KeyAgentBase_serializableData, "f").knownAddresses;
|
|
26
|
-
}
|
|
27
|
-
set knownAddresses(addresses) {
|
|
28
|
-
__classPrivateFieldGet(this, _KeyAgentBase_serializableData, "f").knownAddresses = addresses;
|
|
21
|
+
__classPrivateFieldSet(this, _KeyAgentBase_account, new Bip32Account(serializableData), "f");
|
|
29
22
|
}
|
|
30
23
|
get serializableData() {
|
|
31
24
|
return __classPrivateFieldGet(this, _KeyAgentBase_serializableData, "f");
|
|
@@ -42,46 +35,12 @@ export class KeyAgentBase {
|
|
|
42
35
|
get bip32Ed25519() {
|
|
43
36
|
return __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f");
|
|
44
37
|
}
|
|
45
|
-
async deriveAddress(
|
|
46
|
-
|
|
47
|
-
index: stakeKeyDerivationIndex,
|
|
48
|
-
role: KeyRole.Stake
|
|
49
|
-
};
|
|
50
|
-
const knownAddress = this.knownAddresses.find((addr) => addr.type === type &&
|
|
51
|
-
addr.index === index &&
|
|
52
|
-
addr.stakeKeyDerivationPath?.index === stakeKeyDerivationPath.index);
|
|
53
|
-
if (knownAddress)
|
|
54
|
-
return knownAddress;
|
|
55
|
-
const derivedPublicPaymentKey = await this.derivePublicKey({
|
|
56
|
-
index,
|
|
57
|
-
role: type
|
|
58
|
-
});
|
|
59
|
-
const derivedPublicPaymentKeyHash = await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").getPubKeyHash(derivedPublicPaymentKey);
|
|
60
|
-
const publicStakeKey = await this.derivePublicKey(stakeKeyDerivationPath);
|
|
61
|
-
const publicStakeKeyHash = await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").getPubKeyHash(publicStakeKey);
|
|
62
|
-
const stakeCredential = { hash: Hash28ByteBase16(publicStakeKeyHash), type: Cardano.CredentialType.KeyHash };
|
|
63
|
-
const address = Cardano.BaseAddress.fromCredentials(this.chainId.networkId, { hash: Hash28ByteBase16(derivedPublicPaymentKeyHash), type: Cardano.CredentialType.KeyHash }, stakeCredential).toAddress();
|
|
64
|
-
const rewardAccount = Cardano.RewardAddress.fromCredentials(this.chainId.networkId, stakeCredential).toAddress();
|
|
65
|
-
const groupedAddress = {
|
|
66
|
-
accountIndex: this.accountIndex,
|
|
67
|
-
address: Cardano.PaymentAddress(address.toBech32()),
|
|
68
|
-
index,
|
|
69
|
-
networkId: this.chainId.networkId,
|
|
70
|
-
rewardAccount: Cardano.RewardAccount(rewardAccount.toBech32()),
|
|
71
|
-
stakeKeyDerivationPath,
|
|
72
|
-
type
|
|
73
|
-
};
|
|
74
|
-
if (!pure)
|
|
75
|
-
this.knownAddresses = [...this.knownAddresses, groupedAddress];
|
|
76
|
-
return groupedAddress;
|
|
38
|
+
async deriveAddress(paymentKeyDerivationPath, stakeKeyDerivationIndex) {
|
|
39
|
+
return __classPrivateFieldGet(this, _KeyAgentBase_account, "f").deriveAddress(paymentKeyDerivationPath, stakeKeyDerivationIndex);
|
|
77
40
|
}
|
|
78
41
|
async derivePublicKey(derivationPath) {
|
|
79
|
-
|
|
80
|
-
derivationPath.role,
|
|
81
|
-
derivationPath.index
|
|
82
|
-
]);
|
|
83
|
-
return await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").getRawPublicKey(childKey);
|
|
42
|
+
return (await __classPrivateFieldGet(this, _KeyAgentBase_account, "f").derivePublicKey(derivationPath)).hex();
|
|
84
43
|
}
|
|
85
44
|
}
|
|
86
|
-
_KeyAgentBase_serializableData = new WeakMap(), _KeyAgentBase_bip32Ed25519 = new WeakMap();
|
|
45
|
+
_KeyAgentBase_serializableData = new WeakMap(), _KeyAgentBase_bip32Ed25519 = new WeakMap(), _KeyAgentBase_account = new WeakMap();
|
|
87
46
|
//# sourceMappingURL=KeyAgentBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyAgentBase.js","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"KeyAgentBase.js","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":";;;;;;;;;;;;AAYA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,OAAgB,YAAY;IA6BhC,YAAY,gBAA0C,EAAE,EAAE,YAAY,EAAwB;QA5B9F,iDAAqD;QACrD,6CAA4C;QAC5C,wCAAgC;QA2B9B,uBAAA,IAAI,kCAAqB,gBAAgB,MAAA,CAAC;QAC1C,uBAAA,IAAI,8BAAiB,YAAY,MAAA,CAAC;QAClC,uBAAA,IAAI,yBAAY,IAAI,YAAY,CAAC,gBAAgB,CAAC,MAAA,CAAC;IACrD,CAAC;IA5BD,IAAI,gBAAgB;QAClB,OAAO,uBAAA,IAAI,sCAAkB,CAAC;IAChC,CAAC;IACD,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,CAAC;IACxD,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;IACvC,CAAC;IACD,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC5C,CAAC;IACD,IAAI,YAAY;QACd,OAAO,uBAAA,IAAI,kCAAc,CAAC;IAC5B,CAAC;IAiBD,KAAK,CAAC,aAAa,CACjB,wBAAsD,EACtD,uBAA+B;QAE/B,OAAO,uBAAA,IAAI,6BAAS,CAAC,aAAa,CAAC,wBAAwB,EAAE,uBAAuB,CAAC,CAAC;IACxF,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,cAAwC;QAC5D,OAAO,CAAC,MAAM,uBAAA,IAAI,6BAAS,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GroupedAddress, MessageSender } from '../types';
|
|
2
|
+
import { Bip32Ed25519Witnesser } from '../util';
|
|
2
3
|
import { Cardano } from '@cardano-sdk/core';
|
|
3
4
|
import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
|
|
4
5
|
import { ComposableError, HexBlob } from '@cardano-sdk/util';
|
|
5
6
|
export interface Cip30SignDataRequest {
|
|
6
|
-
|
|
7
|
+
knownAddresses: GroupedAddress[];
|
|
7
8
|
witnesser: Bip32Ed25519Witnesser;
|
|
8
9
|
signWith: Cardano.PaymentAddress | Cardano.RewardAccount | Cardano.DRepID;
|
|
9
10
|
payload: HexBlob;
|
|
11
|
+
sender?: MessageSender;
|
|
10
12
|
}
|
|
11
13
|
export declare enum Cip30DataSignErrorCode {
|
|
12
14
|
ProofGeneration = 1,
|
|
@@ -18,5 +20,5 @@ export declare class Cip30DataSignError<InnerError = unknown> extends Composable
|
|
|
18
20
|
readonly info: string;
|
|
19
21
|
constructor(code: Cip30DataSignErrorCode, info: string, innerError?: InnerError);
|
|
20
22
|
}
|
|
21
|
-
export declare const cip30signData: ({
|
|
23
|
+
export declare const cip30signData: ({ knownAddresses, witnesser, signWith, payload, sender }: Cip30SignDataRequest) => Promise<Cip30DataSignature>;
|
|
22
24
|
//# sourceMappingURL=cip30signData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip30signData.d.ts","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cip30signData.d.ts","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,cAAc,EAAW,aAAa,EAAE,MAAM,UAAU,CAAC;AAc5F,OAAO,EAAE,qBAAqB,EAAuD,MAAM,SAAS,CAAC;AACrG,OAAO,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG7D,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,SAAS,EAAE,qBAAqB,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,oBAAY,sBAAsB;IAChC,eAAe,IAAI;IACnB,YAAY,IAAI;IAChB,YAAY,IAAI;CACjB;AAED,qBAAa,kBAAkB,CAAC,UAAU,GAAG,OAAO,CAAE,SAAQ,eAAe,CAAC,UAAU,CAAC;aAC3D,IAAI,EAAE,sBAAsB;aAAkB,IAAI,EAAE,MAAM;gBAA1D,IAAI,EAAE,sBAAsB,EAAkB,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU;CAGhH;AA4ED,eAAO,MAAM,aAAa,6DAMvB,oBAAoB,KAAG,QAAQ,kBAAkB,CAsBnD,CAAC"}
|
|
@@ -3,7 +3,6 @@ import { DREP_KEY_DERIVATION_PATH, STAKE_KEY_DERIVATION_PATH } from '../util';
|
|
|
3
3
|
import { Cardano, util } from '@cardano-sdk/core';
|
|
4
4
|
import { ComposableError } from '@cardano-sdk/util';
|
|
5
5
|
import { CoseLabel } from './util';
|
|
6
|
-
import { filter, firstValueFrom } from 'rxjs';
|
|
7
6
|
export var Cip30DataSignErrorCode;
|
|
8
7
|
(function (Cip30DataSignErrorCode) {
|
|
9
8
|
Cip30DataSignErrorCode[Cip30DataSignErrorCode["ProofGeneration"] = 1] = "ProofGeneration";
|
|
@@ -24,12 +23,11 @@ const getAddressBytes = (signWith) => {
|
|
|
24
23
|
}
|
|
25
24
|
return Buffer.from(address.toBytes(), 'hex');
|
|
26
25
|
};
|
|
27
|
-
const getDerivationPath = async (signWith,
|
|
26
|
+
const getDerivationPath = async (signWith, knownAddresses) => {
|
|
28
27
|
if (Cardano.DRepID.isValid(signWith)) {
|
|
29
28
|
return DREP_KEY_DERIVATION_PATH;
|
|
30
29
|
}
|
|
31
30
|
const isRewardAccount = signWith.startsWith('stake');
|
|
32
|
-
const knownAddresses = await firstValueFrom(addressManager.knownAddresses$.pipe(filter((addresses) => addresses.length > 0)));
|
|
33
31
|
if (isRewardAccount) {
|
|
34
32
|
const knownRewardAddress = knownAddresses.find(({ rewardAccount }) => rewardAccount === signWith);
|
|
35
33
|
if (!knownRewardAddress)
|
|
@@ -49,9 +47,9 @@ const createSigStructureHeaders = (addressBytes) => {
|
|
|
49
47
|
protectedHeaders.set_algorithm_id(Label.from_algorithm_id(AlgorithmId.EdDSA));
|
|
50
48
|
return protectedHeaders;
|
|
51
49
|
};
|
|
52
|
-
const signSigStructure = (witnesser, derivationPath, sigStructure) => {
|
|
50
|
+
const signSigStructure = (witnesser, derivationPath, sigStructure, sender) => {
|
|
53
51
|
try {
|
|
54
|
-
return witnesser.signBlob(derivationPath, util.bytesToHex(sigStructure.to_bytes()));
|
|
52
|
+
return witnesser.signBlob(derivationPath, util.bytesToHex(sigStructure.to_bytes()), sender);
|
|
55
53
|
}
|
|
56
54
|
catch (error) {
|
|
57
55
|
throw new Cip30DataSignError(Cip30DataSignErrorCode.UserDeclined, 'Failed to sign', error);
|
|
@@ -65,15 +63,15 @@ const createCoseKey = (addressBytes, publicKey) => {
|
|
|
65
63
|
coseKey.set_header(CoseLabel.x, CBORValue.new_bytes(Buffer.from(publicKey, 'hex')));
|
|
66
64
|
return coseKey;
|
|
67
65
|
};
|
|
68
|
-
export const cip30signData = async ({
|
|
66
|
+
export const cip30signData = async ({ knownAddresses, witnesser, signWith, payload, sender }) => {
|
|
69
67
|
if (Cardano.DRepID.isValid(signWith) && !Cardano.DRepID.canSign(signWith)) {
|
|
70
68
|
throw new Cip30DataSignError(Cip30DataSignErrorCode.AddressNotPK, 'Invalid address');
|
|
71
69
|
}
|
|
72
70
|
const addressBytes = getAddressBytes(signWith);
|
|
73
|
-
const derivationPath = await getDerivationPath(signWith,
|
|
71
|
+
const derivationPath = await getDerivationPath(signWith, knownAddresses);
|
|
74
72
|
const builder = COSESign1Builder.new(Headers.new(ProtectedHeaderMap.new(createSigStructureHeaders(addressBytes)), HeaderMap.new()), Buffer.from(payload, 'hex'), false);
|
|
75
73
|
const sigStructure = builder.make_data_to_sign();
|
|
76
|
-
const { signature, publicKey } = await signSigStructure(witnesser, derivationPath, sigStructure);
|
|
74
|
+
const { signature, publicKey } = await signSigStructure(witnesser, derivationPath, sigStructure, sender);
|
|
77
75
|
const coseSign1 = builder.build(Buffer.from(signature, 'hex'));
|
|
78
76
|
const coseKey = createCoseKey(addressBytes, publicKey);
|
|
79
77
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip30signData.js","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,O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D,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|