Skip to content

Commit

Permalink
feat: 🎸 add v7 statistics runtime API
Browse files Browse the repository at this point in the history
  • Loading branch information
polymath-eric committed Sep 20, 2024
1 parent 5b9fe84 commit f3bd507
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ProtocolApiV1 } from './protocolApi/v1';
import { SettlementApiV1 } from './settlementApi/v1';
import { SettlementApiV2 } from './settlementApi/v2';
import { StakingApiV1 } from './stakingApi/v1';
import { StatisticsApiV0 } from './statisticsApi/v0';

export const runtime: DefinitionsCall = {
AssetApi: [
Expand All @@ -40,6 +41,7 @@ export const runtime: DefinitionsCall = {
{ methods: SettlementApiV1, version: 1 },
],
StakingApi: [{ methods: StakingApiV1, version: 1 }],
StatisticsApi: [{ methods: StatisticsApiV0, version: 0 }],
};

export default runtime;
27 changes: 27 additions & 0 deletions src/runtime/statisticsApi/v0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { DefinitionCall } from '@polkadot/types/types';

export const StatisticsApiV0: Record<string, DefinitionCall> = {
transfer_restrictions_report: {
description:
"Returns a vector containing all TransferCondition that are not being respected for the transfer. An empty vec means there's no error.",
params: [
{
name: 'asset_id',
type: 'AssetID',
},
{
name: 'sender_did',
type: 'IdentityId',
},
{
name: 'receiver_did',
type: 'IdentityId',
},
{
name: 'transfer_amount',
type: 'Balance',
},
],
type: 'Result<Vec<TransferCondition>, DispatchError>',
},
};

0 comments on commit f3bd507

Please sign in to comment.