Skip to content

Commit 843dff7

Browse files
committed
feat: 🎸 update SDK to support v7/v8 chains
provide dual v7/v8 chain support
1 parent f3515c3 commit 843dff7

File tree

6 files changed

+42
-28
lines changed

6 files changed

+42
-28
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@polymeshassociation/fireblocks-signing-manager": "^2.5.0",
5353
"@polymeshassociation/hashicorp-vault-signing-manager": "^3.5.0",
5454
"@polymeshassociation/local-signing-manager": "^3.5.2",
55-
"@polymeshassociation/polymesh-sdk": "v29.1.0-beta.9",
55+
"@polymeshassociation/polymesh-sdk": "v29.1.0-beta.15",
5656
"@polymeshassociation/polymesh-types": "^6.2.0",
5757
"@polymeshassociation/signing-manager-types": "^3.4.2",
5858
"class-transformer": "0.5.1",

‎src/assets/assets.service.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { LinkTickerDto } from '~/assets/dto/link-ticker.dto';
2929
import { RedeemTokensDto } from '~/assets/dto/redeem-tokens.dto';
3030
import { RequiredMediatorsDto } from '~/assets/dto/required-mediators.dto';
3131
import { SetAssetDocumentsDto } from '~/assets/dto/set-asset-documents.dto';
32-
import { SetStatsDto } from '~/assets/dto/transfer-restrictions/set-stats.dto';
3332
import { SetTransferRestrictionsDto } from '~/assets/dto/transfer-restrictions/set-transfer-restrictions.dto';
3433
import { VenueIdsDto } from '~/assets/dto/venue-ids.dto';
3534
import { isAssetId } from '~/common/decorators';
@@ -44,6 +43,8 @@ import { toPortfolioId } from '~/portfolios/portfolios.util';
4443
import { TransactionsService } from '~/transactions/transactions.service';
4544
import { handleSdkError } from '~/transactions/transactions.util';
4645

46+
import { SetStatsDto } from './dto/transfer-restrictions/set-stats.dto';
47+
4748
@Injectable()
4849
export class AssetsService {
4950
constructor(

‎src/assets/assets.util.ts‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { BigNumber } from '@polymeshassociation/polymesh-sdk';
22
import {
3+
AddBalanceStatParams,
4+
AddClaimBalanceStatParams,
35
AddClaimCountStatParams,
4-
AddClaimPercentageStatParams,
56
AddCountStatParams,
6-
AddPercentageStatParams,
77
Asset,
88
ClaimType,
99
CreateGroupParams,
@@ -267,15 +267,15 @@ export async function transferRestrictionsDtoToRestrictions(
267267

268268
type StatParams =
269269
| AddCountStatParams
270-
| AddPercentageStatParams
270+
| AddBalanceStatParams
271271
| AddClaimCountStatParams
272-
| AddClaimPercentageStatParams;
272+
| AddClaimBalanceStatParams;
273273

274274
type StatParamsWithStringValues =
275-
| (Omit<AddCountStatParams, 'count'> & { count: string | BigNumber })
276-
| AddPercentageStatParams
275+
| (Omit<AddCountStatParams, 'count'> & { count?: string | BigNumber })
276+
| AddBalanceStatParams
277277
| (Omit<AddClaimCountStatParams, 'value'> & {
278-
value:
278+
value?:
279279
| {
280280
accredited?: string | BigNumber;
281281
nonAccredited?: string | BigNumber;
@@ -289,7 +289,7 @@ type StatParamsWithStringValues =
289289
[key: string]: unknown;
290290
}>;
291291
})
292-
| AddClaimPercentageStatParams;
292+
| AddClaimBalanceStatParams;
293293

294294
/**
295295
* Type guard for AddCountStatParams
@@ -309,7 +309,7 @@ function isAddCountStatParams(
309309
/**
310310
* Type guard for AddPercentageStatParams
311311
*/
312-
function isAddPercentageStatParams(stat: unknown): stat is AddPercentageStatParams {
312+
function isAddPercentageStatParams(stat: unknown): stat is AddBalanceStatParams {
313313
return (
314314
typeof stat === 'object' &&
315315
stat !== null &&
@@ -334,9 +334,9 @@ function isAddClaimCountStatParams(
334334
}
335335

336336
/**
337-
* Type guard for AddClaimPercentageStatParams
337+
* Type guard for AddClaimBalanceStatParams
338338
*/
339-
function isAddClaimPercentageStatParams(stat: unknown): stat is AddClaimPercentageStatParams {
339+
function isAddClaimBalanceStatParams(stat: unknown): stat is AddClaimBalanceStatParams {
340340
return (
341341
typeof stat === 'object' &&
342342
stat !== null &&
@@ -429,7 +429,7 @@ export function ensureStatsBigNumberConversion(stats: StatParamsWithStringValues
429429
return convertScopedCountStat(stat);
430430
}
431431

432-
if (isAddPercentageStatParams(stat) || isAddClaimPercentageStatParams(stat)) {
432+
if (isAddPercentageStatParams(stat) || isAddClaimBalanceStatParams(stat)) {
433433
return stat;
434434
}
435435

‎src/assets/dto/transfer-restrictions/set-stats.dto.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import { ApiExtraModels, ApiProperty } from '@nestjs/swagger';
44
import {
5+
AddBalanceStatParams,
6+
AddClaimBalanceStatParams,
57
AddClaimCountStatParams,
6-
AddClaimPercentageStatParams,
78
AddCountStatParams,
8-
AddPercentageStatParams,
99
} from '@polymeshassociation/polymesh-sdk/types';
1010
import { ValidateNested } from 'class-validator';
1111

@@ -96,8 +96,8 @@ export class SetStatsDto extends TransactionBaseDto {
9696
@TransformScopedCountStats()
9797
readonly stats: (
9898
| AddCountStatParams
99-
| AddPercentageStatParams
99+
| AddBalanceStatParams
100100
| AddClaimCountStatParams
101-
| AddClaimPercentageStatParams
101+
| AddClaimBalanceStatParams
102102
)[];
103103
}

‎src/developer-testing/developer-testing.service.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class DeveloperTestingService {
7878
const initialPolyxCalls = accounts
7979
.filter(({ initialPolyx }) => initialPolyx.gt(0))
8080
.map(({ address, initialPolyx }) =>
81-
balances.transfer(address, initialPolyx.toNumber() * unitsPerPolyx)
81+
balances.transferWithMemo(address, initialPolyx.toNumber() * unitsPerPolyx, null)
8282
);
8383

8484
await this.polymeshService.execTransaction(signerAddress, utility.batchAll, [

‎yarn.lock‎

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,15 +2796,15 @@ __metadata:
27962796
languageName: node
27972797
linkType: hard
27982798

2799-
"@polymeshassociation/polymesh-sdk@npm:v29.1.0-beta.9":
2800-
version: 29.1.0-beta.9
2801-
resolution: "@polymeshassociation/polymesh-sdk@npm:29.1.0-beta.9"
2799+
"@polymeshassociation/polymesh-sdk@npm:v29.1.0-beta.15":
2800+
version: 29.1.0-beta.15
2801+
resolution: "@polymeshassociation/polymesh-sdk@npm:29.1.0-beta.15"
28022802
dependencies:
28032803
"@apollo/client": "npm:^3.8.1"
2804-
"@polkadot/api": "npm:11.2.1"
2805-
"@polkadot/util": "npm:12.6.2"
2806-
"@polkadot/util-crypto": "npm:12.6.2"
2807-
"@polymeshassociation/polymesh-types": "npm:^6.2.0"
2804+
"@polkadot/api": "npm:16.5.2"
2805+
"@polkadot/util": "npm:13.5.8"
2806+
"@polkadot/util-crypto": "npm:13.5.8"
2807+
"@polymeshassociation/polymesh-types": "npm:^7.0.0"
28082808
bignumber.js: "npm:9.0.1"
28092809
cross-fetch: "npm:^4.0.0"
28102810
dayjs: "npm:1.11.9"
@@ -2816,7 +2816,7 @@ __metadata:
28162816
semver: "npm:^7.5.4"
28172817
ts-morph: "npm:^25.0.1"
28182818
websocket: "npm:^1.0.34"
2819-
checksum: 10c0/ad690573767eb54a97942d63693231f3a8364c946676462acec7ef56b3000e864c4ea08a9cc48391532a036d01d63271085ece01f26304cf45217276a638e61f
2819+
checksum: 10c0/f8dd55b1030bb16c3237f409a70e0c1f10bea8f6210353b3bc8be47cae532dd75d3f2ddb75b9161632d6b95b8bc6b41b7a95acb22b67a3db616c4aa7d26df177
28202820
languageName: node
28212821
linkType: hard
28222822

@@ -2830,6 +2830,19 @@ __metadata:
28302830
languageName: node
28312831
linkType: hard
28322832

2833+
"@polymeshassociation/polymesh-types@npm:^7.0.0":
2834+
version: 7.0.0
2835+
resolution: "@polymeshassociation/polymesh-types@npm:7.0.0"
2836+
dependencies:
2837+
"@polkadot/api": "npm:16.5.2"
2838+
"@polkadot/api-base": "npm:16.5.2"
2839+
"@polkadot/rpc-core": "npm:16.5.2"
2840+
"@polkadot/types": "npm:16.5.2"
2841+
"@polkadot/types-codec": "npm:16.5.2"
2842+
checksum: 10c0/431a96557f23ded316f8889ba6a059e4f99ecab288ed485c55e540a91d1745f0780c02f2b80f4f63c9d1337dd9549a53ee4f99c7bf2545a8b7c79a056f068016
2843+
languageName: node
2844+
linkType: hard
2845+
28332846
"@polymeshassociation/signing-manager-types@npm:3.4.2, @polymeshassociation/signing-manager-types@npm:^3.4.2":
28342847
version: 3.4.2
28352848
resolution: "@polymeshassociation/signing-manager-types@npm:3.4.2"
@@ -11632,7 +11645,7 @@ __metadata:
1163211645
"@polymeshassociation/fireblocks-signing-manager": "npm:^2.5.0"
1163311646
"@polymeshassociation/hashicorp-vault-signing-manager": "npm:^3.5.0"
1163411647
"@polymeshassociation/local-signing-manager": "npm:^3.5.2"
11635-
"@polymeshassociation/polymesh-sdk": "npm:v29.1.0-beta.9"
11648+
"@polymeshassociation/polymesh-sdk": "npm:v29.1.0-beta.15"
1163611649
"@polymeshassociation/polymesh-types": "npm:^6.2.0"
1163711650
"@polymeshassociation/signing-manager-types": "npm:^3.4.2"
1163811651
"@semantic-release/changelog": "npm:^6.0.3"

0 commit comments

Comments
 (0)