Skip to content

Commit 596bd9d

Browse files
committed
feat: 🎸 support customClaim withouth scope
update sdk version to 26.2.0-alpha.1
1 parent f97707a commit 596bd9d

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@polymeshassociation/fireblocks-signing-manager": "^2.5.0",
5050
"@polymeshassociation/hashicorp-vault-signing-manager": "^3.4.0",
5151
"@polymeshassociation/local-signing-manager": "^3.3.0",
52-
"@polymeshassociation/polymesh-sdk": "^26.1.0",
52+
"@polymeshassociation/polymesh-sdk": "^26.2.0-alpha.1",
5353
"@polymeshassociation/signing-manager-types": "^3.2.0",
5454
"class-transformer": "0.5.1",
5555
"class-validator": "^0.14.0",

‎src/claims/dto/claim.dto.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ describe('claimsDto', () => {
102102
customClaimTypeId: new BigNumber('1'),
103103
},
104104
],
105+
[
106+
'Custom claim with `customClaimTypeId` and no `scope`',
107+
{
108+
type: ClaimType.Custom,
109+
customClaimTypeId: new BigNumber('1'),
110+
},
111+
],
105112
];
106113
test.each(cases)('%s', async (_, input) => {
107114
await target.transform(input, metadata).catch(err => {
@@ -175,6 +182,15 @@ describe('claimsDto', () => {
175182
'trustedClaimIssuers.0.each value in trustedFor must be one of the following values: Accredited, Affiliate, BuyLockup, SellLockup, CustomerDueDiligence, KnowYourCustomer, Jurisdiction, Exempted, Blocked, Custom',
176183
],
177184
],
185+
[
186+
'Custom with empty `scope`',
187+
{
188+
type: ClaimType.Custom,
189+
scope: {},
190+
customClaimTypeId: new BigNumber('1'),
191+
},
192+
['scope.type must be one of the following values: Identity, Ticker, Asset, Custom'],
193+
],
178194
];
179195
test.each(cases)('%s', async (_, input, expected) => {
180196
let error;

‎src/claims/dto/claim.dto.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export class ClaimDto {
2626
'The scope of the Claim. Required for most types except for `CustomerDueDiligence`, `InvestorUniquenessV2` and `NoData`',
2727
type: ScopeDto,
2828
})
29-
@ValidateIf(claim => !isCddClaim(claim))
29+
@ValidateIf(
30+
claim => !isCddClaim(claim) && !(claim.type === ClaimType.Custom && claim.scope === undefined)
31+
)
3032
@ValidateNested()
3133
@Type(() => ScopeDto)
3234
@IsNotEmptyObject()

‎yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,10 +1954,10 @@
19541954
dependencies:
19551955
"@polymeshassociation/signing-manager-types" "^3.3.0"
19561956

1957-
"@polymeshassociation/polymesh-sdk@^26.1.0":
1958-
version "26.1.0"
1959-
resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-26.1.0.tgz#88584cf89af98fd7eb722ec8d6ce3c2b5d557240"
1960-
integrity sha512-0I6/CwAFxE67Rb8JenEiHnzZObTou4dKpnR4esQZpiRh+DLnzrplk1OMihfccsTFISVYGGf2OdYiNGasGuaMSw==
1957+
"@polymeshassociation/polymesh-sdk@^26.2.0-alpha.1":
1958+
version "26.2.0-alpha.1"
1959+
resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-26.2.0-alpha.1.tgz#227ed72deea0f7137c5d584d85a4b235d380f65c"
1960+
integrity sha512-zUpDRNZGKagQ38N1avGoo54tCX89lShcqTY2Ez5OCN7F3CA7eKDPhRoO+3DQmXIPmHrHu22BB19Z5M+hfeAVlQ==
19611961
dependencies:
19621962
"@apollo/client" "^3.8.1"
19631963
"@polkadot/api" "11.2.1"

0 commit comments

Comments
 (0)