@concordium/common-sdk
Advanced tools
Comparing version
@@ -23,1 +23,16 @@ import { Buffer } from 'buffer/'; | ||
export declare const isEqualContractAddress: (a: ContractAddress) => (b: ContractAddress) => boolean; | ||
/** The name of a smart contract. Note: This does _not_ including the 'init_' prefix. */ | ||
export declare type ContractName = string; | ||
/** The name of an entrypoint exposed by a smart contract. Note: This does _not_ include the '<contractName>.' prefix. */ | ||
export declare type EntrypointName = string; | ||
/** Check if a string is a valid smart contract init name. */ | ||
export declare function isInitName(string: string): boolean; | ||
/** Get the contract name from a string. Assumes the string is a valid init name. */ | ||
export declare function getContractNameFromInit(initName: string): ContractName; | ||
/** Check if a string is a valid smart contract receive name. */ | ||
export declare function isReceiveName(string: string): boolean; | ||
/** Get the contract name and entrypoint name from a string. Assumes the string is a valid receive name. */ | ||
export declare function getNamesFromReceive(receiveName: string): { | ||
contractName: ContractName; | ||
entrypointName: EntrypointName; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isEqualContractAddress = exports.checkParameterLength = exports.getContractName = void 0; | ||
exports.getNamesFromReceive = exports.isReceiveName = exports.getContractNameFromInit = exports.isInitName = exports.isEqualContractAddress = exports.checkParameterLength = exports.getContractName = void 0; | ||
const CONTRACT_PARAM_MAX_LENGTH = 65535; | ||
@@ -37,1 +37,53 @@ /** | ||
exports.isEqualContractAddress = isEqualContractAddress; | ||
/** Check that every character is an Ascii alpha, numeric or punctuation. */ | ||
function isAsciiAlphaNumericPunctuation(string) { | ||
for (let i = 0; i < string.length; i++) { | ||
const charCode = string.charCodeAt(i); | ||
if ((32 <= charCode && charCode <= 47) || // Punctuation ! to / | ||
(48 <= charCode && charCode <= 57) || // Numeric | ||
(58 <= charCode && charCode <= 64) || // Punctuation : to @ | ||
(65 <= charCode && charCode <= 90) || // Uppercase alpha | ||
(91 <= charCode && charCode <= 96) || // Punctuation [ to ` | ||
(97 <= charCode && charCode <= 122) || // Lowercase alpha | ||
(123 <= charCode && charCode <= 126) // Punctuation { to ~ | ||
) { | ||
continue; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
/** Check if a string is a valid smart contract init name. */ | ||
function isInitName(string) { | ||
return (string.length <= 100 && | ||
string.startsWith('init_') && | ||
!string.includes('.') && | ||
isAsciiAlphaNumericPunctuation(string)); | ||
} | ||
exports.isInitName = isInitName; | ||
/** Get the contract name from a string. Assumes the string is a valid init name. */ | ||
function getContractNameFromInit(initName) { | ||
return initName.substring(5); | ||
} | ||
exports.getContractNameFromInit = getContractNameFromInit; | ||
/** Check if a string is a valid smart contract receive name. */ | ||
function isReceiveName(string) { | ||
return (string.length <= 100 && | ||
string.includes('.') && | ||
isAsciiAlphaNumericPunctuation(string)); | ||
} | ||
exports.isReceiveName = isReceiveName; | ||
/** Get the contract name and entrypoint name from a string. Assumes the string is a valid receive name. */ | ||
function getNamesFromReceive(receiveName) { | ||
const splitPoint = receiveName.indexOf('.'); | ||
if (splitPoint === -1) { | ||
throw new Error('Invalid receive name'); | ||
} | ||
return { | ||
contractName: receiveName.substring(0, splitPoint), | ||
entrypointName: receiveName.substring(splitPoint + 1), | ||
}; | ||
} | ||
exports.getNamesFromReceive = getNamesFromReceive; |
@@ -24,3 +24,14 @@ import { Buffer } from 'buffer/'; | ||
static fromHex(data: HexString): Cursor; | ||
/** Read a number of bytes from the cursor */ | ||
/** | ||
* Constructs a `Cursor` from a buffer of bytes. | ||
* | ||
* @param {ArrayBuffer} buffer - the buffer containing bytes. | ||
* | ||
* @returns {Cursor} a Cursor wrapping the data. | ||
*/ | ||
static fromBuffer(buffer: ArrayBuffer): Cursor; | ||
/** | ||
* Read a number of bytes from the cursor. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
read(numBytes: number): Buffer; | ||
@@ -31,2 +42,58 @@ /** The remaining bytes, i.e. not including the bytes already read. */ | ||
/** | ||
* Represents function for deserilizing some value from a {@link Cursor}. | ||
* @template A The value to deserialize. | ||
*/ | ||
export interface Deserializer<A> { | ||
(cursor: Cursor): A; | ||
} | ||
/** | ||
* Deserialize a single byte from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The value of the single byte. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeUInt8(cursor: Cursor): number; | ||
/** | ||
* Deserialize a u16 little endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeUInt16LE(cursor: Cursor): number; | ||
/** | ||
* Deserialize a u32 little endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeUInt32LE(cursor: Cursor): number; | ||
/** | ||
* Deserialize a u64 little endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {bigint} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeBigUInt64LE(cursor: Cursor): bigint; | ||
/** | ||
* Deserialize a u16 big endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeUInt16BE(cursor: Cursor): number; | ||
/** | ||
* Deserialize a u32 big endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeUInt32BE(cursor: Cursor): number; | ||
/** | ||
* Deserialize a u64 big endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {bigint} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
export declare function deserializeBigUInt64BE(cursor: Cursor): bigint; | ||
/** | ||
* Helper function to create a function that deserializes a `HexString` value received in a smart contract response into a list of dynamic type values | ||
@@ -33,0 +100,0 @@ * determined by the deserialization logic defined in the callback function. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.makeDeserializeListResponse = exports.Cursor = void 0; | ||
exports.makeDeserializeListResponse = exports.deserializeBigUInt64BE = exports.deserializeUInt32BE = exports.deserializeUInt16BE = exports.deserializeBigUInt64LE = exports.deserializeUInt32LE = exports.deserializeUInt16LE = exports.deserializeUInt8 = exports.Cursor = void 0; | ||
const buffer_1 = require("buffer/"); | ||
@@ -29,5 +29,22 @@ /** | ||
} | ||
/** Read a number of bytes from the cursor */ | ||
/** | ||
* Constructs a `Cursor` from a buffer of bytes. | ||
* | ||
* @param {ArrayBuffer} buffer - the buffer containing bytes. | ||
* | ||
* @returns {Cursor} a Cursor wrapping the data. | ||
*/ | ||
static fromBuffer(buffer) { | ||
return new Cursor(buffer_1.Buffer.from(buffer)); | ||
} | ||
/** | ||
* Read a number of bytes from the cursor. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
read(numBytes) { | ||
const data = buffer_1.Buffer.from(this.data.subarray(this.cursor, this.cursor + numBytes)); | ||
const end = this.cursor + numBytes; | ||
if (this.data.length < end) { | ||
throw new Error(`Failed to read ${numBytes} bytes from the cursor.`); | ||
} | ||
const data = buffer_1.Buffer.from(this.data.subarray(this.cursor, end)); | ||
this.cursor += numBytes; | ||
@@ -43,2 +60,72 @@ return data; | ||
/** | ||
* Deserialize a single byte from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The value of the single byte. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeUInt8(cursor) { | ||
return cursor.read(1).readUInt8(0); | ||
} | ||
exports.deserializeUInt8 = deserializeUInt8; | ||
/** | ||
* Deserialize a u16 little endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeUInt16LE(cursor) { | ||
return cursor.read(2).readUInt16LE(0); | ||
} | ||
exports.deserializeUInt16LE = deserializeUInt16LE; | ||
/** | ||
* Deserialize a u32 little endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeUInt32LE(cursor) { | ||
return cursor.read(4).readUInt32LE(0); | ||
} | ||
exports.deserializeUInt32LE = deserializeUInt32LE; | ||
/** | ||
* Deserialize a u64 little endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {bigint} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeBigUInt64LE(cursor) { | ||
return cursor.read(8).readBigInt64LE(0).valueOf(); | ||
} | ||
exports.deserializeBigUInt64LE = deserializeBigUInt64LE; | ||
/** | ||
* Deserialize a u16 big endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeUInt16BE(cursor) { | ||
return cursor.read(2).readUInt16BE(0); | ||
} | ||
exports.deserializeUInt16BE = deserializeUInt16BE; | ||
/** | ||
* Deserialize a u32 big endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {number} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeUInt32BE(cursor) { | ||
return cursor.read(4).readUInt32BE(0); | ||
} | ||
exports.deserializeUInt32BE = deserializeUInt32BE; | ||
/** | ||
* Deserialize a u64 big endian from the cursor. | ||
* @param {Cursor} cursor Cursor over the data to deserialize from. | ||
* @returns {bigint} The deserialized value. | ||
* @throws If the buffer contains fewer bytes than being read. | ||
*/ | ||
function deserializeBigUInt64BE(cursor) { | ||
return cursor.read(8).readBigInt64BE(0).valueOf(); | ||
} | ||
exports.deserializeBigUInt64BE = deserializeBigUInt64BE; | ||
/** | ||
* Helper function to create a function that deserializes a `HexString` value received in a smart contract response into a list of dynamic type values | ||
@@ -45,0 +132,0 @@ * determined by the deserialization logic defined in the callback function. |
@@ -12,2 +12,3 @@ /** | ||
import { QueriesClient } from '../grpc/v2/concordium/service.client'; | ||
import { HealthClient } from '../grpc/v2/concordium/health.client'; | ||
import type { RpcTransport } from '@protobuf-ts/runtime-rpc'; | ||
@@ -34,2 +35,3 @@ import { AccountAddress } from './types/accountAddress'; | ||
client: QueriesClient; | ||
healthClient: HealthClient; | ||
/** | ||
@@ -202,2 +204,11 @@ * Initialize a gRPC client for a specific concordium node. | ||
/** | ||
* Sends an update instruction transaction for updating a chain parameter | ||
* to the node to be put in a block on the chain. | ||
* | ||
* @param updateInstructionTransaction the update instruction transaction to send to the node | ||
* @param signatures map of the signatures on the hash of the serialized unsigned update instruction, with the key index as map key | ||
* @returns The transaction hash as a hex string | ||
*/ | ||
sendUpdateInstruction(updateInstructionTransaction: v1.UpdateInstruction, signatures: Record<number, HexString>): Promise<HexString>; | ||
/** | ||
* Retrieves the status of the block chain parameters at the given blockHash. | ||
@@ -675,2 +686,10 @@ * | ||
private getConsensusHeight; | ||
/** | ||
* Queries the node to check its health | ||
* | ||
* {@codeblock ~~:client/healthCheck.ts#documentation-snippet} | ||
* | ||
* @returns a HealthCheck indicating whether the node is healthy or not and provides the message from the client, if not healthy. | ||
*/ | ||
healthCheck(): Promise<v1.HealthCheckResponse>; | ||
} | ||
@@ -677,0 +696,0 @@ /** |
@@ -37,2 +37,3 @@ "use strict"; | ||
const service_client_1 = require("../grpc/v2/concordium/service.client"); | ||
const health_client_1 = require("../grpc/v2/concordium/health.client"); | ||
const translate = __importStar(require("./GRPCTypeTranslation")); | ||
@@ -58,2 +59,3 @@ const accountTransactions_1 = require("./accountTransactions"); | ||
this.client = new service_client_1.QueriesClient(transport); | ||
this.healthClient = new health_client_1.HealthClient(transport); | ||
} | ||
@@ -352,2 +354,46 @@ /** | ||
/** | ||
* Sends an update instruction transaction for updating a chain parameter | ||
* to the node to be put in a block on the chain. | ||
* | ||
* @param updateInstructionTransaction the update instruction transaction to send to the node | ||
* @param signatures map of the signatures on the hash of the serialized unsigned update instruction, with the key index as map key | ||
* @returns The transaction hash as a hex string | ||
*/ | ||
async sendUpdateInstruction(updateInstructionTransaction, signatures) { | ||
const header = updateInstructionTransaction.header; | ||
const updateInstruction = { | ||
header: { | ||
sequenceNumber: { | ||
value: header.sequenceNumber, | ||
}, | ||
effectiveTime: { | ||
value: header.effectiveTime, | ||
}, | ||
timeout: { | ||
value: header.timeout, | ||
}, | ||
}, | ||
payload: { | ||
payload: { | ||
oneofKind: 'rawPayload', | ||
rawPayload: buffer_1.Buffer.from(updateInstructionTransaction.payload, 'hex'), | ||
}, | ||
}, | ||
signatures: { | ||
signatures: (0, util_1.mapRecord)(signatures, (x) => ({ | ||
value: buffer_1.Buffer.from(x, 'hex'), | ||
})), | ||
}, | ||
}; | ||
const sendBlockItemRequest = { | ||
blockItem: { | ||
oneofKind: 'updateInstruction', | ||
updateInstruction: updateInstruction, | ||
}, | ||
}; | ||
const response = await this.client.sendBlockItem(sendBlockItemRequest) | ||
.response; | ||
return buffer_1.Buffer.from(response.value).toString('hex'); | ||
} | ||
/** | ||
* Retrieves the status of the block chain parameters at the given blockHash. | ||
@@ -1138,2 +1184,18 @@ * | ||
} | ||
/** | ||
* Queries the node to check its health | ||
* | ||
* {@codeblock ~~:client/healthCheck.ts#documentation-snippet} | ||
* | ||
* @returns a HealthCheck indicating whether the node is healthy or not and provides the message from the client, if not healthy. | ||
*/ | ||
async healthCheck() { | ||
try { | ||
await this.healthClient.check({}); | ||
return { isHealthy: true }; | ||
} | ||
catch (e) { | ||
return { isHealthy: false, message: e.message }; | ||
} | ||
} | ||
} | ||
@@ -1140,0 +1202,0 @@ exports.ConcordiumGRPCClient = ConcordiumGRPCClient; |
import { sha256 } from './hash'; | ||
export * from './types'; | ||
export { getAccountTransactionHash, getAccountTransactionSignDigest, getCredentialDeploymentSignDigest, getCredentialDeploymentTransactionHash, getCredentialForExistingAccountSignDigest, serializeInitContractParameters, serializeUpdateContractParameters, serializeAccountTransactionForSubmission, serializeCredentialDeploymentTransactionForSubmission, getSignedCredentialDeploymentTransactionHash, serializeTypeValue, serializeAccountTransactionPayload, serializeCredentialDeploymentPayload, } from './serialization'; | ||
export { encodeHexString } from './serializationHelpers'; | ||
export { sha256 }; | ||
@@ -11,2 +12,3 @@ export { CredentialRegistrationId } from './types/CredentialRegistrationId'; | ||
export { ModuleReference } from './types/moduleReference'; | ||
export * from './types/VersionedModuleSource'; | ||
export { VerifiablePresentation, reviveDateFromTimeStampAttribute, replaceDateWithTimeStampAttribute, } from './types/VerifiablePresentation'; | ||
@@ -41,1 +43,2 @@ export * from './credentialDeploymentTransactions'; | ||
export * from './cis4'; | ||
export * from './GenericContract'; |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getAccountTransactionHandler = exports.ConcordiumGRPCClient = exports.JsonRpcClient = exports.HttpProvider = exports.unwrap = exports.wasmToSchema = exports.streamToList = exports.isHex = exports.getContractName = exports.EU_MEMBERS = exports.MAX_DATE = exports.MIN_DATE = exports.StatementTypes = exports.deserializeTypeValue = exports.deserializeInitError = exports.deserializeReceiveError = exports.deserializeReceiveReturnValue = exports.deserializeTransaction = exports.deserializeContractState = exports.getAlias = exports.isAlias = exports.replaceDateWithTimeStampAttribute = exports.reviveDateFromTimeStampAttribute = exports.VerifiablePresentation = exports.ModuleReference = exports.DataBlob = exports.TransactionExpiry = exports.CcdAmount = exports.AccountAddress = exports.CredentialRegistrationId = exports.sha256 = exports.serializeCredentialDeploymentPayload = exports.serializeAccountTransactionPayload = exports.serializeTypeValue = exports.getSignedCredentialDeploymentTransactionHash = exports.serializeCredentialDeploymentTransactionForSubmission = exports.serializeAccountTransactionForSubmission = exports.serializeUpdateContractParameters = exports.serializeInitContractParameters = exports.getCredentialForExistingAccountSignDigest = exports.getCredentialDeploymentTransactionHash = exports.getCredentialDeploymentSignDigest = exports.getAccountTransactionSignDigest = exports.getAccountTransactionHash = void 0; | ||
exports.getAccountTransactionHandler = exports.ConcordiumGRPCClient = exports.JsonRpcClient = exports.HttpProvider = exports.unwrap = exports.wasmToSchema = exports.streamToList = exports.isHex = exports.getContractName = exports.EU_MEMBERS = exports.MAX_DATE = exports.MIN_DATE = exports.StatementTypes = exports.deserializeTypeValue = exports.deserializeInitError = exports.deserializeReceiveError = exports.deserializeReceiveReturnValue = exports.deserializeTransaction = exports.deserializeContractState = exports.getAlias = exports.isAlias = exports.replaceDateWithTimeStampAttribute = exports.reviveDateFromTimeStampAttribute = exports.VerifiablePresentation = exports.ModuleReference = exports.DataBlob = exports.TransactionExpiry = exports.CcdAmount = exports.AccountAddress = exports.CredentialRegistrationId = exports.sha256 = exports.encodeHexString = exports.serializeCredentialDeploymentPayload = exports.serializeAccountTransactionPayload = exports.serializeTypeValue = exports.getSignedCredentialDeploymentTransactionHash = exports.serializeCredentialDeploymentTransactionForSubmission = exports.serializeAccountTransactionForSubmission = exports.serializeUpdateContractParameters = exports.serializeInitContractParameters = exports.getCredentialForExistingAccountSignDigest = exports.getCredentialDeploymentTransactionHash = exports.getCredentialDeploymentSignDigest = exports.getAccountTransactionSignDigest = exports.getAccountTransactionHash = void 0; | ||
const hash_1 = require("./hash"); | ||
@@ -36,2 +36,4 @@ Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return hash_1.sha256; } }); | ||
Object.defineProperty(exports, "serializeCredentialDeploymentPayload", { enumerable: true, get: function () { return serialization_1.serializeCredentialDeploymentPayload; } }); | ||
var serializationHelpers_1 = require("./serializationHelpers"); | ||
Object.defineProperty(exports, "encodeHexString", { enumerable: true, get: function () { return serializationHelpers_1.encodeHexString; } }); | ||
var CredentialRegistrationId_1 = require("./types/CredentialRegistrationId"); | ||
@@ -49,2 +51,3 @@ Object.defineProperty(exports, "CredentialRegistrationId", { enumerable: true, get: function () { return CredentialRegistrationId_1.CredentialRegistrationId; } }); | ||
Object.defineProperty(exports, "ModuleReference", { enumerable: true, get: function () { return moduleReference_1.ModuleReference; } }); | ||
__exportStar(require("./types/VersionedModuleSource"), exports); | ||
var VerifiablePresentation_1 = require("./types/VerifiablePresentation"); | ||
@@ -103,1 +106,2 @@ Object.defineProperty(exports, "VerifiablePresentation", { enumerable: true, get: function () { return VerifiablePresentation_1.VerifiablePresentation; } }); | ||
__exportStar(require("./cis4"), exports); | ||
__exportStar(require("./GenericContract"), exports); |
@@ -373,2 +373,6 @@ /** | ||
foundationAccountIndex?: bigint; | ||
/** Keys allowed to do level1 updates */ | ||
level1Keys: KeysWithThreshold; | ||
/** Keys allowed to do root updates */ | ||
rootKeys: KeysWithThreshold; | ||
} | ||
@@ -381,2 +385,4 @@ /** Chain parameters used from protocol version 1-3 */ | ||
rewardParameters: RewardParametersV0; | ||
/** Keys allowed to do parameter updates */ | ||
level2Keys: AuthorizationsV0; | ||
}; | ||
@@ -389,2 +395,4 @@ /** Chain parameters used in protocol versions 4 and 5 */ | ||
rewardParameters: RewardParametersV1; | ||
/** Keys allowed to do parameter updates */ | ||
level2Keys: AuthorizationsV1; | ||
}; | ||
@@ -395,2 +403,4 @@ /** Chain parameters used from protocol version 6 */ | ||
rewardParameters: RewardParametersV2; | ||
/** Keys allowed to do parameter updates */ | ||
level2Keys: AuthorizationsV1; | ||
}; | ||
@@ -517,3 +527,3 @@ /** Union of all chain parameters across all protocol versions */ | ||
export interface UpdatesV0 extends UpdatesCommon { | ||
chainParameters: ChainParametersV0; | ||
chainParameters: Omit<ChainParametersV0, 'level1Keys' | 'level2Keys' | 'rootKeys'>; | ||
updateQueues: UpdateQueuesV0; | ||
@@ -527,3 +537,3 @@ keys: KeysV0; | ||
export interface UpdatesV1 extends UpdatesCommon { | ||
chainParameters: ChainParametersV1; | ||
chainParameters: Omit<ChainParametersV1, 'level1Keys' | 'level2Keys' | 'rootKeys'>; | ||
updateQueues: UpdateQueuesV1; | ||
@@ -537,3 +547,3 @@ keys: KeysV1; | ||
export interface UpdatesV2 extends UpdatesCommon { | ||
chainParameters: ChainParametersV2; | ||
chainParameters: Omit<ChainParametersV2, 'level1Keys' | 'level2Keys' | 'rootKeys'>; | ||
updateQueues: UpdateQueuesV2; | ||
@@ -1541,1 +1551,7 @@ keys: KeysV1; | ||
} | SmartContractTypeValues[] | number | string | boolean; | ||
export declare type HealthCheckResponse = { | ||
isHealthy: true; | ||
} | { | ||
isHealthy: false; | ||
message?: string; | ||
}; |
@@ -210,3 +210,3 @@ import { AccountTransferredEvent, AmountAddedByDecryptionEvent, BakerAddedEvent, BakerEvent, BakerKeysUpdatedEvent, BakerRemovedEvent, BakerSetRestakeEarningsEvent, BakerStakeChangedEvent, ContractInitializedEvent, ContractTraceEvent, CredentialKeysUpdatedEvent, CredentialsUpdatedEvent, DataRegisteredEvent, DelegationEvent, EncryptedAmountsRemovedEvent, EncryptedSelfAmountAddedEvent, MemoEvent, ModuleDeployedEvent, NewEncryptedAmountEvent, TransferredWithScheduleEvent } from './transactionEvent'; | ||
*/ | ||
export declare const isSuccessTransaction: (summary: BlockItemSummary) => summary is (BaseAccountTransactionSummary & TransferSummary) | (BaseAccountTransactionSummary & TransferWithMemoSummary) | (BaseAccountTransactionSummary & TransferWithScheduleSummary) | (BaseAccountTransactionSummary & TransferWithScheduleAndMemoSummary) | (BaseAccountTransactionSummary & EncryptedAmountTransferSummary) | (BaseAccountTransactionSummary & EncryptedAmountTransferWithMemoSummary) | (BaseAccountTransactionSummary & DataRegisteredSummary) | (BaseAccountTransactionSummary & TransferToPublicSummary) | (BaseAccountTransactionSummary & TransferToEncryptedSummary) | (BaseAccountTransactionSummary & ModuleDeployedSummary) | (BaseAccountTransactionSummary & InitContractSummary) | (BaseAccountTransactionSummary & UpdateContractSummary) | (BaseAccountTransactionSummary & AddBakerSummary) | (BaseAccountTransactionSummary & RemoveBakerSummary) | (BaseAccountTransactionSummary & UpdateBakerKeysSummary) | (BaseAccountTransactionSummary & UpdateBakerStakeSummary) | (BaseAccountTransactionSummary & UpdateBakerRestakeEarningsSummary) | (BaseAccountTransactionSummary & ConfigureBakerSummary) | (BaseAccountTransactionSummary & ConfigureDelegationSummary) | (BaseAccountTransactionSummary & UpdateCredentialKeysSummary) | (BaseAccountTransactionSummary & UpdateCredentialsSummary) | AccountCreationSummary | UpdateSummary; | ||
export declare const isSuccessTransaction: (summary: BlockItemSummary) => summary is (BaseAccountTransactionSummary & TransferSummary) | (BaseAccountTransactionSummary & TransferWithMemoSummary) | (BaseAccountTransactionSummary & TransferWithScheduleSummary) | (BaseAccountTransactionSummary & TransferWithScheduleAndMemoSummary) | (BaseAccountTransactionSummary & EncryptedAmountTransferSummary) | (BaseAccountTransactionSummary & EncryptedAmountTransferWithMemoSummary) | (BaseAccountTransactionSummary & ModuleDeployedSummary) | (BaseAccountTransactionSummary & InitContractSummary) | (BaseAccountTransactionSummary & UpdateContractSummary) | (BaseAccountTransactionSummary & DataRegisteredSummary) | (BaseAccountTransactionSummary & TransferToPublicSummary) | (BaseAccountTransactionSummary & TransferToEncryptedSummary) | (BaseAccountTransactionSummary & AddBakerSummary) | (BaseAccountTransactionSummary & RemoveBakerSummary) | (BaseAccountTransactionSummary & UpdateBakerKeysSummary) | (BaseAccountTransactionSummary & UpdateBakerStakeSummary) | (BaseAccountTransactionSummary & UpdateBakerRestakeEarningsSummary) | (BaseAccountTransactionSummary & ConfigureBakerSummary) | (BaseAccountTransactionSummary & ConfigureDelegationSummary) | (BaseAccountTransactionSummary & UpdateCredentialKeysSummary) | (BaseAccountTransactionSummary & UpdateCredentialsSummary) | AccountCreationSummary | UpdateSummary; | ||
/** | ||
@@ -213,0 +213,0 @@ * Gets the {@link RejectReason} for rejected transction. |
@@ -164,2 +164,11 @@ import { Amount, AuthorizationsV0, AuthorizationsV1, Base58String, Duration, Energy, FinalizationCommitteeParameters, GasRewardsV0, GasRewardsV1, HexString, TimeoutParameters } from '..'; | ||
}; | ||
export declare type UpdateInstructionHeader = { | ||
sequenceNumber: bigint; | ||
effectiveTime: bigint; | ||
timeout: bigint; | ||
}; | ||
export declare type UpdateInstruction = { | ||
header: UpdateInstructionHeader; | ||
payload: HexString; | ||
}; | ||
export {}; |
@@ -7,3 +7,3 @@ import { AttributeList, ContractAddress, HexString, Network } from './types'; | ||
export declare const MAX_STRING_BYTE_LENGTH = 31; | ||
export declare const MAX_U64: bigint; | ||
export declare const MAX_U64 = 18446744073709551615n; | ||
export declare const MIN_DATE_ISO = "-262144-01-01T00:00:00Z"; | ||
@@ -10,0 +10,0 @@ export declare const MAX_DATE_ISO = "+262143-12-31T23:59:59.999999999Z"; |
@@ -37,3 +37,3 @@ "use strict"; | ||
exports.MAX_STRING_BYTE_LENGTH = 31; | ||
exports.MAX_U64 = 2n ** 64n - 1n; | ||
exports.MAX_U64 = 18446744073709551615n; // 2n ** 64n - 1n | ||
exports.MIN_DATE_ISO = '-262144-01-01T00:00:00Z'; | ||
@@ -40,0 +40,0 @@ exports.MAX_DATE_ISO = '+262143-12-31T23:59:59.999999999Z'; |
{ | ||
"name": "@concordium/common-sdk", | ||
"version": "9.3.0", | ||
"version": "9.4.0", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
1572678
6.5%135
3.85%34458
2%