@keetanetwork/keetanet-client 0.10.4 → 0.12.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/api/index.d.ts +23 -7
- package/api/node.d.ts +27 -2
- package/api/vote.d.ts +4 -6
- package/client/builder.d.ts +17 -0
- package/client/client_common_tests.d.ts +28 -1
- package/client/index-browser.d.ts +129 -7
- package/client/index-browser.js +25383 -37128
- package/client/index.d.ts +129 -7
- package/client/index.js +3828 -6498
- package/config/index.d.ts +6 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/KeetaNetSDK.Client.html +42 -13
- package/docs/classes/KeetaNetSDK.Referenced.Account.html +31 -21
- package/docs/classes/KeetaNetSDK.Referenced.BaseSet.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.Block.html +2 -4
- package/docs/classes/KeetaNetSDK.Referenced.BlockBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockHash.html +4 -5
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperation.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationCREATE_IDENTIFIER.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMANAGE_CERTIFICATE.html +12 -0
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationMODIFY_PERMISSIONS.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationRECEIVE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSEND.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_INFO.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationSET_REP.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_MODIFY_BALANCE.html +2 -2
- package/docs/classes/KeetaNetSDK.Referenced.BlockOperationTOKEN_ADMIN_SUPPLY.html +2 -2
- package/docs/classes/{KeetaNetSDK.Referenced.src_lib_utils_certificate.Certificate.html → KeetaNetSDK.Referenced.Certificate.html} +12 -9
- package/docs/classes/KeetaNetSDK.Referenced.CertificateBundle.html +8 -0
- package/docs/classes/KeetaNetSDK.Referenced.CertificateHash.html +16 -0
- 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.IdentifierKey.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.IdentifierKeyPair.html +4 -4
- package/docs/classes/KeetaNetSDK.Referenced.KeetaNetError.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 +4 -2
- package/docs/classes/KeetaNetSDK.Referenced.LedgerAtomicInterface.html +3 -1
- package/docs/classes/KeetaNetSDK.Referenced.LedgerRequestCache.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Node.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.P2PSwitch.html +3 -3
- package/docs/classes/KeetaNetSDK.Referenced.PendingAccount.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.PermissionSetHolder.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Permissions.html +2 -3
- package/docs/classes/KeetaNetSDK.Referenced.PossiblyExpiredVote.html +4 -3
- package/docs/classes/KeetaNetSDK.Referenced.RequestTiming.html +16 -2
- package/docs/classes/KeetaNetSDK.Referenced.SignatureStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.Stats.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.UserClientBuilder.html +3 -2
- package/docs/classes/KeetaNetSDK.Referenced.Vote.html +4 -5
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockBundle.html +35 -0
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteBlockHashMap.html +9 -8
- package/docs/classes/KeetaNetSDK.Referenced.VoteHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.VoteStaple.html +23 -29
- package/docs/classes/KeetaNetSDK.Referenced.VoteStapleHash.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.default.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_asn1.BufferStorageASN1.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_buffer.BufferStorage.html +1 -1
- package/docs/classes/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateBuilder.html +1 -1
- package/docs/classes/KeetaNetSDK.UserClient.html +60 -18
- package/docs/documents/GETTING-STARTED.html +5 -2
- package/docs/enums/KeetaNetSDK.Referenced.AccountKeyAlgorithm.html +2 -1
- package/docs/enums/KeetaNetSDK.Referenced.AdjustMethod.html +4 -4
- package/docs/enums/KeetaNetSDK.Referenced.BaseFlag.html +2 -1
- package/docs/enums/KeetaNetSDK.Referenced.OperationType.html +2 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getDefaultConfig.html +2 -2
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getNetworkAlias.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_config.getValidation.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_config.isNetwork.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.objectToBuffer.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.toJSONSerializable.html +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.booleanEnv.html +1 -0
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_helper.nonNullable.html +1 -0
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ACLUpdate.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.BaseExternalKeyPairFunctions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BaseGenerationConfig.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockCanonical.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSON.html +2 -2
- 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 +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMANAGE_CERTIFICATESerializable.html +5 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOperationMODIFY_PERMISSIONS.html +1 -1
- 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 +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockUnsignedCanonical.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateWithIntermediates.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.CertificateWithIntermediatesResponse.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ComputedBlocksEffectFields.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.Constructor.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.DisposableTimingHandle.html +7 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsNoEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.ExternalKeyPairFunctionsSupportsEncryption.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.IdentifierCreateRequest.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.InitialConfigSupply.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.InstanceSet.html +13 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.KVGenericOptionsType.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.KVSetOptionsType.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.KVStorageProviderAPI.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerConfig.html +4 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStatistics.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageAPI.html +15 -7
- package/docs/interfaces/KeetaNetSDK.Referenced.LedgerStorageTransactionBase.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.ModifyTokenBalanceEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.NodeConfig.html +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.NumericValidationRule.html +3 -0
- 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 +3 -3
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperations.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PendingOperationsJSON.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStorage.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.PublicKeyStringMapping.html +3 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.RequestTokenReceiveEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.TokenNumericEntry.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientConfig.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientListenerOptions.html +2 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.UserClientOptions.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteBundleConstructor.html +6 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteStapleJSON.html +2 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.WithIsInstance.html +1 -1
- package/docs/interfaces/KeetaNetSDK.Referenced.src_config.ValidationConfig.html +2 -2
- 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_conversion.ToJSONSerializableOptions.html +3 -0
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSetConstructor.html +2 -2
- package/docs/modules/KeetaNetSDK.Referenced.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_certificate.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_conversion.html +1 -1
- package/docs/modules/KeetaNetSDK.Referenced.src_lib_utils_helper.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHex.html +8 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHexReverse.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AccountKeyAlgorithmHexToType.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.AddBinaryIfIncluded.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.BlockHashString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateErrorCode.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateHashString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.CertificateOptions.html +4 -4
- package/docs/types/KeetaNetSDK.Referenced.CertificateUpdate.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ClientRepresentative.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.ComputedEffectOfBlocks.html +3 -2
- package/docs/types/KeetaNetSDK.Referenced.DbStats.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.ErrorCode.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.ExportedJSONOperation.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.MultisigPublicKeyString.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.NodeLike-1.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.NodeLike.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.PublicKeyAndTypeStringHex.html +3 -0
- package/docs/types/KeetaNetSDK.Referenced.TimingData.html +2 -0
- package/docs/types/KeetaNetSDK.Referenced.TimingSectionHandle.html +6 -0
- package/docs/types/KeetaNetSDK.Referenced.src_config.NetworkConfig.html +3 -3
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.Schema.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_asn1.ValidateASN1.SchemaMap.html +1 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_certificate.CertificateJSONOutput.html +1 -0
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializable.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes-1.html +1 -0
- package/docs/variables/KeetaNetSDK.Referenced.BlockErrorCodes.html +1 -1
- package/docs/{types/KeetaNetSDK.Referenced.JSONUnsupportedTypes.html → variables/KeetaNetSDK.Referenced.CertificateErrorType.html} +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.ClientErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.KVErrorCodes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.Operation.html +2 -2
- package/docs/variables/KeetaNetSDK.Referenced.identifierKeyTypes.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_config.networksArray.html +1 -1
- package/docs/variables/KeetaNetSDK.Referenced.src_lib_utils_helper.AsyncDisposableStack.html +2 -0
- package/lib/account.d.ts +68 -29
- package/lib/block/index.d.ts +53 -23
- package/lib/block/operations.d.ts +78 -33
- package/lib/error/block.d.ts +1 -1
- package/lib/error/certificate.d.ts +9 -0
- package/lib/error/client.d.ts +1 -1
- package/lib/error/index.d.ts +2 -1
- package/lib/error/kv.d.ts +1 -1
- package/lib/kv/index.d.ts +15 -8
- package/lib/kv/kv_redis.d.ts +18 -8
- package/lib/ledger/common.d.ts +13 -5
- package/lib/ledger/db_dynamodb.d.ts +22 -16
- package/lib/ledger/db_postgres.d.ts +10 -10
- package/lib/ledger/db_spanner.d.ts +26 -14
- package/lib/ledger/db_spanner_helper.d.ts +94 -109
- package/lib/ledger/db_sqlite.d.ts +10 -10
- package/lib/ledger/effects.d.ts +19 -4
- package/lib/ledger/index.d.ts +57 -12
- package/lib/ledger/types.d.ts +7 -1
- package/lib/node/local.d.ts +10 -1
- package/lib/node/timing.d.ts +44 -5
- package/lib/p2p.d.ts +6 -3
- package/lib/permissions.d.ts +3 -3
- package/lib/pubsub/index.d.ts +1 -1
- package/lib/pubsub/providers.d.ts +2 -0
- package/lib/pubsub/ps_gcp.d.ts +14 -0
- package/lib/stats.d.ts +5 -0
- package/lib/utils/asn1.d.ts +3 -3
- package/lib/utils/certificate.d.ts +75 -4
- package/lib/utils/conversion.d.ts +13 -35
- package/lib/utils/helper.d.ts +19 -8
- package/lib/utils/helper_testing.d.ts +1 -1
- package/lib/vote.d.ts +73 -55
- package/package.json +2 -3
- package/version.d.ts +1 -1
- package/docs/functions/KeetaNetSDK.Referenced.src_lib_utils_conversion.RegisterSerializable.html +0 -2
- package/docs/interfaces/KeetaNetSDK.Referenced.BlockJSONOutput.html +0 -5
- package/docs/interfaces/KeetaNetSDK.Referenced.VoteJSONOutput.html +0 -4
- package/docs/interfaces/KeetaNetSDK.Referenced.WithConversionClass.html +0 -6
- package/docs/interfaces/KeetaNetSDK.Referenced.src_lib_utils_helper.InstanceSet.html +0 -10
- package/docs/types/KeetaNetSDK.Referenced.JSONSupportedObject.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.JSONSupportedValue.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.Vote.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.VoteJSONOutput.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.JSONSupported.html +0 -1
- package/docs/types/KeetaNetSDK.Referenced.src_lib_utils_conversion.ToJSONSerializableOptions.html +0 -3
- package/docs/variables/KeetaNetSDK.Referenced.default.html +0 -3
package/api/index.d.ts
CHANGED
|
@@ -7,17 +7,13 @@ declare const rootTree: {
|
|
|
7
7
|
blocks: string[];
|
|
8
8
|
votes?: string[];
|
|
9
9
|
}) => Promise<{
|
|
10
|
-
vote: import("../lib/vote").
|
|
11
|
-
$binary: string;
|
|
12
|
-
};
|
|
10
|
+
vote: import("../lib/vote").Vote;
|
|
13
11
|
}>;
|
|
14
12
|
};
|
|
15
13
|
':blockhash': {
|
|
16
14
|
GET: (request: APIRequest, blockhash: string) => Promise<{
|
|
17
|
-
blockhash:
|
|
18
|
-
votes:
|
|
19
|
-
$binary: string;
|
|
20
|
-
})[] | null;
|
|
15
|
+
blockhash: import("../lib/block").BlockHash;
|
|
16
|
+
votes: import("../lib/vote").Vote[] | null;
|
|
21
17
|
}>;
|
|
22
18
|
};
|
|
23
19
|
};
|
|
@@ -125,6 +121,26 @@ declare const rootTree: {
|
|
|
125
121
|
}>;
|
|
126
122
|
};
|
|
127
123
|
};
|
|
124
|
+
certificates: {
|
|
125
|
+
GET: (request: APIRequest, account: string) => Promise<{
|
|
126
|
+
account: string;
|
|
127
|
+
certificates: {
|
|
128
|
+
certificate: string;
|
|
129
|
+
intermediates: string[] | null;
|
|
130
|
+
}[];
|
|
131
|
+
}>;
|
|
132
|
+
':certificateHash': {
|
|
133
|
+
GET: (request: APIRequest, account: string, certificateHash: string) => Promise<{
|
|
134
|
+
certificate: string;
|
|
135
|
+
intermediates: string[] | null;
|
|
136
|
+
account: string;
|
|
137
|
+
} | {
|
|
138
|
+
certificate: null;
|
|
139
|
+
intermediates: null;
|
|
140
|
+
account: string;
|
|
141
|
+
}>;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
128
144
|
pending: {
|
|
129
145
|
GET: (request: APIRequest, account: string) => Promise<{
|
|
130
146
|
account: string;
|
package/api/node.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ import type { VoteStaple } from '../lib/vote';
|
|
|
10
10
|
interface GetPeersAPIResponse {
|
|
11
11
|
kind: NodeKind;
|
|
12
12
|
key?: string;
|
|
13
|
-
|
|
13
|
+
endpoints?: {
|
|
14
|
+
p2p: string;
|
|
15
|
+
api: string;
|
|
16
|
+
};
|
|
14
17
|
signature?: string;
|
|
15
18
|
}
|
|
16
19
|
interface GetAccountChainAPIResponse {
|
|
@@ -56,7 +59,7 @@ interface PrincipalACLWithInfoResponse {
|
|
|
56
59
|
}
|
|
57
60
|
interface GetAccountHistoryResponse {
|
|
58
61
|
history: {
|
|
59
|
-
voteStaple:
|
|
62
|
+
voteStaple: VoteStaple;
|
|
60
63
|
'$id': string;
|
|
61
64
|
'$timestamp': string;
|
|
62
65
|
}[];
|
|
@@ -97,6 +100,22 @@ declare function getAllBalances(request: APIRequest, account: string | GenericAc
|
|
|
97
100
|
account: GenericAccount;
|
|
98
101
|
balances: GetAllBalancesResponse;
|
|
99
102
|
}>;
|
|
103
|
+
declare function getAccountCertificates(request: APIRequest, account: string): Promise<{
|
|
104
|
+
account: string;
|
|
105
|
+
certificates: {
|
|
106
|
+
certificate: string;
|
|
107
|
+
intermediates: string[] | null;
|
|
108
|
+
}[];
|
|
109
|
+
}>;
|
|
110
|
+
declare function getCertificateByHash(request: APIRequest, account: string, certificateHash: string): Promise<{
|
|
111
|
+
certificate: string;
|
|
112
|
+
intermediates: string[] | null;
|
|
113
|
+
account: string;
|
|
114
|
+
} | {
|
|
115
|
+
certificate: null;
|
|
116
|
+
intermediates: null;
|
|
117
|
+
account: string;
|
|
118
|
+
}>;
|
|
100
119
|
declare function getAccountState(request: APIRequest, pubKey: string): Promise<AccountState | AccountStateError>;
|
|
101
120
|
declare function getBlockByHash(request: APIRequest, blockhash: string): Promise<{
|
|
102
121
|
blockhash: string;
|
|
@@ -192,6 +211,12 @@ declare const _default: {
|
|
|
192
211
|
GET: typeof listACLsByPrincipal;
|
|
193
212
|
};
|
|
194
213
|
};
|
|
214
|
+
certificates: {
|
|
215
|
+
GET: typeof getAccountCertificates;
|
|
216
|
+
':certificateHash': {
|
|
217
|
+
GET: typeof getCertificateByHash;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
195
220
|
pending: {
|
|
196
221
|
GET: typeof getAccountPendingBlock;
|
|
197
222
|
};
|
package/api/vote.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import type { APIRequest } from '.';
|
|
2
2
|
import KeetaNet from '../lib';
|
|
3
3
|
type Vote = InstanceType<typeof KeetaNet['Vote']>;
|
|
4
|
-
type
|
|
5
|
-
'$binary': string;
|
|
6
|
-
};
|
|
4
|
+
type BlockHash = InstanceType<typeof KeetaNet['Block']['Hash']>;
|
|
7
5
|
declare function createNewVote(request: APIRequest, payload: {
|
|
8
6
|
blocks: string[];
|
|
9
7
|
votes?: string[];
|
|
10
8
|
}): Promise<{
|
|
11
|
-
vote:
|
|
9
|
+
vote: Vote;
|
|
12
10
|
}>;
|
|
13
11
|
declare function getVotes(request: APIRequest, blockhash: string): Promise<{
|
|
14
|
-
blockhash:
|
|
15
|
-
votes:
|
|
12
|
+
blockhash: BlockHash;
|
|
13
|
+
votes: Vote[] | null;
|
|
16
14
|
}>;
|
|
17
15
|
declare const _default: {
|
|
18
16
|
_root: {
|
package/client/builder.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ import type { GenericAccount, IdentifierKeyAlgorithm } from '../lib/account';
|
|
|
2
2
|
import { Account, AccountKeyAlgorithm } from '../lib/account';
|
|
3
3
|
import type { AdjustMethod, BlockHash } from '../lib/block';
|
|
4
4
|
import { Block } from '../lib/block';
|
|
5
|
+
import type { BlockJSONOperations } from '../lib/block/operations';
|
|
5
6
|
import type { AccountInfo } from '../lib/ledger/types';
|
|
6
7
|
import type { AcceptedPermissionTypes } from '../lib/permissions';
|
|
7
8
|
import type { UserClient } from '.';
|
|
8
9
|
import { Permissions } from '../lib/permissions';
|
|
10
|
+
import { Certificate, CertificateBundle } from '../lib/utils/certificate';
|
|
9
11
|
type GetPrevFunction = (acct: GenericAccount | string) => Promise<BlockHash | string | null | undefined>;
|
|
10
12
|
interface AccountSignerOptions {
|
|
11
13
|
account: GenericAccount;
|
|
@@ -48,6 +50,9 @@ interface IdentifierCreateRequest {
|
|
|
48
50
|
}
|
|
49
51
|
type AccountOrPending<Type extends AccountKeyAlgorithm = AccountKeyAlgorithm> = Account<Type> | PendingAccount<Type>;
|
|
50
52
|
type TokenOrPending = AccountOrPending<AccountKeyAlgorithm.TOKEN>;
|
|
53
|
+
export type ManageCertificateMethod = Extract<BlockJSONOperations, {
|
|
54
|
+
type: typeof Block['OperationType']['MANAGE_CERTIFICATE'];
|
|
55
|
+
}>['method'];
|
|
51
56
|
export interface PendingOperations {
|
|
52
57
|
receive?: {
|
|
53
58
|
otherParty: AccountOrPending;
|
|
@@ -69,6 +74,11 @@ export interface PendingOperations {
|
|
|
69
74
|
amount: bigint;
|
|
70
75
|
token: TokenOrPending;
|
|
71
76
|
}[];
|
|
77
|
+
modifyCertificates?: {
|
|
78
|
+
method: ManageCertificateMethod;
|
|
79
|
+
certificate: Certificate;
|
|
80
|
+
intermediateCertificates: CertificateBundle | null;
|
|
81
|
+
}[];
|
|
72
82
|
permissionsChanges?: PerAccount<PerAccount<{
|
|
73
83
|
method: AdjustMethod;
|
|
74
84
|
permissions: Permissions;
|
|
@@ -99,6 +109,11 @@ export interface PendingOperationsJSON {
|
|
|
99
109
|
amount: string;
|
|
100
110
|
token: string;
|
|
101
111
|
}[];
|
|
112
|
+
modifyCertificates?: {
|
|
113
|
+
method: ManageCertificateMethod;
|
|
114
|
+
certificate: string;
|
|
115
|
+
intermediateCertificates: string | null;
|
|
116
|
+
}[];
|
|
102
117
|
permissionsChanges?: PerAccount<PerAccount<{
|
|
103
118
|
method: AdjustMethod;
|
|
104
119
|
permissions: [string, string];
|
|
@@ -138,6 +153,7 @@ export declare class PendingAccount<AccountType extends AccountKeyAlgorithm = Ac
|
|
|
138
153
|
static GetValue<T extends AccountKeyAlgorithm>(data: AccountOrPending<T>): Account<T>;
|
|
139
154
|
set account(account: Account<AccountType>);
|
|
140
155
|
get account(): Account<AccountType>;
|
|
156
|
+
toJSON(): Account<AccountType>;
|
|
141
157
|
}
|
|
142
158
|
type AllPending = [AccountSignerOptions, PendingOperations][];
|
|
143
159
|
export declare class UserClientBuilder {
|
|
@@ -158,6 +174,7 @@ export declare class UserClientBuilder {
|
|
|
158
174
|
send(recipient: AccountOrPending, amount: bigint, token: TokenOrPending, external?: string, options?: BuilderBlockOptions): void;
|
|
159
175
|
receive(from: AccountOrPending, amount: bigint, token: TokenOrPending, exact?: boolean, forward?: GenericAccount, options?: BuilderBlockOptions): void;
|
|
160
176
|
updatePermissions(principal: GenericAccount, permissions: AcceptedPermissionTypes, target?: GenericAccount, method?: AdjustMethod, options?: BuilderBlockOptions): void;
|
|
177
|
+
modifyCertificate(method: ManageCertificateMethod, certificate: Certificate, intermediateCertificates?: CertificateBundle | null, options?: BuilderBlockOptions): void;
|
|
161
178
|
modifyTokenSupply(amount: bigint, options?: BuilderBlockOptions): void;
|
|
162
179
|
modifyTokenBalance(token: TokenOrPending, amount: bigint, isSet?: boolean, options?: BuilderBlockOptions): void;
|
|
163
180
|
setInfo(info: AccountInfo, options?: BuilderBlockOptions): void;
|
|
@@ -4,6 +4,7 @@ import type { Networks } from '../config';
|
|
|
4
4
|
import { AccountKeyAlgorithm } from '../lib/account';
|
|
5
5
|
import type Account from '../lib/account';
|
|
6
6
|
import { UserClient } from '.';
|
|
7
|
+
import { type CreateTestNodeOptions } from '../lib/utils/helper_testing';
|
|
7
8
|
import { toJSONSerializable } from '../lib/utils/conversion';
|
|
8
9
|
import { KeetaNetError as KeetaError } from '../lib/error';
|
|
9
10
|
export type ClientParams = {
|
|
@@ -21,6 +22,7 @@ export type ClientParams = {
|
|
|
21
22
|
export type NodeCreationOptions = {
|
|
22
23
|
p2pTested?: boolean;
|
|
23
24
|
count?: number;
|
|
25
|
+
customNodeOptions?: Omit<CreateTestNodeOptions, 'peerNodes' | 'enableP2P' | 'initialTrustedAccount'>[];
|
|
24
26
|
};
|
|
25
27
|
export declare function setup(options?: NodeCreationOptions): Promise<{
|
|
26
28
|
trustedKey: Account<AccountKeyAlgorithm.ECDSA_SECP256K1>;
|
|
@@ -37,7 +39,8 @@ export declare function setup(options?: NodeCreationOptions): Promise<{
|
|
|
37
39
|
declare function runBasicTests(nodes: LocalNode[], userClient: UserClient, trustedClient: UserClient, params: ClientParams, expect: any, _ignoreExpectErrorCode: any): Promise<void>;
|
|
38
40
|
declare function runBuilderStorageTests(_ignoreNodes: LocalNode[], userClient: UserClient, trustedClient: UserClient, params: ClientParams, expect: any, ExpectErrorCode: any): Promise<void>;
|
|
39
41
|
declare function runRecoverAccountTest(nodes: LocalNode[], userClient: UserClient, trustedClient: UserClient, params: ClientParams, expect: any, ExpectErrorCode: any): Promise<void>;
|
|
40
|
-
declare function runNonNodeTests(_ignore_nodes: LocalNode[], _ignore_userClient: UserClient, _ignore_trustedClient: UserClient, _ignore_params: ClientParams, expect: any,
|
|
42
|
+
declare function runNonNodeTests(_ignore_nodes: LocalNode[], _ignore_userClient: UserClient, _ignore_trustedClient: UserClient, _ignore_params: ClientParams, expect: any, ExpectErrorCode: any): Promise<void>;
|
|
43
|
+
declare function runErrorTests(nodes: LocalNode[], userClientAccount1: UserClient, trustedClient: UserClient, params: ClientParams, expect: any, ExpectErrorCode: any): Promise<void>;
|
|
41
44
|
export declare const clientTests: {
|
|
42
45
|
'Basic Client Tests': {
|
|
43
46
|
test: typeof runBasicTests;
|
|
@@ -68,6 +71,30 @@ export declare const clientTests: {
|
|
|
68
71
|
count: number;
|
|
69
72
|
};
|
|
70
73
|
};
|
|
74
|
+
'Client Error Tests': {
|
|
75
|
+
test: typeof runErrorTests;
|
|
76
|
+
options: {
|
|
77
|
+
p2pTested: boolean;
|
|
78
|
+
count: number;
|
|
79
|
+
customNodeOptions: ({
|
|
80
|
+
readonly ledger: {
|
|
81
|
+
readonly ledgerWriteMode: "no-voting";
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
readonly ledger: {
|
|
85
|
+
readonly ledgerWriteMode: "read-write";
|
|
86
|
+
};
|
|
87
|
+
} | {
|
|
88
|
+
readonly ledger: {
|
|
89
|
+
readonly ledgerWriteMode: "bootstrap-only";
|
|
90
|
+
};
|
|
91
|
+
} | {
|
|
92
|
+
readonly ledger: {
|
|
93
|
+
readonly ledgerWriteMode: "read-only";
|
|
94
|
+
};
|
|
95
|
+
})[];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
71
98
|
};
|
|
72
99
|
export declare const KeetaNetError: typeof KeetaError;
|
|
73
100
|
export { toJSONSerializable };
|
|
@@ -15,13 +15,15 @@ import type { AdjustMethod } from '../lib/block';
|
|
|
15
15
|
import Block, { BlockHash } from '../lib/block';
|
|
16
16
|
import type { P2PSwitchStatistics } from '../lib/p2p';
|
|
17
17
|
import * as Config from '../config';
|
|
18
|
-
import type { BuilderOptions } from './builder';
|
|
18
|
+
import type { BuilderOptions, ManageCertificateMethod } from './builder';
|
|
19
19
|
import { UserClientBuilder } from './builder';
|
|
20
20
|
import { KeetaNetError } from '../lib/error';
|
|
21
21
|
import type { AccountInfo, GetAllBalancesResponse, ACLRow, LedgerStatistics } from '../lib/ledger/types';
|
|
22
22
|
import type { LedgerSelector, LedgerStorage } from '../lib/ledger';
|
|
23
23
|
import type { AcceptedPermissionTypes } from '../lib/permissions';
|
|
24
24
|
import { type BlockOperations } from '../lib/block/operations';
|
|
25
|
+
import { Certificate } from '../lib/utils/certificate';
|
|
26
|
+
import { CertificateBundle, type CertificateHash } from '../lib/utils/certificate';
|
|
25
27
|
type Vote = InstanceType<typeof KeetaNet['Vote']>;
|
|
26
28
|
type VoteStaple = InstanceType<typeof KeetaNet['Vote']['Staple']>;
|
|
27
29
|
type VoteBlocksHash = Vote['blocksHash'];
|
|
@@ -113,6 +115,10 @@ interface PrincipalACLWithInfoParsed {
|
|
|
113
115
|
*/
|
|
114
116
|
balances: GetAllBalancesResponse;
|
|
115
117
|
}
|
|
118
|
+
interface CertificateWithIntermediatesResponse {
|
|
119
|
+
certificate: Certificate;
|
|
120
|
+
intermediates: CertificateBundle | null;
|
|
121
|
+
}
|
|
116
122
|
/**
|
|
117
123
|
*/
|
|
118
124
|
interface UserClientOptions {
|
|
@@ -217,6 +223,11 @@ export declare class Client {
|
|
|
217
223
|
* by the application.
|
|
218
224
|
*/
|
|
219
225
|
logger: Pick<Console, "error" | "log" | "warn">;
|
|
226
|
+
/**
|
|
227
|
+
* Indication of whether or not this client has been destroyed.
|
|
228
|
+
*/
|
|
229
|
+
destroyed: boolean;
|
|
230
|
+
private static updateRepsInterval;
|
|
220
231
|
/**
|
|
221
232
|
* Stats for this instance of the client
|
|
222
233
|
*/
|
|
@@ -277,6 +288,14 @@ export declare class Client {
|
|
|
277
288
|
* any resources used by the instance and stop any background tasks.
|
|
278
289
|
*/
|
|
279
290
|
destroy(): Promise<void>;
|
|
291
|
+
/**
|
|
292
|
+
* This enables the use of `using` to automatically clean up the
|
|
293
|
+
* instance of the {@link Client} class when it is no longer needed.
|
|
294
|
+
*
|
|
295
|
+
* It calls the {@link destroy}() method to clean up the instance when
|
|
296
|
+
* it goes out of scope.
|
|
297
|
+
*/
|
|
298
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
280
299
|
/**
|
|
281
300
|
* Create a new instance of the {@link UserClientBuilder} class. This
|
|
282
301
|
* is a convenience method to create a new instance of the builder
|
|
@@ -424,6 +443,23 @@ export declare class Client {
|
|
|
424
443
|
* for each token the user holds a balance for
|
|
425
444
|
*/
|
|
426
445
|
getAllBalances(account: GenericAccount | string): Promise<GetAllBalancesResponse>;
|
|
446
|
+
/**
|
|
447
|
+
* List all certificates for a given account. This will return
|
|
448
|
+
* all certificates that have been added by and issued to the account, including
|
|
449
|
+
* any intermediate certificates that have been issued.
|
|
450
|
+
* @param account Account to lookup certificates for
|
|
451
|
+
* @returns An array of objects containing the certificate and any intermediates associated with the specified account
|
|
452
|
+
*/
|
|
453
|
+
getAllCertificates(account: GenericAccount | string): Promise<CertificateWithIntermediatesResponse[]>;
|
|
454
|
+
/**
|
|
455
|
+
* Get a certificate by its hash for a given account. This will return
|
|
456
|
+
* the certificate and any intermediate certificates that have been issued.
|
|
457
|
+
*
|
|
458
|
+
* @param account The account to get the certificate for
|
|
459
|
+
* @param certificateHash The hash of the certificate to get
|
|
460
|
+
* @return The certificate and any intermediates or null if the certificate was not found
|
|
461
|
+
*/
|
|
462
|
+
getCertificateByHash(account: GenericAccount | string, certificateHash: string | CertificateHash): Promise<CertificateWithIntermediatesResponse | null>;
|
|
427
463
|
/**
|
|
428
464
|
* Get the current head block for a given account. This will return the
|
|
429
465
|
* entire block, or null if the account has not created any blocks.
|
|
@@ -432,10 +468,11 @@ export declare class Client {
|
|
|
432
468
|
* may have sent tokens to it.
|
|
433
469
|
*
|
|
434
470
|
* @param account The account to get the head block for
|
|
471
|
+
* @param rep The representative to get the head block from -- this is generally "ANY" in which case the best representative will be used, but it is possible to request a specific representative
|
|
435
472
|
* @return The head block for the account or null if the account has
|
|
436
473
|
* not created any blocks
|
|
437
474
|
*/
|
|
438
|
-
getHeadBlock(account: GenericAccount | string): Promise<Block | null>;
|
|
475
|
+
getHeadBlock(account: GenericAccount | string, rep?: Config.Representative | 'ANY'): Promise<Block | null>;
|
|
439
476
|
/**
|
|
440
477
|
* Get a block from the specified representative by its block hash.
|
|
441
478
|
*
|
|
@@ -477,9 +514,10 @@ export declare class Client {
|
|
|
477
514
|
/**
|
|
478
515
|
* @param blockhash The block hash to get the vote staple for
|
|
479
516
|
* @param side The side of the ledger to get the vote staple from -- this is generally "main", but it is possible to request "side" ledger blocks
|
|
517
|
+
* @param rep The representative to get the staple from -- this is generally "ANY" in which case the best representative will be used, but it is possible to request a specific representative
|
|
480
518
|
* @return The vote staple for the given block hash or null if the vote staple does not exist on the given ledger
|
|
481
519
|
*/
|
|
482
|
-
getVoteStaple(blockhash: BlockHash | string, side?: LedgerStorage): Promise<VoteStaple | null>;
|
|
520
|
+
getVoteStaple(blockhash: BlockHash | string, side?: LedgerStorage, rep?: Config.Representative): Promise<VoteStaple | null>;
|
|
483
521
|
/**
|
|
484
522
|
* Get the chain for a given account. This is the set of blocks that
|
|
485
523
|
* the account has created. This will return the blocks in reverse
|
|
@@ -501,11 +539,13 @@ export declare class Client {
|
|
|
501
539
|
* @param account The account to get the chain for
|
|
502
540
|
* @param options The options to use for the request
|
|
503
541
|
* @param options.startBlock The block hash to start from -- this is used to paginate the request
|
|
542
|
+
* @param options.endBlock The block hash to stop on -- this is used to limit the chain to a specific range of blocks
|
|
504
543
|
* @param options.depth The maximum number of blocks to return -- this is used to limit the number of blocks returned
|
|
505
544
|
* @return The chain of blocks for the given account, in reverse order starting with the most recent block
|
|
506
545
|
*/
|
|
507
546
|
getChain(account: GenericAccount | string, options?: {
|
|
508
547
|
startBlock?: BlockHash | string;
|
|
548
|
+
endBlock?: BlockHash | string;
|
|
509
549
|
depth?: number;
|
|
510
550
|
}): Promise<Block[]>;
|
|
511
551
|
/**
|
|
@@ -586,6 +626,7 @@ export declare class Client {
|
|
|
586
626
|
blockCount: number;
|
|
587
627
|
transactionCount: number;
|
|
588
628
|
representativeCount: number;
|
|
629
|
+
db: import("../lib/stats").DbStats;
|
|
589
630
|
settlementTimes: import("../lib/stats").TimeStats;
|
|
590
631
|
};
|
|
591
632
|
switch: {
|
|
@@ -643,6 +684,16 @@ export declare class Client {
|
|
|
643
684
|
* pending block
|
|
644
685
|
*/
|
|
645
686
|
getPendingBlock(account: GenericAccount): Promise<Block | null>;
|
|
687
|
+
/**
|
|
688
|
+
* Get the successor block for a given block. This will return the
|
|
689
|
+
* block on the representative's ledger that comes after the given block
|
|
690
|
+
*
|
|
691
|
+
* @param blockOrHash The block or hash to get the successor for
|
|
692
|
+
* @param rep The representative account to get the successor block from
|
|
693
|
+
* @return The successor block for the block or null if there is no
|
|
694
|
+
* successor block
|
|
695
|
+
*/
|
|
696
|
+
getSuccessorBlock(blockOrHash: Block | BlockHash | string, rep?: Config.Representative | 'ANY'): Promise<Block | null>;
|
|
646
697
|
/**
|
|
647
698
|
* Recover any unpublished or half-publish account artifacts
|
|
648
699
|
*
|
|
@@ -669,6 +720,11 @@ interface UserClientListenerTypes {
|
|
|
669
720
|
change: ((data: GetAccountStateAPIResponseFormatted) => void);
|
|
670
721
|
}
|
|
671
722
|
type UserClientEventName = keyof UserClientListenerTypes;
|
|
723
|
+
interface UserClientListenerOptions {
|
|
724
|
+
change: {
|
|
725
|
+
fallbackFrequency?: number;
|
|
726
|
+
};
|
|
727
|
+
}
|
|
672
728
|
/**
|
|
673
729
|
* The UserClient class provides a high-level interface, user-oriented
|
|
674
730
|
* interface to the Keeta network. It is designed to be easy to use and
|
|
@@ -704,6 +760,10 @@ export declare class UserClient {
|
|
|
704
760
|
* The network address for the network this client is connected to.
|
|
705
761
|
*/
|
|
706
762
|
readonly networkAddress: NetworkAddress;
|
|
763
|
+
/**
|
|
764
|
+
* Indication of whether or not this client has been destroyed.
|
|
765
|
+
*/
|
|
766
|
+
destroyed: boolean;
|
|
707
767
|
/**
|
|
708
768
|
* Create an instance of the UserClient class from a specific
|
|
709
769
|
* representative. This will use the given representative to
|
|
@@ -879,6 +939,59 @@ export declare class UserClient {
|
|
|
879
939
|
publish: boolean;
|
|
880
940
|
from: "publish-aid";
|
|
881
941
|
}>;
|
|
942
|
+
/**
|
|
943
|
+
* Add a certificate for a account
|
|
944
|
+
*
|
|
945
|
+
* @param method The method to use for modifying the certificate: `ADD` for this signature
|
|
946
|
+
* @param certificate The certificate to modify, this should be a {@link Certificate} instance.
|
|
947
|
+
* @param intermediates The certificate bundle containing the intermediate certificates, or null if there are no intermediates.
|
|
948
|
+
* @param options The options to use for the request
|
|
949
|
+
* @returns The vote staple that was generated and whether it was able to be published
|
|
950
|
+
*/
|
|
951
|
+
modifyCertificate(method: AdjustMethod.ADD, certificate: Certificate, intermediates: CertificateBundle | null, options?: UserClientOptions): Promise<Awaited<ReturnType<typeof this.publishBuilder>>>;
|
|
952
|
+
/**
|
|
953
|
+
* Remove a certificate from a account
|
|
954
|
+
*
|
|
955
|
+
* @param method The method to use for modifying the certificate, either `ADD` or `REMOVE`
|
|
956
|
+
* @param certificate The certificate to remove, this should be a {@link Certificate} or a {@link CertificateHash} instance.
|
|
957
|
+
* @param intermediates Because the `SUBTRACT` method is used to remove a certificate, intermediates are not needed and should not be defined.
|
|
958
|
+
* @param options The options to use for the request
|
|
959
|
+
* @returns The vote staple that was generated and whether it was able to be published
|
|
960
|
+
*/
|
|
961
|
+
modifyCertificate(method: AdjustMethod.SUBTRACT, certificate: Certificate | CertificateHash, intermediates?: undefined, options?: UserClientOptions): Promise<Awaited<ReturnType<typeof this.publishBuilder>>>;
|
|
962
|
+
/**
|
|
963
|
+
* Add or remove a certificate for a account
|
|
964
|
+
*
|
|
965
|
+
* @param method The method to use for modifying the certificate, either `ADD` or `REMOVE`
|
|
966
|
+
* @param certificate The certificate to modify, this should be a {@link Certificate} instance.
|
|
967
|
+
* @param intermediates The certificate bundle containing the intermediate certificates, or null if there are no intermediates.
|
|
968
|
+
* @param options The options to use for the request
|
|
969
|
+
* @returns The vote staple that was generated and whether it was able to be published
|
|
970
|
+
*/
|
|
971
|
+
modifyCertificate(method: ManageCertificateMethod, certificate: Certificate | CertificateHash, intermediates?: CertificateBundle | null, options?: UserClientOptions): Promise<Awaited<ReturnType<typeof this.publishBuilder>>>;
|
|
972
|
+
/**
|
|
973
|
+
* Get a single certificate for the account, by the certificate hash.
|
|
974
|
+
* @param certificateHash The hash of the certificate to get, or a {@link CertificateHash} instance.
|
|
975
|
+
* @param options The options to use for the request
|
|
976
|
+
* @return The found certificate, or null if no certificate was found.
|
|
977
|
+
*/
|
|
978
|
+
getCertificates(certificateHash: string | CertificateHash, options?: UserClientOptions): Promise<CertificateWithIntermediatesResponse | null>;
|
|
979
|
+
/**
|
|
980
|
+
* List certificates for a account.
|
|
981
|
+
* @param options The options to use for the request
|
|
982
|
+
* @return The found certificates for the account
|
|
983
|
+
*/
|
|
984
|
+
getCertificates(certificateHash?: undefined, options?: UserClientOptions): Promise<CertificateWithIntermediatesResponse[]>;
|
|
985
|
+
/**
|
|
986
|
+
* Get the certificates for the account. If a certificate hash is provided,
|
|
987
|
+
* then only that certificate will be returned, otherwise all certificates
|
|
988
|
+
* for the account will be returned.
|
|
989
|
+
* @param certificateHash The hash of the certificate to get, or a {@link CertificateHash} instance.
|
|
990
|
+
* If not provided, all certificates for the account will be returned.
|
|
991
|
+
* @param options The options to use for the request
|
|
992
|
+
* @return The certificate or certificates for the account, depending on whether a hash was provided.
|
|
993
|
+
*/
|
|
994
|
+
getCertificates(certificateHash?: string | CertificateHash | undefined, options?: UserClientOptions): Promise<CertificateWithIntermediatesResponse | (CertificateWithIntermediatesResponse[]) | null>;
|
|
882
995
|
/**
|
|
883
996
|
* Send some tokens from this account to another account.
|
|
884
997
|
*
|
|
@@ -891,10 +1004,10 @@ export declare class UserClient {
|
|
|
891
1004
|
* @param token The token to send
|
|
892
1005
|
* @param external The external identifier to use for the transaction
|
|
893
1006
|
* @param options The options to use for the request
|
|
894
|
-
* @param retries The number of times
|
|
1007
|
+
* @param retries The number of times the request has been retried
|
|
895
1008
|
* @return The vote staple that was generated and whether it was able to be published
|
|
896
1009
|
*/
|
|
897
|
-
send(to: GenericAccount | string, amount: bigint | number, token: TokenAddress | string, external?: string, options?: UserClientOptions, retries?: number): Promise<
|
|
1010
|
+
send(to: GenericAccount | string, amount: bigint | number, token: TokenAddress | string, external?: string, options?: UserClientOptions, retries?: number): Promise<Awaited<ReturnType<typeof this.publishBuilder>>>;
|
|
898
1011
|
/**
|
|
899
1012
|
* Generate a new identifier for the given type and publish the blocks
|
|
900
1013
|
*
|
|
@@ -902,7 +1015,7 @@ export declare class UserClient {
|
|
|
902
1015
|
* @param options The options to use for the request
|
|
903
1016
|
* @return The identifier that was generated
|
|
904
1017
|
*/
|
|
905
|
-
generateIdentifier(type: IdentifierKeyAlgorithm, options?: UserClientOptions): Promise<import("./builder").PendingAccount<AccountKeyAlgorithm.NETWORK | AccountKeyAlgorithm.TOKEN | AccountKeyAlgorithm.STORAGE>>;
|
|
1018
|
+
generateIdentifier(type: IdentifierKeyAlgorithm, options?: UserClientOptions): Promise<import("./builder").PendingAccount<AccountKeyAlgorithm.NETWORK | AccountKeyAlgorithm.TOKEN | AccountKeyAlgorithm.STORAGE | AccountKeyAlgorithm.MULTISIG>>;
|
|
906
1019
|
/**
|
|
907
1020
|
* Update the permissions for a given account. This will publish the
|
|
908
1021
|
* changes to the network.
|
|
@@ -1051,7 +1164,7 @@ export declare class UserClient {
|
|
|
1051
1164
|
* Also set up long timeout polling for changes in case the websocket misses a change update
|
|
1052
1165
|
* Check that parameters of function complies with respective event function
|
|
1053
1166
|
*/
|
|
1054
|
-
on<EventName extends UserClientEventName>(event: EventName, handler: UserClientListenerTypes[EventName]): symbol;
|
|
1167
|
+
on<EventName extends UserClientEventName>(event: EventName, handler: UserClientListenerTypes[EventName], listenerOptions?: UserClientListenerOptions[EventName]): symbol;
|
|
1055
1168
|
/**
|
|
1056
1169
|
* Cancel a previously registered callback from {@link on}
|
|
1057
1170
|
*/
|
|
@@ -1060,6 +1173,15 @@ export declare class UserClient {
|
|
|
1060
1173
|
* Destroy this instance -- this is required to clean up all resources.
|
|
1061
1174
|
*/
|
|
1062
1175
|
destroy(): Promise<void>;
|
|
1176
|
+
/**
|
|
1177
|
+
* This enables the use of `using` to automatically clean up the
|
|
1178
|
+
* instance of the {@link UserClient} class when it is no longer
|
|
1179
|
+
* needed.
|
|
1180
|
+
*
|
|
1181
|
+
* It calls the {@link destroy}() method to clean up the instance when
|
|
1182
|
+
* it goes out of scope.
|
|
1183
|
+
*/
|
|
1184
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
1063
1185
|
/**
|
|
1064
1186
|
* Get the configuration for this UserClient instance.
|
|
1065
1187
|
*/
|