diff --git a/deps/concordium-base b/deps/concordium-base index 6fcfe4ba3..8c925efc1 160000 --- a/deps/concordium-base +++ b/deps/concordium-base @@ -1 +1 @@ -Subproject commit 6fcfe4ba3276de73d953dba29c3e153ea5772692 +Subproject commit 8c925efc17405cc2927f20df46ed5b57275840c2 diff --git a/examples/nodejs/client/getEmbeddedSchema.ts b/examples/nodejs/client/getEmbeddedSchema.ts index 9b7d5d264..150697161 100644 --- a/examples/nodejs/client/getEmbeddedSchema.ts +++ b/examples/nodejs/client/getEmbeddedSchema.ts @@ -52,7 +52,9 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c const schema = await client.getEmbeddedSchema(moduleRef); // #endregion documentation-snippet - fs.writeFileSync(cli.flags.outPath, schema); + if (schema) { + fs.writeFileSync(cli.flags.outPath, new Uint8Array(schema.buffer)); + } console.log('Wrote schema to file: ', cli.flags.outPath); })(); diff --git a/examples/nodejs/client/getPoolInfo.ts b/examples/nodejs/client/getPoolInfo.ts index 0cf433f51..f449965fb 100644 --- a/examples/nodejs/client/getPoolInfo.ts +++ b/examples/nodejs/client/getPoolInfo.ts @@ -53,11 +53,17 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c const blockHash = cli.flags.block === undefined ? undefined : BlockHash.fromHexString(cli.flags.block); const bakerPool: BakerPoolStatus = await client.getPoolInfo(BigInt(cli.flags.poolOwner), blockHash); - console.log('Open status:', bakerPool.poolInfo.openStatus); + console.log('Open status:', bakerPool.poolInfo?.openStatus); console.log('Baker address:', bakerPool.bakerAddress); - console.log('CCD provided by the baker to the pool:', CcdAmount.toCcd(bakerPool.bakerEquityCapital)); - console.log('CCD provided by the delegators to the pool:', CcdAmount.toCcd(bakerPool.delegatedCapital)); + console.log( + 'CCD provided by the baker to the pool:', + bakerPool.bakerEquityCapital !== undefined ? CcdAmount.toCcd(bakerPool.bakerEquityCapital) : undefined + ); + console.log( + 'CCD provided by the delegators to the pool:', + bakerPool.delegatedCapital !== undefined ? CcdAmount.toCcd(bakerPool.delegatedCapital) : undefined + ); console.log('Total capital in CCD of ALL pools:', CcdAmount.toCcd(bakerPool.allPoolTotalCapital)); - console.log('Pool commision rates:', bakerPool.poolInfo.commissionRates); + console.log('Pool commision rates:', bakerPool.poolInfo?.commissionRates); // #endregion documentation-snippet })(); diff --git a/examples/nodejs/composed-examples/getEmbeddedSchemaFromInstance.ts b/examples/nodejs/composed-examples/getEmbeddedSchemaFromInstance.ts index cba1864e5..089aaff83 100644 --- a/examples/nodejs/composed-examples/getEmbeddedSchemaFromInstance.ts +++ b/examples/nodejs/composed-examples/getEmbeddedSchemaFromInstance.ts @@ -59,7 +59,9 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c const schema = await client.getEmbeddedSchema(moduleRef); // #endregion documentation-snippet - fs.writeFileSync(cli.flags.outPath, schema); + if (schema) { + fs.writeFileSync(cli.flags.outPath, new Uint8Array(schema.buffer)); + } console.log('Wrote schema to file: ', cli.flags.outPath); })(); diff --git a/examples/nodejs/composed-examples/initAndUpdateContract.ts b/examples/nodejs/composed-examples/initAndUpdateContract.ts index 5499db7f8..45e343670 100644 --- a/examples/nodejs/composed-examples/initAndUpdateContract.ts +++ b/examples/nodejs/composed-examples/initAndUpdateContract.ts @@ -94,7 +94,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c sender, }; - const initParams = serializeInitContractParameters(contractName, sunnyWeather, schema); + const initParams = serializeInitContractParameters(contractName, sunnyWeather, schema!.buffer); const initPayload: InitContractPayload = { amount: CcdAmount.zero(), @@ -142,7 +142,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c contractName, EntrypointName.fromString('set'), rainyWeather, - schema + schema!.buffer ); const updatePayload: UpdateContractPayload = { @@ -187,7 +187,7 @@ const client = new ConcordiumGRPCNodeClient(address, Number(port), credentials.c const rawReturnValue = unwrap(invokedPostInit.returnValue); const returnValue = deserializeReceiveReturnValue( ReturnValue.toBuffer(rawReturnValue), - schema, + schema!.buffer, contractName, EntrypointName.fromString('get') ); diff --git a/examples/reactnative/ios/Podfile.lock b/examples/reactnative/ios/Podfile.lock index f95249369..d8dfed029 100644 --- a/examples/reactnative/ios/Podfile.lock +++ b/examples/reactnative/ios/Podfile.lock @@ -716,4 +716,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: c70448f9d8b13c40c47391af88ee9f69ffe85d63 -COCOAPODS: 1.14.3 +COCOAPODS: 1.15.2 diff --git a/packages/ccd-js-gen/CHANGELOG.md b/packages/ccd-js-gen/CHANGELOG.md index 51c5c9841..89c3aa240 100644 --- a/packages/ccd-js-gen/CHANGELOG.md +++ b/packages/ccd-js-gen/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog - ccd-js-gen -## Unreleased +## 1.2.1 + +### Changed + +- Update peer depedency for `@concordium/web-sdk` to support any version above `7` ## 1.2.0 diff --git a/packages/ccd-js-gen/package.json b/packages/ccd-js-gen/package.json index ead2c2857..b6efd9dae 100644 --- a/packages/ccd-js-gen/package.json +++ b/packages/ccd-js-gen/package.json @@ -40,10 +40,10 @@ }, "license": "Apache-2.0", "peerDependencies": { - "@concordium/web-sdk": "7.x" + "@concordium/web-sdk": ">= 7" }, "dependencies": { - "@concordium/web-sdk": "workspace:^7.0.0", + "@concordium/web-sdk": "workspace:^", "buffer": "^6.0.3", "commander": "^11.0.0", "sanitize-filename": "^1.6.3", diff --git a/packages/ccd-js-gen/src/lib.ts b/packages/ccd-js-gen/src/lib.ts index 5c6268e46..b5caaad32 100644 --- a/packages/ccd-js-gen/src/lib.ts +++ b/packages/ccd-js-gen/src/lib.ts @@ -178,7 +178,7 @@ async function generateCode( } notifier.done('Parse smart contract module.'); - const moduleSchema = rawModuleSchema === null ? null : SDK.parseRawModuleSchema(rawModuleSchema); + const moduleSchema = rawModuleSchema && SDK.parseRawModuleSchema(rawModuleSchema); const outputFilePath = path.format({ dir: outDirPath, diff --git a/packages/react-components/CHANGELOG.md b/packages/react-components/CHANGELOG.md index 064a493f4..1fb26c882 100644 --- a/packages/react-components/CHANGELOG.md +++ b/packages/react-components/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.1] + +### Changed + +- Update peer depedency for `@concordium/web-sdk` to support any version above `7` + ## [0.6.0] - 2024-06-12 ### Changed diff --git a/packages/react-components/package.json b/packages/react-components/package.json index da324d1fd..791e79d2f 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -1,6 +1,6 @@ { "name": "@concordium/react-components", - "version": "0.6.0", + "version": "0.6.1", "description": "Utility library of React components for building dApps that interact with the Concordium blockchain.", "author": "Concordium Software", "license": "Apache-2.0", @@ -42,7 +42,7 @@ "typescript": "^5.2.2" }, "peerDependencies": { - "@concordium/web-sdk": "7.x", + "@concordium/web-sdk": ">= 7", "react": "^18" } } diff --git a/packages/rust-bindings/Cargo.lock b/packages/rust-bindings/Cargo.lock index dfcf43d56..36a5b398b 100644 --- a/packages/rust-bindings/Cargo.lock +++ b/packages/rust-bindings/Cargo.lock @@ -350,7 +350,7 @@ dependencies = [ [[package]] name = "concordium-contracts-common" -version = "9.1.0" +version = "9.2.0" dependencies = [ "base64", "bs58", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "concordium_base" -version = "5.0.0" +version = "6.0.0" dependencies = [ "anyhow", "ark-bls12-381", @@ -1818,7 +1818,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wallet_library" -version = "0.3.0" +version = "0.4.0" dependencies = [ "anyhow", "chrono", diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index f31bcd800..a0498c755 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 8.0.1 + +### Breaking changes + +- `getEmbeddedModuleSchema` now uses the module version to determine in which custom wasm sections to look for the schema. +- `ConcordiumGRPCClient.getEmbeddedSchema` now delegates to `getEmbeddedModuleSchema` instead of `wasmToSchema` + (which was removed as it was just a less capable version of `getEmbeddedModuleSchema`). + This means that it returns the complete `RawModuleSchema` instead of only the schema bytes. + It also means that it returns `null` instead of an error when no embedded schema was found. +- Update `AccountInfo` and `BakerPoolStatus` according to the changes introduced in the GRPC types introduced with node version 7 + ## 7.5.1 ### Fixed diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 2589f2062..a71c90bbd 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@concordium/web-sdk", - "version": "7.5.1", + "version": "8.0.1", "license": "Apache-2.0", "engines": { "node": ">=16" diff --git a/packages/sdk/src/GenericContract.ts b/packages/sdk/src/GenericContract.ts index 3b323582b..29e78eab3 100644 --- a/packages/sdk/src/GenericContract.ts +++ b/packages/sdk/src/GenericContract.ts @@ -521,10 +521,11 @@ export class Contract exte if (!schema) { try { const raw = await grpcClient.getEmbeddedSchema(instanceInfo.sourceModule); - const encoded = Buffer.from(raw).toString('base64'); - - if (encoded) { - mSchema = encoded; + if (raw) { + const encoded = Buffer.from(raw.buffer).toString('base64'); + if (encoded) { + mSchema = encoded; + } } } catch { // Do nothing. diff --git a/packages/sdk/src/grpc/GRPCClient.ts b/packages/sdk/src/grpc/GRPCClient.ts index 65ab8e018..3311adf0d 100644 --- a/packages/sdk/src/grpc/GRPCClient.ts +++ b/packages/sdk/src/grpc/GRPCClient.ts @@ -14,6 +14,7 @@ import { calculateEnergyCost } from '../energyCost.js'; import { HealthClient } from '../grpc-api/v2/concordium/health.client.js'; import { QueriesClient } from '../grpc-api/v2/concordium/service.client.js'; import * as v2 from '../grpc-api/v2/concordium/types.js'; +import { RawModuleSchema } from '../schemaTypes.js'; import { serializeAccountTransactionPayload } from '../serialization.js'; import * as v1 from '../types.js'; import { HexString, isRpcError } from '../types.js'; @@ -29,8 +30,9 @@ import * as SequenceNumber from '../types/SequenceNumber.js'; import * as Timestamp from '../types/Timestamp.js'; import * as TransactionExpiry from '../types/TransactionExpiry.js'; import * as TransactionHash from '../types/TransactionHash.js'; +import { getEmbeddedModuleSchema } from '../types/VersionedModuleSource.js'; import type { BlockItemStatus, BlockItemSummary } from '../types/blockItemSummary.js'; -import { countSignatures, isHex, isValidIp, mapRecord, mapStream, unwrap, wasmToSchema } from '../util.js'; +import { countSignatures, isHex, isValidIp, mapRecord, mapStream, unwrap } from '../util.js'; import * as translate from './translation.js'; /** @@ -199,13 +201,16 @@ export class ConcordiumGRPCClient { * @param moduleRef the module's reference, represented by the ModuleReference class. * @param blockHash optional block hash to get the module embedded schema at, otherwise retrieves from last finalized block * - * @returns the module schema as a buffer. - * @throws An error of type `RpcError` if not found in the block. - * @throws If the module or schema cannot be parsed + * @returns the module schema as a {@link RawModuleSchema} or `null` if not found in the block. + * @throws An error of type `RpcError` if the module was not found in the block. + * @throws If the module source cannot be parsed or contains duplicate schema sections. */ - async getEmbeddedSchema(moduleRef: ModuleReference.Type, blockHash?: BlockHash.Type): Promise { - const versionedSource = await this.getModuleSource(moduleRef, blockHash); - return wasmToSchema(versionedSource.source); + async getEmbeddedSchema( + moduleRef: ModuleReference.Type, + blockHash?: BlockHash.Type + ): Promise { + const source = await this.getModuleSource(moduleRef, blockHash); + return getEmbeddedModuleSchema(source); } /** diff --git a/packages/sdk/src/grpc/translation.ts b/packages/sdk/src/grpc/translation.ts index 290536572..1ef27c169 100644 --- a/packages/sdk/src/grpc/translation.ts +++ b/packages/sdk/src/grpc/translation.ts @@ -314,10 +314,7 @@ function transPoolInfo(info: v2.BakerPoolInfo): v1.BakerPoolInfo { }; } -function transPaydayStatus(status: v2.PoolCurrentPaydayInfo | undefined): v1.CurrentPaydayBakerPoolStatus | null { - if (!status) { - return null; - } +function transPaydayStatus(status: v2.PoolCurrentPaydayInfo): v1.CurrentPaydayBakerPoolStatus { return { blocksBaked: status.blocksBaked, finalizationLive: status.finalizationLive, @@ -330,11 +327,19 @@ function transPaydayStatus(status: v2.PoolCurrentPaydayInfo | undefined): v1.Cur }; } +function transCooldown(cooldown: v2.Cooldown): v1.Cooldown { + return { + amount: CcdAmount.fromProto(unwrap(cooldown.amount)), + timestamp: Timestamp.fromProto(unwrap(cooldown.endTime)), + status: cooldown.status as number, + }; +} + export function accountInfo(acc: v2.AccountInfo): v1.AccountInfo { const aggAmount = acc.encryptedBalance?.aggregatedAmount?.value; const numAggregated = acc.encryptedBalance?.numAggregated; - const encryptedAmount: v1.AccountEncryptedAmount = { + const accountEncryptedAmount: v1.AccountEncryptedAmount = { selfAmount: unwrapValToHex(acc.encryptedBalance?.selfAmount), startIndex: unwrap(acc.encryptedBalance?.startIndex), incomingAmounts: unwrap(acc.encryptedBalance?.incomingAmounts).map(unwrapValToHex), @@ -342,21 +347,54 @@ export function accountInfo(acc: v2.AccountInfo): v1.AccountInfo { ...(numAggregated && { numAggregated: numAggregated }), ...(aggAmount && { aggregatedAmount: unwrapToHex(aggAmount) }), }; - const releaseSchedule = { + const accountReleaseSchedule = { total: CcdAmount.fromProto(unwrap(acc.schedule?.total)), schedule: unwrap(acc.schedule?.schedules).map(trRelease), }; + const accountCooldowns = acc.cooldowns.map(transCooldown); + const accountAmount = CcdAmount.fromProto(unwrap(acc.amount)); + + let accountAvailableBalance: CcdAmount.Type; + + // This is undefined for node version <7, so we add this check to be backwards compatible. + if (acc.availableBalance !== undefined) { + accountAvailableBalance = CcdAmount.fromProto(unwrap(acc.availableBalance)); + } else { + // NOTE: implementation borrowed from concordium-browser-wallet. + let staked = 0n; + switch (acc.stake?.stakingInfo.oneofKind) { + case 'baker': { + staked = unwrap(acc.stake.stakingInfo.baker.stakedAmount?.value); + break; + } + case 'delegator': { + staked = unwrap(acc.stake.stakingInfo.delegator.stakedAmount?.value); + break; + } + } + + const scheduled = accountReleaseSchedule ? BigInt(accountReleaseSchedule.total.microCcdAmount) : 0n; + + const max = (first: bigint, second: bigint) => { + return first > second ? first : second; + }; + + const atDisposal = accountAmount.microCcdAmount - max(scheduled, staked); + accountAvailableBalance = CcdAmount.fromMicroCcd(atDisposal); + } const accInfoCommon: v1.AccountInfoSimple = { type: v1.AccountInfoType.Simple, accountAddress: AccountAddress.fromProto(unwrap(acc.address)), accountNonce: SequenceNumber.fromProto(unwrap(acc.sequenceNumber)), - accountAmount: CcdAmount.fromProto(unwrap(acc.amount)), + accountAmount, accountIndex: unwrap(acc.index?.value), accountThreshold: unwrap(acc.threshold?.value), accountEncryptionKey: unwrapValToHex(acc.encryptionKey), - accountEncryptedAmount: encryptedAmount, - accountReleaseSchedule: releaseSchedule, + accountEncryptedAmount, + accountReleaseSchedule, accountCredentials: mapRecord(acc.creds, trCred), + accountCooldowns, + accountAvailableBalance, }; if (acc.stake?.stakingInfo.oneofKind === 'delegator') { @@ -531,12 +569,14 @@ export function bakerPoolInfo(info: v2.PoolInfoResponse): v1.BakerPoolStatus { poolType: v1.PoolStatusType.BakerPool, bakerId: unwrap(info.baker?.value), bakerAddress: AccountAddress.fromProto(unwrap(info.address)), - bakerEquityCapital: CcdAmount.fromProto(unwrap(info.equityCapital)), - delegatedCapital: CcdAmount.fromProto(unwrap(info.delegatedCapital)), - delegatedCapitalCap: CcdAmount.fromProto(unwrap(info.delegatedCapitalCap)), - poolInfo: transPoolInfo(unwrap(info?.poolInfo)), + bakerEquityCapital: info.equityCapital !== undefined ? CcdAmount.fromProto(info.equityCapital) : undefined, + delegatedCapital: info.delegatedCapital !== undefined ? CcdAmount.fromProto(info.delegatedCapital) : undefined, + delegatedCapitalCap: + info.delegatedCapitalCap !== undefined ? CcdAmount.fromProto(info.delegatedCapitalCap) : undefined, + poolInfo: info.poolInfo !== undefined ? transPoolInfo(info.poolInfo) : undefined, bakerStakePendingChange: transPoolPendingChange(info.equityPendingChange), - currentPaydayStatus: transPaydayStatus(info.currentPaydayInfo), + currentPaydayStatus: + info.currentPaydayInfo !== undefined ? transPaydayStatus(info.currentPaydayInfo) : undefined, allPoolTotalCapital: CcdAmount.fromProto(unwrap(info.allPoolTotalCapital)), }; } @@ -830,8 +870,14 @@ function trBakerEvent(bakerEvent: v2.BakerEvent, account: AccountAddress.Type): account, }; } + case 'delegationRemoved': { + return { + tag: v1.TransactionEventTag.BakerDelegationRemoved, + delegatorId: unwrap(event.delegationRemoved.delegatorId?.id?.value), + }; + } case undefined: - throw Error('Failed translating BakerEvent, encountered undefined'); + throw Error('Unrecognized event type. This should be impossible.'); } } @@ -847,7 +893,7 @@ function trDelegTarget(delegationTarget: v2.DelegationTarget | undefined): v1.Ev delegateType: v1.DelegationTargetType.PassiveDelegation, }; } else { - throw 'Failed translating DelegationTarget, encountered undefined'; + throw Error('Failed translating DelegationTarget, encountered undefined'); } } @@ -902,7 +948,12 @@ function trDelegationEvent(delegationEvent: v2.DelegationEvent, account: Account delegatorId: unwrap(event.delegationRemoved.id?.value), account, }; - default: + case 'bakerRemoved': + return { + tag: v1.TransactionEventTag.DelegationBakerRemoved, + bakerId: unwrap(event.bakerRemoved.bakerId?.value), + }; + case undefined: throw Error('Unrecognized event type. This should be impossible.'); } } diff --git a/packages/sdk/src/pub/types.ts b/packages/sdk/src/pub/types.ts index c79e3c85c..d03f462ac 100644 --- a/packages/sdk/src/pub/types.ts +++ b/packages/sdk/src/pub/types.ts @@ -46,7 +46,7 @@ export * from '../signHelpers.js'; export * from '../versionedTypeHelpers.js'; export * from '../accountHelpers.js'; -export { isHex, streamToList, wasmToSchema, unwrap } from '../util.js'; +export { isHex, streamToList, unwrap } from '../util.js'; export * from '../accountTransactions.js'; export * from '../energyCost.js'; diff --git a/packages/sdk/src/schemaTypes.ts b/packages/sdk/src/schemaTypes.ts index fda63aae3..4974103ca 100644 --- a/packages/sdk/src/schemaTypes.ts +++ b/packages/sdk/src/schemaTypes.ts @@ -36,7 +36,7 @@ export function toOptionJson(value: T | undefined): OptionJson { } /** Schema version from before the schema bytes contained version information. */ -type UnversionedSchemaVersion = 0 | 1; +export type UnversionedSchemaVersion = 0 | 1; /** * Represents unparsed bytes for a smart contract module schema. diff --git a/packages/sdk/src/types.ts b/packages/sdk/src/types.ts index 9b97bf22c..35da39b10 100644 --- a/packages/sdk/src/types.ts +++ b/packages/sdk/src/types.ts @@ -939,27 +939,59 @@ type PoolStatusWrapper = S & { }; export interface BakerPoolStatusDetails { + /** The pool owner */ bakerId: BakerId; + /** The account address of the pool owner */ bakerAddress: AccountAddress.Type; - bakerEquityCapital: CcdAmount.Type; - delegatedCapital: CcdAmount.Type; - delegatedCapitalCap: CcdAmount.Type; - poolInfo: BakerPoolInfo; + /** The equity capital provided by the pool owner. Absent if the pool is removed. */ + bakerEquityCapital?: CcdAmount.Type; + /** The capital delegated to the pool by other accounts. Absent if the pool is removed. */ + delegatedCapital?: CcdAmount.Type; + /** + * The maximum amount that may be delegated to the pool, accounting for leverage and stake limits. + * Absent if the pool is removed + */ + delegatedCapitalCap?: CcdAmount.Type; + /** + * The pool info associated with the pool: open status, metadata URL and commission rates. + * Absent if the pool is removed + */ + poolInfo?: BakerPoolInfo; + /** Any pending change to the equity capital. This is not used from protocol version 7 onwards, as stake changes are immediate. */ bakerStakePendingChange: BakerPoolPendingChange; - currentPaydayStatus: CurrentPaydayBakerPoolStatus | null; + /** Information of the pool in the current reward period. */ + currentPaydayStatus?: CurrentPaydayBakerPoolStatus; + /** Total capital staked across all pools, including passive delegation. */ allPoolTotalCapital: CcdAmount.Type; } +/** + * Contains information about a given pool at the end of a given block. + * From protocol version 7, pool removal has immediate effect, however, the + * pool may still be present for the current (and possibly next) reward period. + * In this case, the `current_payday_info` field will be set, but the + * `equity_capital`, `delegated_capital`, `delegated_capital_cap` and, + * `pool_info` fields will all be absent. The `equity_pending_change` field + * will also be absent, as stake changes are immediate. + */ export type BakerPoolStatus = PoolStatusWrapper; export interface PassiveDelegationStatusDetails { + /** The total capital delegated passively. */ delegatedCapital: CcdAmount.Type; + /** The passive delegation commission rates. */ commissionRates: CommissionRates; + /** The transaction fees accruing to the passive delegators in the current reward period. */ currentPaydayTransactionFeesEarned: CcdAmount.Type; + /** The effective delegated capital of passive delegators for the current reward period. */ currentPaydayDelegatedCapital: CcdAmount.Type; + /** Total capital staked across all pools, including passive delegation. */ allPoolTotalCapital: CcdAmount.Type; } +/** + * Contains information about passive delegators at the end of a given block. + */ export type PassiveDelegationStatus = PoolStatusWrapper< PoolStatusType.PassiveDelegation, PassiveDelegationStatusDetails @@ -1037,6 +1069,21 @@ interface AccountInfoCommon { accountEncryptedAmount: AccountEncryptedAmount; accountReleaseSchedule: AccountReleaseSchedule; accountCredentials: Record; + /** + * The stake on the account that is in cooldown. + * There can be multiple amounts in cooldown that expire at different times. + * This was introduced in protocol version 7, and will be empty in + * earlier protocol versions. + */ + accountCooldowns: Cooldown[]; + /** + * The available (unencrypted) balance of the account (i.e. that can be transferred + * or used to pay for transactions). This is the balance minus the locked amount. + * The locked amount is the maximum of the amount in the release schedule and + * the total amount that is actively staked or in cooldown (inactive stake). + * This was introduced with node version 7.0 + */ + accountAvailableBalance: CcdAmount.Type; } export interface AccountInfoSimple extends AccountInfoCommon { @@ -1832,3 +1879,44 @@ export type BlockItem = expiry: number; }; }; + +/** + * The status of a cooldown. When stake is removed from a baker or delegator + * (from protocol version 7) it first enters the pre-pre-cooldown state. + * The next time the stake snaphot is taken (at the epoch transition before + * a payday) it enters the pre-cooldown state. At the subsequent payday, it + * enters the cooldown state. At the payday after the end of the cooldown + * period, the stake is finally released. + */ +export enum CooldownStatus { + /** + * The amount is in cooldown and will expire at the specified time, becoming available + * at the subsequent pay day. + */ + Cooldown, + /** + * The amount will enter cooldown at the next pay day. The specified end time is + * projected to be the end of the cooldown period, but the actual end time will be + * determined at the payday, and may be different if the global cooldown period + * changes. + */ + PreCooldown, + /** + * The amount will enter pre-cooldown at the next snapshot epoch (i.e. the epoch + * transition before a pay day transition). As with pre-cooldown, the specified + * end time is projected, but the actual end time will be determined later. + */ + PrePreCooldown, +} + +/** + * Describes a cooldown associated with removal of stake from a baker/delegator account + */ +export type Cooldown = { + /** The time at which the cooldown will end */ + timestamp: Timestamp.Type; + /** The amount that is in cooldown and set to be released at the end of the cooldown period */ + amount: CcdAmount.Type; + /** The status of the cooldown */ + status: CooldownStatus; +}; diff --git a/packages/sdk/src/types/VersionedModuleSource.ts b/packages/sdk/src/types/VersionedModuleSource.ts index ae0aad043..19b4a41f4 100644 --- a/packages/sdk/src/types/VersionedModuleSource.ts +++ b/packages/sdk/src/types/VersionedModuleSource.ts @@ -3,10 +3,9 @@ import { Buffer } from 'buffer/index.js'; import * as H from '../contractHelpers.js'; import { Cursor, deserializeUInt32BE } from '../deserializationHelpers.js'; import { sha256 } from '../hash.js'; -import { RawModuleSchema } from '../schemaTypes.js'; +import { RawModuleSchema, UnversionedSchemaVersion } from '../schemaTypes.js'; import { encodeWord32 } from '../serializationHelpers.js'; import { VersionedModuleSource } from '../types.js'; -import { schemaBytesFromWasmModule } from '../util.js'; import * as ModuleReference from './ModuleReference.js'; /** Interface of a smart contract containing the name of the contract and every entrypoint. */ @@ -100,22 +99,53 @@ export async function parseModuleInterface(moduleSource: VersionedModuleSource): * Extract the embedded smart contract schema bytes. Returns `null` if no schema is embedded. * @param {VersionedModuleSource} moduleSource The smart contract module source. * @returns {RawModuleSchema | null} The raw module schema if found. + * @throws If the module source cannot be parsed or contains duplicate schema sections. */ -export async function getEmbeddedModuleSchema(moduleSource: VersionedModuleSource): Promise { - const wasmModule = await WebAssembly.compile(moduleSource.source); - const versionedSchema = schemaBytesFromWasmModule(wasmModule, 'concordium-schema'); - if (versionedSchema !== null) { - return { type: 'versioned', buffer: versionedSchema }; +export async function getEmbeddedModuleSchema({ + source, + version, +}: VersionedModuleSource): Promise { + const sections = findCustomSections(await WebAssembly.compile(source), version); + if (sections === undefined) { + return undefined; + } + const { sectionName, unversionedSchemaVersion, contents } = sections; + if (contents.length !== 1) { + throw new Error( + `invalid module: expected to find at most one custom section named "${sectionName}", but found ${contents.length}` + ); + } + const schema = contents[0]; + if (unversionedSchemaVersion !== undefined) { + return { + type: 'unversioned', + version: unversionedSchemaVersion, + buffer: schema, + }; } - const unversionedSchemaV0 = schemaBytesFromWasmModule(wasmModule, 'concordium-schema-v1'); - if (unversionedSchemaV0 !== null) { - return { type: 'unversioned', version: 0, buffer: unversionedSchemaV0 }; + return { type: 'versioned', buffer: schema }; +} + +function findCustomSections(m: WebAssembly.Module, moduleVersion: number) { + function getCustomSections(sectionName: string, unversionedSchemaVersion: UnversionedSchemaVersion | undefined) { + const s = WebAssembly.Module.customSections(m, sectionName); + return s.length === 0 ? undefined : { sectionName, unversionedSchemaVersion, contents: s }; } - const unversionedSchemaV1 = schemaBytesFromWasmModule(wasmModule, 'concordium-schema-v2'); - if (unversionedSchemaV1 !== null) { - return { type: 'unversioned', version: 1, buffer: unversionedSchemaV1 }; + + // First look for section containing schema with embedded version, then "-v1" or "-v2" depending on the module version. + switch (moduleVersion) { + case 0: + return ( + getCustomSections('concordium-schema', undefined) || // always v0 + getCustomSections('concordium-schema-v1', 0) // v0 (not a typo) + ); + case 1: + return ( + getCustomSections('concordium-schema', undefined) || // v1, v2, or v3 + getCustomSections('concordium-schema-v2', 1) // v1 (not a typo) + ); } - return null; + return getCustomSections('concordium-schema', undefined); // expecting to find this section in future module versions } /** diff --git a/packages/sdk/src/types/transactionEvent.ts b/packages/sdk/src/types/transactionEvent.ts index a865ccee8..a49e559e7 100644 --- a/packages/sdk/src/types/transactionEvent.ts +++ b/packages/sdk/src/types/transactionEvent.ts @@ -43,12 +43,14 @@ export enum TransactionEventTag { BakerSetTransactionFeeCommission = 'BakerSetTransactionFeeCommission', BakerSetBakingRewardCommission = 'BakerSetBakingRewardCommission', BakerSetFinalizationRewardCommission = 'BakerSetFinalizationRewardCommission', + BakerDelegationRemoved = 'BakerDelegationRemoved', DelegationStakeIncreased = 'DelegationStakeIncreased', DelegationStakeDecreased = 'DelegationStakeDecreased', DelegationSetRestakeEarnings = 'DelegationSetRestakeEarnings', DelegationSetDelegationTarget = 'DelegationSetDelegationTarget', DelegationAdded = 'DelegationAdded', DelegationRemoved = 'DelegationRemoved', + DelegationBakerRemoved = 'DelegationBakerRemoved', TransferMemo = 'TransferMemo', Transferred = 'Transferred', Interrupted = 'Interrupted', @@ -247,6 +249,11 @@ export interface DelegationStakeChangedEvent { newStake: CcdAmount.Type; } +export interface DelegationBakerRemovedEvent { + tag: TransactionEventTag.DelegationBakerRemoved; + bakerId: BakerId; +} + // Baker Events export interface BakerAddedEvent { @@ -324,6 +331,11 @@ export interface BakerSetTransactionFeeCommissionEvent { transactionFeeCommission: number; } +export interface BakerDelegationRemovedEvent { + tag: TransactionEventTag.BakerDelegationRemoved; + delegatorId: DelegatorId; +} + export interface UpdateEnqueuedEvent { tag: TransactionEventTag.UpdateEnqueued; effectiveTime: number; @@ -341,9 +353,11 @@ export type BakerEvent = | BakerStakeChangedEvent | BakerAddedEvent | BakerRemovedEvent - | BakerKeysUpdatedEvent; + | BakerKeysUpdatedEvent + | BakerDelegationRemovedEvent; export type DelegationEvent = | DelegatorEvent | DelegationSetDelegationTargetEvent | DelegationSetRestakeEarningsEvent - | DelegationStakeChangedEvent; + | DelegationStakeChangedEvent + | DelegationBakerRemovedEvent; diff --git a/packages/sdk/src/util.ts b/packages/sdk/src/util.ts index 46958932e..b45e9d1e7 100644 --- a/packages/sdk/src/util.ts +++ b/packages/sdk/src/util.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { Buffer } from 'buffer/index.js'; import { AccountTransactionSignature, HexString, IpAddressString } from './types.js'; @@ -60,44 +59,6 @@ export function countSignatures(accountSignatures: AccountTransactionSignature): return totalSignatureCount; } -/** - * Compiles a wasm module and extracts the smart contract schema. - * - * @param wasm the wasm module as a Buffer - * - * @throws If WASM module contains no schema - * @throws If WASM module provided is invalid - * - * @returns the smart contract schema as a Buffer - */ -export function wasmToSchema(wasm: ArrayBuffer): Uint8Array { - const wasmModule = new WebAssembly.Module(wasm); - const schemaBytes = schemaBytesFromWasmModule(wasmModule, 'concordium-schema'); - if (schemaBytes === null) { - throw Error('WASM-Module contains no schema!'); - } - return new Uint8Array(schemaBytes); -} - -/** - * Extracts custom-section containing the smart contract schema if present. - * @param wasmModule the WebAssembly module. - * @returns the smart contract schema as a Buffer or null if not present. - */ -export function schemaBytesFromWasmModule( - wasmModule: WebAssembly.Module, - sectionName: 'concordium-schema' | 'concordium-schema-v1' | 'concordium-schema-v2' -): ArrayBuffer | null { - const sections = WebAssembly.Module.customSections(wasmModule, sectionName); - if (sections.length === 1) { - return sections[0]; - } else if (sections.length === 0) { - return null; - } else { - throw Error('Invalid WASM-Module retrieved!'); - } -} - /** * Convert a Date to seconds since epoch. */ diff --git a/packages/sdk/test/ci/module-schema.test.ts b/packages/sdk/test/ci/module-schema.test.ts index 64d9604f5..3f3d9a4de 100644 --- a/packages/sdk/test/ci/module-schema.test.ts +++ b/packages/sdk/test/ci/module-schema.test.ts @@ -13,7 +13,7 @@ describe('VersionedModuleSource: getEmbeddedModuleSchema', () => { ); const moduleSource = versionedModuleSourceFromBuffer(contractModule); const moduleSchema = await getEmbeddedModuleSchema(moduleSource); - if (moduleSchema === null) { + if (moduleSchema === undefined) { fail('Failed to find module schame'); } expect(moduleSchema.type).toBe('versioned'); @@ -25,7 +25,7 @@ describe('VersionedModuleSource: getEmbeddedModuleSchema', () => { ); const moduleSource = versionedModuleSourceFromBuffer(contractModule); const moduleSchema = await getEmbeddedModuleSchema(moduleSource); - if (moduleSchema === null) { + if (moduleSchema === undefined) { fail('Failed to find module schame'); } expect(moduleSchema.type).toBe('versioned'); @@ -40,7 +40,7 @@ describe('VersionedModuleSource: getEmbeddedModuleSchema', () => { source: Buffer.from(unversionedContractModule), } as const; const moduleSchema = await getEmbeddedModuleSchema(moduleSource); - if (moduleSchema === null) { + if (moduleSchema === undefined) { fail('Failed to find module schame'); } expect(moduleSchema.type).toBe('unversioned'); @@ -52,7 +52,7 @@ describe('VersionedModuleSource: getEmbeddedModuleSchema', () => { ); const moduleSource = versionedModuleSourceFromBuffer(contractModule); const moduleSchema = await getEmbeddedModuleSchema(moduleSource); - if (moduleSchema === null) { + if (moduleSchema === undefined) { fail('Failed to find module schame'); } expect(moduleSchema.type).toBe('unversioned'); diff --git a/packages/sdk/test/ci/util.test.ts b/packages/sdk/test/ci/util.test.ts index bcd57db62..efa9d4d88 100644 --- a/packages/sdk/test/ci/util.test.ts +++ b/packages/sdk/test/ci/util.test.ts @@ -1,6 +1,7 @@ import { readFileSync } from 'fs'; -import { stringToInt, wasmToSchema } from '../../src/util.js'; +import { getEmbeddedModuleSchema } from '../../src/index.js'; +import { stringToInt } from '../../src/util.js'; test('stringToInt transforms chosen field, but not others', () => { const keysToTransform = ['a']; @@ -25,13 +26,16 @@ test('stringToInt will not change the string if no keys match', () => { expect(transformed).toEqual(input); }); -test('Embedded schema is the same as a seperate schema file', () => { +test('Embedded schema is the same as a seperate schema file', async () => { const versionedWasmModule = readFileSync('test/ci/resources/icecream-with-schema.wasm'); // Strip module version information const wasmModule = versionedWasmModule.subarray(8); const seperateSchema = readFileSync('test/ci/resources/icecream-schema.bin'); - const embeddedSchema = wasmToSchema(wasmModule); + const embeddedSchema = await getEmbeddedModuleSchema({ + source: wasmModule, + version: 1, + }); - expect(new Uint8Array(seperateSchema)).toEqual(embeddedSchema); + expect(new Uint8Array(seperateSchema)).toEqual(new Uint8Array(embeddedSchema!.buffer)); }); diff --git a/packages/sdk/test/client/clientV2.test.ts b/packages/sdk/test/client/clientV2.test.ts index f2877fe92..a465e843b 100644 --- a/packages/sdk/test/client/clientV2.test.ts +++ b/packages/sdk/test/client/clientV2.test.ts @@ -28,9 +28,6 @@ const clientWeb = getNodeClientWeb(); const clients = testEnvironment === 'node' ? [clientV2, clientWeb] : [clientWeb]; const testAccount = v1.AccountAddress.fromBase58('3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G'); -const testCredId = v1.CredentialRegistrationId.fromHexString( - 'aa730045bcd20bb5c24349db29d949f767e72f7cce459dc163c4b93c780a7d7f65801dda8ff7e4fc06fdf1a1b246276f' -); const testAccBaker = v1.AccountAddress.fromBase58('4EJJ1hVhbVZT2sR9xPzWUwFcJWK3fPX54z94zskTozFVk8Xd4L'); const testAccDeleg = v1.AccountAddress.fromBase58('3bFo43GiPnkk5MmaSdsRVboaX2DNSKaRkLseQbyB3WPW1osPwh'); const testBlockHash = v1.BlockHash.fromHexString('fe88ff35454079c3df11d8ae13d5777babd61f28be58494efe51b6593e30716e'); @@ -96,23 +93,14 @@ test.each(clients)('getAccountInfo for delegator', async (client) => { } }); -test.each(clients)('getAccountInfo: Account Address and CredentialRegistrationId is equal', async (client) => { - const accInfo = await client.getAccountInfo(testAccount, testBlockHash); - const credIdInfo = await client.getAccountInfo(testCredId, testBlockHash); - - expect(accInfo).toEqual(credIdInfo); -}); - test.each(clients)( // TODO: fails.. 'accountInfo implementations is the same', async (client) => { const regular = await client.getAccountInfo(testAccount, testBlockHash); - const credId = await client.getAccountInfo(testCredId, testBlockHash); const baker = await client.getAccountInfo(testAccBaker, testBlockHash); const deleg = await client.getAccountInfo(testAccDeleg, testBlockHash); expect(regular).toEqual(expected.regularAccountInfo); - expect(credId).toEqual(expected.credIdAccountInfo); expect(baker).toEqual(expected.bakerAccountInfo); expect(deleg).toEqual(expected.delegatorAccountInfo); } @@ -605,7 +593,7 @@ test.each(clients)('getEmbeddedSchema', async (client) => { const rawReturnValue = invoked.returnValue; const returnValue = v1.deserializeReceiveReturnValue( v1.ReturnValue.toBuffer(rawReturnValue), - schema, + schema!.buffer, v1.ContractName.fromStringUnchecked('weather'), v1.EntrypointName.fromStringUnchecked('get') ); diff --git a/packages/sdk/test/client/resources/expectedJsons.ts b/packages/sdk/test/client/resources/expectedJsons.ts index d6cd9b72e..132d0cbab 100644 --- a/packages/sdk/test/client/resources/expectedJsons.ts +++ b/packages/sdk/test/client/resources/expectedJsons.ts @@ -148,6 +148,9 @@ export const accountInfo = { }, }, }, + availableBalance: { + value: '35495453082577742', + }, threshold: { value: 1, }, @@ -1403,6 +1406,8 @@ export const bakerAccountInfo: AccountInfoBaker = { restakeEarnings: true, stakedAmount: CcdAmount.fromMicroCcd(7349646704751788n), }, + accountCooldowns: [], + accountAvailableBalance: CcdAmount.fromMicroCcd(100000000000000n), }; export const delegatorAccountInfo: AccountInfoDelegator = { @@ -1508,80 +1513,8 @@ export const delegatorAccountInfo: AccountInfoDelegator = { restakeEarnings: true, stakedAmount: CcdAmount.fromMicroCcd(620942412516n), }, -}; - -export const credIdAccountInfo: AccountInfoSimple = { - type: AccountInfoType.Simple, - accountNonce: SequenceNumber.create(19), - accountAmount: CcdAmount.fromMicroCcd(35495453082577742n), - accountReleaseSchedule: { total: CcdAmount.zero(), schedule: [] }, - accountCredentials: { - '0': { - v: 0, - value: { - contents: { - arData: { - '1': { - encIdCredPubShare: - 'a91e570e54b9ee7c304570bc3a066ea75dd833086c683a421c11e565482de01ffc2fb742408cf1dbd6c744cdde8835469120ce6a0e0c12fbfd53e9be81656900a95109f80418e7cbba510c457f15a0cb347bdc3f5508d46cec87a9214686a61d', - }, - }, - commitments: { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - cmmAttributes: {}, - cmmCredCounter: - 'b0aa65f420a9f3fab61d3f875eebcc221e43154bfaf1b6365dace99bff20778de7003437631222e845fd9917c8d2874b', - cmmIdCredSecSharingCoeff: [ - '8bac440a2e46ccbfbfa768c6ad99f2abf25f8b327a795ecf23b2b804c327022f06d0aced0b5eed65899a3ef3029804ec', - ], - cmmMaxAccounts: - '869e2bddb2c60703ecd512b55b772baf75691f81bbc45362f88e5abcdab85a23714a92d46fe40457364d506abc2202a3', - cmmPrf: 'b8930e48976902f67f0cbb50b8c2911fcc0646fbccf4bfb6a442ef7d40a8351f48ae7206ee8083e28d357be808803f82', - }, - credId: 'aa730045bcd20bb5c24349db29d949f767e72f7cce459dc163c4b93c780a7d7f65801dda8ff7e4fc06fdf1a1b246276f', - credentialPublicKeys: { - keys: { - '0': { - schemeId: 'Ed25519', - verifyKey: '9e975c838d037136cff54f7f5b741922dd9bc31e5dd3c9eb793a026b7d1f5125', - }, - '1': { - schemeId: 'Ed25519', - verifyKey: '2d322b8744fa5d01823adce3f6a13bbebdd7b8503c08ccc3d8497e6c46021976', - }, - '2': { - schemeId: 'Ed25519', - verifyKey: '9a77df3f869206a7c085bc1ab821f1e248762a22bb37471b3cefcb83740764c9', - }, - }, - threshold: 2, - }, - ipIdentity: 0, - policy: { - createdAt: '202206', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - revealedAttributes: {}, - validTo: '202306', - }, - revocationThreshold: 1, - }, - type: 'normal', - }, - }, - }, - accountThreshold: 1, - accountEncryptedAmount: { - incomingAmounts: [], - selfAmount: - 'c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - startIndex: 0n, - }, - accountEncryptionKey: - 'b14cbfe44a02c6b1f78711176d5f437295367aa4f2a8c2551ee10d25a03adc69d61a332a058971919dad7312e1fc94c5aa730045bcd20bb5c24349db29d949f767e72f7cce459dc163c4b93c780a7d7f65801dda8ff7e4fc06fdf1a1b246276f', - accountIndex: 11n, - accountAddress: AccountAddress.fromBase58('3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G'), + accountCooldowns: [], + accountAvailableBalance: CcdAmount.fromMicroCcd(6088626n), }; export const regularAccountInfo: AccountInfoSimple = { @@ -1656,6 +1589,8 @@ export const regularAccountInfo: AccountInfoSimple = { 'b14cbfe44a02c6b1f78711176d5f437295367aa4f2a8c2551ee10d25a03adc69d61a332a058971919dad7312e1fc94c5aa730045bcd20bb5c24349db29d949f767e72f7cce459dc163c4b93c780a7d7f65801dda8ff7e4fc06fdf1a1b246276f', accountIndex: 11n, accountAddress: AccountAddress.fromBase58('3kBx2h5Y2veb4hZgAJWPrr8RyQESKm5TjzF3ti1QQ4VSYLwK1G'), + accountCooldowns: [], + accountAvailableBalance: CcdAmount.fromMicroCcd(35495453082577742n), }; const rootKeys = { @@ -2024,7 +1959,6 @@ export const bakerPoolStatusWithPendingChange: BakerPoolStatus = { pendingChangeType: BakerPoolPendingChangeType.RemovePool, effectiveTime: new Date('2022-12-08T07:54:00.000Z'), }, - currentPaydayStatus: null, allPoolTotalCapital: CcdAmount.fromMicroCcd(46470271917743628n), }; diff --git a/packages/sdk/test/client/testHelpers.ts b/packages/sdk/test/client/testHelpers.ts index 0399f744a..150505166 100644 --- a/packages/sdk/test/client/testHelpers.ts +++ b/packages/sdk/test/client/testHelpers.ts @@ -24,10 +24,7 @@ export function getNodeClientV2(address = TESTNET_NODE, port = GRPCV2_PORT): Con * Creates a gRPC v2 client (for web) to communicate with a local concordium-node * used for automatic tests. */ -export function getNodeClientWeb( - address = 'http://node.testnet.concordium.com', - port = GRPCV2_PORT -): ConcordiumGRPCClient { +export function getNodeClientWeb(address = `http://${TESTNET_NODE}`, port = GRPCV2_PORT): ConcordiumGRPCClient { return new ConcordiumGRPCWebClient(address, port, { timeout: 15000 }); } diff --git a/packages/wallet-connectors/CHANGELOG.md b/packages/wallet-connectors/CHANGELOG.md index 1f0162d2e..a3f7f8624 100644 --- a/packages/wallet-connectors/CHANGELOG.md +++ b/packages/wallet-connectors/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.1] + +### Changed + +- Update peer depedency for `@concordium/web-sdk` to support any version above `7` + ## [0.6.0] - 2024-06-12 ### Fixed diff --git a/packages/wallet-connectors/package.json b/packages/wallet-connectors/package.json index 7c5bb46c5..eb6de6d1f 100644 --- a/packages/wallet-connectors/package.json +++ b/packages/wallet-connectors/package.json @@ -1,6 +1,6 @@ { "name": "@concordium/wallet-connectors", - "version": "0.6.0", + "version": "0.6.1", "description": "Utility interface for dApps to interact with wallets without depending on the underlying protocol and implementations for Concordium Browser Wallet and Wallet Connect v2.", "author": "Concordium Software", "license": "Apache-2.0", @@ -38,7 +38,7 @@ "buffer": "^6.0.3" }, "peerDependencies": { - "@concordium/web-sdk": "7.x", + "@concordium/web-sdk": ">= 7", "@walletconnect/types": "^2.13.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index d43d3ecbd..e6385dfad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3565,7 +3565,7 @@ __metadata: version: 0.0.0-use.local resolution: "@concordium/ccd-js-gen@workspace:packages/ccd-js-gen" dependencies: - "@concordium/web-sdk": "workspace:^7.0.0" + "@concordium/web-sdk": "workspace:^" "@types/jest": ^26.0.23 "@types/node": ^20.5.0 buffer: ^6.0.3 @@ -3578,7 +3578,7 @@ __metadata: ts-morph: ^19.0.0 typescript: ^5.2.2 peerDependencies: - "@concordium/web-sdk": 7.x + "@concordium/web-sdk": ">= 7" bin: ccd-js-gen: bin/ccd-js-gen.js languageName: unknown @@ -3642,7 +3642,7 @@ __metadata: prettier: ^3.2.5 typescript: ^5.2.2 peerDependencies: - "@concordium/web-sdk": 7.x + "@concordium/web-sdk": ">= 7" react: ^18 languageName: unknown linkType: soft @@ -3690,12 +3690,12 @@ __metadata: ts-node: ^10.9.2 typescript: ^5.2.2 peerDependencies: - "@concordium/web-sdk": 7.x + "@concordium/web-sdk": ">= 7" "@walletconnect/types": ^2.13.1 languageName: unknown linkType: soft -"@concordium/web-sdk@workspace:^, @concordium/web-sdk@workspace:^7.0.0, @concordium/web-sdk@workspace:packages/sdk": +"@concordium/web-sdk@workspace:^, @concordium/web-sdk@workspace:packages/sdk": version: 0.0.0-use.local resolution: "@concordium/web-sdk@workspace:packages/sdk" dependencies: