Skip to content

Split runtime so version are individually typed + add missing count to Authorization #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/runtime/assetApi/v3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { DefinitionCall } from '@polkadot/types/types';

export const AssetApiV3: Record<string, DefinitionCall> = {
can_transfer_granular: {
description:
'Checks whether a transaction with given parameters can take place or not. The result is granular meaning each check is run and returned regardless of outcome.',
params: [
{ name: 'from_custodian', type: 'Option<IdentityId>' },
{ name: 'from_portfolio', type: 'PortfolioId' },
{ name: 'to_custodian', type: 'Option<IdentityId>' },
{ name: 'to_portfolio', type: 'PortfolioId' },
{ name: 'ticker', type: 'Ticker' },
{ name: 'value', type: 'Balance' },
],
type: 'CanTransferGranularReturn',
},
};
16 changes: 16 additions & 0 deletions src/runtime/assetApi/v4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { DefinitionCall } from '@polkadot/types/types';

export const AssetApiV4: Record<string, DefinitionCall> = {
transfer_report: {
description:
"Returns a vector containing all errors for the transfer. An empty vec means there's no error.",
params: [
{ name: 'sender_portfolio', type: 'PortfolioId' },
{ name: 'receiver_portfolio', type: 'PortfolioId' },
{ name: 'asset_id', type: 'AssetID' },
{ name: 'transfer_value', type: 'Balance' },
{ name: 'skip_locked_check', type: 'bool' },
],
type: 'Vec<DispatchError>',
},
};
13 changes: 13 additions & 0 deletions src/runtime/complianceApi/v1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { DefinitionCall } from '@polkadot/types/types';

export const ComplianceApiV1: Record<string, DefinitionCall> = {
compliance_report: {
description: 'Checks all compliance requirements for the given ticker.',
params: [
{ name: 'ticker', type: 'Ticker' },
{ name: 'sender_identity', type: 'IdentityId' },
{ name: 'receiver_identity', type: 'IdentityId' },
],
type: 'Result<ComplianceReport, DispatchError>',
},
};
13 changes: 13 additions & 0 deletions src/runtime/complianceApi/v2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { DefinitionCall } from '@polkadot/types/types';

export const ComplianceApiV2: Record<string, DefinitionCall> = {
compliance_report: {
description: 'Checks all compliance requirements for the given asset_id.',
params: [
{ name: 'asset_id', type: 'AssetID' },
{ name: 'sender_identity', type: 'IdentityId' },
{ name: 'receiver_identity', type: 'IdentityId' },
],
type: 'Result<ComplianceReport, DispatchError>',
},
};
14 changes: 14 additions & 0 deletions src/runtime/groupApi/v1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DefinitionCall } from '@polkadot/types/types';

export const GroupApiV1: Record<string, DefinitionCall> = {
get_cdd_valid_members: {
description: 'Get the CDD members',
params: [],
type: 'Vec<Member>',
},
get_gc_valid_members: {
description: 'Get the GC members',
params: [],
type: 'Vec<Member>',
},
};
51 changes: 51 additions & 0 deletions src/runtime/identityApi/v3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { DefinitionCall } from '@polkadot/types/types';

export const IdentityApiV3: Record<string, DefinitionCall> = {
is_identity_has_valid_cdd: {
description: 'use to tell whether the given did has valid cdd claim or not',
params: [
{ name: 'did', type: 'IdentityId' },
{ name: 'buffer_time', type: 'Option<u64>' },
],
type: 'CddStatus',
},
get_asset_did: {
description: 'function is used to query the given ticker DID',
params: [{ name: 'ticker', type: 'Ticker' }],
type: 'AssetDidResult',
},
get_did_records: {
description: 'Used to get the did record values for a given DID',
params: [{ name: 'did', type: 'IdentityId' }],
type: 'RpcDidRecords',
},
get_did_status: {
description: 'Retrieve status of the DID',
params: [{ name: 'did', type: 'Vec<IdentityId>' }],
type: 'Vec<DidStatus>',
},
get_filtered_authorizations: {
description:
'Retrieve authorizations data for a given signatory and filtered using the given authorization type',
params: [
{ name: 'signatory', type: 'Signatory' },
{ name: 'allow_expired', type: 'bool' },
{ name: 'auth_type', type: 'Option<AuthorizationType>' },
],
type: 'Vec<Authorization>',
},
get_key_identity_data: {
description: 'Query relation between a signing key and a DID',
params: [{ name: 'acc', type: 'AccountId' }],
type: 'Option<KeyIdentityData>',
},
valid_cdd_claims: {
description:
'Returns all valid IdentityClaim of type CustomerDueDiligence for the given target_identity',
params: [
{ name: 'target_identity', type: 'IdentityId' },
{ name: 'cdd_checker_leeway', type: 'Option<u64>' },
],
type: 'Vec<IdentityClaim>',
},
};
46 changes: 46 additions & 0 deletions src/runtime/identityApi/v4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { DefinitionCall } from '@polkadot/types/types';

export const IdentityApiV4: Record<string, DefinitionCall> = {
is_identity_has_valid_cdd: {
description: 'use to tell whether the given did has valid cdd claim or not',
params: [
{ name: 'did', type: 'IdentityId' },
{ name: 'buffer_time', type: 'Option<u64>' },
],
type: 'CddStatus',
},
get_did_records: {
description: 'Used to get the did record values for a given DID',
params: [{ name: 'did', type: 'IdentityId' }],
type: 'RpcDidRecords',
},
get_did_status: {
description: 'Retrieve status of the DID',
params: [{ name: 'did', type: 'Vec<IdentityId>' }],
type: 'Vec<DidStatus>',
},
get_filtered_authorizations: {
description:
'Retrieve authorizations data for a given signatory and filtered using the given authorization type',
params: [
{ name: 'signatory', type: 'Signatory' },
{ name: 'allow_expired', type: 'bool' },
{ name: 'auth_type', type: 'Option<AuthorizationType>' },
],
type: 'Vec<Authorization>',
},
get_key_identity_data: {
description: 'Query relation between a signing key and a DID',
params: [{ name: 'acc', type: 'AccountId' }],
type: 'Option<KeyIdentityData>',
},
valid_cdd_claims: {
description:
'Returns all valid IdentityClaim of type CustomerDueDiligence for the given target_identity',
params: [
{ name: 'target_identity', type: 'IdentityId' },
{ name: 'cdd_checker_leeway', type: 'Option<u64>' },
],
type: 'Vec<IdentityClaim>',
},
};
Loading
Loading