Skip to content

Commit

Permalink
companion - sdk update v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smohan-dw committed Dec 28, 2023
1 parent 59f3378 commit eda6d61
Show file tree
Hide file tree
Showing 26 changed files with 1,088 additions and 1,106 deletions.
34 changes: 14 additions & 20 deletions demo/src/network-score-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function main() {
console.log(`\n🌐 Network Score Initial Setup`)

console.log(`\n🎎 Particpants `)
const { account: networkAuthorIdentity } = await createAccount(
const { account: networkAuthorIdentity } = createAccount(
Cord.Utils.Crypto.mnemonicGenerate()
)
console.log(
Expand Down Expand Up @@ -76,7 +76,7 @@ async function main() {
const chainSpace = await Cord.ChainSpace.dispatchToChain(
spaceProperties,
chainSpaceAdminDid.uri,
networkAuthorIdentity,
devAuthorIdentity,
async ({ data }) => ({
signature: chainSpaceAdminKeys.authentication.sign(data),
keyType: chainSpaceAdminKeys.authentication.type,
Expand Down Expand Up @@ -158,9 +158,8 @@ async function main() {
async ({ data }) => ({
signature: networkProviderKeys.assertionMethod.sign(data),
keyType: networkProviderKeys.assertionMethod.type,
keyUri: `${networkProviderDid.uri}${
networkProviderDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
keyUri: `${networkProviderDid.uri}${networkProviderDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
})
)
console.log(`\n🌐 Rating Information to API endpoint (/write-ratings) `)
Expand All @@ -176,9 +175,8 @@ async function main() {
async ({ data }) => ({
signature: networkAuthorKeys.assertionMethod.sign(data),
keyType: networkAuthorKeys.assertionMethod.type,
keyUri: `${networkAuthorDid.uri}${
networkAuthorDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
keyUri: `${networkAuthorDid.uri}${networkAuthorDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
})
)

Expand Down Expand Up @@ -220,9 +218,8 @@ async function main() {
async ({ data }) => ({
signature: networkProviderKeys.assertionMethod.sign(data),
keyType: networkProviderKeys.assertionMethod.type,
keyUri: `${networkProviderDid.uri}${
networkProviderDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
keyUri: `${networkProviderDid.uri}${networkProviderDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
})
)
console.log(
Expand All @@ -241,9 +238,8 @@ async function main() {
async ({ data }) => ({
signature: networkAuthorKeys.assertionMethod.sign(data),
keyType: networkAuthorKeys.assertionMethod.type,
keyUri: `${networkAuthorDid.uri}${
networkAuthorDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
keyUri: `${networkAuthorDid.uri}${networkAuthorDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
})
)
console.log(
Expand Down Expand Up @@ -290,9 +286,8 @@ async function main() {
async ({ data }) => ({
signature: networkProviderKeys.assertionMethod.sign(data),
keyType: networkProviderKeys.assertionMethod.type,
keyUri: `${networkProviderDid.uri}${
networkProviderDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
keyUri: `${networkProviderDid.uri}${networkProviderDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
})
)
console.log(
Expand All @@ -310,9 +305,8 @@ async function main() {
async ({ data }) => ({
signature: networkAuthorKeys.assertionMethod.sign(data),
keyType: networkAuthorKeys.assertionMethod.type,
keyUri: `${networkAuthorDid.uri}${
networkAuthorDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
keyUri: `${networkAuthorDid.uri}${networkAuthorDid.assertionMethod![0].id
}` as Cord.DidResourceUri,
})
)

Expand Down
14 changes: 2 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,10 @@
"ts-jest-resolver": "^2.0.1",
"tsx": "^3.4.3",
"typedoc": "^0.25.3",
"typescript": "^5.1.6"
"typescript": "^5.3.0"
},
"resolutions": {
"typescript": "5.1.6",
"@polkadot/api": "10.10.1",
"@polkadot/keyring": "12.4.1",
"@polkadot/types": "10.10.1",
"@polkadot/types-codec": "10.10.1",
"@polkadot/typegen": "10.10.1",
"@polkadot/util": "12.4.1",
"@polkadot/util-crypto": "12.4.1",
"@polkadot/rpc-augment": "10.10.1",
"@polkadot/rpc-core": "10.10.1",
"@polkadot/rpc-provider": "10.10.1"
"typescript": "^5.3.3"
},
"version": "0.9.0-1beta5",
"packageManager": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion packages/augment-api/metadata/cord.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions packages/augment-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,26 @@
},
"repository": "github:dhiway/cord.js",
"engines": {
"node": ">=18.0"
"node": ">=20.0"
},
"author": "Dhiway <[email protected]>",
"license": "Apache-2.0",
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"@polkadot/api": "^10.10.1",
"@polkadot/typegen": "^10.10.1",
"@types/node": "^20.8.4",
"@polkadot/api": "^10.11.1",
"@polkadot/typegen": "^10.11.1",
"@types/node": "^20.10.5",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"typescript": "^5.3.0",
"yargs": "^16.2.0"
},
"dependencies": {
"@cord.network/type-definitions": "workspace:*",
"@polkadot/rpc-augment": "^10.10.1",
"@polkadot/rpc-core": "^10.10.1",
"@polkadot/rpc-provider": "^10.10.1",
"@polkadot/rpc-augment": "^10.11.1",
"@polkadot/rpc-core": "^10.11.1",
"@polkadot/rpc-provider": "^10.11.1",
"glob": "^7.1.1"
}
}
10 changes: 5 additions & 5 deletions packages/augment-api/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ declare module '@polkadot/api-base/types/errors' {
* distribution limit exceeded
**/
DistributionLimitExceeded: AugmentedError<ApiType>;
/**
* Not enough balance
**/
InsufficientBalance: AugmentedError<ApiType>;
/**
* Invalid asset type
**/
Expand All @@ -56,6 +52,10 @@ declare module '@polkadot/api-base/types/errors' {
* Invalid creator signature
**/
InvalidSignature: AugmentedError<ApiType>;
/**
* Not enough balance
**/
OverIssuanceLimit: AugmentedError<ApiType>;
/**
* Unauthorized operation
**/
Expand Down Expand Up @@ -1043,7 +1043,7 @@ declare module '@polkadot/api-base/types/errors' {
};
sudo: {
/**
* Sender must be the Sudo account
* Sender must be the Sudo account.
**/
RequireSudo: AugmentedError<ApiType>;
};
Expand Down
10 changes: 7 additions & 3 deletions packages/augment-api/src/interfaces/augment-api-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
import type { ITuple } from '@polkadot/types-codec/types';
import type { OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
import type { CordRuntimeEntitiesValidatorFullIdentification, FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, SpConsensusGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
import type { FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, SpConsensusGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';

export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;

Expand Down Expand Up @@ -374,7 +374,7 @@ declare module '@polkadot/api-base/types/events' {
/**
* At the end of the session, at least one validator was found to be offline.
**/
SomeOffline: AugmentedEvent<ApiType, [offline: Vec<ITuple<[AccountId32, CordRuntimeEntitiesValidatorFullIdentification]>>], { offline: Vec<ITuple<[AccountId32, CordRuntimeEntitiesValidatorFullIdentification]>> }>;
SomeOffline: AugmentedEvent<ApiType, [offline: Vec<ITuple<[AccountId32, Null]>>], { offline: Vec<ITuple<[AccountId32, Null]>> }>;
};
indices: {
/**
Expand Down Expand Up @@ -611,7 +611,11 @@ declare module '@polkadot/api-base/types/events' {
/**
* The sudo key has been updated.
**/
KeyChanged: AugmentedEvent<ApiType, [oldSudoer: Option<AccountId32>], { oldSudoer: Option<AccountId32> }>;
KeyChanged: AugmentedEvent<ApiType, [old: Option<AccountId32>, new_: AccountId32], { old: Option<AccountId32>, new_: AccountId32 }>;
/**
* The key was permanently removed.
**/
KeyRemoved: AugmentedEvent<ApiType, []>;
/**
* A sudo call just took place.
**/
Expand Down
6 changes: 5 additions & 1 deletion packages/augment-api/src/interfaces/augment-api-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, bool, u128, u32, u64
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import type { AccountId32, Call, H256 } from '@polkadot/types/interfaces/runtime';
import type { CordIdentifierEventEntry, CordIdentifierIdentifierTypeOf, CordRuntimeSessionKeys, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAssetAssetDistributionEntry, PalletAssetAssetEntry, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmountRuntimeFreezeReason, PalletBalancesIdAmountRuntimeHoldReason, PalletBalancesReserveData, PalletChainSpaceSpaceAuthorization, PalletChainSpaceSpaceDetails, PalletCollectiveVotes, PalletDidDidDetails, PalletDidNameDidNameDidNameOwnership, PalletDidServiceEndpointsDidEndpoint, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineSr25519AppSr25519Public, PalletMixnetBoundedMixnode, PalletMultisigMultisig, PalletNetworkMembershipMemberData, PalletNetworkScoreAggregatedEntryOf, PalletNetworkScoreRatingEntry, PalletNetworkScoreRatingTypeOf, PalletNodeAuthorizationNodeInfo, PalletPreimageOldRequestStatus, PalletPreimageRequestStatus, PalletSchedulerScheduled, PalletSchemaSchemaEntry, PalletStatementStatementDetails, PalletStatementStatementEntryStatus, PalletStatementStatementPresentationDetails, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpMixnetAppPublic, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { CordIdentifierEventEntry, CordIdentifierIdentifierTypeOf, CordRuntimeSessionKeys, FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAssetAssetDistributionEntry, PalletAssetAssetEntry, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmountRuntimeFreezeReason, PalletBalancesIdAmountRuntimeHoldReason, PalletBalancesReserveData, PalletChainSpaceSpaceAuthorization, PalletChainSpaceSpaceDetails, PalletCollectiveVotes, PalletDidDidDetails, PalletDidNameDidNameDidNameOwnership, PalletDidServiceEndpointsDidEndpoint, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineSr25519AppSr25519Public, PalletMixnetBoundedMixnode, PalletMultisigMultisig, PalletNetworkMembershipMemberData, PalletNetworkScoreAggregatedEntryOf, PalletNetworkScoreRatingEntry, PalletNetworkScoreRatingTypeOf, PalletNodeAuthorizationNodeInfo, PalletPreimageOldRequestStatus, PalletPreimageRequestStatus, PalletSchedulerScheduled, PalletSchemaSchemaEntry, PalletStatementStatementDetails, PalletStatementStatementEntryStatus, PalletStatementStatementPresentationDetails, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpConsensusGrandpaAppPublic, SpCoreCryptoKeyTypeId, SpMixnetAppPublic, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';

export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
Expand Down Expand Up @@ -328,6 +328,10 @@ declare module '@polkadot/api-base/types/storage' {
owner: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<PalletDidNameDidNameDidNameOwnership>>, [Bytes]>;
};
grandpa: {
/**
* The current list of authorities.
**/
authorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[SpConsensusGrandpaAppPublic, u64]>>>, []>;
/**
* The number of changes (both in terms of keys and underlying economic responsibilities)
* in the "set" of Grandpa validators from genesis.
Expand Down
6 changes: 3 additions & 3 deletions packages/augment-api/src/interfaces/augment-api-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f6
import type { AnyNumber, Codec } from '@polkadot/types-codec/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
import type { BeefyVersionedFinalityProof } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
Expand Down Expand Up @@ -80,9 +80,9 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
**/
getFinalizedHead: AugmentedRpc<() => Observable<H256>>;
/**
* Returns the block most recently finalized by BEEFY, alongside side its justification.
* Returns the block most recently finalized by BEEFY, alongside its justification.
**/
subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;
subscribeJustifications: AugmentedRpc<() => Observable<BeefyVersionedFinalityProof>>;
};
chain: {
/**
Expand Down
10 changes: 7 additions & 3 deletions packages/augment-api/src/interfaces/augment-api-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* See [`Pallet::create`].
**/
create: AugmentedSubmittable<(entry: PalletAssetAssetInputEntry | { assetType?: any; assetDesc?: any; assetQty?: any; assetValue?: any; assetTag?: any; assetMeta?: any } | string | Uint8Array, signature: SpRuntimeMultiSignature | { ed25519: any } | { sr25519: any } | { ecdsa: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAssetAssetInputEntry, SpRuntimeMultiSignature]>;
create: AugmentedSubmittable<(entry: PalletAssetAssetInputEntry | { assetType?: any; assetDesc?: any; assetQty?: any; assetValue?: any; assetTag?: any; assetMeta?: any } | string | Uint8Array, digest: H256 | string | Uint8Array, signature: SpRuntimeMultiSignature | { ed25519: any } | { sr25519: any } | { ecdsa: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAssetAssetInputEntry, H256, SpRuntimeMultiSignature]>;
/**
* See [`Pallet::issue`].
**/
issue: AugmentedSubmittable<(entry: PalletAssetAssetIssuanceEntry | { assetId?: any; newAssetOwner?: any; assetIssuanceQty?: any } | string | Uint8Array, signature: SpRuntimeMultiSignature | { ed25519: any } | { sr25519: any } | { ecdsa: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAssetAssetIssuanceEntry, SpRuntimeMultiSignature]>;
issue: AugmentedSubmittable<(entry: PalletAssetAssetIssuanceEntry | { assetId?: any; assetOwner?: any; assetIssuanceQty?: any } | string | Uint8Array, digest: H256 | string | Uint8Array, signature: SpRuntimeMultiSignature | { ed25519: any } | { sr25519: any } | { ecdsa: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAssetAssetIssuanceEntry, H256, SpRuntimeMultiSignature]>;
/**
* See [`Pallet::transfer`].
**/
transfer: AugmentedSubmittable<(entry: PalletAssetAssetTransferEntry | { assetId?: any; assetInstanceId?: any; newAssetOwner?: any } | string | Uint8Array, signature: SpRuntimeMultiSignature | { ed25519: any } | { sr25519: any } | { ecdsa: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAssetAssetTransferEntry, SpRuntimeMultiSignature]>;
transfer: AugmentedSubmittable<(entry: PalletAssetAssetTransferEntry | { assetId?: any; assetInstanceId?: any; assetOwner?: any; newAssetOwner?: any } | string | Uint8Array, digest: H256 | string | Uint8Array, signature: SpRuntimeMultiSignature | { ed25519: any } | { sr25519: any } | { ecdsa: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletAssetAssetTransferEntry, H256, SpRuntimeMultiSignature]>;
};
authorityMembership: {
/**
Expand Down Expand Up @@ -552,6 +552,10 @@ declare module '@polkadot/api-base/types/submittable' {
update: AugmentedSubmittable<(statementId: Bytes | string | Uint8Array, newStatementDigest: H256 | string | Uint8Array, authorization: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, H256, Bytes]>;
};
sudo: {
/**
* See [`Pallet::remove_key`].
**/
removeKey: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* See [`Pallet::set_key`].
**/
Expand Down
Loading

0 comments on commit eda6d61

Please sign in to comment.