From a8dfae5ed204ea44d3d3f8ad3d1947a2143934b3 Mon Sep 17 00:00:00 2001 From: polymath-eric <86971143+polymath-eric@users.noreply.github.com> Date: Thu, 4 May 2023 03:55:55 -1000 Subject: [PATCH 01/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20finding=20default?= =?UTF-8?q?=20portfolio=20when=20id=200=20is=20given=20(#197)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: ๐Ÿ› finding default portfolio when id 0 is given --- src/portfolios/portfolios.service.spec.ts | 17 +++++++++++++++++ src/portfolios/portfolios.service.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/portfolios/portfolios.service.spec.ts b/src/portfolios/portfolios.service.spec.ts index d5dca01d..fdf9bf72 100644 --- a/src/portfolios/portfolios.service.spec.ts +++ b/src/portfolios/portfolios.service.spec.ts @@ -121,6 +121,23 @@ describe('PortfoliosService', () => { }); }); + it('should return the default portfolio when given id of 0', async () => { + const mockIdentity = new MockIdentity(); + const mockPortfolio = { + id: new BigNumber(0), + assetBalances: [], + }; + const owner = '0x6000'; + mockIdentity.portfolios.getPortfolio.mockResolvedValue(mockPortfolio); + mockIdentitiesService.findOne.mockReturnValue(mockIdentity); + + const result = await service.findOne(owner, new BigNumber(0)); + expect(result).toEqual({ + id: new BigNumber(0), + assetBalances: [], + }); + }); + describe('otherwise', () => { it('should call the handleSdkError method and throw an error', async () => { const mockError = new Error('foo'); diff --git a/src/portfolios/portfolios.service.ts b/src/portfolios/portfolios.service.ts index 68188e6a..84a3002d 100644 --- a/src/portfolios/portfolios.service.ts +++ b/src/portfolios/portfolios.service.ts @@ -44,7 +44,7 @@ export class PortfoliosService { portfolioId?: BigNumber ): Promise { const identity = await this.identitiesService.findOne(did); - if (portfolioId) { + if (portfolioId?.gt(0)) { return await identity.portfolios.getPortfolio({ portfolioId }).catch(error => { throw handleSdkError(error); }); From 83d2c7973c490e3ad99078300873163335b2bc4d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 4 May 2023 14:01:47 +0000 Subject: [PATCH 02/19] chore(release): 3.0.0-alpha.4 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [3.0.0-alpha.4](https://github.com/PolymeshAssociation/polymesh-rest-api/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2023-05-04) ### Bug Fixes * ๐Ÿ› finding default portfolio when id 0 is given ([#197](https://github.com/PolymeshAssociation/polymesh-rest-api/issues/197)) ([a8dfae5](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/a8dfae5ed204ea44d3d3f8ad3d1947a2143934b3)) * ๐Ÿ› Upgrade SDK to v20.1.0 ([5e3e291](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/5e3e291dded0f6093f1e81de5f9be719bedb0104)) --- package.json | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 74986254..6855d0fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polymesh-rest-api", - "version": "3.0.0-alpha.3", + "version": "3.0.0-alpha.4", "description": "Provides a REST like interface for interacting with the Polymesh blockchain", "author": "Polymesh Association", "private": true, diff --git a/src/main.ts b/src/main.ts index a99adf16..6b2ceb9d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,7 @@ async function bootstrap(): Promise { const options = new DocumentBuilder() .setTitle(swaggerTitle) .setDescription(swaggerDescription) - .setVersion('3.0.0-alpha.3'); + .setVersion('3.0.0-alpha.4'); const configService = app.get(ConfigService); From 3c865176217e04fb34baa1b095630548d1da987d Mon Sep 17 00:00:00 2001 From: Toms Veidemanis Date: Sat, 22 Jul 2023 22:24:23 +0200 Subject: [PATCH 03/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20register=20identit?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/identities/dto/register-identity.dto.ts | 44 +++++++++++++++++ src/identities/identities.controller.spec.ts | 49 +++++++++++++++++++ src/identities/identities.controller.ts | 28 ++++++++++- src/identities/identities.service.spec.ts | 26 ++++++++++ src/identities/identities.service.ts | 27 ++++++++++ .../models/created-identity.model.ts | 21 ++++++++ src/identities/models/identity.util.ts | 21 ++++++++ src/test-utils/service-mocks.ts | 1 + 8 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 src/identities/dto/register-identity.dto.ts create mode 100644 src/identities/models/created-identity.model.ts create mode 100644 src/identities/models/identity.util.ts diff --git a/src/identities/dto/register-identity.dto.ts b/src/identities/dto/register-identity.dto.ts new file mode 100644 index 00000000..1b4cc399 --- /dev/null +++ b/src/identities/dto/register-identity.dto.ts @@ -0,0 +1,44 @@ +/* istanbul ignore file */ + +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { Type } from 'class-transformer'; +import { IsDate, IsOptional, IsString, ValidateNested } from 'class-validator'; + +import { PermissionedAccountDto } from '~/accounts/dto/permissioned-account.dto'; +import { TransactionBaseDto } from '~/common/dto/transaction-base-dto'; + +export class RegisterIdentityDto extends TransactionBaseDto { + @ApiProperty({ + description: 'Account address for which to create an Identity', + example: '5grwXxxXxxXxxXxxXxxXxxXxxXxxXxxXxxXxxXxxXxxXxxXx', + }) + @IsString() + readonly targetAccount: string; + + @ApiPropertyOptional({ + description: 'Secondary Accounts and their permissions to be added to the Identity', + type: PermissionedAccountDto, + nullable: true, + }) + @IsOptional() + @ValidateNested({ each: true }) + @Type(() => PermissionedAccountDto) + secondaryAccounts?: PermissionedAccountDto[]; + + @ApiPropertyOptional({ + description: + 'Issue a CDD claim for the created DID, completing the onboarding process for the Account', + type: 'boolean', + example: false, + }) + readonly createCdd?: boolean; + + @ApiPropertyOptional({ + description: 'Date at which the Identity will expire (to be used together with createCdd)', + example: new Date(new Date().getTime() + +365 * 24 * 60 * 60 * 1000).toISOString(), + type: 'string', + }) + @IsOptional() + @IsDate() + readonly expiry?: Date; +} diff --git a/src/identities/identities.controller.spec.ts b/src/identities/identities.controller.spec.ts index aa2058df..cf744071 100644 --- a/src/identities/identities.controller.spec.ts +++ b/src/identities/identities.controller.spec.ts @@ -12,6 +12,8 @@ import { ResultSet, } from '@polymeshassociation/polymesh-sdk/types'; +import { PermissionedAccountModel } from '~/accounts/models/permissioned-account.model'; +import { PermissionsModel } from '~/accounts/models/permissions.model'; import { AssetsService } from '~/assets/assets.service'; import { AuthorizationsService } from '~/authorizations/authorizations.service'; import { createAuthorizationRequestModel } from '~/authorizations/authorizations.util'; @@ -20,6 +22,7 @@ import { PendingAuthorizationsModel } from '~/authorizations/models/pending-auth import { ClaimsService } from '~/claims/claims.service'; import { PaginatedResultsModel } from '~/common/models/paginated-results.model'; import { ResultsModel } from '~/common/models/results.model'; +import { RegisterIdentityDto } from '~/identities/dto/register-identity.dto'; import { IdentitiesController } from '~/identities/identities.controller'; import { IdentitiesService } from '~/identities/identities.service'; import * as identityUtil from '~/identities/identities.util'; @@ -607,4 +610,50 @@ describe('IdentitiesController', () => { expect(mockClaimsService.findCddClaimsByDid).toHaveBeenCalledWith(did, true); }); }); + + describe('registerIdentity', () => { + it('should return the transaction details on adding registering an Identity', async () => { + const identity = new MockIdentity(); + const address = 'address'; + identity.getPrimaryAccount.mockResolvedValue({ + account: { address }, + permissions: [], + }); + identity.areSecondaryAccountsFrozen.mockResolvedValue(false); + identity.getSecondaryAccounts.mockResolvedValue({ data: [] }); + + const identityData = new IdentityModel({ + did, + primaryAccount: new PermissionedAccountModel({ + account: new AccountModel({ address }), + permissions: new PermissionsModel({ + assets: null, + portfolios: null, + transactionGroups: [], + transactions: null, + }), + }), + secondaryAccounts: [], + secondaryAccountsFrozen: false, + }); + + const mockData = { + ...txResult, + result: identity, + }; + mockIdentitiesService.registerDid.mockResolvedValue(mockData); + + const data: RegisterIdentityDto = { + signer: 'Ox60', + targetAccount: 'address', + }; + + const result = await controller.registerIdentity(data); + + expect(result).toEqual({ + ...txResult, + identity: identityData, + }); + }); + }); }); diff --git a/src/identities/identities.controller.ts b/src/identities/identities.controller.ts index 6d3a5f1c..218ae2e6 100644 --- a/src/identities/identities.controller.ts +++ b/src/identities/identities.controller.ts @@ -1,4 +1,4 @@ -import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common'; +import { Body, Controller, Get, HttpStatus, Param, Post, Query } from '@nestjs/common'; import { ApiBadRequestResponse, ApiInternalServerErrorResponse, @@ -39,6 +39,7 @@ import { InvestorUniquenessClaimModel } from '~/claims/models/investor-uniquenes import { ApiArrayResponse, ApiArrayResponseReplaceModelProperties, + ApiTransactionFailedResponse, ApiTransactionResponse, } from '~/common/decorators/swagger'; import { PaginatedParamsDto } from '~/common/dto/paginated-params.dto'; @@ -49,9 +50,12 @@ import { handleServiceResult, TransactionResponseModel } from '~/common/utils'; import { DeveloperTestingService } from '~/developer-testing/developer-testing.service'; import { CreateMockIdentityDto } from '~/developer-testing/dto/create-mock-identity.dto'; import { AddSecondaryAccountParamsDto } from '~/identities/dto/add-secondary-account-params.dto'; +import { RegisterIdentityDto } from '~/identities/dto/register-identity.dto'; import { IdentitiesService } from '~/identities/identities.service'; import { createIdentityModel } from '~/identities/identities.util'; +import { CreatedIdentityModel } from '~/identities/models/created-identity.model'; import { IdentityModel } from '~/identities/models/identity.model'; +import { createIdentityResolver } from '~/identities/models/identity.util'; import { PolymeshLogger } from '~/logger/polymesh-logger.service'; import { SettlementsService } from '~/settlements/settlements.service'; import { TickerReservationsService } from '~/ticker-reservations/ticker-reservations.service'; @@ -72,6 +76,28 @@ export class IdentitiesController { logger.setContext(IdentitiesController.name); } + @Post('register') + @ApiOperation({ + summary: 'Register Identity', + description: + 'This endpoint allows registering a new Identity. The transaction signer must be a CDD provider. This might create an Authorization Request which has to be accepted by the target Account.', + }) + @ApiTransactionResponse({ + description: 'Newly created Authorization Request along with transaction details', + type: CreatedIdentityModel, + }) + @ApiTransactionFailedResponse({ + [HttpStatus.BAD_REQUEST]: ['Expiry cannot be set unless a CDD claim is being created'], + }) + async registerIdentity( + @Body() registerIdentityDto: RegisterIdentityDto + ): Promise { + this.logger.debug('Registering new identity'); + const serviceResult = await this.identitiesService.registerDid(registerIdentityDto); + + return handleServiceResult(serviceResult, createIdentityResolver); + } + @Get(':did') @ApiOperation({ summary: 'Get Identity details', diff --git a/src/identities/identities.service.spec.ts b/src/identities/identities.service.spec.ts index 7f4a91c7..c660f96a 100644 --- a/src/identities/identities.service.spec.ts +++ b/src/identities/identities.service.spec.ts @@ -6,6 +6,7 @@ import { BigNumber } from '@polymeshassociation/polymesh-sdk'; import { TxTags } from '@polymeshassociation/polymesh-sdk/types'; import { AccountsService } from '~/accounts/accounts.service'; +import { RegisterIdentityDto } from '~/identities/dto/register-identity.dto'; import { IdentitiesService } from '~/identities/identities.service'; import { mockPolymeshLoggerProvider } from '~/logger/mock-polymesh-logger'; import { POLYMESH_API } from '~/polymesh/polymesh.consts'; @@ -180,4 +181,29 @@ describe('IdentitiesService', () => { }); }); }); + + describe('registerDid', () => { + it('should return the transaction details', async () => { + const transaction = { + blockHash: '0x1', + txHash: '0x2', + blockNumber: new BigNumber(1), + tag: TxTags.identity.CddRegisterDid, + }; + const mockTransaction = new MockTransaction(transaction); + mockTransactionsService.submit.mockResolvedValue({ transactions: [mockTransaction] }); + + const body: RegisterIdentityDto = { + signer, + targetAccount: 'address', + }; + + const result = await service.registerDid(body); + expect(result).toEqual({ + result: undefined, + transactions: [mockTransaction], + }); + expect(mockTransactionsService.submit).toHaveBeenCalled(); + }); + }); }); diff --git a/src/identities/identities.service.ts b/src/identities/identities.service.ts index 0eaf8da4..cdc3413a 100644 --- a/src/identities/identities.service.ts +++ b/src/identities/identities.service.ts @@ -5,11 +5,13 @@ import { Asset, AuthorizationRequest, Identity, + RegisterIdentityParams, ResultSet, } from '@polymeshassociation/polymesh-sdk/types'; import { extractTxBase, ServiceReturn } from '~/common/utils'; import { AddSecondaryAccountParamsDto } from '~/identities/dto/add-secondary-account-params.dto'; +import { RegisterIdentityDto } from '~/identities/dto/register-identity.dto'; import { PolymeshLogger } from '~/logger/polymesh-logger.service'; import { PolymeshService } from '~/polymesh/polymesh.service'; import { TransactionsService } from '~/transactions/transactions.service'; @@ -72,4 +74,29 @@ export class IdentitiesService { return this.transactionsService.submit(inviteAccount, params, base); } + + public async registerDid(registerIdentityDto: RegisterIdentityDto): ServiceReturn { + const { + polymeshService: { polymeshApi }, + } = this; + + const { + base, + args: { targetAccount, secondaryAccounts, createCdd, expiry }, + } = extractTxBase(registerIdentityDto); + + const params = { + targetAccount, + secondaryAccounts: secondaryAccounts?.map(({ secondaryAccount, permissions }) => ({ + secondaryAccount, + permissions: permissions?.toPermissionsLike(), + })), + createCdd, + expiry, + } as RegisterIdentityParams; + + const { registerIdentity } = polymeshApi.identities; + + return this.transactionsService.submit(registerIdentity, params, base); + } } diff --git a/src/identities/models/created-identity.model.ts b/src/identities/models/created-identity.model.ts new file mode 100644 index 00000000..750cd7dd --- /dev/null +++ b/src/identities/models/created-identity.model.ts @@ -0,0 +1,21 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { Type } from 'class-transformer'; + +import { TransactionQueueModel } from '~/common/models/transaction-queue.model'; +import { IdentityModel } from '~/identities/models/identity.model'; + +export class CreatedIdentityModel extends TransactionQueueModel { + @ApiProperty({ + description: 'Static data (and identifiers) of the newly created Dividend Distribution', + type: IdentityModel, + }) + @Type(() => IdentityModel) + readonly identity: IdentityModel; + + constructor(model: CreatedIdentityModel) { + const { transactions, details, ...rest } = model; + super({ transactions, details }); + + Object.assign(this, rest); + } +} diff --git a/src/identities/models/identity.util.ts b/src/identities/models/identity.util.ts new file mode 100644 index 00000000..a55c294d --- /dev/null +++ b/src/identities/models/identity.util.ts @@ -0,0 +1,21 @@ +/** istanbul ignore file */ + +import { Identity } from '@polymeshassociation/polymesh-sdk/types'; + +import { TransactionResolver } from '~/common/utils'; +import { createIdentityModel } from '~/identities/identities.util'; +import { CreatedIdentityModel } from '~/identities/models/created-identity.model'; + +export const createIdentityResolver: TransactionResolver = async ({ + transactions, + details, + result, +}) => { + const identity = await createIdentityModel(result); + + return new CreatedIdentityModel({ + transactions, + details, + identity, + }); +}; diff --git a/src/test-utils/service-mocks.ts b/src/test-utils/service-mocks.ts index 68c2a8a4..7ceb8570 100644 --- a/src/test-utils/service-mocks.ts +++ b/src/test-utils/service-mocks.ts @@ -133,6 +133,7 @@ export class MockIdentitiesService { findHeldAssets = jest.fn(); addSecondaryAccount = jest.fn(); createMockCdd = jest.fn(); + registerDid = jest.fn(); } export class MockSettlementsService { From fcffc4b860dce489eb04b2969199601ad9e4d34b Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Mon, 31 Jul 2023 17:38:11 -0400 Subject: [PATCH 04/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20update=20to=206.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates to be compatible with 6.0 chains BREAKING CHANGE: ๐Ÿงจ Checkpoint Schedules specify dates explictly, reschedule instruction removed - use executeManually instead, InvestorUniquness claim types removed --- README.md | 2 +- package.json | 11 +- .../checkpoints.controller.spec.ts | 18 +- src/checkpoints/checkpoints.controller.ts | 20 +- src/checkpoints/checkpoints.service.spec.ts | 14 +- src/checkpoints/dto/calendar-period.dto.ts | 29 -- .../dto/create-checkpoint-schedule.dto.ts | 41 +- .../models/calendar-period.model.ts | 25 - .../models/checkpoint-schedule.model.ts | 37 +- src/claims/claims.controller.spec.ts | 20 +- src/claims/claims.controller.ts | 21 - src/claims/claims.service.spec.ts | 51 +- src/claims/claims.service.ts | 29 +- src/claims/dto/add-investor-uniqueness.dto.ts | 55 --- src/claims/dto/claim.dto.spec.ts | 34 +- src/claims/dto/claim.dto.ts | 18 +- src/claims/dto/claims-filter.dto.ts | 2 +- .../models/investor-uniqueness-claim.model.ts | 41 -- .../models/trusted-claim-issuer.model.ts | 2 +- .../trusted-claim-issuers.service.spec.ts | 2 +- src/identities/identities.controller.spec.ts | 21 - src/identities/identities.controller.ts | 45 -- .../settlements.controller.spec.ts | 6 +- src/settlements/settlements.controller.ts | 12 +- src/settlements/settlements.service.spec.ts | 7 +- src/settlements/settlements.service.ts | 4 +- src/test-utils/mocks.ts | 7 +- src/test-utils/service-mocks.ts | 2 +- yarn.lock | 464 ++++++------------ 29 files changed, 227 insertions(+), 813 deletions(-) delete mode 100644 src/checkpoints/dto/calendar-period.dto.ts delete mode 100644 src/checkpoints/models/calendar-period.model.ts delete mode 100644 src/claims/dto/add-investor-uniqueness.dto.ts delete mode 100644 src/claims/models/investor-uniqueness-claim.model.ts diff --git a/README.md b/README.md index 06fe80aa..8681a0dd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A REST API wrapper for the Polymesh blockchain. -This version is compatible with chain versions 5.2.x +This version is compatible with chain versions 6.0.x ## Setup diff --git a/package.json b/package.json index 6855d0fd..a04c58f3 100644 --- a/package.json +++ b/package.json @@ -45,11 +45,11 @@ "@nestjs/schedule": "^2.2.0", "@nestjs/swagger": "^6.2.1", "@nestjs/typeorm": "^9.0.1", - "@polymeshassociation/fireblocks-signing-manager": "^1.0.3", - "@polymeshassociation/hashicorp-vault-signing-manager": "^1.1.6", - "@polymeshassociation/local-signing-manager": "^1.3.0", - "@polymeshassociation/polymesh-sdk": "20.1.0", - "@polymeshassociation/signing-manager-types": "^1.2.1", + "@polymeshassociation/fireblocks-signing-manager": "^2.1.0", + "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", + "@polymeshassociation/local-signing-manager": "^2.1.0", + "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.9", + "@polymeshassociation/signing-manager-types": "^2.1.0", "class-transformer": "0.5.1", "class-validator": "^0.14.0", "joi": "17.4.0", @@ -106,6 +106,7 @@ "prettier": "2.3.1", "prettier-eslint": "12.0.0", "prettier-eslint-cli": "5.0.1", + "react": "^18.2.0", "semantic-release": "^19.0.5", "supertest": "6.1.3", "ts-jest": "26.5.4", diff --git a/src/checkpoints/checkpoints.controller.spec.ts b/src/checkpoints/checkpoints.controller.spec.ts index 4a4059f1..e57bc36e 100644 --- a/src/checkpoints/checkpoints.controller.spec.ts +++ b/src/checkpoints/checkpoints.controller.spec.ts @@ -1,6 +1,5 @@ import { Test, TestingModule } from '@nestjs/testing'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { CalendarUnit } from '@polymeshassociation/polymesh-sdk/types'; import { IdentityBalanceModel } from '~/assets/models/identity-balance.model'; import { CheckpointsController } from '~/checkpoints/checkpoints.controller'; @@ -131,12 +130,7 @@ describe('CheckpointsController', () => { { schedule: { id: new BigNumber(1), - period: { - unit: CalendarUnit.Month, - amount: new BigNumber(3), - }, - start: mockDate, - complexity: new BigNumber(4), + pendingPoints: [mockDate], expiryDate: null, }, details: { @@ -154,12 +148,7 @@ describe('CheckpointsController', () => { { id: new BigNumber(1), ticker: 'TICKER', - period: { - unit: CalendarUnit.Month, - amount: new BigNumber(3), - }, - start: mockDate, - complexity: new BigNumber(4), + pendingPoints: [mockDate], expiryDate: null, remainingCheckpoints: new BigNumber(1), nextCheckpointDate: mockDate, @@ -215,8 +204,7 @@ describe('CheckpointsController', () => { const body = { signer: 'signer', start: mockDate, - period: { unit: CalendarUnit.Month, amount: new BigNumber(3) }, - repetitions: new BigNumber(2), + points: [], }; const result = await controller.createSchedule({ ticker: 'TICKER' }, body); diff --git a/src/checkpoints/checkpoints.controller.ts b/src/checkpoints/checkpoints.controller.ts index f3cd71a7..3cff71d4 100644 --- a/src/checkpoints/checkpoints.controller.ts +++ b/src/checkpoints/checkpoints.controller.ts @@ -193,13 +193,11 @@ export class CheckpointsController { const schedules = await this.checkpointsService.findSchedulesByTicker(ticker); return new ResultsModel({ results: schedules.map( - ({ schedule: { id, period, start, complexity, expiryDate }, details }) => + ({ schedule: { id, pendingPoints, expiryDate }, details }) => new CheckpointScheduleModel({ id, ticker, - period, - start, - complexity, + pendingPoints, expiryDate, ...details, }) @@ -234,16 +232,14 @@ export class CheckpointsController { @Param() { ticker, id }: CheckpointScheduleParamsDto ): Promise { const { - schedule: { period, start, complexity, expiryDate }, + schedule: { pendingPoints, expiryDate }, details, } = await this.checkpointsService.findScheduleById(ticker, id); return new CheckpointScheduleModel({ id, - period, - start, ticker, - complexity, + pendingPoints, expiryDate, ...details, }); @@ -251,7 +247,7 @@ export class CheckpointsController { @ApiOperation({ summary: 'Create Schedule', - description: 'This endpoint will create a Schedule that creates Checkpoints periodically', + description: 'This endpoint will create a Schedule that creates future Checkpoints', }) @ApiParam({ name: 'ticker', @@ -279,7 +275,7 @@ export class CheckpointsController { details, }) => { const { - schedule: { id, period, start, complexity, expiryDate }, + schedule: { id, expiryDate, pendingPoints }, details: scheduleDetails, } = await this.checkpointsService.findScheduleById(ticker, createdScheduleId); @@ -287,10 +283,8 @@ export class CheckpointsController { schedule: new CheckpointScheduleModel({ id, ticker, - period, - start, - complexity, expiryDate, + pendingPoints, ...scheduleDetails, }), transactions, diff --git a/src/checkpoints/checkpoints.service.spec.ts b/src/checkpoints/checkpoints.service.spec.ts index 9a44bbc4..9260e0cb 100644 --- a/src/checkpoints/checkpoints.service.spec.ts +++ b/src/checkpoints/checkpoints.service.spec.ts @@ -3,7 +3,7 @@ const mockIsPolymeshTransaction = jest.fn(); import { Test, TestingModule } from '@nestjs/testing'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { CalendarUnit, TxTags } from '@polymeshassociation/polymesh-sdk/types'; +import { TxTags } from '@polymeshassociation/polymesh-sdk/types'; import { AssetsService } from '~/assets/assets.service'; import { CheckpointsService } from '~/checkpoints/checkpoints.service'; @@ -133,10 +133,6 @@ describe('CheckpointsService', () => { { schedule: { id: new BigNumber(1), - period: { - unit: CalendarUnit.Month, - amount: new BigNumber(3), - }, start: new Date(), complexity: new BigNumber(4), expiryDate: null, @@ -266,9 +262,7 @@ describe('CheckpointsService', () => { const mockDate = new Date(); const params = { signer, - start: mockDate, - period: { unit: CalendarUnit.Month, amount: new BigNumber(3) }, - repetitions: new BigNumber(2), + points: [mockDate], }; const result = await service.createScheduleByTicker('TICKER', params); @@ -279,9 +273,7 @@ describe('CheckpointsService', () => { expect(mockTransactionsService.submit).toHaveBeenCalledWith( mockAsset.checkpoints.schedules.create, { - start: mockDate, - period: { unit: CalendarUnit.Month, amount: new BigNumber(3) }, - repetitions: new BigNumber(2), + points: [mockDate], }, { signer, diff --git a/src/checkpoints/dto/calendar-period.dto.ts b/src/checkpoints/dto/calendar-period.dto.ts deleted file mode 100644 index 3cd534dc..00000000 --- a/src/checkpoints/dto/calendar-period.dto.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* istanbul ignore file */ - -import { ApiProperty } from '@nestjs/swagger'; -import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { CalendarUnit } from '@polymeshassociation/polymesh-sdk/types'; -import { IsEnum } from 'class-validator'; - -import { ToBigNumber } from '~/common/decorators/transformation'; -import { IsBigNumber } from '~/common/decorators/validation'; - -export class CalendarPeriodDto { - @ApiProperty({ - description: 'Unit of the period', - type: 'string', - enum: CalendarUnit, - example: CalendarUnit.Month, - }) - @IsEnum(CalendarUnit) - readonly unit: CalendarUnit; - - @ApiProperty({ - description: 'Number of units', - type: 'string', - example: '3', - }) - @IsBigNumber() - @ToBigNumber() - readonly amount: BigNumber; -} diff --git a/src/checkpoints/dto/create-checkpoint-schedule.dto.ts b/src/checkpoints/dto/create-checkpoint-schedule.dto.ts index 380f9447..fcf43e2a 100644 --- a/src/checkpoints/dto/create-checkpoint-schedule.dto.ts +++ b/src/checkpoints/dto/create-checkpoint-schedule.dto.ts @@ -1,48 +1,19 @@ /* istanbul ignore file */ import { ApiProperty } from '@nestjs/swagger'; -import { BigNumber } from '@polymeshassociation/polymesh-sdk'; import { Type } from 'class-transformer'; -import { IsDate, IsOptional, ValidateNested } from 'class-validator'; +import { IsArray } from 'class-validator'; -import { CalendarPeriodDto } from '~/checkpoints/dto/calendar-period.dto'; -import { ToBigNumber } from '~/common/decorators/transformation'; -import { IsBigNumber } from '~/common/decorators/validation'; import { TransactionBaseDto } from '~/common/dto/transaction-base-dto'; export class CreateCheckpointScheduleDto extends TransactionBaseDto { @ApiProperty({ - description: - 'Date from which the Schedule will start creating Checkpoints. A null value means the first Checkpoint will be created immediately', + description: 'An array of dates for when to make Checkpoints', type: 'string', - example: new Date('05/23/2021').toISOString(), - nullable: true, + isArray: true, + example: [new Date('03/23/2030').toISOString(), new Date('03/23/2031').toISOString()], }) - @IsOptional() - @IsDate() + @IsArray() @Type(() => Date) - readonly start: Date | null; - - @ApiProperty({ - description: - 'Periodic interval between Checkpoints. For example, a period of 2 weeks means that a Checkpoint will be created every 2 weeks. A null value means this Schedule creates a single Checkpoint and then expires', - type: CalendarPeriodDto, - nullable: true, - }) - @IsOptional() - @ValidateNested() - @Type(() => CalendarPeriodDto) - readonly period: CalendarPeriodDto | null; - - @ApiProperty({ - description: - 'Number of Checkpoints that should be created by this Schedule. A null or 0 value means infinite Checkpoints (the Schedule never expires)', - type: 'string', - example: '12', - nullable: true, - }) - @IsOptional() - @IsBigNumber() - @ToBigNumber() - readonly repetitions: BigNumber | null; + readonly points: Date[]; } diff --git a/src/checkpoints/models/calendar-period.model.ts b/src/checkpoints/models/calendar-period.model.ts deleted file mode 100644 index 5568f2a5..00000000 --- a/src/checkpoints/models/calendar-period.model.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* istanbul ignore file */ - -import { ApiProperty } from '@nestjs/swagger'; -import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { CalendarUnit } from '@polymeshassociation/polymesh-sdk/types'; - -import { FromBigNumber } from '~/common/decorators/transformation'; - -export class CalendarPeriodModel { - @ApiProperty({ - description: 'Unit of the period', - type: 'string', - enum: CalendarUnit, - example: CalendarUnit.Month, - }) - readonly unit: CalendarUnit; - - @ApiProperty({ - description: 'Number of units', - type: 'string', - example: '3', - }) - @FromBigNumber() - readonly amount: BigNumber; -} diff --git a/src/checkpoints/models/checkpoint-schedule.model.ts b/src/checkpoints/models/checkpoint-schedule.model.ts index c568e41b..9ba1c6f7 100644 --- a/src/checkpoints/models/checkpoint-schedule.model.ts +++ b/src/checkpoints/models/checkpoint-schedule.model.ts @@ -2,9 +2,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { Type } from 'class-transformer'; -import { CalendarPeriodModel } from '~/checkpoints/models/calendar-period.model'; import { FromBigNumber } from '~/common/decorators/transformation'; export class CheckpointScheduleModel { @@ -23,39 +21,26 @@ export class CheckpointScheduleModel { }) readonly ticker: string; - @ApiProperty({ - description: 'Date at which first Checkpoint was created', - type: 'string', - example: new Date('10/14/1987').toISOString(), - }) - readonly start: Date; + // @ApiProperty({ + // description: 'Date at which first Checkpoint was created', + // type: 'string', + // example: new Date('10/14/1987').toISOString(), + // }) + // readonly start: Date; @ApiProperty({ - description: - 'Date at which the last Checkpoint will be created with this Schedule. A null value means that this Schedule never expires', + description: 'Date at which the last Checkpoint will be created', type: 'string', - nullable: true, example: new Date('10/14/1987').toISOString(), }) - readonly expiryDate: Date | null; + readonly expiryDate: Date; @ApiProperty({ - description: - 'Period in which this Schedule creates a Checkpoint. A null value means this Schedule creates a single Checkpoint and then expires', - nullable: true, - type: CalendarPeriodModel, - }) - @Type(() => CalendarPeriodModel) - readonly period: CalendarPeriodModel | null; - - @ApiProperty({ - description: - 'Abstract measure of the complexity of this Schedule. Shorter periods translate into more complexity', + description: 'Dates at which checkpoints will be created', type: 'string', - example: '1', + example: new Date('10/14/1987').toISOString(), }) - @FromBigNumber() - readonly complexity: BigNumber; + readonly pendingPoints: Date[]; @ApiProperty({ description: 'Number of Checkpoints left to be created by the Schedule', diff --git a/src/claims/claims.controller.spec.ts b/src/claims/claims.controller.spec.ts index aa4ae63c..8b82f42c 100644 --- a/src/claims/claims.controller.spec.ts +++ b/src/claims/claims.controller.spec.ts @@ -1,6 +1,6 @@ import { DeepMocked } from '@golevelup/ts-jest'; import { Test } from '@nestjs/testing'; -import { ClaimType, ScopeType } from '@polymeshassociation/polymesh-sdk/types'; +import { ClaimType } from '@polymeshassociation/polymesh-sdk/types'; import { ClaimsController } from '~/claims/claims.controller'; import { ClaimsService } from '~/claims/claims.service'; @@ -76,22 +76,4 @@ describe('ClaimsController', () => { expect(result).toEqual({ ...txResult, results: undefined }); }); }); - - describe('addInvestorUniqueness', () => { - it('should call addInvestorUniqueness method and return transaction data', async () => { - mockClaimsService.addInvestorUniqueness.mockResolvedValue({ ...txResult, result: undefined }); - const mockArgs = { - scope: { type: ScopeType.Identity, value: did }, - cddId: '0x1', - proof: 'proof', - scopeId: 'id', - signer, - }; - const result = await controller.addInvestorUniqueness(mockArgs); - - expect(mockClaimsService.addInvestorUniqueness).toHaveBeenCalledWith(mockArgs); - - expect(result).toEqual({ ...txResult, results: undefined }); - }); - }); }); diff --git a/src/claims/claims.controller.ts b/src/claims/claims.controller.ts index 298d98ff..5370fb30 100644 --- a/src/claims/claims.controller.ts +++ b/src/claims/claims.controller.ts @@ -2,7 +2,6 @@ import { Body, Controller, HttpStatus, Post } from '@nestjs/common'; import { ApiOperation, ApiTags } from '@nestjs/swagger'; import { ClaimsService } from '~/claims/claims.service'; -import { AddInvestorUniquenessDto } from '~/claims/dto/add-investor-uniqueness.dto'; import { ModifyClaimsDto } from '~/claims/dto/modify-claims.dto'; import { ApiTransactionFailedResponse, ApiTransactionResponse } from '~/common/decorators/swagger'; import { TransactionQueueModel } from '~/common/models/transaction-queue.model'; @@ -78,24 +77,4 @@ export class ClaimsController { return handleServiceResult(serviceResult); } - - @ApiOperation({ - summary: 'Add Investor uniqueness Claims to the signing Identity', - description: 'This endpoint will add Investor uniqueness Claims to the signing Identity', - }) - @ApiTransactionResponse({ - description: 'Transaction response', - type: TransactionQueueModel, - }) - @ApiTransactionFailedResponse({ - [HttpStatus.UNPROCESSABLE_ENTITY]: ['Account does not have the required roles or permissions'], - }) - @Post('add-investor-uniqueness') - async addInvestorUniqueness( - @Body() args: AddInvestorUniquenessDto - ): Promise { - const serviceResult = await this.claimsService.addInvestorUniqueness(args); - - return handleServiceResult(serviceResult); - } } diff --git a/src/claims/claims.service.spec.ts b/src/claims/claims.service.spec.ts index b79efc9b..190e8dab 100644 --- a/src/claims/claims.service.spec.ts +++ b/src/claims/claims.service.spec.ts @@ -1,12 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { - ClaimData, - ClaimType, - ResultSet, - ScopeType, - TxTags, -} from '@polymeshassociation/polymesh-sdk/types'; +import { ClaimData, ClaimType, ResultSet, TxTags } from '@polymeshassociation/polymesh-sdk/types'; import { ClaimsService } from '~/claims/claims.service'; import { POLYMESH_API } from '~/polymesh/polymesh.consts'; @@ -254,47 +248,4 @@ describe('ClaimsService', () => { expect(mockPolymeshApi.claims.getClaimScopes).toHaveBeenCalledWith({ target: did }); }); }); - - describe('addInvestorUniqueness', () => { - it('should run a addInvestorUniquenessClaim procedure and return the queue results', async () => { - const mockTransactions = { - blockHash: '0x1', - txHash: '0x2', - blockNumber: new BigNumber(1), - tag: TxTags.identity.AddInvestorUniquenessClaim, - }; - - const mockArgs = { - scope: { type: ScopeType.Identity, value: did }, - cddId: '0x1', - proof: 'proof', - scopeId: 'id', - }; - const mockTransaction = new MockTransaction(mockTransactions); - - mockTransactionsService.submit.mockResolvedValue(mockTransaction); - - const result = await claimsService.addInvestorUniqueness({ signer, ...mockArgs }); - - expect(result).toBe(mockTransaction); - - expect(mockTransactionsService.submit).toHaveBeenCalledWith( - mockPolymeshApi.claims.addInvestorUniquenessClaim, - mockArgs, - { signer } - ); - }); - }); - - describe('getInvestorUniqueness', () => { - it('should run a getInvestorUniquenessClaims procedure and return the result', async () => { - const claimsResult = [] as ClaimData[]; - - mockPolymeshApi.claims.getInvestorUniquenessClaims.mockResolvedValue(claimsResult); - - const result = await claimsService.getInvestorUniquenessClaims(did, true); - - expect(result).toBe(claimsResult); - }); - }); }); diff --git a/src/claims/claims.service.ts b/src/claims/claims.service.ts index f2dae664..f6664c69 100644 --- a/src/claims/claims.service.ts +++ b/src/claims/claims.service.ts @@ -2,19 +2,16 @@ import { Injectable } from '@nestjs/common'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; import { AddClaimsParams, - AddInvestorUniquenessClaimParams, CddClaim, ClaimData, ClaimScope, ClaimType, - InvestorUniquenessClaim, ModifyClaimsParams, ResultSet, RevokeClaimsParams, Scope, } from '@polymeshassociation/polymesh-sdk/types'; -import { AddInvestorUniquenessDto } from '~/claims/dto/add-investor-uniqueness.dto'; import { ModifyClaimsDto } from '~/claims/dto/modify-claims.dto'; import { extractTxBase, ServiceReturn } from '~/common/utils'; import { PolymeshService } from '~/polymesh/polymesh.service'; @@ -44,7 +41,7 @@ export class ClaimsService { public async findAssociatedByDid( target: string, scope?: Scope, - claimTypes?: Exclude[], + claimTypes?: ClaimType[], includeExpired?: boolean, size?: BigNumber, start?: BigNumber @@ -95,20 +92,6 @@ export class ClaimsService { }); } - public async addInvestorUniqueness( - modifyClaimsDto: AddInvestorUniquenessDto - ): ServiceReturn { - const { base, args } = extractTxBase(modifyClaimsDto); - - const { addInvestorUniquenessClaim } = this.polymeshService.polymeshApi.claims; - - return this.transactionsService.submit( - addInvestorUniquenessClaim, - args as AddInvestorUniquenessClaimParams, - base - ); - } - public async findCddClaimsByDid( target: string, includeExpired = true @@ -118,14 +101,4 @@ export class ClaimsService { includeExpired, }); } - - public async getInvestorUniquenessClaims( - target: string, - includeExpired = true - ): Promise[]> { - return await this.polymeshService.polymeshApi.claims.getInvestorUniquenessClaims({ - target, - includeExpired, - }); - } } diff --git a/src/claims/dto/add-investor-uniqueness.dto.ts b/src/claims/dto/add-investor-uniqueness.dto.ts deleted file mode 100644 index a5af419f..00000000 --- a/src/claims/dto/add-investor-uniqueness.dto.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* istanbul ignore file */ - -import { ApiExtraModels, ApiProperty } from '@nestjs/swagger'; -import { Type } from 'class-transformer'; -import { IsDate, IsOptional, IsString, ValidateIf } from 'class-validator'; - -import { ScopeClaimProofDto } from '~/claims/dto/scope-claim-proof.dto'; -import { ScopeDto } from '~/claims/dto/scope.dto'; -import { ApiPropertyOneOf } from '~/common/decorators/swagger'; -import { TransactionBaseDto } from '~/common/dto/transaction-base-dto'; - -@ApiExtraModels(ScopeClaimProofDto) -export class AddInvestorUniquenessDto extends TransactionBaseDto { - @ApiProperty({ - description: 'The type of Claim. Note that different types require different fields', - }) - @Type(() => ScopeDto) - readonly scope: ScopeDto; - - @ApiProperty({ - description: 'The CDD ID of the investor', - example: '0x0600000000000000000000000000000000000000000000000000000000000000', - }) - @IsString() - readonly cddId: string; - - @ApiPropertyOneOf({ - description: 'The proof of the claim', - union: [ - { - type: 'string', - example: '0x0600000000000000000000000000000000000000000000000000000000000000', - }, - ScopeClaimProofDto, - ], - }) - @ValidateIf(({ proof }) => typeof proof !== 'string') - @Type(() => ScopeClaimProofDto) - readonly proof: string | ScopeClaimProofDto; - - @ApiProperty({ - description: 'The scope ID of the claim', - example: '0x0600000000000000000000000000000000000000000000000000000000000000', - }) - @IsString() - readonly scopeId: string; - - @ApiProperty({ - description: 'The expiry date of the claim', - example: '2020-01-01', - }) - @IsOptional() - @IsDate() - readonly expiry?: Date; -} diff --git a/src/claims/dto/claim.dto.spec.ts b/src/claims/dto/claim.dto.spec.ts index 43115119..0a4eab69 100644 --- a/src/claims/dto/claim.dto.spec.ts +++ b/src/claims/dto/claim.dto.spec.ts @@ -81,27 +81,6 @@ describe('claimsDto', () => { scope, }, ], - [ - 'InvestorUniqueness claim with `scope`', - { - type: ClaimType.InvestorUniqueness, - scope, - cddId: '0x60000000000000000000000000000000', - }, - ], - [ - 'NoData claim with no additional fields', - { - type: ClaimType.NoData, - }, - ], - [ - 'InvestorUniquenessV2 with `cddId`', - { - type: ClaimType.InvestorUniquenessV2, - cddId: '0x60000000000000000000000000000000', - }, - ], [ 'Accredited with valid `issuers`', { @@ -160,17 +139,6 @@ describe('claimsDto', () => { }, ['scope.type must be one of the following values: Identity, Ticker, Custom'], ], - [ - 'InvestorUniquenessV2 without `cddId`', - { - type: ClaimType.InvestorUniquenessV2, - }, - [ - 'cddId must be a hexadecimal number', - 'cddId must start with "0x"', - 'cddId must be 34 characters long', - ], - ], [ 'CustomerDueDiligence without `cddId`', { @@ -195,7 +163,7 @@ describe('claimsDto', () => { ], }, [ - 'trustedClaimIssuers.0.each value in trustedFor must be one of the following values: Accredited, Affiliate, BuyLockup, SellLockup, CustomerDueDiligence, KnowYourCustomer, Jurisdiction, Exempted, Blocked, InvestorUniqueness, NoType, NoData, InvestorUniquenessV2', + 'trustedClaimIssuers.0.each value in trustedFor must be one of the following values: Accredited, Affiliate, BuyLockup, SellLockup, CustomerDueDiligence, KnowYourCustomer, Jurisdiction, Exempted, Blocked', ], ], ]; diff --git a/src/claims/dto/claim.dto.ts b/src/claims/dto/claim.dto.ts index 1484ed1b..5ba8dc99 100644 --- a/src/claims/dto/claim.dto.ts +++ b/src/claims/dto/claim.dto.ts @@ -2,11 +2,7 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { ClaimType, CountryCode } from '@polymeshassociation/polymesh-sdk/types'; -import { - isCddClaim, - isInvestorUniquenessV2Claim, - isNoDataClaim, -} from '@polymeshassociation/polymesh-sdk/utils'; +import { isCddClaim } from '@polymeshassociation/polymesh-sdk/utils'; import { Type } from 'class-transformer'; import { IsEnum, IsNotEmptyObject, IsOptional, ValidateIf, ValidateNested } from 'class-validator'; @@ -28,9 +24,7 @@ export class ClaimDto { 'The scope of the Claim. Required for most types except for `CustomerDueDiligence`, `InvestorUniquenessV2` and `NoData`', type: ScopeDto, }) - @ValidateIf( - claim => !isNoDataClaim(claim) && !isCddClaim(claim) && !isInvestorUniquenessV2Claim(claim) - ) + @ValidateIf(claim => !isCddClaim(claim)) @ValidateNested() @Type(() => ScopeDto) @IsNotEmptyObject() @@ -49,13 +43,7 @@ export class ClaimDto { description: 'cddId for `CustomerDueDiligence` and `InvestorUniqueness` type Claims', example: '0x60000000000000000000000000000000', }) - @ValidateIf(({ type }) => - [ - ClaimType.InvestorUniqueness, - ClaimType.InvestorUniquenessV2, - ClaimType.CustomerDueDiligence, - ].includes(type) - ) + @ValidateIf(({ type }) => [ClaimType.CustomerDueDiligence].includes(type)) @IsCddId() cddId?: string; diff --git a/src/claims/dto/claims-filter.dto.ts b/src/claims/dto/claims-filter.dto.ts index 1ab37a25..1cf493ea 100644 --- a/src/claims/dto/claims-filter.dto.ts +++ b/src/claims/dto/claims-filter.dto.ts @@ -8,5 +8,5 @@ import { IncludeExpiredFilterDto } from '~/common/dto/params.dto'; export class ClaimsFilterDto extends IncludeExpiredFilterDto { @IsEnum(ClaimType, { each: true }) @IsOptional() - readonly claimTypes?: Exclude[]; + readonly claimTypes?: ClaimType[]; } diff --git a/src/claims/models/investor-uniqueness-claim.model.ts b/src/claims/models/investor-uniqueness-claim.model.ts deleted file mode 100644 index 974b58bc..00000000 --- a/src/claims/models/investor-uniqueness-claim.model.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* istanbul ignore file */ - -import { ApiProperty } from '@nestjs/swagger'; -import { ClaimType } from '@polymeshassociation/polymesh-sdk/types'; -import { Type } from 'class-transformer'; - -import { ScopeModel } from '~/claims/models/scope.model'; - -export class InvestorUniquenessClaimModel { - @ApiProperty({ - type: 'string', - description: 'Claim type', - example: 'InvestorUniqueness', - }) - readonly type: ClaimType.InvestorUniqueness; - - @ApiProperty({ - type: ScopeModel, - description: 'Scope of the Claim', - }) - @Type(() => ScopeModel) - readonly scope: ScopeModel; - - @ApiProperty({ - type: 'string', - description: 'CDD ID of the Claim', - example: '0x0600000000000000000000000000000000000000000000000000000000000000', - }) - readonly cddId: string; - - @ApiProperty({ - type: 'string', - description: 'Scope ID of the Claim', - example: '0x0600000000000000000000000000000000000000000000000000000000000000', - }) - readonly scopeId: string; - - constructor(model: InvestorUniquenessClaimModel) { - Object.assign(this, model); - } -} diff --git a/src/compliance/models/trusted-claim-issuer.model.ts b/src/compliance/models/trusted-claim-issuer.model.ts index 1a4f07c3..d5e71aa9 100644 --- a/src/compliance/models/trusted-claim-issuer.model.ts +++ b/src/compliance/models/trusted-claim-issuer.model.ts @@ -15,7 +15,7 @@ export class TrustedClaimIssuerModel { type: 'string', enum: ClaimType, isArray: true, - example: [ClaimType.Accredited, ClaimType.InvestorUniqueness], + example: [ClaimType.Accredited, ClaimType.Affiliate], nullable: true, }) readonly trustedFor: ClaimType[] | null; diff --git a/src/compliance/trusted-claim-issuers.service.spec.ts b/src/compliance/trusted-claim-issuers.service.spec.ts index 953547d0..a6a0ce11 100644 --- a/src/compliance/trusted-claim-issuers.service.spec.ts +++ b/src/compliance/trusted-claim-issuers.service.spec.ts @@ -35,7 +35,7 @@ describe('TrustedClaimIssuersService', () => { const mockClaimIssuers = [ { identity: 'Ox6'.padEnd(66, '0'), - trustedFor: [ClaimType.Accredited, ClaimType.InvestorUniqueness], + trustedFor: [ClaimType.Accredited, ClaimType.Affiliate], }, ]; diff --git a/src/identities/identities.controller.spec.ts b/src/identities/identities.controller.spec.ts index aa2058df..eb8e9a91 100644 --- a/src/identities/identities.controller.spec.ts +++ b/src/identities/identities.controller.spec.ts @@ -8,7 +8,6 @@ import { ClaimScope, ClaimType, GenericAuthorizationData, - InvestorUniquenessClaim, ResultSet, } from '@polymeshassociation/polymesh-sdk/types'; @@ -555,26 +554,6 @@ describe('IdentitiesController', () => { expect(mockClaimsService.findClaimScopesByDid).toHaveBeenCalledWith(did); }); }); - - describe('getInvestorUniquenessClaims', () => { - it('should call the service and return the InvestorUniquenessClaims', async () => { - const includeExpired = true; - const mockClaimList = [{}]; - - mockClaimsService.getInvestorUniquenessClaims.mockResolvedValue( - mockClaimList as unknown as ClaimData[] - ); - - const result = await controller.getInvestorUniquenessClaims({ did }, { includeExpired }); - - expect(result).toEqual({ results: mockClaimList }); - expect(mockClaimsService.getInvestorUniquenessClaims).toHaveBeenCalledWith( - did, - includeExpired - ); - }); - }); - describe('getCddClaims', () => { const date = new Date().toISOString(); const mockCddClaims = [ diff --git a/src/identities/identities.controller.ts b/src/identities/identities.controller.ts index 6d3a5f1c..6638035a 100644 --- a/src/identities/identities.controller.ts +++ b/src/identities/identities.controller.ts @@ -35,7 +35,6 @@ import { ClaimsFilterDto } from '~/claims/dto/claims-filter.dto'; import { CddClaimModel } from '~/claims/models/cdd-claim.model'; import { ClaimScopeModel } from '~/claims/models/claim-scope.model'; import { ClaimModel } from '~/claims/models/claim.model'; -import { InvestorUniquenessClaimModel } from '~/claims/models/investor-uniqueness-claim.model'; import { ApiArrayResponse, ApiArrayResponseReplaceModelProperties, @@ -575,48 +574,4 @@ export class IdentitiesController { return new ResultsModel({ results }); } - - @ApiTags('claims') - @ApiOperation({ - summary: 'Retrieve the list of InvestorUniqueness claims for a target Identity', - description: - 'This endpoint will provide a list of all the InvestorUniquenessClaims made about an Identity', - }) - @ApiParam({ - name: 'did', - description: 'The DID of the Identity for which to fetch InvestorUniquenessClaims', - type: 'string', - example: '0x0600000000000000000000000000000000000000000000000000000000000000', - }) - @ApiQuery({ - name: 'includeExpired', - description: - 'Indicates whether to include expired InvestorUniquenessClaims or not. Defaults to true', - type: 'boolean', - required: false, - }) - @ApiArrayResponseReplaceModelProperties( - ClaimModel, - { - description: 'List of InvestorUniquenessClaims for the given DID', - paginated: false, - }, - { claim: InvestorUniquenessClaimModel } - ) - @Get(':did/investor-uniqueness-claims') - async getInvestorUniquenessClaims( - @Param() { did }: DidDto, - @Query() { includeExpired }: IncludeExpiredFilterDto - ): Promise>> { - const investorUniquenessClaims = await this.claimsService.getInvestorUniquenessClaims( - did, - includeExpired - ); - - const results = investorUniquenessClaims.map( - claim => new ClaimModel(claim) - ); - - return { results }; - } } diff --git a/src/settlements/settlements.controller.spec.ts b/src/settlements/settlements.controller.spec.ts index cc842a93..bc577553 100644 --- a/src/settlements/settlements.controller.spec.ts +++ b/src/settlements/settlements.controller.spec.ts @@ -141,11 +141,11 @@ describe('SettlementsController', () => { }); }); - describe('rescheduleInstruction', () => { + describe('manuallyExecuteInstruction', () => { it('should reschedule a failed instruction and return the data returned by the service', async () => { - mockSettlementsService.rescheduleInstruction.mockResolvedValue(txResult); + mockSettlementsService.manuallyExecuteInstruction.mockResolvedValue(txResult); - const result = await controller.rescheduleInstruction( + const result = await controller.manuallyExecuteInstruction( { id: new BigNumber(3) }, { signer: 'signer' } ); diff --git a/src/settlements/settlements.controller.ts b/src/settlements/settlements.controller.ts index 7f37ceaf..3c5b417a 100644 --- a/src/settlements/settlements.controller.ts +++ b/src/settlements/settlements.controller.ts @@ -177,8 +177,8 @@ export class SettlementsController { @ApiTags('instructions') @ApiOperation({ - summary: 'Reschedule a failed Instruction', - description: 'This endpoint will reschedule a failed Instruction', + summary: 'Manually execute an Instruction', + description: 'This endpoint will execute an Instruction', }) @ApiParam({ name: 'id', @@ -192,16 +192,16 @@ export class SettlementsController { }) @ApiTransactionFailedResponse({ [HttpStatus.UNPROCESSABLE_ENTITY]: [ - 'Only transaction with status code `Failed` can be rescheduled', + 'Only Instruction with status code `Failed` or of type "Manual" can be executed manually', ], [HttpStatus.NOT_FOUND]: ['The Instruction with the given ID was not found'], }) - @Post('instructions/:id/reschedule') - public async rescheduleInstruction( + @Post('instructions/:id/manuallyExecute') + public async manuallyExecuteInstruction( @Param() { id }: IdParamsDto, @Body() signerDto: TransactionBaseDto ): Promise { - const result = await this.settlementsService.rescheduleInstruction(id, signerDto); + const result = await this.settlementsService.manuallyExecuteInstruction(id, signerDto); return handleServiceResult(result); } diff --git a/src/settlements/settlements.service.spec.ts b/src/settlements/settlements.service.spec.ts index b04f1fc2..e7ffa894 100644 --- a/src/settlements/settlements.service.spec.ts +++ b/src/settlements/settlements.service.spec.ts @@ -433,13 +433,14 @@ describe('SettlementsService', () => { tag: TxTags.settlement.RescheduleInstruction, }; const mockTransaction = new MockTransaction(transaction); + const id = new BigNumber(123); mockTransactionsService.submit.mockResolvedValue({ transactions: [mockTransaction] }); const findInstructionSpy = jest.spyOn(service, 'findInstruction'); // eslint-disable-next-line @typescript-eslint/no-explicit-any findInstructionSpy.mockResolvedValue(mockInstruction as any); - const result = await service.rescheduleInstruction(new BigNumber(123), { + const result = await service.manuallyExecuteInstruction(id, { signer, }); @@ -448,8 +449,8 @@ describe('SettlementsService', () => { transactions: [mockTransaction], }); expect(mockTransactionsService.submit).toHaveBeenCalledWith( - mockInstruction.reschedule, - {}, + mockInstruction.executeManually, + { id }, { signer } ); }); diff --git a/src/settlements/settlements.service.ts b/src/settlements/settlements.service.ts index 3600c611..63e0b6ff 100644 --- a/src/settlements/settlements.service.ts +++ b/src/settlements/settlements.service.ts @@ -152,12 +152,12 @@ export class SettlementsService { return this.transactionsService.submit(instruction.withdraw, {}, signerDto); } - public async rescheduleInstruction( + public async manuallyExecuteInstruction( id: BigNumber, signerDto: TransactionBaseDto ): ServiceReturn { const instruction = await this.findInstruction(id); - return this.transactionsService.submit(instruction.reschedule, {}, signerDto); + return this.transactionsService.submit(instruction.executeManually, { id }, signerDto); } } diff --git a/src/test-utils/mocks.ts b/src/test-utils/mocks.ts index 97fe08b7..390e7e3f 100644 --- a/src/test-utils/mocks.ts +++ b/src/test-utils/mocks.ts @@ -10,7 +10,6 @@ import { import { Account, AuthorizationType, - CalendarUnit, HistoricSettlement, MetadataEntry, MetadataType, @@ -245,7 +244,7 @@ export class MockInstruction { public getLegs = jest.fn(); public getAffirmations = jest.fn(); public withdraw = jest.fn(); - public reschedule = jest.fn(); + public executeManually = jest.fn(); } export class MockVenue { @@ -315,10 +314,8 @@ export class MockCheckpoint { export class MockCheckpointSchedule { id = new BigNumber(1); ticker = 'TICKER'; - period = { unit: CalendarUnit.Month, amount: new BigNumber(3) }; - start = new Date('10/14/1987'); + pendingPoints = [new Date('10/14/1987')]; expiryDate = new Date('10/14/2000'); - complexity = new BigNumber(4); } export class MockAuthorizationRequest { diff --git a/src/test-utils/service-mocks.ts b/src/test-utils/service-mocks.ts index 68c2a8a4..031cf5d7 100644 --- a/src/test-utils/service-mocks.ts +++ b/src/test-utils/service-mocks.ts @@ -148,7 +148,7 @@ export class MockSettlementsService { findPendingInstructionsByDid = jest.fn(); findVenuesByOwner = jest.fn(); withdrawAffirmation = jest.fn(); - rescheduleInstruction = jest.fn(); + manuallyExecuteInstruction = jest.fn(); } export class MockClaimsService { diff --git a/yarn.lock b/yarn.lock index 84c0e885..63861605 100644 --- a/yarn.lock +++ b/yarn.lock @@ -80,6 +80,25 @@ ora "5.4.1" rxjs "6.6.7" +"@apollo/client@^3.7.10": + version "3.7.17" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.7.17.tgz#1d2538729fd8ef138aa301a7cf62704474e57b72" + integrity sha512-0EErSHEtKPNl5wgWikHJbKFAzJ/k11O0WO2QyqZSHpdxdAnw7UWHY4YiLbHCFG7lhrD+NTQ3Z/H9Jn4rcikoJA== + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + "@wry/context" "^0.7.0" + "@wry/equality" "^0.5.0" + "@wry/trie" "^0.4.0" + graphql-tag "^2.12.6" + hoist-non-react-statics "^3.3.2" + optimism "^0.16.2" + prop-types "^15.7.2" + response-iterator "^0.2.6" + symbol-observable "^4.0.0" + ts-invariant "^0.10.3" + tslib "^2.3.0" + zen-observable-ts "^1.2.5" + "@babel/code-frame@7.12.11": version "7.12.11" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" @@ -353,13 +372,6 @@ "@babel/helper-simple-access" "^7.14.8" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/runtime@^7.18.6", "@babel/runtime@^7.20.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd" - integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ== - dependencies: - regenerator-runtime "^0.13.11" - "@babel/runtime@^7.20.13": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" @@ -367,6 +379,13 @@ dependencies: regenerator-runtime "^0.13.11" +"@babel/runtime@^7.20.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd" + integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ== + dependencies: + regenerator-runtime "^0.13.11" + "@babel/template@^7.14.5", "@babel/template@^7.3.3": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" @@ -579,6 +598,11 @@ resolved "https://registry.yarnpkg.com/@golevelup/ts-jest/-/ts-jest-0.3.3.tgz#f9901f3eaaa7fd366d97538d2fc859ffc3052693" integrity sha512-gut5EhD2S7W1p+C/IsUS1o0P5SHgxsN9TqHyRTjG+rfycniLNBfvIWZPEizpsTev/lR10/XOTpE0YicxPme2+Q== +"@graphql-typed-document-node/core@^3.1.1": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" + integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== + "@hapi/hoek@^9.0.0": version "9.2.0" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131" @@ -994,21 +1018,11 @@ dependencies: uuid "8.3.2" -"@noble/hashes@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" - integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== - "@noble/hashes@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== -"@noble/secp256k1@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.0.tgz#602afbbfcfb7e169210469b697365ef740d7e930" - integrity sha512-DWSsg8zMHOYMYBqIQi96BQuthZrp98LCeMNcUOaffCIVYQ5yxDbNikLF+H7jEnmNNmXbtVic46iCuVWzar+MgA== - "@noble/secp256k1@1.7.1": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" @@ -1418,15 +1432,6 @@ "@polkadot/util" "10.4.2" "@substrate/ss58-registry" "^1.38.0" -"@polkadot/networks@9.7.2": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-9.7.2.tgz#9064f0578b293245bee263367d6f1674eb06e506" - integrity sha512-oMAdF8Y9CLBI0EUZBcycHcvbQQdbkJHevPJ/lwnZXJTaueXuav/Xm2yiFj5J3V8meIjLocURlMawgsAVItXOBQ== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/util" "9.7.2" - "@substrate/ss58-registry" "^1.23.0" - "@polkadot/rpc-augment@9.14.2": version "9.14.2" resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-9.14.2.tgz#eb70d5511463dab8d995faeb77d4edfe4952fe26" @@ -1549,23 +1554,6 @@ ed2curve "^0.3.0" tweetnacl "^1.0.3" -"@polkadot/util-crypto@^9.0.1": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-9.7.2.tgz#0a097f4e197cd344d101ab748a740c2d99a4c5b9" - integrity sha512-tfz6mJtPwoNteivKCmR+QklC4mr1/hGZRsDJLWKaFhanDinYZ3V2pJM1EbCI6WONLuuzlTxsDXjAffWzzRqlPA== - dependencies: - "@babel/runtime" "^7.18.6" - "@noble/hashes" "1.1.2" - "@noble/secp256k1" "1.6.0" - "@polkadot/networks" "9.7.2" - "@polkadot/util" "9.7.2" - "@polkadot/wasm-crypto" "^6.2.2" - "@polkadot/x-bigint" "9.7.2" - "@polkadot/x-randomvalues" "9.7.2" - "@scure/base" "1.1.1" - ed2curve "^0.3.0" - tweetnacl "^1.0.3" - "@polkadot/util@10.4.2", "@polkadot/util@^10.4.2": version "10.4.2" resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-10.4.2.tgz#df41805cb27f46b2b4dad24c371fa2a68761baa1" @@ -1579,20 +1567,6 @@ "@types/bn.js" "^5.1.1" bn.js "^5.2.1" -"@polkadot/util@9.7.2", "@polkadot/util@^9.0.1": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-9.7.2.tgz#0f97fa92b273e6ce4b53fe869a957ac99342007d" - integrity sha512-ivTmA+KkPCq5i3O0Gk+dTds/hwdwlYCh89aKfeaG9ni3XHUbbuBgTqHneo648HqxwAwSAyiDiwE9EdXrzAdO4Q== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-bigint" "9.7.2" - "@polkadot/x-global" "9.7.2" - "@polkadot/x-textdecoder" "9.7.2" - "@polkadot/x-textencoder" "9.7.2" - "@types/bn.js" "^5.1.0" - bn.js "^5.2.1" - ip-regex "^4.3.0" - "@polkadot/wasm-bridge@6.4.1": version "6.4.1" resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-6.4.1.tgz#e97915dd67ba543ec3381299c2a5b9330686e27e" @@ -1625,7 +1599,7 @@ "@babel/runtime" "^7.20.6" "@polkadot/wasm-util" "6.4.1" -"@polkadot/wasm-crypto@^6.2.2", "@polkadot/wasm-crypto@^6.4.1": +"@polkadot/wasm-crypto@^6.4.1": version "6.4.1" resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-6.4.1.tgz#79310e23ad1ca62362ba893db6a8567154c2536a" integrity sha512-FH+dcDPdhSLJvwL0pMLtn/LIPd62QDPODZRCmDyw+pFjLOMaRBc7raomWUOqyRWJTnqVf/iscc2rLVLNMyt7ag== @@ -1652,14 +1626,6 @@ "@babel/runtime" "^7.20.13" "@polkadot/x-global" "10.4.2" -"@polkadot/x-bigint@9.7.2": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-9.7.2.tgz#ec79977335dce173a81e45247bdfd46f3b301702" - integrity sha512-qi8/DTGypFSt5vvNOsYcEaqH72lymfyidGlsHlZ6e7nNASnEhk/NaOcINiTr1ds+fpu4dtKXWAIPZufujf2JeQ== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "9.7.2" - "@polkadot/x-fetch@^10.4.2": version "10.4.2" resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-10.4.2.tgz#bc6ba70de71a252472fbe36180511ed920e05f05" @@ -1677,13 +1643,6 @@ dependencies: "@babel/runtime" "^7.20.13" -"@polkadot/x-global@9.7.2": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-9.7.2.tgz#9847fd1da13989f321ca621e85477ba70fd8d55a" - integrity sha512-3NN5JhjosaelaFWBJSlv9mb/gDAlt7RuZ8NKlOjB+LQHd9g6ZbnYi5wwjW+i/x/3E4IVbBx66uvWgNaw7IBrkg== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-randomvalues@10.4.2": version "10.4.2" resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-10.4.2.tgz#895f1220d5a4522a83d8d5014e3c1e03b129893e" @@ -1692,14 +1651,6 @@ "@babel/runtime" "^7.20.13" "@polkadot/x-global" "10.4.2" -"@polkadot/x-randomvalues@9.7.2": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-9.7.2.tgz#d580b0e9149ea22b2afebba5d7b1368371f7086d" - integrity sha512-819slnXNpoVtqdhjI19ao7w5m+Zwx11VfwCZkFQypVv3b/1UEoKG/baJA9dVI6yMvhnBN//i8mLgNy3IXWbVVw== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "9.7.2" - "@polkadot/x-textdecoder@10.4.2": version "10.4.2" resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-10.4.2.tgz#93202f3e5ad0e7f75a3fa02d2b8a3343091b341b" @@ -1708,14 +1659,6 @@ "@babel/runtime" "^7.20.13" "@polkadot/x-global" "10.4.2" -"@polkadot/x-textdecoder@9.7.2": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-9.7.2.tgz#c94ea6c8f510fdf579659248ede9421854e32b42" - integrity sha512-hhrMNZwJBmusdpqjDRpOHZoMB4hpyJt9Gu9Bi9is7/D/vq/hpxq8z7s6NxrbRyXJf1SIk6NMK0jf5XjRLdKdbw== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "9.7.2" - "@polkadot/x-textencoder@10.4.2": version "10.4.2" resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-10.4.2.tgz#cd2e6c8a66b0b400a73f0164e99c510fb5c83501" @@ -1724,14 +1667,6 @@ "@babel/runtime" "^7.20.13" "@polkadot/x-global" "10.4.2" -"@polkadot/x-textencoder@9.7.2": - version "9.7.2" - resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-9.7.2.tgz#2ae29fa5ca2c0353e7a1913eef710b2d45bdf0b2" - integrity sha512-GHbSdbMPixDAOnJ9cvL/x9sPNeHegPoDSqCAzY5H6/zHc/fNn0vUu0To9VpPgPhp/Jb9dbc0h8YqEyvOcOlphw== - dependencies: - "@babel/runtime" "^7.18.6" - "@polkadot/x-global" "9.7.2" - "@polkadot/x-ws@^10.4.2": version "10.4.2" resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-10.4.2.tgz#4e9d88f37717570ccf942c6f4f63b06260f45025" @@ -1742,49 +1677,43 @@ "@types/websocket" "^1.0.5" websocket "^1.0.34" -"@polymeshassociation/fireblocks-signing-manager@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@polymeshassociation/fireblocks-signing-manager/-/fireblocks-signing-manager-1.0.3.tgz#7341341e82cd1a8231b33a019c962c209efec222" - integrity sha512-kDEUtIEU5iDbc+XCndbX8oO/PQ13nT39YP+AK0tIjzkIwLwDvWb8Pf8BJuHgymiRvmR9MxHLIMSADlwUYNcjAw== +"@polymeshassociation/fireblocks-signing-manager@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@polymeshassociation/fireblocks-signing-manager/-/fireblocks-signing-manager-2.1.0.tgz#eda9af552b862ba14bad20682c6a59e69347192b" + integrity sha512-YVRvjEVhzS+WPHx95rNgOnRRgjjYijRjcriG+iGeHcQWprZnxGuVUlsaz+MvmxoySo/XtAHzavOzzMZfQyaL2g== dependencies: - "@polkadot/util" "^9.0.1" - "@polkadot/util-crypto" "^9.0.1" - "@polymeshassociation/signing-manager-types" "^1.2.1" + "@polkadot/util" "^10.4.2" + "@polkadot/util-crypto" "^10.4.2" + "@polymeshassociation/signing-manager-types" "^2.1.0" fireblocks-sdk "^2.5.3" -"@polymeshassociation/hashicorp-vault-signing-manager@^1.1.6": - version "1.1.6" - resolved "https://registry.yarnpkg.com/@polymeshassociation/hashicorp-vault-signing-manager/-/hashicorp-vault-signing-manager-1.1.6.tgz#79f2d14538c28e9418966add6e7735a8c27e7fd9" - integrity sha512-1RtaG8Tw58VHtW2TfTGrAF30Gl/8jx6EsMqU7BIwQUct53RkHzj9jcczG0u1rWtWThEB2X4zGMayIKj2epa91g== +"@polymeshassociation/hashicorp-vault-signing-manager@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@polymeshassociation/hashicorp-vault-signing-manager/-/hashicorp-vault-signing-manager-2.1.0.tgz#1fb400a9d0887afc3ce71781aa6b87cd1fbd2663" + integrity sha512-y8CPBsPD3U6N+p9vSK1w5u9/UC1JIajfvCuh1FcmjX8Y172tLs5twrEQdMQiFvueh66oZsxVf2RZ8aTw8U11PQ== dependencies: - "@polkadot/util" "^9.0.1" - "@polkadot/util-crypto" "^9.0.1" - "@polymeshassociation/signing-manager-types" "^1.2.1" + "@polkadot/util" "^10.4.2" + "@polkadot/util-crypto" "^10.4.2" + "@polymeshassociation/signing-manager-types" "^2.1.0" cross-fetch "^3.1.5" lodash "^4.17.21" -"@polymeshassociation/local-signing-manager@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@polymeshassociation/local-signing-manager/-/local-signing-manager-1.3.0.tgz#0fee036f6a66d24683242043a412fe6d27e0cbc9" - integrity sha512-Dn77nkxGqpAxubWI+G0y0mxOUqM0C8sdw+iABcFbMKFaA8TVecQovyYVw7gLkFcHVIVDGx3pzLDoh8pGBngskQ== +"@polymeshassociation/local-signing-manager@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@polymeshassociation/local-signing-manager/-/local-signing-manager-2.1.0.tgz#1e47ea3dac1fdf61a4642172a2480a436638a53c" + integrity sha512-mBXG6VrGCwf1vgpTYTRbpdHE+C9OJkOds6fmGzCKx9xpZa013tv3L8My7VI0ehcuz916hJCheCgCYZj0uPjRTQ== dependencies: - "@polymeshassociation/signing-manager-types" "^1.2.1" + "@polymeshassociation/signing-manager-types" "^2.1.0" -"@polymeshassociation/polymesh-sdk@20.1.0": - version "20.1.0" - resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-20.1.0.tgz#5b21f47cfaa9102a951d86707c99e769e88ff170" - integrity sha512-8G2J4AUlFBme+4W+gu72JLGZWdZyQ0m1DlOvwWh5CncF4vnf44HbLh0Ci10cPLM9SfUHH4an1L76o69DxLypdQ== +"@polymeshassociation/polymesh-sdk@21.0.0-alpha.9": + version "21.0.0-alpha.9" + resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.9.tgz#5d500d630143f6579494eb0055f9472b36172232" + integrity sha512-4UpbMWhUVvmiJKHWBoYJCbbF5kF7oqnMC5FuH9anaxA0yBd5z8Qw5bY2l6vAmBiza5XKkNUkPdd8b/HrEDdPPA== dependencies: + "@apollo/client" "^3.7.10" "@polkadot/api" "9.14.2" "@polkadot/util" "10.4.2" "@polkadot/util-crypto" "10.4.2" - apollo-cache-inmemory "^1.6.6" - apollo-client "^2.6.10" - apollo-link "^1.2.14" - apollo-link-context "^1.0.20" - apollo-link-error "^1.1.13" - apollo-link-http "^1.5.17" - apollo-link-state "^0.4.2" bignumber.js "9.0.1" bluebird "^3.7.2" cross-fetch "^3.0.6" @@ -1798,10 +1727,10 @@ semver "^7.3.5" websocket "^1.0.31" -"@polymeshassociation/signing-manager-types@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@polymeshassociation/signing-manager-types/-/signing-manager-types-1.2.1.tgz#94876c7f55d35d8ae15e77625e0c9a4480f7e95f" - integrity sha512-HTEto0PhYHSKkNKz3ntW7F7q82AmKqqkeXX9ozaRbw58BH8AFp5awdZj7fS/9fmY+NzQJj4UN3VobwOjSG8z1g== +"@polymeshassociation/signing-manager-types@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@polymeshassociation/signing-manager-types/-/signing-manager-types-2.1.0.tgz#c4c6e27e93d3d98de5c28a92862bcab7fb527a6c" + integrity sha512-UJaaFuHeHtduN42bU5GUhJ7JgExhWvcF5751jHxGg7Gj4xjQyiaNvpQsejYeOlUoALnZ1McmB3nPrbm03TeNKA== "@scure/base@1.1.1": version "1.1.1" @@ -2001,11 +1930,6 @@ pako "^2.0.4" ws "^8.8.1" -"@substrate/ss58-registry@^1.23.0": - version "1.36.0" - resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.36.0.tgz#22b59fa85cacc0bdf40aa5d8131a377c1b5a8dd8" - integrity sha512-YfQIpe2bIvGg/XWNByycznbOiAknMvpYaUpQJ2sLmNT/OwPx7XjEXk7dLShccuiQDoOQt3trTtF3Frz/Tjv6Fg== - "@substrate/ss58-registry@^1.38.0": version "1.39.0" resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.39.0.tgz#eb916ff5fea7fa02e77745823fde21af979273d2" @@ -2061,13 +1985,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.0.tgz#32c5d271503a12653c62cf4d2b45e6eab8cebc68" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== - dependencies: - "@types/node" "*" - "@types/bn.js@^5.1.1": version "5.1.1" resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682" @@ -2240,7 +2157,7 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@>=6": +"@types/node@*": version "18.11.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== @@ -2346,11 +2263,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/zen-observable@^0.8.0": - version "0.8.3" - resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.3.tgz#781d360c282436494b32fe7d9f7f8e64b3118aa3" - integrity sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw== - "@typescript-eslint/eslint-plugin@5.20.0": version "5.20.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.20.0.tgz#022531a639640ff3faafaf251d1ce00a2ef000a1" @@ -2627,20 +2539,33 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@wry/context@^0.4.0": - version "0.4.4" - resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.4.4.tgz#e50f5fa1d6cfaabf2977d1fda5ae91717f8815f8" - integrity sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag== +"@wry/context@^0.7.0": + version "0.7.3" + resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.7.3.tgz#240f6dfd4db5ef54f81f6597f6714e58d4f476a1" + integrity sha512-Nl8WTesHp89RF803Se9X3IiHjdmLBrIvPMaJkl+rKVJAYyPsz1TEUbu89943HpvujtSJgDUx9W4vZw3K1Mr3sA== dependencies: - "@types/node" ">=6" - tslib "^1.9.3" + tslib "^2.3.0" -"@wry/equality@^0.1.2": - version "0.1.11" - resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.1.11.tgz#35cb156e4a96695aa81a9ecc4d03787bc17f1790" - integrity sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA== +"@wry/equality@^0.5.0": + version "0.5.6" + resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.6.tgz#cd4a533c72c3752993ab8cbf682d3d20e3cb601e" + integrity sha512-D46sfMTngaYlrH+OspKf8mIJETntFnf6Hsjb0V41jAXJ7Bx2kB8Rv8RCUujuVWYttFtHkUNp7g+FwxNQAr6mXA== + dependencies: + tslib "^2.3.0" + +"@wry/trie@^0.3.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.2.tgz#a06f235dc184bd26396ba456711f69f8c35097e6" + integrity sha512-yRTyhWSls2OY/pYLfwff867r8ekooZ4UI+/gxot5Wj8EFwSf2rG+n+Mo/6LoLQm1TKA4GRj2+LCpbfS937dClQ== + dependencies: + tslib "^2.3.0" + +"@wry/trie@^0.4.0": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.4.3.tgz#077d52c22365871bf3ffcbab8e95cb8bc5689af4" + integrity sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w== dependencies: - tslib "^1.9.3" + tslib "^2.3.0" "@xtuc/ieee754@^1.2.0": version "1.2.0" @@ -2912,102 +2837,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -apollo-cache-inmemory@^1.6.6: - version "1.6.6" - resolved "https://registry.yarnpkg.com/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz#56d1f2a463a6b9db32e9fa990af16d2a008206fd" - integrity sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A== - dependencies: - apollo-cache "^1.3.5" - apollo-utilities "^1.3.4" - optimism "^0.10.0" - ts-invariant "^0.4.0" - tslib "^1.10.0" - -apollo-cache@1.3.5, apollo-cache@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/apollo-cache/-/apollo-cache-1.3.5.tgz#9dbebfc8dbe8fe7f97ba568a224bca2c5d81f461" - integrity sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA== - dependencies: - apollo-utilities "^1.3.4" - tslib "^1.10.0" - -apollo-client@^2.6.10: - version "2.6.10" - resolved "https://registry.yarnpkg.com/apollo-client/-/apollo-client-2.6.10.tgz#86637047b51d940c8eaa771a4ce1b02df16bea6a" - integrity sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA== - dependencies: - "@types/zen-observable" "^0.8.0" - apollo-cache "1.3.5" - apollo-link "^1.0.0" - apollo-utilities "1.3.4" - symbol-observable "^1.0.2" - ts-invariant "^0.4.0" - tslib "^1.10.0" - zen-observable "^0.8.0" - -apollo-link-context@^1.0.20: - version "1.0.20" - resolved "https://registry.yarnpkg.com/apollo-link-context/-/apollo-link-context-1.0.20.tgz#1939ac5dc65d6dff0c855ee53521150053c24676" - integrity sha512-MLLPYvhzNb8AglNsk2NcL9AvhO/Vc9hn2ZZuegbhRHGet3oGr0YH9s30NS9+ieoM0sGT11p7oZ6oAILM/kiRBA== - dependencies: - apollo-link "^1.2.14" - tslib "^1.9.3" - -apollo-link-error@^1.1.13: - version "1.1.13" - resolved "https://registry.yarnpkg.com/apollo-link-error/-/apollo-link-error-1.1.13.tgz#c1a1bb876ffe380802c8df0506a32c33aad284cd" - integrity sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg== - dependencies: - apollo-link "^1.2.14" - apollo-link-http-common "^0.2.16" - tslib "^1.9.3" - -apollo-link-http-common@^0.2.16: - version "0.2.16" - resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz#756749dafc732792c8ca0923f9a40564b7c59ecc" - integrity sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg== - dependencies: - apollo-link "^1.2.14" - ts-invariant "^0.4.0" - tslib "^1.9.3" - -apollo-link-http@^1.5.17: - version "1.5.17" - resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.17.tgz#499e9f1711bf694497f02c51af12d82de5d8d8ba" - integrity sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg== - dependencies: - apollo-link "^1.2.14" - apollo-link-http-common "^0.2.16" - tslib "^1.9.3" - -apollo-link-state@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/apollo-link-state/-/apollo-link-state-0.4.2.tgz#ac00e9be9b0ca89eae0be6ba31fe904b80bbe2e8" - integrity sha512-xMPcAfuiPVYXaLwC6oJFIZrKgV3GmdO31Ag2eufRoXpvT0AfJZjdaPB4450Nu9TslHRePN9A3quxNueILlQxlw== - dependencies: - apollo-utilities "^1.0.8" - graphql-anywhere "^4.1.0-alpha.0" - -apollo-link@^1.0.0, apollo-link@^1.2.14: - version "1.2.14" - resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" - integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== - dependencies: - apollo-utilities "^1.3.0" - ts-invariant "^0.4.0" - tslib "^1.9.3" - zen-observable-ts "^0.8.21" - -apollo-utilities@1.3.4, apollo-utilities@^1.0.8, apollo-utilities@^1.3.0, apollo-utilities@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.3.4.tgz#6129e438e8be201b6c55b0f13ce49d2c7175c9cf" - integrity sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig== - dependencies: - "@wry/equality" "^0.1.2" - fast-json-stable-stringify "^2.0.0" - ts-invariant "^0.4.0" - tslib "^1.10.0" - app-root-path@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.1.0.tgz#5971a2fc12ba170369a7a1ef018c71e6e47c2e86" @@ -3558,9 +3387,9 @@ camelcase@^6.0.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001248: - version "1.0.30001442" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001442.tgz" - integrity sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow== + version "1.0.30001518" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001518.tgz" + integrity sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA== capture-exit@^2.0.0: version "2.0.0" @@ -5670,15 +5499,6 @@ graceful-fs@4.2.10, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graphql-anywhere@^4.1.0-alpha.0: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graphql-anywhere/-/graphql-anywhere-4.2.8.tgz#136ede3142268f96f67c9a7d13ba37bff640aeb7" - integrity sha512-bKeJJoY9JyWMAiz5isKrtYUdIUBOBiXUOrA9CQgs9Drh9itFtxhWndQH4UBuYfrMticum6Oj1uQ6iSvZk94cMQ== - dependencies: - apollo-utilities "^1.3.4" - ts-invariant "^0.3.2" - tslib "^2.4.0" - graphql-tag@2.12.4: version "2.12.4" resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.4.tgz#d34066688a4f09e72d6f4663c74211e9b4b7c4bf" @@ -5686,6 +5506,13 @@ graphql-tag@2.12.4: dependencies: tslib "^2.1.0" +graphql-tag@^2.12.6: + version "2.12.6" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" + integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== + dependencies: + tslib "^2.1.0" + graphql@^15.0.0: version "15.8.0" resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38" @@ -5795,6 +5622,13 @@ highlight.js@^10.7.1: resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== +hoist-non-react-statics@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + hook-std@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hook-std/-/hook-std-2.0.0.tgz#ff9aafdebb6a989a354f729bb6445cf4a3a7077c" @@ -6086,7 +5920,7 @@ into-stream@^6.0.0: from2 "^2.3.0" p-is-promise "^3.0.0" -ip-regex@^4.1.0, ip-regex@^4.3.0: +ip-regex@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" integrity sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q== @@ -6933,7 +6767,7 @@ joi@17.4.0: "@sideway/formula" "^3.0.0" "@sideway/pinpoint" "^2.0.0" -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -7473,6 +7307,13 @@ loglevel@^1.4.1: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -8436,12 +8277,13 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -optimism@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.10.3.tgz#163268fdc741dea2fb50f300bedda80356445fd7" - integrity sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw== +optimism@^0.16.2: + version "0.16.2" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.2.tgz#519b0c78b3b30954baed0defe5143de7776bf081" + integrity sha512-zWNbgWj+3vLEjZNIh/okkY2EUfX+vB9TJopzIZwT1xxaMqC5hRLLraePod4c5n4He08xuXNH+zhKFFCu390wiQ== dependencies: - "@wry/context" "^0.4.0" + "@wry/context" "^0.7.0" + "@wry/trie" "^0.3.0" optionator@^0.8.1, optionator@^0.8.2: version "0.8.3" @@ -9134,6 +8976,15 @@ promzard@^0.3.0: dependencies: read "1" +prop-types@^15.7.2: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + propagate@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" @@ -9254,6 +9105,11 @@ rc@1.2.8, rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-is@^16.13.1, react-is@^16.7.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" @@ -9264,6 +9120,13 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +react@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + read-cmd-shim@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-3.0.1.tgz#868c235ec59d1de2db69e11aec885bc095aea087" @@ -9505,6 +9368,11 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12.0, resolve@^1.13 is-core-module "^2.2.0" path-parse "^1.0.6" +response-iterator@^0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/response-iterator/-/response-iterator-0.2.6.tgz#249005fb14d2e4eeb478a3f735a28fd8b4c9f3da" + integrity sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw== + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -10346,16 +10214,11 @@ swagger-ui-express@4.4.0: dependencies: swagger-ui-dist ">=4.11.0" -symbol-observable@4.0.0: +symbol-observable@4.0.0, symbol-observable@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205" integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ== -symbol-observable@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== - symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -10608,19 +10471,12 @@ trim-newlines@^3.0.0: resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== -ts-invariant@^0.3.2: - version "0.3.3" - resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.3.3.tgz#b5742b1885ecf9e29c31a750307480f045ec0b16" - integrity sha512-UReOKsrJFGC9tUblgSRWo+BsVNbEd77Cl6WiV/XpMlkifXwNIJbknViCucHvVZkXSC/mcWeRnIGdY7uprcwvdQ== - dependencies: - tslib "^1.9.3" - -ts-invariant@^0.4.0: - version "0.4.4" - resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.4.4.tgz#97a523518688f93aafad01b0e80eb803eb2abd86" - integrity sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA== +ts-invariant@^0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/ts-invariant/-/ts-invariant-0.10.3.tgz#3e048ff96e91459ffca01304dbc7f61c1f642f6c" + integrity sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ== dependencies: - tslib "^1.9.3" + tslib "^2.1.0" ts-jest@26.5.4: version "26.5.4" @@ -10693,16 +10549,21 @@ tslib@2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== -tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0: +tslib@^2.1.0, tslib@^2.3.1: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== +tslib@^2.3.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" + integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== + tsutils@^3.17.1, tsutils@^3.21.0: version "3.21.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" @@ -11441,15 +11302,14 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zen-observable-ts@^0.8.21: - version "0.8.21" - resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" - integrity sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg== +zen-observable-ts@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz#6c6d9ea3d3a842812c6e9519209365a122ba8b58" + integrity sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg== dependencies: - tslib "^1.9.3" - zen-observable "^0.8.0" + zen-observable "0.8.15" -zen-observable@^0.8.0: +zen-observable@0.8.15: version "0.8.15" resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== From 3ea5fccbcd3cf9244ad6adc90744d8f22b89ec9b Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Tue, 1 Aug 2023 11:26:32 -0400 Subject: [PATCH 05/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20external?= =?UTF-8?q?=20chain=20dep=20for=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit generate swagger was failing due to testnet being on 5.x. This change modifes the prepareRelease.sh script to start up a docker image to use instead --- chain-entry.sh | 8 ++++++++ docker-compose.yml | 18 +++++++++++++++++- prepareRelease.sh | 20 +++++++++++++++++++- src/main.ts | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100755 chain-entry.sh diff --git a/chain-entry.sh b/chain-entry.sh new file mode 100755 index 00000000..4fed5826 --- /dev/null +++ b/chain-entry.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +/usr/local/bin/polymesh \ +-d /var/lib/polymesh \ +--unsafe-ws-external --unsafe-rpc-external --wasm-execution=compiled \ +--no-prometheus --no-telemetry --pruning=archive --no-mdns \ +--validator --rpc-cors=all --rpc-methods=unsafe --force-authoring \ +--port 30333 $1 diff --git a/docker-compose.yml b/docker-compose.yml index 41e8a776..1cdabb78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,20 @@ services: + chain: + image: ${CHAIN_IMAGE} + init: true # Faster shutdown by container process not be PID 1 + restart: unless-stopped + ports: + # expose ports to localhost + - '9944:9944' # ws:// + - '9933:9933' # http:// + - '30333:30333' # for other nodes + extra_hosts: + - 'host.docker.internal:host-gateway' + volumes: + - './chain-entry.sh:/chain-entry.sh' + entrypoint: '/chain-entry.sh' + command: [ '--alice --chain dev' ] + postgres: image: postgres:15 ports: @@ -9,7 +25,7 @@ services: POSTGRES_USER: $REST_POSTGRES_USER POSTGRES_PASSWORD: $REST_POSTGRES_PASSWORD healthcheck: - test: ['CMD-SHELL', 'pg_isready -U postgres'] + test: [ 'CMD-SHELL', 'pg_isready -U postgres' ] interval: 5s timeout: 5s retries: 5 diff --git a/prepareRelease.sh b/prepareRelease.sh index c0ae21e7..f26f0ba1 100755 --- a/prepareRelease.sh +++ b/prepareRelease.sh @@ -1,8 +1,26 @@ #!/bin/bash +set -exu -o pipefail + declare nextVersion=$1 +# This needs to be set to and SDK compatible value +CHAIN_TAG='6.0.0-develop-debian' + +# This lets it work on arm64, like Mac Books +ARCHITECTURE=$(uname -m) +CHAIN_REPO=polymeshassociation/polymesh +if [ "$ARCHITECTURE" = "arm64" ]; then + CHAIN_REPO="polymeshassociation/polymesh-arm64" +fi + sed -i.bak -e "s/.setVersion('.*')/.setVersion('$nextVersion')/g" src/main.ts rm src/main.ts.bak -SWAGGER_VERSION=$nextVersion POLYMESH_NODE_URL='wss://testnet-rpc.polymesh.live' yarn generate:swagger > /dev/null 2>&1 \ No newline at end of file +export CHAIN_IMAGE="$CHAIN_REPO:$CHAIN_TAG" + +docker compose up -d chain + +SWAGGER_VERSION=$nextVersion POLYMESH_NODE_URL='ws://localhost:9944' yarn generate:swagger > /dev/null 2>&1 + +docker compose down chain \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 6b2ceb9d..7110f7a2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,7 @@ async function bootstrap(): Promise { const options = new DocumentBuilder() .setTitle(swaggerTitle) .setDescription(swaggerDescription) - .setVersion('3.0.0-alpha.4'); + .setVersion('3.0.0-alpha.5'); const configService = app.get(ConfigService); From da9f5574b868722fc76a796a7316ba786c7627f7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 1 Aug 2023 16:32:51 +0000 Subject: [PATCH 06/19] chore(release): 3.0.0-alpha.5 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [3.0.0-alpha.5](https://github.com/PolymeshAssociation/polymesh-rest-api/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2023-08-01) ### Features * ๐ŸŽธ update to 6.0 ([fcffc4b](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/fcffc4b860dce489eb04b2969199601ad9e4d34b)) ### BREAKING CHANGES * ๐Ÿงจ Checkpoint Schedules specify dates explictly, reschedule instruction removed - use executeManually instead, InvestorUniquness claim types removed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a04c58f3..0631d063 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polymesh-rest-api", - "version": "3.0.0-alpha.4", + "version": "3.0.0-alpha.5", "description": "Provides a REST like interface for interacting with the Polymesh blockchain", "author": "Polymesh Association", "private": true, From eba8cbf14ce7a7601ab2070814a8153a94e0825f Mon Sep 17 00:00:00 2001 From: Toms Veidemanis Date: Fri, 4 Aug 2023 14:47:32 +0300 Subject: [PATCH 07/19] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20pr=20comments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/identities/dto/register-identity.dto.ts | 6 +++--- src/identities/identities.controller.spec.ts | 1 + src/identities/identities.controller.ts | 2 +- src/identities/identities.service.spec.ts | 1 + src/identities/models/created-identity.model.ts | 4 +++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/identities/dto/register-identity.dto.ts b/src/identities/dto/register-identity.dto.ts index 1b4cc399..a35df8ba 100644 --- a/src/identities/dto/register-identity.dto.ts +++ b/src/identities/dto/register-identity.dto.ts @@ -23,15 +23,15 @@ export class RegisterIdentityDto extends TransactionBaseDto { @IsOptional() @ValidateNested({ each: true }) @Type(() => PermissionedAccountDto) - secondaryAccounts?: PermissionedAccountDto[]; + readonly secondaryAccounts?: PermissionedAccountDto[]; - @ApiPropertyOptional({ + @ApiProperty({ description: 'Issue a CDD claim for the created DID, completing the onboarding process for the Account', type: 'boolean', example: false, }) - readonly createCdd?: boolean; + readonly createCdd: boolean; @ApiPropertyOptional({ description: 'Date at which the Identity will expire (to be used together with createCdd)', diff --git a/src/identities/identities.controller.spec.ts b/src/identities/identities.controller.spec.ts index cf744071..2d8e474a 100644 --- a/src/identities/identities.controller.spec.ts +++ b/src/identities/identities.controller.spec.ts @@ -646,6 +646,7 @@ describe('IdentitiesController', () => { const data: RegisterIdentityDto = { signer: 'Ox60', targetAccount: 'address', + createCdd: false, }; const result = await controller.registerIdentity(data); diff --git a/src/identities/identities.controller.ts b/src/identities/identities.controller.ts index 218ae2e6..b7061fd7 100644 --- a/src/identities/identities.controller.ts +++ b/src/identities/identities.controller.ts @@ -80,7 +80,7 @@ export class IdentitiesController { @ApiOperation({ summary: 'Register Identity', description: - 'This endpoint allows registering a new Identity. The transaction signer must be a CDD provider. This might create an Authorization Request which has to be accepted by the target Account.', + 'This endpoint allows registering a new Identity. The transaction signer must be a CDD provider. This will create Authorization Requests which have to be accepted by any secondary accounts if they were specified.', }) @ApiTransactionResponse({ description: 'Newly created Authorization Request along with transaction details', diff --git a/src/identities/identities.service.spec.ts b/src/identities/identities.service.spec.ts index c660f96a..fcbb8a02 100644 --- a/src/identities/identities.service.spec.ts +++ b/src/identities/identities.service.spec.ts @@ -196,6 +196,7 @@ describe('IdentitiesService', () => { const body: RegisterIdentityDto = { signer, targetAccount: 'address', + createCdd: false, }; const result = await service.registerDid(body); diff --git a/src/identities/models/created-identity.model.ts b/src/identities/models/created-identity.model.ts index 750cd7dd..ed6b7c7e 100644 --- a/src/identities/models/created-identity.model.ts +++ b/src/identities/models/created-identity.model.ts @@ -1,3 +1,5 @@ +/* istanbul ignore file */ + import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; @@ -6,7 +8,7 @@ import { IdentityModel } from '~/identities/models/identity.model'; export class CreatedIdentityModel extends TransactionQueueModel { @ApiProperty({ - description: 'Static data (and identifiers) of the newly created Dividend Distribution', + description: 'Static data (and identifiers) of the newly created Identity', type: IdentityModel, }) @Type(() => IdentityModel) From 55c9e4d718fbc0654200762ddfedfc191d7fb413 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Fri, 11 Aug 2023 14:30:32 -0400 Subject: [PATCH 08/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20sdk=20dual?= =?UTF-8?q?=205.4-6.0=20version=20for=20smooth=20upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit allows for continued operation when the chain gets upgraded to 6.0. This reverts the checkpoint changes introduced in 3ea5fcc --- README.md | 2 +- package.json | 2 +- .../checkpoints.controller.spec.ts | 18 +++++-- src/checkpoints/checkpoints.controller.ts | 20 ++++--- src/checkpoints/checkpoints.service.spec.ts | 14 +++-- src/checkpoints/dto/calendar-period.dto.ts | 29 +++++++++++ .../dto/create-checkpoint-schedule.dto.ts | 41 ++++++++++++--- .../models/calendar-period.model.ts | 25 +++++++++ .../models/checkpoint-schedule.model.ts | 37 +++++++++---- src/identities/identities.controller.spec.ts | 1 + .../settlements.controller.spec.ts | 6 +-- src/settlements/settlements.controller.ts | 12 ++--- src/settlements/settlements.service.spec.ts | 7 ++- src/settlements/settlements.service.ts | 4 +- src/test-utils/mocks.ts | 7 ++- src/test-utils/service-mocks.ts | 2 +- yarn.lock | 52 ++++++++----------- 17 files changed, 200 insertions(+), 79 deletions(-) create mode 100644 src/checkpoints/dto/calendar-period.dto.ts create mode 100644 src/checkpoints/models/calendar-period.model.ts diff --git a/README.md b/README.md index 8681a0dd..06fe80aa 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A REST API wrapper for the Polymesh blockchain. -This version is compatible with chain versions 6.0.x +This version is compatible with chain versions 5.2.x ## Setup diff --git a/package.json b/package.json index 0631d063..edf8ba49 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@polymeshassociation/fireblocks-signing-manager": "^2.1.0", "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", "@polymeshassociation/local-signing-manager": "^2.1.0", - "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.9", + "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.11", "@polymeshassociation/signing-manager-types": "^2.1.0", "class-transformer": "0.5.1", "class-validator": "^0.14.0", diff --git a/src/checkpoints/checkpoints.controller.spec.ts b/src/checkpoints/checkpoints.controller.spec.ts index e57bc36e..4a4059f1 100644 --- a/src/checkpoints/checkpoints.controller.spec.ts +++ b/src/checkpoints/checkpoints.controller.spec.ts @@ -1,5 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; +import { CalendarUnit } from '@polymeshassociation/polymesh-sdk/types'; import { IdentityBalanceModel } from '~/assets/models/identity-balance.model'; import { CheckpointsController } from '~/checkpoints/checkpoints.controller'; @@ -130,7 +131,12 @@ describe('CheckpointsController', () => { { schedule: { id: new BigNumber(1), - pendingPoints: [mockDate], + period: { + unit: CalendarUnit.Month, + amount: new BigNumber(3), + }, + start: mockDate, + complexity: new BigNumber(4), expiryDate: null, }, details: { @@ -148,7 +154,12 @@ describe('CheckpointsController', () => { { id: new BigNumber(1), ticker: 'TICKER', - pendingPoints: [mockDate], + period: { + unit: CalendarUnit.Month, + amount: new BigNumber(3), + }, + start: mockDate, + complexity: new BigNumber(4), expiryDate: null, remainingCheckpoints: new BigNumber(1), nextCheckpointDate: mockDate, @@ -204,7 +215,8 @@ describe('CheckpointsController', () => { const body = { signer: 'signer', start: mockDate, - points: [], + period: { unit: CalendarUnit.Month, amount: new BigNumber(3) }, + repetitions: new BigNumber(2), }; const result = await controller.createSchedule({ ticker: 'TICKER' }, body); diff --git a/src/checkpoints/checkpoints.controller.ts b/src/checkpoints/checkpoints.controller.ts index 3cff71d4..f3cd71a7 100644 --- a/src/checkpoints/checkpoints.controller.ts +++ b/src/checkpoints/checkpoints.controller.ts @@ -193,11 +193,13 @@ export class CheckpointsController { const schedules = await this.checkpointsService.findSchedulesByTicker(ticker); return new ResultsModel({ results: schedules.map( - ({ schedule: { id, pendingPoints, expiryDate }, details }) => + ({ schedule: { id, period, start, complexity, expiryDate }, details }) => new CheckpointScheduleModel({ id, ticker, - pendingPoints, + period, + start, + complexity, expiryDate, ...details, }) @@ -232,14 +234,16 @@ export class CheckpointsController { @Param() { ticker, id }: CheckpointScheduleParamsDto ): Promise { const { - schedule: { pendingPoints, expiryDate }, + schedule: { period, start, complexity, expiryDate }, details, } = await this.checkpointsService.findScheduleById(ticker, id); return new CheckpointScheduleModel({ id, + period, + start, ticker, - pendingPoints, + complexity, expiryDate, ...details, }); @@ -247,7 +251,7 @@ export class CheckpointsController { @ApiOperation({ summary: 'Create Schedule', - description: 'This endpoint will create a Schedule that creates future Checkpoints', + description: 'This endpoint will create a Schedule that creates Checkpoints periodically', }) @ApiParam({ name: 'ticker', @@ -275,7 +279,7 @@ export class CheckpointsController { details, }) => { const { - schedule: { id, expiryDate, pendingPoints }, + schedule: { id, period, start, complexity, expiryDate }, details: scheduleDetails, } = await this.checkpointsService.findScheduleById(ticker, createdScheduleId); @@ -283,8 +287,10 @@ export class CheckpointsController { schedule: new CheckpointScheduleModel({ id, ticker, + period, + start, + complexity, expiryDate, - pendingPoints, ...scheduleDetails, }), transactions, diff --git a/src/checkpoints/checkpoints.service.spec.ts b/src/checkpoints/checkpoints.service.spec.ts index 9260e0cb..9a44bbc4 100644 --- a/src/checkpoints/checkpoints.service.spec.ts +++ b/src/checkpoints/checkpoints.service.spec.ts @@ -3,7 +3,7 @@ const mockIsPolymeshTransaction = jest.fn(); import { Test, TestingModule } from '@nestjs/testing'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; -import { TxTags } from '@polymeshassociation/polymesh-sdk/types'; +import { CalendarUnit, TxTags } from '@polymeshassociation/polymesh-sdk/types'; import { AssetsService } from '~/assets/assets.service'; import { CheckpointsService } from '~/checkpoints/checkpoints.service'; @@ -133,6 +133,10 @@ describe('CheckpointsService', () => { { schedule: { id: new BigNumber(1), + period: { + unit: CalendarUnit.Month, + amount: new BigNumber(3), + }, start: new Date(), complexity: new BigNumber(4), expiryDate: null, @@ -262,7 +266,9 @@ describe('CheckpointsService', () => { const mockDate = new Date(); const params = { signer, - points: [mockDate], + start: mockDate, + period: { unit: CalendarUnit.Month, amount: new BigNumber(3) }, + repetitions: new BigNumber(2), }; const result = await service.createScheduleByTicker('TICKER', params); @@ -273,7 +279,9 @@ describe('CheckpointsService', () => { expect(mockTransactionsService.submit).toHaveBeenCalledWith( mockAsset.checkpoints.schedules.create, { - points: [mockDate], + start: mockDate, + period: { unit: CalendarUnit.Month, amount: new BigNumber(3) }, + repetitions: new BigNumber(2), }, { signer, diff --git a/src/checkpoints/dto/calendar-period.dto.ts b/src/checkpoints/dto/calendar-period.dto.ts new file mode 100644 index 00000000..3cd534dc --- /dev/null +++ b/src/checkpoints/dto/calendar-period.dto.ts @@ -0,0 +1,29 @@ +/* istanbul ignore file */ + +import { ApiProperty } from '@nestjs/swagger'; +import { BigNumber } from '@polymeshassociation/polymesh-sdk'; +import { CalendarUnit } from '@polymeshassociation/polymesh-sdk/types'; +import { IsEnum } from 'class-validator'; + +import { ToBigNumber } from '~/common/decorators/transformation'; +import { IsBigNumber } from '~/common/decorators/validation'; + +export class CalendarPeriodDto { + @ApiProperty({ + description: 'Unit of the period', + type: 'string', + enum: CalendarUnit, + example: CalendarUnit.Month, + }) + @IsEnum(CalendarUnit) + readonly unit: CalendarUnit; + + @ApiProperty({ + description: 'Number of units', + type: 'string', + example: '3', + }) + @IsBigNumber() + @ToBigNumber() + readonly amount: BigNumber; +} diff --git a/src/checkpoints/dto/create-checkpoint-schedule.dto.ts b/src/checkpoints/dto/create-checkpoint-schedule.dto.ts index fcf43e2a..380f9447 100644 --- a/src/checkpoints/dto/create-checkpoint-schedule.dto.ts +++ b/src/checkpoints/dto/create-checkpoint-schedule.dto.ts @@ -1,19 +1,48 @@ /* istanbul ignore file */ import { ApiProperty } from '@nestjs/swagger'; +import { BigNumber } from '@polymeshassociation/polymesh-sdk'; import { Type } from 'class-transformer'; -import { IsArray } from 'class-validator'; +import { IsDate, IsOptional, ValidateNested } from 'class-validator'; +import { CalendarPeriodDto } from '~/checkpoints/dto/calendar-period.dto'; +import { ToBigNumber } from '~/common/decorators/transformation'; +import { IsBigNumber } from '~/common/decorators/validation'; import { TransactionBaseDto } from '~/common/dto/transaction-base-dto'; export class CreateCheckpointScheduleDto extends TransactionBaseDto { @ApiProperty({ - description: 'An array of dates for when to make Checkpoints', + description: + 'Date from which the Schedule will start creating Checkpoints. A null value means the first Checkpoint will be created immediately', type: 'string', - isArray: true, - example: [new Date('03/23/2030').toISOString(), new Date('03/23/2031').toISOString()], + example: new Date('05/23/2021').toISOString(), + nullable: true, }) - @IsArray() + @IsOptional() + @IsDate() @Type(() => Date) - readonly points: Date[]; + readonly start: Date | null; + + @ApiProperty({ + description: + 'Periodic interval between Checkpoints. For example, a period of 2 weeks means that a Checkpoint will be created every 2 weeks. A null value means this Schedule creates a single Checkpoint and then expires', + type: CalendarPeriodDto, + nullable: true, + }) + @IsOptional() + @ValidateNested() + @Type(() => CalendarPeriodDto) + readonly period: CalendarPeriodDto | null; + + @ApiProperty({ + description: + 'Number of Checkpoints that should be created by this Schedule. A null or 0 value means infinite Checkpoints (the Schedule never expires)', + type: 'string', + example: '12', + nullable: true, + }) + @IsOptional() + @IsBigNumber() + @ToBigNumber() + readonly repetitions: BigNumber | null; } diff --git a/src/checkpoints/models/calendar-period.model.ts b/src/checkpoints/models/calendar-period.model.ts new file mode 100644 index 00000000..5568f2a5 --- /dev/null +++ b/src/checkpoints/models/calendar-period.model.ts @@ -0,0 +1,25 @@ +/* istanbul ignore file */ + +import { ApiProperty } from '@nestjs/swagger'; +import { BigNumber } from '@polymeshassociation/polymesh-sdk'; +import { CalendarUnit } from '@polymeshassociation/polymesh-sdk/types'; + +import { FromBigNumber } from '~/common/decorators/transformation'; + +export class CalendarPeriodModel { + @ApiProperty({ + description: 'Unit of the period', + type: 'string', + enum: CalendarUnit, + example: CalendarUnit.Month, + }) + readonly unit: CalendarUnit; + + @ApiProperty({ + description: 'Number of units', + type: 'string', + example: '3', + }) + @FromBigNumber() + readonly amount: BigNumber; +} diff --git a/src/checkpoints/models/checkpoint-schedule.model.ts b/src/checkpoints/models/checkpoint-schedule.model.ts index 9ba1c6f7..c568e41b 100644 --- a/src/checkpoints/models/checkpoint-schedule.model.ts +++ b/src/checkpoints/models/checkpoint-schedule.model.ts @@ -2,7 +2,9 @@ import { ApiProperty } from '@nestjs/swagger'; import { BigNumber } from '@polymeshassociation/polymesh-sdk'; +import { Type } from 'class-transformer'; +import { CalendarPeriodModel } from '~/checkpoints/models/calendar-period.model'; import { FromBigNumber } from '~/common/decorators/transformation'; export class CheckpointScheduleModel { @@ -21,26 +23,39 @@ export class CheckpointScheduleModel { }) readonly ticker: string; - // @ApiProperty({ - // description: 'Date at which first Checkpoint was created', - // type: 'string', - // example: new Date('10/14/1987').toISOString(), - // }) - // readonly start: Date; - @ApiProperty({ - description: 'Date at which the last Checkpoint will be created', + description: 'Date at which first Checkpoint was created', type: 'string', example: new Date('10/14/1987').toISOString(), }) - readonly expiryDate: Date; + readonly start: Date; @ApiProperty({ - description: 'Dates at which checkpoints will be created', + description: + 'Date at which the last Checkpoint will be created with this Schedule. A null value means that this Schedule never expires', type: 'string', + nullable: true, example: new Date('10/14/1987').toISOString(), }) - readonly pendingPoints: Date[]; + readonly expiryDate: Date | null; + + @ApiProperty({ + description: + 'Period in which this Schedule creates a Checkpoint. A null value means this Schedule creates a single Checkpoint and then expires', + nullable: true, + type: CalendarPeriodModel, + }) + @Type(() => CalendarPeriodModel) + readonly period: CalendarPeriodModel | null; + + @ApiProperty({ + description: + 'Abstract measure of the complexity of this Schedule. Shorter periods translate into more complexity', + type: 'string', + example: '1', + }) + @FromBigNumber() + readonly complexity: BigNumber; @ApiProperty({ description: 'Number of Checkpoints left to be created by the Schedule', diff --git a/src/identities/identities.controller.spec.ts b/src/identities/identities.controller.spec.ts index eb8e9a91..1a1dbaa5 100644 --- a/src/identities/identities.controller.spec.ts +++ b/src/identities/identities.controller.spec.ts @@ -554,6 +554,7 @@ describe('IdentitiesController', () => { expect(mockClaimsService.findClaimScopesByDid).toHaveBeenCalledWith(did); }); }); + describe('getCddClaims', () => { const date = new Date().toISOString(); const mockCddClaims = [ diff --git a/src/settlements/settlements.controller.spec.ts b/src/settlements/settlements.controller.spec.ts index bc577553..cc842a93 100644 --- a/src/settlements/settlements.controller.spec.ts +++ b/src/settlements/settlements.controller.spec.ts @@ -141,11 +141,11 @@ describe('SettlementsController', () => { }); }); - describe('manuallyExecuteInstruction', () => { + describe('rescheduleInstruction', () => { it('should reschedule a failed instruction and return the data returned by the service', async () => { - mockSettlementsService.manuallyExecuteInstruction.mockResolvedValue(txResult); + mockSettlementsService.rescheduleInstruction.mockResolvedValue(txResult); - const result = await controller.manuallyExecuteInstruction( + const result = await controller.rescheduleInstruction( { id: new BigNumber(3) }, { signer: 'signer' } ); diff --git a/src/settlements/settlements.controller.ts b/src/settlements/settlements.controller.ts index 3c5b417a..7f37ceaf 100644 --- a/src/settlements/settlements.controller.ts +++ b/src/settlements/settlements.controller.ts @@ -177,8 +177,8 @@ export class SettlementsController { @ApiTags('instructions') @ApiOperation({ - summary: 'Manually execute an Instruction', - description: 'This endpoint will execute an Instruction', + summary: 'Reschedule a failed Instruction', + description: 'This endpoint will reschedule a failed Instruction', }) @ApiParam({ name: 'id', @@ -192,16 +192,16 @@ export class SettlementsController { }) @ApiTransactionFailedResponse({ [HttpStatus.UNPROCESSABLE_ENTITY]: [ - 'Only Instruction with status code `Failed` or of type "Manual" can be executed manually', + 'Only transaction with status code `Failed` can be rescheduled', ], [HttpStatus.NOT_FOUND]: ['The Instruction with the given ID was not found'], }) - @Post('instructions/:id/manuallyExecute') - public async manuallyExecuteInstruction( + @Post('instructions/:id/reschedule') + public async rescheduleInstruction( @Param() { id }: IdParamsDto, @Body() signerDto: TransactionBaseDto ): Promise { - const result = await this.settlementsService.manuallyExecuteInstruction(id, signerDto); + const result = await this.settlementsService.rescheduleInstruction(id, signerDto); return handleServiceResult(result); } diff --git a/src/settlements/settlements.service.spec.ts b/src/settlements/settlements.service.spec.ts index e7ffa894..b04f1fc2 100644 --- a/src/settlements/settlements.service.spec.ts +++ b/src/settlements/settlements.service.spec.ts @@ -433,14 +433,13 @@ describe('SettlementsService', () => { tag: TxTags.settlement.RescheduleInstruction, }; const mockTransaction = new MockTransaction(transaction); - const id = new BigNumber(123); mockTransactionsService.submit.mockResolvedValue({ transactions: [mockTransaction] }); const findInstructionSpy = jest.spyOn(service, 'findInstruction'); // eslint-disable-next-line @typescript-eslint/no-explicit-any findInstructionSpy.mockResolvedValue(mockInstruction as any); - const result = await service.manuallyExecuteInstruction(id, { + const result = await service.rescheduleInstruction(new BigNumber(123), { signer, }); @@ -449,8 +448,8 @@ describe('SettlementsService', () => { transactions: [mockTransaction], }); expect(mockTransactionsService.submit).toHaveBeenCalledWith( - mockInstruction.executeManually, - { id }, + mockInstruction.reschedule, + {}, { signer } ); }); diff --git a/src/settlements/settlements.service.ts b/src/settlements/settlements.service.ts index 63e0b6ff..3600c611 100644 --- a/src/settlements/settlements.service.ts +++ b/src/settlements/settlements.service.ts @@ -152,12 +152,12 @@ export class SettlementsService { return this.transactionsService.submit(instruction.withdraw, {}, signerDto); } - public async manuallyExecuteInstruction( + public async rescheduleInstruction( id: BigNumber, signerDto: TransactionBaseDto ): ServiceReturn { const instruction = await this.findInstruction(id); - return this.transactionsService.submit(instruction.executeManually, { id }, signerDto); + return this.transactionsService.submit(instruction.reschedule, {}, signerDto); } } diff --git a/src/test-utils/mocks.ts b/src/test-utils/mocks.ts index 390e7e3f..97fe08b7 100644 --- a/src/test-utils/mocks.ts +++ b/src/test-utils/mocks.ts @@ -10,6 +10,7 @@ import { import { Account, AuthorizationType, + CalendarUnit, HistoricSettlement, MetadataEntry, MetadataType, @@ -244,7 +245,7 @@ export class MockInstruction { public getLegs = jest.fn(); public getAffirmations = jest.fn(); public withdraw = jest.fn(); - public executeManually = jest.fn(); + public reschedule = jest.fn(); } export class MockVenue { @@ -314,8 +315,10 @@ export class MockCheckpoint { export class MockCheckpointSchedule { id = new BigNumber(1); ticker = 'TICKER'; - pendingPoints = [new Date('10/14/1987')]; + period = { unit: CalendarUnit.Month, amount: new BigNumber(3) }; + start = new Date('10/14/1987'); expiryDate = new Date('10/14/2000'); + complexity = new BigNumber(4); } export class MockAuthorizationRequest { diff --git a/src/test-utils/service-mocks.ts b/src/test-utils/service-mocks.ts index 031cf5d7..68c2a8a4 100644 --- a/src/test-utils/service-mocks.ts +++ b/src/test-utils/service-mocks.ts @@ -148,7 +148,7 @@ export class MockSettlementsService { findPendingInstructionsByDid = jest.fn(); findVenuesByOwner = jest.fn(); withdrawAffirmation = jest.fn(); - manuallyExecuteInstruction = jest.fn(); + rescheduleInstruction = jest.fn(); } export class MockClaimsService { diff --git a/yarn.lock b/yarn.lock index 63861605..cd7dc26b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -81,17 +81,17 @@ rxjs "6.6.7" "@apollo/client@^3.7.10": - version "3.7.17" - resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.7.17.tgz#1d2538729fd8ef138aa301a7cf62704474e57b72" - integrity sha512-0EErSHEtKPNl5wgWikHJbKFAzJ/k11O0WO2QyqZSHpdxdAnw7UWHY4YiLbHCFG7lhrD+NTQ3Z/H9Jn4rcikoJA== + version "3.8.1" + resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.8.1.tgz#a1e3045a5fb276c08e38f7b5f930551d79741257" + integrity sha512-JGGj/9bdoLEqzatRikDeN8etseY5qeFAY0vSAx/Pd0ePNsaflKzHx6V2NZ0NsGkInq+9IXXX3RLVDf0EotizMA== dependencies: "@graphql-typed-document-node/core" "^3.1.1" - "@wry/context" "^0.7.0" - "@wry/equality" "^0.5.0" - "@wry/trie" "^0.4.0" + "@wry/context" "^0.7.3" + "@wry/equality" "^0.5.6" + "@wry/trie" "^0.4.3" graphql-tag "^2.12.6" hoist-non-react-statics "^3.3.2" - optimism "^0.16.2" + optimism "^0.17.5" prop-types "^15.7.2" response-iterator "^0.2.6" symbol-observable "^4.0.0" @@ -1705,10 +1705,10 @@ dependencies: "@polymeshassociation/signing-manager-types" "^2.1.0" -"@polymeshassociation/polymesh-sdk@21.0.0-alpha.9": - version "21.0.0-alpha.9" - resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.9.tgz#5d500d630143f6579494eb0055f9472b36172232" - integrity sha512-4UpbMWhUVvmiJKHWBoYJCbbF5kF7oqnMC5FuH9anaxA0yBd5z8Qw5bY2l6vAmBiza5XKkNUkPdd8b/HrEDdPPA== +"@polymeshassociation/polymesh-sdk@21.0.0-alpha.11": + version "21.0.0-alpha.11" + resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.11.tgz#0a062ab3bfcb9c8123c6aab4e5682c8a44c471a7" + integrity sha512-inWXX/qzseGuaWmg7K78qAI3LBfdskeCRUtD2Emo9b05gZGN8Nmpj/WH8uvD9GfcS5XTxxm3cXEDLr1zaAIRWQ== dependencies: "@apollo/client" "^3.7.10" "@polkadot/api" "9.14.2" @@ -2539,28 +2539,21 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@wry/context@^0.7.0": +"@wry/context@^0.7.0", "@wry/context@^0.7.3": version "0.7.3" resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.7.3.tgz#240f6dfd4db5ef54f81f6597f6714e58d4f476a1" integrity sha512-Nl8WTesHp89RF803Se9X3IiHjdmLBrIvPMaJkl+rKVJAYyPsz1TEUbu89943HpvujtSJgDUx9W4vZw3K1Mr3sA== dependencies: tslib "^2.3.0" -"@wry/equality@^0.5.0": +"@wry/equality@^0.5.6": version "0.5.6" resolved "https://registry.yarnpkg.com/@wry/equality/-/equality-0.5.6.tgz#cd4a533c72c3752993ab8cbf682d3d20e3cb601e" integrity sha512-D46sfMTngaYlrH+OspKf8mIJETntFnf6Hsjb0V41jAXJ7Bx2kB8Rv8RCUujuVWYttFtHkUNp7g+FwxNQAr6mXA== dependencies: tslib "^2.3.0" -"@wry/trie@^0.3.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.3.2.tgz#a06f235dc184bd26396ba456711f69f8c35097e6" - integrity sha512-yRTyhWSls2OY/pYLfwff867r8ekooZ4UI+/gxot5Wj8EFwSf2rG+n+Mo/6LoLQm1TKA4GRj2+LCpbfS937dClQ== - dependencies: - tslib "^2.3.0" - -"@wry/trie@^0.4.0": +"@wry/trie@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@wry/trie/-/trie-0.4.3.tgz#077d52c22365871bf3ffcbab8e95cb8bc5689af4" integrity sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w== @@ -3387,9 +3380,9 @@ camelcase@^6.0.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001248: - version "1.0.30001518" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001518.tgz" - integrity sha512-rup09/e3I0BKjncL+FesTayKtPrdwKhUufQFd3riFw1hHg8JmIFoInYfB102cFcY/pPgGmdyl/iy+jgiDi2vdA== + version "1.0.30001442" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001442.tgz" + integrity sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow== capture-exit@^2.0.0: version "2.0.0" @@ -8277,13 +8270,14 @@ opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== -optimism@^0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.16.2.tgz#519b0c78b3b30954baed0defe5143de7776bf081" - integrity sha512-zWNbgWj+3vLEjZNIh/okkY2EUfX+vB9TJopzIZwT1xxaMqC5hRLLraePod4c5n4He08xuXNH+zhKFFCu390wiQ== +optimism@^0.17.5: + version "0.17.5" + resolved "https://registry.yarnpkg.com/optimism/-/optimism-0.17.5.tgz#a4c78b3ad12c58623abedbebb4f2f2c19b8e8816" + integrity sha512-TEcp8ZwK1RczmvMnvktxHSF2tKgMWjJ71xEFGX5ApLh67VsMSTy1ZUlipJw8W+KaqgOmQ+4pqwkeivY89j+4Vw== dependencies: "@wry/context" "^0.7.0" - "@wry/trie" "^0.3.0" + "@wry/trie" "^0.4.3" + tslib "^2.3.0" optionator@^0.8.1, optionator@^0.8.2: version "0.8.3" From e652bbbe76dd451777b8b96231f45aa9e7bd7152 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Fri, 11 Aug 2023 16:42:02 -0400 Subject: [PATCH 09/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20remove=20react=20?= =?UTF-8?q?dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +-- yarn.lock | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index edf8ba49..54eea628 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@polymeshassociation/fireblocks-signing-manager": "^2.1.0", "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", "@polymeshassociation/local-signing-manager": "^2.1.0", - "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.11", + "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.12", "@polymeshassociation/signing-manager-types": "^2.1.0", "class-transformer": "0.5.1", "class-validator": "^0.14.0", @@ -106,7 +106,6 @@ "prettier": "2.3.1", "prettier-eslint": "12.0.0", "prettier-eslint-cli": "5.0.1", - "react": "^18.2.0", "semantic-release": "^19.0.5", "supertest": "6.1.3", "ts-jest": "26.5.4", diff --git a/yarn.lock b/yarn.lock index cd7dc26b..1695e47d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1705,10 +1705,10 @@ dependencies: "@polymeshassociation/signing-manager-types" "^2.1.0" -"@polymeshassociation/polymesh-sdk@21.0.0-alpha.11": - version "21.0.0-alpha.11" - resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.11.tgz#0a062ab3bfcb9c8123c6aab4e5682c8a44c471a7" - integrity sha512-inWXX/qzseGuaWmg7K78qAI3LBfdskeCRUtD2Emo9b05gZGN8Nmpj/WH8uvD9GfcS5XTxxm3cXEDLr1zaAIRWQ== +"@polymeshassociation/polymesh-sdk@21.0.0-alpha.12": + version "21.0.0-alpha.12" + resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.12.tgz#89f9786c99f6c8a33f97bf54d0fc1fbf3e1b31b7" + integrity sha512-BM3D+1+VTsqrLNWJ+KyEDH3NDU9yJlM7f1YYfd7jr1oEKn6Y1U/0VrkgJBkm5YbQ8XaxF3Mo0kyyqqxsc+pJ2g== dependencies: "@apollo/client" "^3.7.10" "@polkadot/api" "9.14.2" @@ -3380,9 +3380,9 @@ camelcase@^6.0.0: integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== caniuse-lite@^1.0.30001248: - version "1.0.30001442" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001442.tgz" - integrity sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow== + version "1.0.30001519" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz" + integrity sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg== capture-exit@^2.0.0: version "2.0.0" @@ -7300,7 +7300,7 @@ loglevel@^1.4.1: resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== -loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -9114,13 +9114,6 @@ react-is@^18.0.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react@^18.2.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" - integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== - dependencies: - loose-envify "^1.1.0" - read-cmd-shim@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-3.0.1.tgz#868c235ec59d1de2db69e11aec885bc095aea087" From e4d27006d28c50d5f936670acf0cbe3b5cf7af6b Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Fri, 11 Aug 2023 16:45:50 -0400 Subject: [PATCH 10/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20reduce=20docker?= =?UTF-8?q?=20image=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use lts-alpine for base image and use builder container to avoid importing dev dependencies into the final image --- Dockerfile | 34 +++++++++++++++++++++++++++------- README.md | 2 +- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d00a3c63..767d6213 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,33 @@ -FROM node:18 +FROM node:lts-alpine3.17 AS builder + +RUN apk add --no-cache \ + python3 \ + make \ + cmake \ + g++ \ + jq + +WORKDIR /app/builder +RUN chown -R node: /app + +USER node + +COPY --chown=node:node . . + +RUN yarn install \ + --frozen-lockfile \ + --no-progress && \ + yarn build && \ + yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') && \ + rm -r /home/node/.cache/ + +FROM node:lts-alpine3.17 WORKDIR /home/node -# cache yarn install step -COPY --chown=node:node package.json /home/node -COPY --chown=node:node yarn.lock /home/node -RUN yarn --frozen-lockfile +COPY --from=builder --chown=root:root /app/builder/node_modules ./node_modules +COPY --from=builder --chown=root:root /app/builder/dist/ ./dist COPY --chown=node:node . /home/node USER node -RUN yarn build -ENTRYPOINT ["/bin/bash", "./docker-entrypoint.sh"] +ENTRYPOINT ["/bin/sh", "./docker-entrypoint.sh"] diff --git a/README.md b/README.md index 06fe80aa..cceba1bb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A REST API wrapper for the Polymesh blockchain. -This version is compatible with chain versions 5.2.x +This version is compatible with chain versions 5.4.x - 6.0.x ## Setup From babaa08425b91db1514f5f9f31daa86df8e1e668 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Mon, 14 Aug 2023 11:32:13 -0400 Subject: [PATCH 11/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20improve=20dockerf?= =?UTF-8?q?ile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ignore scripts during install and make files owned by "node" user in the image --- .dockerignore | 1 + Dockerfile | 9 ++++++--- docker-entrypoint.sh | 1 - package.json | 5 ++--- 4 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 docker-entrypoint.sh diff --git a/.dockerignore b/.dockerignore index 60684c71..45229ed5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ .git +.env* node_modules/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 767d6213..6904de86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ USER node COPY --chown=node:node . . RUN yarn install \ + --ignore-scripts \ --frozen-lockfile \ --no-progress && \ yarn build && \ @@ -23,11 +24,13 @@ RUN yarn install \ FROM node:lts-alpine3.17 WORKDIR /home/node +ENV NODE_ENV production -COPY --from=builder --chown=root:root /app/builder/node_modules ./node_modules -COPY --from=builder --chown=root:root /app/builder/dist/ ./dist +COPY --from=builder --chown=node:node /app/builder/node_modules ./node_modules +COPY --from=builder --chown=node:node /app/builder/dist/ ./dist COPY --chown=node:node . /home/node USER node -ENTRYPOINT ["/bin/sh", "./docker-entrypoint.sh"] +CMD [ "node", "dist/main.js" ] + diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100644 index 0d92ae2d..00000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1 +0,0 @@ -yarn start:prod diff --git a/package.json b/package.json index 54eea628..a565341f 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "start": "nest start", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", - "start:prod": "NODE_ENV='production' node dist/main", "start:repl": "yarn start --entryFile commands/repl", "generate:swagger": "yarn start --entryFile commands/write-swagger", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", @@ -63,13 +62,13 @@ "rimraf": "3.0.2", "rxjs": "^7.5.7", "swagger-ui-express": "4.4.0", - "typeorm": "^0.3.10" + "typeorm": "^0.3.10", + "@golevelup/ts-jest": "^0.3.3" }, "devDependencies": { "@babel/plugin-transform-modules-commonjs": "7.15.0", "@commitlint/cli": "12.1.4", "@commitlint/config-conventional": "12.1.4", - "@golevelup/ts-jest": "^0.3.3", "@nestjs/cli": "^9.3.0", "@nestjs/schematics": "^9.0.3", "@nestjs/testing": "^9.3.0", From 4ca9c25fcc2ae96ce4cf1909ccc353282e32c3e3 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Wed, 16 Aug 2023 07:44:01 -0400 Subject: [PATCH 12/19] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20to=20use?= =?UTF-8?q?=20latest=20fireblock=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/signing/config/signers.config.ts | 4 +++- yarn.lock | 15 ++++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 0631d063..3a88b552 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "@nestjs/schedule": "^2.2.0", "@nestjs/swagger": "^6.2.1", "@nestjs/typeorm": "^9.0.1", - "@polymeshassociation/fireblocks-signing-manager": "^2.1.0", + "@polymeshassociation/fireblocks-signing-manager": "^2.2.0", "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", "@polymeshassociation/local-signing-manager": "^2.1.0", "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.9", diff --git a/src/signing/config/signers.config.ts b/src/signing/config/signers.config.ts index 6b9d4083..d93e7131 100644 --- a/src/signing/config/signers.config.ts +++ b/src/signing/config/signers.config.ts @@ -1,6 +1,7 @@ /* istanbul ignore file */ import { registerAs } from '@nestjs/config'; +import { readFileSync } from 'fs'; export default registerAs('signer-accounts', () => { const { @@ -22,10 +23,11 @@ export default registerAs('signer-accounts', () => { } if (FIREBLOCKS_URL && FIREBLOCKS_API_KEY && FIREBLOCKS_SECRET_PATH) { + const secret = readFileSync(FIREBLOCKS_SECRET_PATH, 'utf8'); const fireblocks = { url: FIREBLOCKS_URL, apiKey: FIREBLOCKS_API_KEY, - secretPath: FIREBLOCKS_SECRET_PATH, + secret: secret, }; return { fireblocks }; diff --git a/yarn.lock b/yarn.lock index 63861605..11df0d9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1677,14 +1677,14 @@ "@types/websocket" "^1.0.5" websocket "^1.0.34" -"@polymeshassociation/fireblocks-signing-manager@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@polymeshassociation/fireblocks-signing-manager/-/fireblocks-signing-manager-2.1.0.tgz#eda9af552b862ba14bad20682c6a59e69347192b" - integrity sha512-YVRvjEVhzS+WPHx95rNgOnRRgjjYijRjcriG+iGeHcQWprZnxGuVUlsaz+MvmxoySo/XtAHzavOzzMZfQyaL2g== +"@polymeshassociation/fireblocks-signing-manager@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@polymeshassociation/fireblocks-signing-manager/-/fireblocks-signing-manager-2.2.0.tgz#15aea1e8131dc604301ee840e7b418006cb61598" + integrity sha512-Y9ILReIwRNyWu2nw1Kf9xvkNwcsoBiaaY57URJFB2jSaXr8eHSRmEZwyS6jpy8JKeMJBDmUVF0pRcrN7iO/YFA== dependencies: "@polkadot/util" "^10.4.2" "@polkadot/util-crypto" "^10.4.2" - "@polymeshassociation/signing-manager-types" "^2.1.0" + "@polymeshassociation/signing-manager-types" "^3.0.0" fireblocks-sdk "^2.5.3" "@polymeshassociation/hashicorp-vault-signing-manager@^2.1.0": @@ -1732,6 +1732,11 @@ resolved "https://registry.yarnpkg.com/@polymeshassociation/signing-manager-types/-/signing-manager-types-2.1.0.tgz#c4c6e27e93d3d98de5c28a92862bcab7fb527a6c" integrity sha512-UJaaFuHeHtduN42bU5GUhJ7JgExhWvcF5751jHxGg7Gj4xjQyiaNvpQsejYeOlUoALnZ1McmB3nPrbm03TeNKA== +"@polymeshassociation/signing-manager-types@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@polymeshassociation/signing-manager-types/-/signing-manager-types-3.0.0.tgz#70327690e1779b2ceb7b612c3f447a96d6621557" + integrity sha512-8jiR+6Yijy+kGBDTWjr6H+YbaoSlU7tIgXqpX7YVKdmnEbP/SKDh4ktGkF88513J52So+JGDcoLG4URLAhDkhQ== + "@scure/base@1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" From 900ef367084534fb139afb832a0edf89c9317b5e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 21 Aug 2023 15:47:44 +0000 Subject: [PATCH 13/19] chore(release): 3.0.0-alpha.6 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [3.0.0-alpha.6](https://github.com/PolymeshAssociation/polymesh-rest-api/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2023-08-21) ### Features * ๐ŸŽธ add sdk dual 5.4-6.0 version for smooth upgrade ([55c9e4d](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/55c9e4d718fbc0654200762ddfedfc191d7fb413)) --- package.json | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a85ed7ce..30f92810 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polymesh-rest-api", - "version": "3.0.0-alpha.5", + "version": "3.0.0-alpha.6", "description": "Provides a REST like interface for interacting with the Polymesh blockchain", "author": "Polymesh Association", "private": true, diff --git a/src/main.ts b/src/main.ts index 7110f7a2..15fec8e5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,7 @@ async function bootstrap(): Promise { const options = new DocumentBuilder() .setTitle(swaggerTitle) .setDescription(swaggerDescription) - .setVersion('3.0.0-alpha.5'); + .setVersion('3.0.0-alpha.6'); const configService = app.get(ConfigService); From a269b2923ae05f328903f885cffac464b1c49792 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Tue, 22 Aug 2023 09:35:51 -0400 Subject: [PATCH 14/19] =?UTF-8?q?fix:=20=F0=9F=90=9B=20bump=20sdk=20versio?= =?UTF-8?q?n=20for=205.4=20asset=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 30f92810..e61d1719 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@polymeshassociation/fireblocks-signing-manager": "^2.2.0", "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", "@polymeshassociation/local-signing-manager": "^2.1.0", - "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.12", + "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.13", "@polymeshassociation/signing-manager-types": "^2.1.0", "class-transformer": "0.5.1", "class-validator": "^0.14.0", diff --git a/yarn.lock b/yarn.lock index 14be732c..570a6e39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1705,10 +1705,10 @@ dependencies: "@polymeshassociation/signing-manager-types" "^2.1.0" -"@polymeshassociation/polymesh-sdk@21.0.0-alpha.12": - version "21.0.0-alpha.12" - resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.12.tgz#89f9786c99f6c8a33f97bf54d0fc1fbf3e1b31b7" - integrity sha512-BM3D+1+VTsqrLNWJ+KyEDH3NDU9yJlM7f1YYfd7jr1oEKn6Y1U/0VrkgJBkm5YbQ8XaxF3Mo0kyyqqxsc+pJ2g== +"@polymeshassociation/polymesh-sdk@21.0.0-alpha.13": + version "21.0.0-alpha.13" + resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.13.tgz#413d4a5846c6c8c836b89333aa302c793c0eab2a" + integrity sha512-4NyDEaw68IxSFBvja3OmmsLISyuEVpL+MH4hkScwECZKDXhztckNPZ+CkAU/ePSLno/5oK8D9dq+WK+WiGvfBg== dependencies: "@apollo/client" "^3.7.10" "@polkadot/api" "9.14.2" From 6ea68f1d65220b76d399d31ec610e6681ebcffab Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 22 Aug 2023 14:26:29 +0000 Subject: [PATCH 15/19] chore(release): 3.0.0-alpha.7 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [3.0.0-alpha.7](https://github.com/PolymeshAssociation/polymesh-rest-api/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2023-08-22) ### Bug Fixes * ๐Ÿ› bump sdk version for 5.4 asset fix ([a269b29](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/a269b2923ae05f328903f885cffac464b1c49792)) --- package.json | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e61d1719..9b13e6f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polymesh-rest-api", - "version": "3.0.0-alpha.6", + "version": "3.0.0-alpha.7", "description": "Provides a REST like interface for interacting with the Polymesh blockchain", "author": "Polymesh Association", "private": true, diff --git a/src/main.ts b/src/main.ts index 15fec8e5..c8700c56 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,7 @@ async function bootstrap(): Promise { const options = new DocumentBuilder() .setTitle(swaggerTitle) .setDescription(swaggerDescription) - .setVersion('3.0.0-alpha.6'); + .setVersion('3.0.0-alpha.7'); const configService = app.get(ConfigService); From 09d401189bcca667ff0bf3a5e3ff1265181174a0 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Wed, 23 Aug 2023 09:44:43 -0400 Subject: [PATCH 16/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20upgrade=20sdk=20to?= =?UTF-8?q?=2022.alpha-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e61d1719..f9b508ee 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@polymeshassociation/fireblocks-signing-manager": "^2.2.0", "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", "@polymeshassociation/local-signing-manager": "^2.1.0", - "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.13", + "@polymeshassociation/polymesh-sdk": "22.0.0-alpha.2", "@polymeshassociation/signing-manager-types": "^2.1.0", "class-transformer": "0.5.1", "class-validator": "^0.14.0", diff --git a/yarn.lock b/yarn.lock index 570a6e39..fdc9e8bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1705,10 +1705,10 @@ dependencies: "@polymeshassociation/signing-manager-types" "^2.1.0" -"@polymeshassociation/polymesh-sdk@21.0.0-alpha.13": - version "21.0.0-alpha.13" - resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.13.tgz#413d4a5846c6c8c836b89333aa302c793c0eab2a" - integrity sha512-4NyDEaw68IxSFBvja3OmmsLISyuEVpL+MH4hkScwECZKDXhztckNPZ+CkAU/ePSLno/5oK8D9dq+WK+WiGvfBg== +"@polymeshassociation/polymesh-sdk@22.0.0-alpha.2": + version "22.0.0-alpha.2" + resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-22.0.0-alpha.2.tgz#60ebc975da2f8e4def886848b8ed98939a8afe73" + integrity sha512-nO1hFg934CApdHJ29PfoagHVmmmIVso+K/RJlfprJoGUSZo5uSmdHfnvqvyPgd/jTsfZK0uISHgfYxjjcrR+nw== dependencies: "@apollo/client" "^3.7.10" "@polkadot/api" "9.14.2" From 1762a31105ed0fc2fe7538c1c4aa3bec901567f0 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 23 Aug 2023 14:02:38 +0000 Subject: [PATCH 17/19] chore(release): 3.0.0-alpha.8 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [3.0.0-alpha.8](https://github.com/PolymeshAssociation/polymesh-rest-api/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2023-08-23) ### Features * ๐ŸŽธ upgrade sdk to 22.alpha-2 ([09d4011](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/09d401189bcca667ff0bf3a5e3ff1265181174a0)) --- package.json | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0cfb4b1b..d437a807 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polymesh-rest-api", - "version": "3.0.0-alpha.7", + "version": "3.0.0-alpha.8", "description": "Provides a REST like interface for interacting with the Polymesh blockchain", "author": "Polymesh Association", "private": true, diff --git a/src/main.ts b/src/main.ts index c8700c56..675ea2ac 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,7 @@ async function bootstrap(): Promise { const options = new DocumentBuilder() .setTitle(swaggerTitle) .setDescription(swaggerDescription) - .setVersion('3.0.0-alpha.7'); + .setVersion('3.0.0-alpha.8'); const configService = app.get(ConfigService); From 4bfacdbfa275711ed979616a08fff44c6656c4c4 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Wed, 23 Aug 2023 15:18:16 -0400 Subject: [PATCH 18/19] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20use=20sdk=20v22.al?= =?UTF-8?q?pha-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9b13e6f7..d00e0aef 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@polymeshassociation/fireblocks-signing-manager": "^2.2.0", "@polymeshassociation/hashicorp-vault-signing-manager": "^2.1.0", "@polymeshassociation/local-signing-manager": "^2.1.0", - "@polymeshassociation/polymesh-sdk": "21.0.0-alpha.13", + "@polymeshassociation/polymesh-sdk": "22.0.0-alpha.3", "@polymeshassociation/signing-manager-types": "^2.1.0", "class-transformer": "0.5.1", "class-validator": "^0.14.0", diff --git a/yarn.lock b/yarn.lock index 570a6e39..1574ca05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1705,10 +1705,10 @@ dependencies: "@polymeshassociation/signing-manager-types" "^2.1.0" -"@polymeshassociation/polymesh-sdk@21.0.0-alpha.13": - version "21.0.0-alpha.13" - resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-21.0.0-alpha.13.tgz#413d4a5846c6c8c836b89333aa302c793c0eab2a" - integrity sha512-4NyDEaw68IxSFBvja3OmmsLISyuEVpL+MH4hkScwECZKDXhztckNPZ+CkAU/ePSLno/5oK8D9dq+WK+WiGvfBg== +"@polymeshassociation/polymesh-sdk@22.0.0-alpha.3": + version "22.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-22.0.0-alpha.3.tgz#2cf6161a679b571c4e9be7e74200eddf96a0aeab" + integrity sha512-4dVP5jpt0SXycP3SmBZW8gbJIxq9iWKoBhKWbSuQZ7UKwQvNCnSDUxq1PXcgHSJYmwWPkxh5l391WiKCSrlwmQ== dependencies: "@apollo/client" "^3.7.10" "@polkadot/api" "9.14.2" From ca8342a496782a0d94d03629c9562848b4d63a98 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 24 Aug 2023 13:23:21 +0000 Subject: [PATCH 19/19] chore(release): 3.0.0-alpha.9 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # [3.0.0-alpha.9](https://github.com/PolymeshAssociation/polymesh-rest-api/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2023-08-24) ### Features * ๐ŸŽธ register identity ([3c86517](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/3c865176217e04fb34baa1b095630548d1da987d)) * ๐ŸŽธ use sdk v22.alpha-3 ([4bfacdb](https://github.com/PolymeshAssociation/polymesh-rest-api/commit/4bfacdbfa275711ed979616a08fff44c6656c4c4)) --- package.json | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7387aff6..0c2f02d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polymesh-rest-api", - "version": "3.0.0-alpha.8", + "version": "3.0.0-alpha.9", "description": "Provides a REST like interface for interacting with the Polymesh blockchain", "author": "Polymesh Association", "private": true, diff --git a/src/main.ts b/src/main.ts index 675ea2ac..e43e49f0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,7 +47,7 @@ async function bootstrap(): Promise { const options = new DocumentBuilder() .setTitle(swaggerTitle) .setDescription(swaggerDescription) - .setVersion('3.0.0-alpha.8'); + .setVersion('3.0.0-alpha.9'); const configService = app.get(ConfigService);