Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add runtime calls definitions
  • Loading branch information
ntn-x2 committed Aug 11, 2022
commit 210107d652194806169d5adb932c236bf8d35a54
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { types21 } from "./types_21"
import { types23 } from "./types_23"
import { types25 } from "./types_25"
import { types2700 } from "./types_2700"
import { SPEC_10800 } from "./spec_10800"
import { types10700 } from "./types_10700"

import runtime from "./runtime"

export {
types8,
Expand All @@ -27,8 +29,8 @@ export {
types23,
types25,
types2700,
SPEC_10800,
SPEC_10800 as latest,
types10700,
types10700 as latest,
}

export const typeBundleForPolkadot: OverrideBundleDefinition = {
Expand Down Expand Up @@ -82,9 +84,9 @@ export const typeBundleForPolkadot: OverrideBundleDefinition = {
types: types2700,
},
{
minmax: [10800, undefined],
types: SPEC_10800.types,
minmax: [10700, undefined],
types: types10700,
},
],
rpc: SPEC_10800.rpc,
runtime: runtime
}
45 changes: 45 additions & 0 deletions src/runtime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import type {
DefinitionsCall,
} from "@polkadot/types/types"

const runtime: DefinitionsCall = {
DidApi: [
{
methods: {
query_did_by_w3n: {
description: "Test",
params: [
{
name: "name",
type: "Text",
},
],
type: "Option<RawDidLinkedInfo<AccountId32, AccountId32, PalletDidLookupLinkableAccountLinkableAccountId, Balance, Key, BlockNumber>>"
},
query_did_by_account_id: {
description: "Test",
params: [
{
name: "name",
type: "PalletDidLookupLinkableAccountLinkableAccountId"
}
],
type: "Option<RawDidLinkedInfo<AccountId32, AccountId32, PalletDidLookupLinkableAccountLinkableAccountId, Balance, Key, BlockNumber>>"
},
query_did: {
description: "Test",
params: [
{
name: "did",
type: "AccountId32"
}
],
type: "Option<RawDidLinkedInfo<AccountId32, AccountId32, PalletDidLookupLinkableAccountLinkableAccountId, Balance, Key, BlockNumber>>"
}
},
version: 1
}
],
}

export default runtime
78 changes: 0 additions & 78 deletions src/spec_10800.ts

This file was deleted.

28 changes: 28 additions & 0 deletions src/types_10700.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type {
RegistryTypes,
} from "@polkadot/types/types"

export const types10700: RegistryTypes = {
// DID state_call
RawDidLinkedInfo: {
identifier: "AccountId32",
accounts: "Vec<PalletDidLookupLinkableAccountLinkableAccountId>",
w3n: "Option<Text>",
serviceEndpoints: "Vec<RawServiceEndpoints>",
details: "RawDidDetails",
},
RawServiceEndpoints: {
id: "Text",
serviceTypes: "Vec<Text>",
urls: "Vec<Text>"
},
RawDidDetails: {
authenticationKey: "Hash",
keyAgreementKeys: "BTreeSet<Hash>",
delegationKey: "Option<Hash>",
attestationKey: "Option<Hash>",
publicKeys: "BTreeMap<Hash, DidDidDetailsDidPublicKeyDetails<BlockNumber>>",
lastTxCounter: "BlockNumber",
deposit: "KiltSupportDeposit<AccountId32, Balance>"
},
}