@keetanetwork/keetanet-client 0.16.2 → 0.18.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/client/index-browser.js +509 -159
- package/client/index.js +511 -137
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Client.html +4 -4
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BaseVoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Block.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.CertificateHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSAKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256K1Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ECDSASECP256R1Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519KeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PrivateKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519PublicKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ED25519Signature.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.ExternalSet.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdempotentKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetErrorBase.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerError.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerIdempotentKeyError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetLedgerVoteError.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyInterface.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.KeyStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Ledger.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.LedgerAtomicInterface.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyUnsignedBlock.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Stats.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.StatsPending.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.UnsignedBlock.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteLikeBase.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuote.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteQuoteBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.UserClient.html +4 -4
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ExplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1ImplicitContextTag.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ASN1Object.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.AccountACLRow.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.AccountComputedEffect.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseACLRow.html +9 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseAccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseExternalKeyPairFunctions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseIdentifierAccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseIdentifierCreateArguments.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperation.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationCREATE_IDENTIFIER.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationRECEIVE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSEND.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_INFO.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationSET_REP.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_MODIFY_BALANCE.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationTOKEN_ADMIN_SUPPLY.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV1Canonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockV2Canonical.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateACLPrincipal.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateACLRow.html +11 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateComputedEffect.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectFields.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ECDSA_SECP256K1AccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ECDSA_SECP256R1AccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ED25519AccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageAPI.html +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.ListACLsByEntityFilters.html +4 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultiSigIdentifierCreateArguments.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultisigAccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.MultisigConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.NetworkAccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValueEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerListener.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.P2PPeerRepBase.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.PrincipalACLWithInfoParsed.html +2 -7
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.PublishOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.StorageAccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenAccountInfo.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteStapleJSON.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1BitString.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Date.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1OID.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Set.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1String.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_asn1.ASN1Struct.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.ACLEntryUnparsed.html +1 -5
- package/docs/types/KeetaNetSDK.Referenced.ACLPermissionRequirement.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ACLPrincipalType.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ACLRow.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ACLUpdate.html +5 -0
- package/docs/types/KeetaNetSDK.Referenced.ComputedBlockEffect.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocks.html +2 -2
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocksByEntity.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ModifyPermissionsPrincipal.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.ModifyPermissionsPrincipalInput.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.BlockOperationASN1Schema.html +2 -2
- package/docs/variables/KeetaNetSDK.Referenced.FullLedgerBaseErrorCode.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.aclPrincipalType.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.allFullErrorCodes.html +1 -1
- package/lib/block/index.d.ts +14 -2
- package/lib/block/operations.d.ts +40 -4
- package/lib/error/block.d.ts +2 -2
- package/lib/error/index.d.ts +1 -1
- package/lib/error/ledger.d.ts +3 -3
- package/lib/ledger/common.d.ts +7 -5
- package/lib/ledger/db_dynamodb.d.ts +2 -2
- package/lib/ledger/db_postgres.d.ts +3 -3
- package/lib/ledger/db_spanner.d.ts +3 -3
- package/lib/ledger/db_spanner_helper.d.ts +23 -3
- package/lib/ledger/db_sqlite.d.ts +3 -3
- package/lib/ledger/effects.d.ts +17 -9
- package/lib/ledger/index.d.ts +14 -5
- package/lib/ledger/types.d.ts +38 -14
- package/lib/log/target_gcp.js +19 -17
- package/lib/utils/external-keys/gcp-kms-wrapped.d.ts +85 -0
- package/lib/utils/external-keys/gcp-kms-wrapped.js +453 -0
- package/lib/utils/external-keys/gcp-kms.common.d.ts +17 -0
- package/lib/utils/external-keys/gcp-kms.d.ts +4 -9
- package/lib/utils/external-keys/gcp-kms.js +52 -39
- package/lib/utils/external-keys/passkey-prf.d.ts +42 -1
- package/lib/utils/external-keys/passkey-prf.js +107 -13
- package/lib/vote.d.ts +7 -1
- package/npm-shrinkwrap.json +24 -24
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +0 -10
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLRow.html +0 -10
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.html +0 -12
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlockEffect.html +0 -4
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocksByAccount.html +0 -2
|
@@ -6,7 +6,17 @@ import Vote, { PossiblyExpiredVote, VoteBlockHash } from '../vote';
|
|
|
6
6
|
import type { BaseSet, ExternalSet } from '../permissions';
|
|
7
7
|
import type { SpannerTransaction } from './db_spanner';
|
|
8
8
|
import { Certificate, CertificateBundle, CertificateHash } from '../utils/certificate';
|
|
9
|
+
import type { ACLPrincipalType } from './types';
|
|
9
10
|
declare const ColumnTypes: {
|
|
11
|
+
readonly GENERIC_ACCOUNT_OR_CERTIFICATE_HASH: {
|
|
12
|
+
readonly fromSpanner: (value: string) => GenericAccount | CertificateHash;
|
|
13
|
+
readonly toSpanner: (value: CertificateHash | GenericAccount) => import("../account").TokenPublicKeyString | import("../account").NetworkPublicKeyString | import("../account").StoragePublicKeyString | import("../account").MultisigPublicKeyString | import("../account").Secp256K1PublicKeyString | import("../account").Secp256R1PublicKeyString | import("../account").ED25519PublicKeyString | (string & {
|
|
14
|
+
readonly __certificateHash: never;
|
|
15
|
+
});
|
|
16
|
+
readonly toComparable: (name: string | CertificateHash | GenericAccount) => string;
|
|
17
|
+
readonly dbType: string;
|
|
18
|
+
readonly dbSize: number;
|
|
19
|
+
};
|
|
10
20
|
readonly LEDGER: {
|
|
11
21
|
readonly dbType: "STRING";
|
|
12
22
|
readonly dbSize: 4;
|
|
@@ -212,6 +222,13 @@ declare const ColumnTypes: {
|
|
|
212
222
|
fromSpanner: (value: Buffer) => bigint;
|
|
213
223
|
toComparable: (val: Buffer | bigint | string) => bigint;
|
|
214
224
|
};
|
|
225
|
+
readonly ACL_ROW_TYPE: {
|
|
226
|
+
dbType: string;
|
|
227
|
+
dbSize: number;
|
|
228
|
+
toComparable: (input: string | ACLPrincipalType) => "ACCOUNT" | "CERTIFICATE";
|
|
229
|
+
fromSpanner: (input: string) => "ACCOUNT" | "CERTIFICATE";
|
|
230
|
+
toSpanner: (input: ACLPrincipalType) => "ACCOUNT" | "CERTIFICATE";
|
|
231
|
+
};
|
|
215
232
|
};
|
|
216
233
|
type ColumnTypeName = keyof typeof ColumnTypes;
|
|
217
234
|
type ColumnOutputTypeArg<T extends ColumnTypeName> = Parameters<typeof ColumnTypes[T]['fromSpanner']>[0];
|
|
@@ -221,6 +238,7 @@ type ColumnOutputTypeInfer<X> = X extends ColumnInterface<infer TR, infer Nullab
|
|
|
221
238
|
type ColumnInputTypeArg<T extends ColumnTypeName> = Parameters<typeof ColumnTypes[T]['toSpanner']>[0];
|
|
222
239
|
type ColumnInputTypeReturn<T extends ColumnTypeName> = ReturnType<typeof ColumnTypes[T]['toSpanner']>;
|
|
223
240
|
interface ColumnInterface<T extends ColumnTypeName, Nullable extends boolean = boolean> {
|
|
241
|
+
default: (value: ColumnOutputTypeReturn<T>) => ColumnInterface<T, Nullable>;
|
|
224
242
|
nullable: <SetNullable extends boolean>(nullable: SetNullable) => ColumnInterface<T, SetNullable>;
|
|
225
243
|
fromSpanner: (value: ColumnOutputTypeArg<T>, transaction: SpannerTransaction) => ColumnOutputTypeReturn<T>;
|
|
226
244
|
toSpanner: (value: ColumnInputTypeArg<T>, transaction: SpannerTransaction) => ColumnInputTypeReturn<T>;
|
|
@@ -247,7 +265,7 @@ declare const schema: {
|
|
|
247
265
|
readonly accountInfo: {
|
|
248
266
|
readonly type: "TABLE";
|
|
249
267
|
readonly columns: {
|
|
250
|
-
readonly account: ColumnInterface<"
|
|
268
|
+
readonly account: ColumnInterface<"GENERIC_ACCOUNT_OR_CERTIFICATE_HASH", false>;
|
|
251
269
|
readonly name: ColumnInterface<"INFO_NAME", true>;
|
|
252
270
|
readonly description: ColumnInterface<"INFO_DESCRIPTION", true>;
|
|
253
271
|
readonly metadata: ColumnInterface<"INFO_METADATA", true>;
|
|
@@ -261,11 +279,13 @@ declare const schema: {
|
|
|
261
279
|
readonly permissions: {
|
|
262
280
|
readonly type: "TABLE";
|
|
263
281
|
readonly columns: {
|
|
264
|
-
readonly account: ColumnInterface<"
|
|
282
|
+
readonly account: ColumnInterface<"GENERIC_ACCOUNT_OR_CERTIFICATE_HASH", false>;
|
|
265
283
|
readonly entity: ColumnInterface<"GENERIC_ACCOUNT", false>;
|
|
266
284
|
readonly target: ColumnInterface<"GENERIC_ACCOUNT", false>;
|
|
267
285
|
readonly basePermission: ColumnInterface<"BASE_PERMISSION", false>;
|
|
268
286
|
readonly externalPermission: ColumnInterface<"EXTERNAL_PERMISSION", false>;
|
|
287
|
+
readonly principalType: ColumnInterface<"ACL_ROW_TYPE", false>;
|
|
288
|
+
readonly certificateAccount: ColumnInterface<"GENERIC_ACCOUNT", true>;
|
|
269
289
|
};
|
|
270
290
|
readonly key: readonly [Key, Key, Key];
|
|
271
291
|
readonly interleave: Interleave;
|
|
@@ -391,7 +411,7 @@ declare const schema: {
|
|
|
391
411
|
readonly type: "INDEX";
|
|
392
412
|
readonly table: "permissions";
|
|
393
413
|
readonly key: readonly [Key];
|
|
394
|
-
readonly storing: readonly [Key, Key];
|
|
414
|
+
readonly storing: readonly [Key, Key, Key, Key];
|
|
395
415
|
};
|
|
396
416
|
readonly permissionsEntityBasePerm: {
|
|
397
417
|
readonly type: "INDEX";
|
|
@@ -4,7 +4,7 @@ import { BlockHash } from '../block';
|
|
|
4
4
|
import { Block } from '../block';
|
|
5
5
|
import type { GenericAccount, IdentifierAddress, TokenAddress } from '../account';
|
|
6
6
|
import Account, { AccountKeyAlgorithm } from '../account';
|
|
7
|
-
import type { Ledger, LedgerConfig, LedgerStorageAPI, LedgerSelector, PaginatedVotes, GetVotesAfterOptions, LedgerStorageTransactionBaseOptions } from '../ledger';
|
|
7
|
+
import type { Ledger, LedgerConfig, LedgerStorageAPI, LedgerSelector, PaginatedVotes, GetVotesAfterOptions, LedgerStorageTransactionBaseOptions, ListACLsByEntityFilters } from '../ledger';
|
|
8
8
|
import { IdempotentKey, LedgerStorageTransactionBase } from '../ledger';
|
|
9
9
|
import type { ACLRow, GetAllBalancesResponse, LedgerStatistics, CertificateWithIntermediates, AccountInfoForType } from './types';
|
|
10
10
|
import { LedgerStorageBase } from './common';
|
|
@@ -40,8 +40,8 @@ export declare class DBSqlite extends LedgerStorageBase implements LedgerStorage
|
|
|
40
40
|
*/
|
|
41
41
|
protected adjustDefer(transaction: DBSqliteTransaction, input: VoteStaple): Promise<void>;
|
|
42
42
|
listOwners(transaction: DBSqliteTransaction, entity: IdentifierAddress): Promise<Account<AccountKeyAlgorithm.TOKEN>[]>;
|
|
43
|
-
listACLsByEntity(transaction: DBSqliteTransaction, entity: GenericAccount): Promise<ACLRow[]>;
|
|
44
|
-
listACLsByPrincipal(transaction: DBSqliteTransaction, principal:
|
|
43
|
+
listACLsByEntity(transaction: DBSqliteTransaction, entity: GenericAccount, options?: ListACLsByEntityFilters): Promise<ACLRow[]>;
|
|
44
|
+
listACLsByPrincipal(transaction: DBSqliteTransaction, principal: ACLRow['principal'], entityList?: GenericAccount[]): Promise<ACLRow[]>;
|
|
45
45
|
getAccountInfo<T extends AccountKeyAlgorithm = AccountKeyAlgorithm>(transaction: DBSqliteTransaction, account: Account<T> | string): Promise<AccountInfoForType<T>>;
|
|
46
46
|
adjust(transaction: DBSqliteTransaction, input: VoteStaple, changes: ComputedEffectOfBlocks, mayDefer?: boolean, completedStaples?: Set<string>): Promise<VoteStaple[]>;
|
|
47
47
|
getBlock(transaction: DBSqliteTransaction, block: BlockHash, from: LedgerSelector): Promise<Block | null>;
|
package/lib/ledger/effects.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Account from '../account';
|
|
|
3
3
|
import type { AdjustMethod } from '../block';
|
|
4
4
|
import { Block } from '../block';
|
|
5
5
|
import type * as Operations from '../block/operations';
|
|
6
|
-
import type {
|
|
6
|
+
import type { AccountInfo, ACLUpdate, ACLPermissionRequirement } from '../ledger/types';
|
|
7
7
|
import type { Certificate, CertificateBundle } from '../utils/certificate';
|
|
8
8
|
import { CertificateHash } from '../utils/certificate';
|
|
9
9
|
import type { DistributiveOmit } from '../utils/helper';
|
|
@@ -56,27 +56,35 @@ interface ComputedBlocksEffectFields {
|
|
|
56
56
|
supply?: NumericValueEntry[];
|
|
57
57
|
info?: Partial<UserEditableAccountInfo>;
|
|
58
58
|
permissions?: ACLUpdate[];
|
|
59
|
-
permissionRequirements?:
|
|
59
|
+
permissionRequirements?: ACLPermissionRequirement[];
|
|
60
60
|
createRequests?: CreateIdentifierRequest[];
|
|
61
61
|
delegation?: DelegationUpdate;
|
|
62
62
|
certificate?: CertificateUpdate[];
|
|
63
63
|
minSignerSetLength?: bigint;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
interface CertificateComputedEffect {
|
|
66
|
+
type: 'CERTIFICATE';
|
|
67
|
+
certificateHash: CertificateHash;
|
|
68
|
+
certificateAccount: GenericAccount;
|
|
69
|
+
fields: ComputedBlocksEffectFields;
|
|
70
|
+
}
|
|
71
|
+
interface AccountComputedEffect {
|
|
72
|
+
type: 'ACCOUNT';
|
|
69
73
|
account: GenericAccount;
|
|
70
74
|
fields: ComputedBlocksEffectFields;
|
|
71
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Which accounts and fields are affected by a set of block
|
|
78
|
+
*/
|
|
79
|
+
type ComputedBlockEffect = CertificateComputedEffect | AccountComputedEffect;
|
|
72
80
|
/**
|
|
73
81
|
* A breakdown of computed effects by account public key
|
|
74
82
|
*/
|
|
75
|
-
export type
|
|
76
|
-
[
|
|
83
|
+
export type ComputedEffectOfBlocksByEntity = {
|
|
84
|
+
[entityKey: string]: ComputedBlockEffect;
|
|
77
85
|
};
|
|
78
86
|
export type ComputedEffectOfBlocks = {
|
|
79
|
-
accounts:
|
|
87
|
+
accounts: ComputedEffectOfBlocksByEntity;
|
|
80
88
|
touched: InstanceType<typeof Account.Set>;
|
|
81
89
|
possibleNewAccounts: InstanceType<typeof Account.Set>;
|
|
82
90
|
metadata: {
|
package/lib/ledger/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import Account from '../account';
|
|
|
6
6
|
import type Node from '../node';
|
|
7
7
|
import type { BloomFilter } from '../utils/bloom';
|
|
8
8
|
import type { ComputedEffectOfBlocks } from './effects';
|
|
9
|
-
import type { ACLRow, GetAllBalancesResponse, LedgerStatistics, CertificateWithIntermediates, AccountInfoForType } from './types';
|
|
9
|
+
import type { ACLRow, GetAllBalancesResponse, LedgerStatistics, CertificateWithIntermediates, AccountInfoForType, ACLPrincipalType } from './types';
|
|
10
10
|
import LedgerRequestCache from './cache';
|
|
11
11
|
import type { Logger } from '../log';
|
|
12
12
|
import type { CertificateHash } from '../utils/certificate';
|
|
@@ -109,6 +109,15 @@ export type GetVotesAfterOptions = {
|
|
|
109
109
|
*/
|
|
110
110
|
timeout?: number;
|
|
111
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* Filters for listing ACLs by entity
|
|
114
|
+
*/
|
|
115
|
+
export interface ListACLsByEntityFilters {
|
|
116
|
+
/**
|
|
117
|
+
* If provided, only return ACL rows of this type
|
|
118
|
+
*/
|
|
119
|
+
principalType?: ACLPrincipalType;
|
|
120
|
+
}
|
|
112
121
|
type IdempotentKeyString = string & {
|
|
113
122
|
readonly __idempotentKey: never;
|
|
114
123
|
};
|
|
@@ -197,11 +206,11 @@ export interface LedgerStorageAPI {
|
|
|
197
206
|
/**
|
|
198
207
|
* List permissions principal has on all provided entity's
|
|
199
208
|
*/
|
|
200
|
-
listACLsByPrincipal: (transaction: any, principal:
|
|
209
|
+
listACLsByPrincipal: (transaction: any, principal: ACLRow['principal'], entityList?: GenericAccount[]) => Promise<ACLRow[]>;
|
|
201
210
|
/**
|
|
202
211
|
* List permissions any principal has on provided entity
|
|
203
212
|
*/
|
|
204
|
-
listACLsByEntity: (transaction: any, entity: GenericAccount) => Promise<ACLRow[]>;
|
|
213
|
+
listACLsByEntity: (transaction: any, entity: GenericAccount, options?: ListACLsByEntityFilters) => Promise<ACLRow[]>;
|
|
205
214
|
/**
|
|
206
215
|
* Adjust the ledger by performing a set of changes based on some blocks and votes
|
|
207
216
|
*/
|
|
@@ -338,8 +347,8 @@ declare class LedgerAtomicInterface {
|
|
|
338
347
|
getAllBalances(account: GenericAccount): Promise<GetAllBalancesResponse>;
|
|
339
348
|
getAccountCertificates(account: GenericAccount): Promise<CertificateWithIntermediates[]>;
|
|
340
349
|
getAccountCertificateByHash(account: GenericAccount, hash: CertificateHash): Promise<CertificateWithIntermediates | null>;
|
|
341
|
-
listACLsByPrincipal(principal:
|
|
342
|
-
listACLsByEntity(entity: GenericAccount): Promise<ACLRow[]>;
|
|
350
|
+
listACLsByPrincipal(principal: ACLRow['principal'], entityList?: GenericAccount[]): Promise<ACLRow[]>;
|
|
351
|
+
listACLsByEntity(entity: GenericAccount, options?: ListACLsByEntityFilters): Promise<ACLRow[]>;
|
|
343
352
|
votingPower(rep?: Account): Promise<bigint>;
|
|
344
353
|
getVotes(block: BlockHash, from?: LedgerStorage): Promise<Vote[] | null>;
|
|
345
354
|
getVotesFromMultiplePrevious(prevBlocks: BlockHash[], from?: LedgerSelector, issuer?: Account): Promise<{
|
package/lib/ledger/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Account, AccountKeyAlgorithm, GenericAccount, IdentifierKeyAlgorit
|
|
|
2
2
|
import type { AdjustMethod } from '../block';
|
|
3
3
|
import type { Permissions } from '../permissions';
|
|
4
4
|
import type { DbStats, TimeStats } from '../stats';
|
|
5
|
-
import type { Certificate, CertificateBundle } from '../utils/certificate';
|
|
5
|
+
import type { Certificate, CertificateBundle, CertificateHash } from '../utils/certificate';
|
|
6
6
|
import type { DistributiveOmit } from '../utils/helper';
|
|
7
7
|
export interface MultisigConfig {
|
|
8
8
|
signers: (Account | MultisigAddress)[];
|
|
@@ -70,14 +70,21 @@ export declare function isKeyPairAccountInfo(info: AccountInfo): info is KeyPair
|
|
|
70
70
|
export declare function isAccountInfoOfType<T extends AccountKeyAlgorithm>(info: AccountInfo, type: T): info is Extract<AccountInfo, {
|
|
71
71
|
account: Account<T>;
|
|
72
72
|
}>;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
export
|
|
73
|
+
declare const aclPrincipalType: readonly ["ACCOUNT", "CERTIFICATE"];
|
|
74
|
+
export type ACLPrincipalType = typeof aclPrincipalType[number];
|
|
75
|
+
export declare function isACLPrincipalType(type: string): type is ACLPrincipalType;
|
|
76
|
+
export declare function assertACLPrincipalType(type: string): asserts type is ACLPrincipalType;
|
|
77
|
+
export declare function asACLPrincipalType(type: string): ACLPrincipalType;
|
|
78
|
+
interface CertificateACLPrincipal {
|
|
79
|
+
usingCertificate: true;
|
|
80
|
+
certificate: CertificateHash;
|
|
81
|
+
certificateAccount: GenericAccount;
|
|
82
|
+
}
|
|
83
|
+
interface BaseACLRow<PrincipalType extends ACLPrincipalType> {
|
|
77
84
|
/**
|
|
78
|
-
* The
|
|
85
|
+
* The type of ACL row, which determines the shape of the principal
|
|
79
86
|
*/
|
|
80
|
-
|
|
87
|
+
principalType: PrincipalType;
|
|
81
88
|
/**
|
|
82
89
|
* The account that this row is for
|
|
83
90
|
*/
|
|
@@ -91,19 +98,36 @@ export interface ACLRow {
|
|
|
91
98
|
*/
|
|
92
99
|
permissions: Permissions;
|
|
93
100
|
}
|
|
101
|
+
interface AccountACLRow extends BaseACLRow<'ACCOUNT'> {
|
|
102
|
+
/**
|
|
103
|
+
* The account that these permissions apply to
|
|
104
|
+
*/
|
|
105
|
+
principal: GenericAccount;
|
|
106
|
+
}
|
|
107
|
+
interface CertificateACLRow extends BaseACLRow<'CERTIFICATE'> {
|
|
108
|
+
/**
|
|
109
|
+
* Accounts having certificate issued by this certificate will be granted the permissions in this ACL row
|
|
110
|
+
*/
|
|
111
|
+
principal: CertificateACLPrincipal;
|
|
112
|
+
}
|
|
94
113
|
/**
|
|
95
|
-
*
|
|
96
|
-
* @expandType ACLRow
|
|
114
|
+
* Permissions types
|
|
97
115
|
*/
|
|
98
|
-
export
|
|
116
|
+
export type ACLRow = AccountACLRow | CertificateACLRow;
|
|
117
|
+
/**
|
|
118
|
+
* A permission requirement for ledger effects
|
|
119
|
+
* @expandType AccountACLRow
|
|
120
|
+
*/
|
|
121
|
+
export type ACLPermissionRequirement = Omit<AccountACLRow, 'target' | 'principalType'> & {
|
|
99
122
|
target?: GenericAccount;
|
|
100
123
|
method?: AdjustMethod.SET;
|
|
101
|
-
}
|
|
124
|
+
};
|
|
102
125
|
/**
|
|
103
126
|
* Update an ACL for an account
|
|
104
|
-
* @expandType
|
|
127
|
+
* @expandType ACLRow
|
|
105
128
|
*/
|
|
106
|
-
export
|
|
129
|
+
export type ACLUpdate = DistributiveOmit<ACLRow, 'method' | 'permissions' | 'target'> & {
|
|
130
|
+
target?: GenericAccount;
|
|
107
131
|
/**
|
|
108
132
|
* The method to use to update the ACL
|
|
109
133
|
*/
|
|
@@ -114,7 +138,7 @@ export interface ACLUpdate extends Omit<ACLEntry, 'method' | 'permissions'> {
|
|
|
114
138
|
* If this is set to null, the permissions will be unset
|
|
115
139
|
*/
|
|
116
140
|
permissions: Permissions | null;
|
|
117
|
-
}
|
|
141
|
+
};
|
|
118
142
|
/**
|
|
119
143
|
* All balances for each token on an account
|
|
120
144
|
*/
|
package/lib/log/target_gcp.js
CHANGED
|
@@ -274,7 +274,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
274
274
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
275
275
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
276
276
|
};
|
|
277
|
-
var _LogTargetGCP_instances, _LogTargetGCP_googleCloudLoggingOptions, _LogTargetGCP_googleCloudLogging, _LogTargetGCP_consoleLoggingTarget, _LogTargetGCP_console, _LogTargetGCP_gcpLoggingTarget_get;
|
|
277
|
+
var _LogTargetGCP_instances, _LogTargetGCP_googleCloudLoggingOptions, _LogTargetGCP_googleCloudLogging, _LogTargetGCP_consoleLoggingTarget, _LogTargetGCP_console, _LogTargetGCP_getLabels, _LogTargetGCP_logStartupInformationToConsole, _LogTargetGCP_gcpLoggingTarget_get;
|
|
278
278
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
279
279
|
exports.Testing = void 0;
|
|
280
280
|
const common_1 = __webpack_require__(364);
|
|
@@ -403,6 +403,7 @@ class LogTargetGCP {
|
|
|
403
403
|
instance: instance,
|
|
404
404
|
log: instance.log(__classPrivateFieldGet(this, _LogTargetGCP_instances, "a", _LogTargetGCP_gcpLoggingTarget_get))
|
|
405
405
|
}, "f");
|
|
406
|
+
__classPrivateFieldGet(this, _LogTargetGCP_instances, "m", _LogTargetGCP_logStartupInformationToConsole).call(this);
|
|
406
407
|
}
|
|
407
408
|
/**
|
|
408
409
|
* This function tries to log a test message to GCP Logging, and if it fails,
|
|
@@ -413,8 +414,7 @@ class LogTargetGCP {
|
|
|
413
414
|
*/
|
|
414
415
|
async test(canRun, elseRun) {
|
|
415
416
|
const gcpLogging = __classPrivateFieldGet(this, _LogTargetGCP_googleCloudLogging, "f");
|
|
416
|
-
const
|
|
417
|
-
const environment = __classPrivateFieldGet(this, _LogTargetGCP_googleCloudLoggingOptions, "f").environment;
|
|
417
|
+
const labels = __classPrivateFieldGet(this, _LogTargetGCP_instances, "m", _LogTargetGCP_getLabels).call(this);
|
|
418
418
|
try {
|
|
419
419
|
await gcpLogging.log.write(gcpLogging.instance.entry({
|
|
420
420
|
jsonPayload: {
|
|
@@ -427,11 +427,7 @@ class LogTargetGCP {
|
|
|
427
427
|
resource: {
|
|
428
428
|
type: 'global'
|
|
429
429
|
},
|
|
430
|
-
labels:
|
|
431
|
-
vendor: vendor,
|
|
432
|
-
product: product,
|
|
433
|
-
environment: environment
|
|
434
|
-
},
|
|
430
|
+
labels: labels,
|
|
435
431
|
severity: 'DEBUG'
|
|
436
432
|
}));
|
|
437
433
|
await canRun();
|
|
@@ -450,8 +446,7 @@ class LogTargetGCP {
|
|
|
450
446
|
if (logs.length === 0) {
|
|
451
447
|
return;
|
|
452
448
|
}
|
|
453
|
-
const
|
|
454
|
-
const environment = __classPrivateFieldGet(this, _LogTargetGCP_googleCloudLoggingOptions, "f").environment;
|
|
449
|
+
const labels = __classPrivateFieldGet(this, _LogTargetGCP_instances, "m", _LogTargetGCP_getLabels).call(this);
|
|
455
450
|
const logEntries = logs.map((log) => {
|
|
456
451
|
const addLogFields = {};
|
|
457
452
|
if (log.trace !== undefined) {
|
|
@@ -479,12 +474,7 @@ class LogTargetGCP {
|
|
|
479
474
|
resource: {
|
|
480
475
|
type: 'global'
|
|
481
476
|
},
|
|
482
|
-
labels:
|
|
483
|
-
vendor: vendor,
|
|
484
|
-
product: product,
|
|
485
|
-
environment: environment,
|
|
486
|
-
...(this.context ?? {})
|
|
487
|
-
},
|
|
477
|
+
labels: labels,
|
|
488
478
|
severity: log.level
|
|
489
479
|
}));
|
|
490
480
|
});
|
|
@@ -497,7 +487,19 @@ class LogTargetGCP {
|
|
|
497
487
|
}
|
|
498
488
|
}
|
|
499
489
|
}
|
|
500
|
-
_LogTargetGCP_googleCloudLoggingOptions = new WeakMap(), _LogTargetGCP_googleCloudLogging = new WeakMap(), _LogTargetGCP_consoleLoggingTarget = new WeakMap(), _LogTargetGCP_console = new WeakMap(), _LogTargetGCP_instances = new WeakSet(),
|
|
490
|
+
_LogTargetGCP_googleCloudLoggingOptions = new WeakMap(), _LogTargetGCP_googleCloudLogging = new WeakMap(), _LogTargetGCP_consoleLoggingTarget = new WeakMap(), _LogTargetGCP_console = new WeakMap(), _LogTargetGCP_instances = new WeakSet(), _LogTargetGCP_getLabels = function _LogTargetGCP_getLabels() {
|
|
491
|
+
const [vendor, product] = __classPrivateFieldGet(this, _LogTargetGCP_instances, "a", _LogTargetGCP_gcpLoggingTarget_get).split('/');
|
|
492
|
+
const environment = __classPrivateFieldGet(this, _LogTargetGCP_googleCloudLoggingOptions, "f").environment;
|
|
493
|
+
return ({
|
|
494
|
+
vendor: vendor,
|
|
495
|
+
product: product,
|
|
496
|
+
environment: environment,
|
|
497
|
+
...this.context
|
|
498
|
+
});
|
|
499
|
+
}, _LogTargetGCP_logStartupInformationToConsole = function _LogTargetGCP_logStartupInformationToConsole() {
|
|
500
|
+
const labels = __classPrivateFieldGet(this, _LogTargetGCP_instances, "m", _LogTargetGCP_getLabels).call(this);
|
|
501
|
+
__classPrivateFieldGet(this, _LogTargetGCP_console, "f").info(`[LogTargetGCP] Initializing Google Cloud Logging with ${JSON.stringify(labels)}`);
|
|
502
|
+
}, _LogTargetGCP_gcpLoggingTarget_get = function _LogTargetGCP_gcpLoggingTarget_get() {
|
|
501
503
|
return (`${__classPrivateFieldGet(this, _LogTargetGCP_googleCloudLoggingOptions, "f").vendor}/${__classPrivateFieldGet(this, _LogTargetGCP_googleCloudLoggingOptions, "f").product}`);
|
|
502
504
|
};
|
|
503
505
|
/** @internal */
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExternalKeyPair for the Keeta Network which uses Google Cloud KMS
|
|
3
|
+
* to wrap private key operations. This allows users to leverage GCP KMS for
|
|
4
|
+
* decrypting an encrypted private key and performing signing and encryption
|
|
5
|
+
* operations without exposing the private key material to the application.
|
|
6
|
+
*
|
|
7
|
+
* Internally, it uses RSA keys on GCP KMS to support decrypting the
|
|
8
|
+
* supplied encrypted keying material.
|
|
9
|
+
*/
|
|
10
|
+
import type { KeyManagementServiceClient } from '@google-cloud/kms';
|
|
11
|
+
import type * as KeetaNet from '../../../client';
|
|
12
|
+
import type { AccountKeyAlgorithm } from '../../../lib/account';
|
|
13
|
+
import type * as crypto from 'node:crypto';
|
|
14
|
+
import type { GCPKMSKeyConfig } from './gcp-kms.common';
|
|
15
|
+
type KeetaGCPKMSWrappedKeyPairPackages = {
|
|
16
|
+
/**
|
|
17
|
+
* GCP KMS Key Management Service Client, used to interact with GCP KMS
|
|
18
|
+
* for key lookups and decryption operations
|
|
19
|
+
*/
|
|
20
|
+
KeyManagementServiceClient: typeof KeyManagementServiceClient;
|
|
21
|
+
/**
|
|
22
|
+
* Keeta Network client library
|
|
23
|
+
*/
|
|
24
|
+
KeetaNet: {
|
|
25
|
+
lib: {
|
|
26
|
+
Account: typeof KeetaNet.lib.Account;
|
|
27
|
+
Utils: {
|
|
28
|
+
Helper: {
|
|
29
|
+
bufferToArrayBuffer: typeof KeetaNet.lib.Utils.Helper.bufferToArrayBuffer;
|
|
30
|
+
};
|
|
31
|
+
Buffer: typeof KeetaNet.lib.Utils.Buffer;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* NodeJS Crypto module, only required for encrypting the seed material
|
|
37
|
+
* not required otherwise
|
|
38
|
+
*/
|
|
39
|
+
crypto?: {
|
|
40
|
+
createPublicKey: typeof crypto.createPublicKey;
|
|
41
|
+
publicEncrypt: typeof crypto.publicEncrypt;
|
|
42
|
+
constants: {
|
|
43
|
+
RSA_PKCS1_OAEP_PADDING: typeof crypto.constants.RSA_PKCS1_OAEP_PADDING;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
type AccountKeyAlgorithmNumberOrString = AccountKeyAlgorithm | keyof typeof AccountKeyAlgorithm;
|
|
48
|
+
type KeetaGCPKMSWrappedKeyPairOptions = {
|
|
49
|
+
/**
|
|
50
|
+
* The GCP KMS key resource name or config object.
|
|
51
|
+
* Format: projects/<project>/locations/<location>/keyRings/<keyRing>/cryptoKeys/<key>
|
|
52
|
+
*/
|
|
53
|
+
kmsKey: string | GCPKMSKeyConfig;
|
|
54
|
+
/**
|
|
55
|
+
* The encrypted seed to use for account creation
|
|
56
|
+
*/
|
|
57
|
+
encryptedSeed: ArrayBuffer;
|
|
58
|
+
/**
|
|
59
|
+
* The index of the key to use for account creation (default is 0)
|
|
60
|
+
*/
|
|
61
|
+
index?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Key type for this key
|
|
64
|
+
*/
|
|
65
|
+
keyType: AccountKeyAlgorithmNumberOrString;
|
|
66
|
+
};
|
|
67
|
+
interface KeetaGCPKMSWrappedKeyPairClass {
|
|
68
|
+
encryptSeed: (input: ArrayBuffer, options: Omit<KeetaGCPKMSWrappedKeyPairOptions, 'encryptedSeed'>) => Promise<ArrayBuffer>;
|
|
69
|
+
lookup: (options: KeetaGCPKMSWrappedKeyPairOptions) => Promise<InstanceType<typeof KeetaNet.lib.Account>>;
|
|
70
|
+
lookupFromJSON: ((input: Pick<KeetaGCPKMSWrappedKeyPairOptions, 'kmsKey' | 'keyType' | 'index'> & {
|
|
71
|
+
encryptedSeed: string;
|
|
72
|
+
type: 'gcpkmswrapped';
|
|
73
|
+
}) => Promise<InstanceType<typeof KeetaNet.lib.Account>>) | ((input: unknown) => Promise<InstanceType<typeof KeetaNet.lib.Account>>);
|
|
74
|
+
lookupFromString: (input: string) => Promise<InstanceType<typeof KeetaNet.lib.Account>>;
|
|
75
|
+
getJSONFromOptions: (options: KeetaGCPKMSWrappedKeyPairOptions) => Promise<{
|
|
76
|
+
type: 'gcpkmswrapped';
|
|
77
|
+
kmsKey: string;
|
|
78
|
+
keyType: string;
|
|
79
|
+
encryptedSeed: string;
|
|
80
|
+
index: number;
|
|
81
|
+
}>;
|
|
82
|
+
getStringFromOptions: (options: KeetaGCPKMSWrappedKeyPairOptions) => Promise<string>;
|
|
83
|
+
}
|
|
84
|
+
export declare function KeetaGCPKMSWrappedKeyPairFactory(packages: KeetaGCPKMSWrappedKeyPairPackages): Omit<KeetaGCPKMSWrappedKeyPairClass, '_Testing'>;
|
|
85
|
+
export {};
|