├── .gitignore ├── LICENSE ├── README.md ├── doc ├── allclasses-frame.html ├── allclasses-noframe.html ├── classref.txt ├── constant-values.html ├── deprecated-list.html ├── docfiles │ ├── examples │ │ ├── promise │ │ │ ├── 01_simple_connect │ │ │ │ └── index.html │ │ │ ├── 02_listen_to_blocks │ │ │ │ └── index.html │ │ │ ├── 03_listen_to_balance_change │ │ │ │ └── index.html │ │ │ ├── 04_unsubscribe │ │ │ │ └── index.html │ │ │ ├── 05_read_storage │ │ │ │ └── index.html │ │ │ ├── 06_make_transfer │ │ │ │ └── index.html │ │ │ ├── 08_system_events │ │ │ │ └── index.html │ │ │ ├── 09_transfer_events │ │ │ │ └── index.html │ │ │ ├── 10_upgrade_chain │ │ │ │ └── index.html │ │ │ └── index.html │ │ └── rx │ │ │ ├── 01_simple_connect │ │ │ └── index.html │ │ │ ├── 02_listen_to_blocks │ │ │ └── index.html │ │ │ ├── 03_listen_to_balance_change │ │ │ └── index.html │ │ │ ├── 04_unsubscribe │ │ │ └── index.html │ │ │ ├── 05_read_storage │ │ │ └── index.html │ │ │ ├── 06_make_transfer │ │ │ └── index.html │ │ │ ├── 08_system_events │ │ │ └── index.html │ │ │ ├── 09_transfer_events │ │ │ └── index.html │ │ │ ├── 10_upgrade_chain │ │ │ └── index.html │ │ │ └── index.html │ └── overview.html ├── help-doc.html ├── highlight-LICENSE.txt ├── highlight.css ├── highlight.pack.js ├── index-all.html ├── index.html ├── org │ └── polkadot │ │ ├── api │ │ ├── ApiBase.ApiType.html │ │ ├── ApiBase.html │ │ ├── ApiUtils.html │ │ ├── SubmittableExtrinsic.StatusCb.html │ │ ├── SubmittableExtrinsic.SubmittableExtrinsicImpl.html │ │ ├── SubmittableExtrinsic.SubmittableResult.html │ │ ├── SubmittableExtrinsic.html │ │ ├── Types.ApiBaseInterface.html │ │ ├── Types.ApiInterfacePromise.html │ │ ├── Types.ApiOptions.html │ │ ├── Types.DecoratedRpc.html │ │ ├── Types.DecoratedRpcMethod.html │ │ ├── Types.DecoratedRpcSection.html │ │ ├── Types.Derive.html │ │ ├── Types.DeriveMethod.html │ │ ├── Types.DeriveSection.html │ │ ├── Types.OnCallDefinition.html │ │ ├── Types.OnCallFunction.html │ │ ├── Types.QueryableModuleStorage.html │ │ ├── Types.QueryableStorage.html │ │ ├── Types.QueryableStorageFunction.html │ │ ├── Types.Signer.html │ │ ├── Types.SubmittableExtrinsicFunction.html │ │ ├── Types.SubmittableExtrinsics.html │ │ ├── Types.SubmittableModuleExtrinsics.html │ │ ├── Types.html │ │ ├── derive │ │ │ ├── Index.Derive.html │ │ │ ├── Index.DeriveCustom.html │ │ │ ├── Index.DeriveCustomSection.html │ │ │ ├── Index.DeriveReal.html │ │ │ ├── Index.DeriveRealSection.html │ │ │ ├── Index.html │ │ │ ├── Types.DeriveRealFunction.html │ │ │ ├── Types.DerivedBalances.html │ │ │ ├── Types.DerivedBalancesMap.html │ │ │ ├── Types.DerivedFees.html │ │ │ ├── Types.DerivedReferendumVote.html │ │ │ ├── Types.html │ │ │ ├── accounts │ │ │ │ ├── AccountFunctions.AccountIdAndIndex.html │ │ │ │ ├── AccountFunctions.AccountIndexes.html │ │ │ │ ├── AccountFunctions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── balances │ │ │ │ ├── BalancesFunctions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── chain │ │ │ │ ├── ChainFunctions.HeaderAndValidators.html │ │ │ │ ├── ChainFunctions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── democracy │ │ │ │ ├── DemocracyFunctions.ReferendumInfoExtended.html │ │ │ │ ├── DemocracyFunctions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── session │ │ │ │ ├── SessionFunctions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ └── staking │ │ │ │ ├── StakingFunctions.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ ├── promise │ │ │ ├── ApiPromise.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── rx │ │ │ ├── ApiRx.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── common │ │ ├── EventEmitter.EventListener.html │ │ ├── EventEmitter.EventType.html │ │ ├── EventEmitter.html │ │ ├── ExecutorsManager.html │ │ ├── HttpClient.HeadOptions.html │ │ ├── HttpClient.HttpResp.html │ │ ├── HttpClient.Params.html │ │ ├── HttpClient.html │ │ ├── NamedThreadFactory.html │ │ ├── ReflectionUtils.html │ │ ├── keyring │ │ │ ├── Defaults.html │ │ │ ├── Keyring.html │ │ │ ├── Pairs.KeyringPairMap.html │ │ │ ├── Pairs.html │ │ │ ├── Types.KeyringInstance.html │ │ │ ├── Types.KeyringOptions.html │ │ │ ├── Types.KeyringPair.html │ │ │ ├── Types.KeyringPairJson.html │ │ │ ├── Types.KeyringPairJsonEncoding.html │ │ │ ├── Types.KeyringPairMeta.html │ │ │ ├── Types.KeyringPairs.html │ │ │ ├── Types.html │ │ │ ├── address │ │ │ │ ├── AddressCodec.html │ │ │ │ ├── Defaults.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── pair │ │ │ │ ├── Defaults.html │ │ │ │ ├── Index.KeyringPairDefault.html │ │ │ │ ├── Index.html │ │ │ │ ├── PairCodec.DecodeResult.html │ │ │ │ ├── PairCodec.PairStateJson.html │ │ │ │ ├── PairCodec.html │ │ │ │ ├── Types.PairInfo.html │ │ │ │ ├── Types.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── direct │ │ ├── IApi.html │ │ ├── IFunction.html │ │ ├── IModule.html │ │ ├── IRpcFunction.SubscribeCallback.html │ │ ├── IRpcFunction.Unsubscribe.html │ │ ├── IRpcFunction.html │ │ ├── IRpcModule.html │ │ ├── ISection.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── example │ │ ├── Democracy.html │ │ ├── Staking.html │ │ ├── TestingPairs.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ ├── promise │ │ │ ├── E01_SimpleConnect.html │ │ │ ├── E02_ListenToBlocks.html │ │ │ ├── E03_ListenToBalanceChange.html │ │ │ ├── E04_Unsubscribe.html │ │ │ ├── E05_ReadStorage.html │ │ │ ├── E06_MakeTransfer.html │ │ │ ├── E08_SystemEvent.html │ │ │ ├── E09_TransferEvents.html │ │ │ ├── E10_UpgradeChain.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── rx │ │ │ ├── E01_SimpleConnect.html │ │ │ ├── E02_ListenToBlocks.html │ │ │ ├── E03_ListenToBalanceChange.html │ │ │ ├── E04_Unsubscribe.html │ │ │ ├── E05_ReadStorage.html │ │ │ ├── E06_MakeTransfer.html │ │ │ ├── E08_SystemEvent.html │ │ │ ├── E09_TransferEvents.html │ │ │ ├── E10_UpgradeChain.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── rpc │ │ ├── core │ │ │ ├── IRpc.RpcInterfaceSection.html │ │ │ ├── IRpc.html │ │ │ ├── RpcCore.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── json │ │ │ ├── JsonAuthor.html │ │ │ ├── JsonChain.html │ │ │ ├── JsonRpc.html │ │ │ ├── JsonState.html │ │ │ ├── JsonSystem.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── types │ │ │ │ ├── JsonRpcMethod.html │ │ │ │ ├── JsonRpcMethodOpt.html │ │ │ │ ├── JsonRpcParam.html │ │ │ │ ├── JsonRpcSection.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ ├── provider │ │ │ ├── Constants.html │ │ │ ├── IProvider.CallbackHandler.html │ │ │ ├── IProvider.ProviderInterfaceEmitCb.html │ │ │ ├── IProvider.ProviderInterfaceEmitted.html │ │ │ ├── IProvider.SubscriptionHandler.html │ │ │ ├── IProvider.html │ │ │ ├── IWsProvider.html │ │ │ ├── Types.JsonRpcError.html │ │ │ ├── Types.JsonRpcObject.html │ │ │ ├── Types.JsonRpcRequest.html │ │ │ ├── Types.JsonRpcResponse.html │ │ │ ├── Types.SubscriptionParam.html │ │ │ ├── Types.html │ │ │ ├── coder │ │ │ │ ├── RpcCoder.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── http │ │ │ │ ├── HttpProvider.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── ws │ │ │ │ ├── WsProvider.WsStateAwaiting.html │ │ │ │ ├── WsProvider.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ └── rx │ │ │ ├── RpcRx.html │ │ │ ├── Types.IRpcRx.html │ │ │ ├── Types.RpcRxInterface.html │ │ │ ├── Types.RpcRxInterfaceMethod.html │ │ │ ├── Types.RpcRxInterfaceSection.html │ │ │ ├── Types.RpcRxOnCb.html │ │ │ ├── Types.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── type │ │ ├── extrinsics │ │ │ ├── CreateUnchecked.html │ │ │ ├── FromMetadata.html │ │ │ ├── Index.html │ │ │ ├── StaticMetadata.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── storage │ │ │ ├── CreateFunction.CreateItemOptions.html │ │ │ ├── CreateFunction.html │ │ │ ├── FromMetadata.html │ │ │ ├── Substrate.SubstrateMetadata.html │ │ │ ├── Substrate.html │ │ │ ├── Types.ModuleStorage.html │ │ │ ├── Types.Storage.html │ │ │ ├── Types.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── types │ │ ├── Codec.html │ │ ├── CodecTypes.html │ │ ├── Types.CodecArg.html │ │ ├── Types.CodecCallback.html │ │ ├── Types.ConstructorCodec.html │ │ ├── Types.ConstructorDef.html │ │ ├── Types.IExtrinsic.html │ │ ├── Types.IExtrinsicSignature.html │ │ ├── Types.IHash.html │ │ ├── Types.IMethod.html │ │ ├── Types.RegistryTypes.html │ │ ├── Types.RuntimeVersionInterface.html │ │ ├── Types.SignatureOptions.html │ │ ├── Types.html │ │ ├── TypesUtils.html │ │ ├── codec │ │ │ ├── AbstractArray.html │ │ │ ├── AbstractInt.html │ │ │ ├── Base.html │ │ │ ├── CodecUtils.html │ │ │ ├── Compact.html │ │ │ ├── Compactable.html │ │ │ ├── CreateType.TypeDef.html │ │ │ ├── CreateType.TypeDefInfo.html │ │ │ ├── CreateType.html │ │ │ ├── Enum.html │ │ │ ├── EnumType.EnumConstructor.html │ │ │ ├── EnumType.html │ │ │ ├── Linkage.LinkageResult.html │ │ │ ├── Linkage.html │ │ │ ├── Option.html │ │ │ ├── Set.SetValues.html │ │ │ ├── Set.html │ │ │ ├── Struct.html │ │ │ ├── Tuple.html │ │ │ ├── TypeRegistry.html │ │ │ ├── U8a.html │ │ │ ├── U8aFixed.html │ │ │ ├── UInt.html │ │ │ ├── Vector.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── metadata │ │ │ ├── MagicNumber.html │ │ │ ├── Metadata.html │ │ │ ├── MetadataUtils.html │ │ │ ├── MetadataVersioned.MetadataEnum.html │ │ │ ├── MetadataVersioned.html │ │ │ ├── Types.MetadataInterface.html │ │ │ ├── Types.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── v0 │ │ │ │ ├── Calls.OuterDispatchCall.html │ │ │ │ ├── Calls.OuterDispatchMetadata.html │ │ │ │ ├── Calls.html │ │ │ │ ├── Events.EventMetadata.html │ │ │ │ ├── Events.OuterEventMetadata.html │ │ │ │ ├── Events.OuterEventMetadataEvent.html │ │ │ │ ├── Events.html │ │ │ │ ├── MetadataV0.html │ │ │ │ ├── Modules.CallMetadata.html │ │ │ │ ├── Modules.FunctionArgumentMetadata.html │ │ │ │ ├── Modules.FunctionMetadata.html │ │ │ │ ├── Modules.MapType.html │ │ │ │ ├── Modules.ModuleMetadata.html │ │ │ │ ├── Modules.PlainType.html │ │ │ │ ├── Modules.RuntimeModuleMetadata.html │ │ │ │ ├── Modules.StorageFunctionMetadata.html │ │ │ │ ├── Modules.StorageFunctionMetadataValue.html │ │ │ │ ├── Modules.StorageFunctionModifier.html │ │ │ │ ├── Modules.StorageFunctionType.html │ │ │ │ ├── Modules.StorageMetadata.html │ │ │ │ ├── Modules.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── v1 │ │ │ │ ├── Calls.MetadataCall.html │ │ │ │ ├── Calls.MetadataCallArg.html │ │ │ │ ├── Calls.html │ │ │ │ ├── Events.MetadataEvent.html │ │ │ │ ├── Events.html │ │ │ │ ├── MetadataV1.MetadataModule.html │ │ │ │ ├── MetadataV1.html │ │ │ │ ├── Storage.Default.html │ │ │ │ ├── Storage.MapType.html │ │ │ │ ├── Storage.MetadataStorageModifier.html │ │ │ │ ├── Storage.MetadataStorageType.html │ │ │ │ ├── Storage.MetadataStorageV1.html │ │ │ │ ├── Storage.Optional.html │ │ │ │ ├── Storage.PlainType.html │ │ │ │ ├── Storage.html │ │ │ │ ├── ToV0.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ ├── v2 │ │ │ │ ├── MetadataV2.MetadataModule.html │ │ │ │ ├── MetadataV2.html │ │ │ │ ├── Storage.Default.html │ │ │ │ ├── Storage.MapType.html │ │ │ │ ├── Storage.MetadataStorageType.html │ │ │ │ ├── Storage.MetadataStorageV2.html │ │ │ │ ├── Storage.Optional.html │ │ │ │ ├── Storage.PlainType.html │ │ │ │ ├── Storage.html │ │ │ │ ├── ToV1.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ │ └── v3 │ │ │ │ ├── MetadataV3.MetadataModule.html │ │ │ │ ├── MetadataV3.html │ │ │ │ ├── Storage.DoubleMapType.html │ │ │ │ ├── Storage.MetadataStorageType.html │ │ │ │ ├── Storage.MetadataStorageV3.html │ │ │ │ ├── Storage.html │ │ │ │ ├── ToV2.html │ │ │ │ ├── package-frame.html │ │ │ │ ├── package-summary.html │ │ │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ ├── package-tree.html │ │ ├── primitive │ │ │ ├── Bool.html │ │ │ ├── Bytes.html │ │ │ ├── H160.html │ │ │ ├── H256.html │ │ │ ├── H512.html │ │ │ ├── I128.html │ │ │ ├── I16.html │ │ │ ├── I256.html │ │ │ ├── I32.html │ │ │ ├── I64.html │ │ │ ├── I8.html │ │ │ ├── Int.html │ │ │ ├── Method.DecodeMethodInput.html │ │ │ ├── Method.DecodedMethod.html │ │ │ ├── Method.MethodFunction.html │ │ │ ├── Method.MethodIndex.html │ │ │ ├── Method.Methods.html │ │ │ ├── Method.ModulesWithMethods.html │ │ │ ├── Method.html │ │ │ ├── Moment.MomentOf.html │ │ │ ├── Moment.html │ │ │ ├── Null.html │ │ │ ├── StorageData.html │ │ │ ├── StorageKey.StorageFunction.html │ │ │ ├── StorageKey.html │ │ │ ├── Text.html │ │ │ ├── Type.html │ │ │ ├── U128.html │ │ │ ├── U16.html │ │ │ ├── U256.html │ │ │ ├── U32.html │ │ │ ├── U64.html │ │ │ ├── U8.html │ │ │ ├── USize.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ ├── rpc │ │ │ ├── ChainProperties.html │ │ │ ├── ExtrinsicStatus.Broadcast.html │ │ │ ├── ExtrinsicStatus.Dropped.html │ │ │ ├── ExtrinsicStatus.Finalized.html │ │ │ ├── ExtrinsicStatus.Future.html │ │ │ ├── ExtrinsicStatus.Invalid.html │ │ │ ├── ExtrinsicStatus.Ready.html │ │ │ ├── ExtrinsicStatus.Usurped.html │ │ │ ├── ExtrinsicStatus.html │ │ │ ├── Health.html │ │ │ ├── Json.html │ │ │ ├── NetworkState.html │ │ │ ├── PeerInfo.html │ │ │ ├── PendingExtrinsics.html │ │ │ ├── RuntimeVersion.ApiId.html │ │ │ ├── RuntimeVersion.RuntimeVersionApi.html │ │ │ ├── RuntimeVersion.html │ │ │ ├── SignedBlock.SignedBlockValue.html │ │ │ ├── SignedBlock.html │ │ │ ├── StorageChangeSet.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── type │ │ │ ├── AccountId.AccountIdOf.html │ │ │ ├── AccountId.html │ │ │ ├── AccountIndex.html │ │ │ ├── AccountInfo.html │ │ │ ├── Address.html │ │ │ ├── Amount.html │ │ │ ├── AssetOf.html │ │ │ ├── AttestedCandidate.AvailabilityVote.html │ │ │ ├── AttestedCandidate.BalanceUpload.html │ │ │ ├── AttestedCandidate.CandidateReceipt.html │ │ │ ├── AttestedCandidate.CandidateSignature.html │ │ │ ├── AttestedCandidate.EgressQueueRoot.html │ │ │ ├── AttestedCandidate.ExplicitCandidateSignature.html │ │ │ ├── AttestedCandidate.HeadData.html │ │ │ ├── AttestedCandidate.ValidityAttestation.html │ │ │ ├── AttestedCandidate.ValidityVote.html │ │ │ ├── AttestedCandidate.html │ │ │ ├── AuthorityId.html │ │ │ ├── Balance.BalanceOf.html │ │ │ ├── Balance.html │ │ │ ├── BalanceLock.html │ │ │ ├── BftAuthoritySignature.BftAuthoritySignatureValue.html │ │ │ ├── BftAuthoritySignature.BftHashSignature.html │ │ │ ├── BftAuthoritySignature.BftHashSignatureValue.html │ │ │ ├── BftAuthoritySignature.html │ │ │ ├── Block.BlockValue.html │ │ │ ├── Block.html │ │ │ ├── BlockNumber.html │ │ │ ├── CodeHash.html │ │ │ ├── Digest.AuthoritiesChange.html │ │ │ ├── Digest.ChangesTrieRoot.html │ │ │ ├── Digest.Consensus.html │ │ │ ├── Digest.DigestItem.html │ │ │ ├── Digest.Other.html │ │ │ ├── Digest.Seal.html │ │ │ ├── Digest.html │ │ │ ├── Event.EventData.Builder.html │ │ │ ├── Event.EventData.html │ │ │ ├── Event.EventIndex.html │ │ │ ├── Event.html │ │ │ ├── EventRecord.ApplyExtrinsic.html │ │ │ ├── EventRecord.Finalization.html │ │ │ ├── EventRecord.Phase.html │ │ │ ├── EventRecord.html │ │ │ ├── Exposure.html │ │ │ ├── Extrinsic.ExtrinsicValue.html │ │ │ ├── Extrinsic.html │ │ │ ├── ExtrinsicEra.html │ │ │ ├── ExtrinsicSignature.html │ │ │ ├── Extrinsics.html │ │ │ ├── Gas.html │ │ │ ├── Hash.html │ │ │ ├── Header.HeaderExtended.html │ │ │ ├── Header.HeaderValue.html │ │ │ ├── Header.html │ │ │ ├── Index.html │ │ │ ├── IndividualExposure.html │ │ │ ├── InherentOfflineReport.html │ │ │ ├── Justification.RhdJustification.html │ │ │ ├── Justification.RhdJustificationValue.html │ │ │ ├── Justification.html │ │ │ ├── Key.html │ │ │ ├── KeyValue.KeyValueOption.html │ │ │ ├── KeyValue.html │ │ │ ├── LocKPeriods.html │ │ │ ├── LockIdentifier.html │ │ │ ├── MisbehaviorReport.BftAtReport.html │ │ │ ├── MisbehaviorReport.BftAtReportValue.html │ │ │ ├── MisbehaviorReport.BftAtReportValueSingle.html │ │ │ ├── MisbehaviorReport.BftDoubleCommit.html │ │ │ ├── MisbehaviorReport.BftDoublePrepare.html │ │ │ ├── MisbehaviorReport.BftDoublePropose.html │ │ │ ├── MisbehaviorReport.BftProposeOutOfTurn.html │ │ │ ├── MisbehaviorReport.MisbehaviorKind.html │ │ │ ├── MisbehaviorReport.MisbehaviorReportValue.html │ │ │ ├── MisbehaviorReport.html │ │ │ ├── NewAccountOutcome.html │ │ │ ├── Nonce.html │ │ │ ├── NonceCompact.html │ │ │ ├── Origin.html │ │ │ ├── ParaId.html │ │ │ ├── Perbill.html │ │ │ ├── Permill.html │ │ │ ├── PrefabWasmModule.PrefabWasmModuleReserved.html │ │ │ ├── PrefabWasmModule.html │ │ │ ├── PropIndex.html │ │ │ ├── Proposal.html │ │ │ ├── ProposalIndex.html │ │ │ ├── ReferendumIndex.html │ │ │ ├── ReferendumInfo.ReferendumInfoValue.html │ │ │ ├── ReferendumInfo.html │ │ │ ├── RewardDestination.html │ │ │ ├── Schedule.html │ │ │ ├── SeedOf.html │ │ │ ├── SessionKey.html │ │ │ ├── Signature.Ed25519Signature.html │ │ │ ├── Signature.Sr25519Signature.html │ │ │ ├── Signature.html │ │ │ ├── SignaturePayload.SignaturePayloadValue.html │ │ │ ├── SignaturePayload.html │ │ │ ├── StakingLedger.html │ │ │ ├── StoredPendingChange.NextAuthority.html │ │ │ ├── StoredPendingChange.NextAuthorityValue.html │ │ │ ├── StoredPendingChange.StoredPendingChangeValue.html │ │ │ ├── StoredPendingChange.html │ │ │ ├── TreasuryProposal.html │ │ │ ├── UnlockChunk.html │ │ │ ├── ValidatorPrefs.html │ │ │ ├── VestingSchedule.html │ │ │ ├── Vote.html │ │ │ ├── VoteIndex.html │ │ │ ├── VoteThreshold.html │ │ │ ├── WithdrawReasons.html │ │ │ ├── package-frame.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ │ └── utils │ │ ├── MapUtils.html │ │ ├── PackageScanner.html │ │ ├── RxUtils.html │ │ ├── Utils.html │ │ ├── UtilsCrypto.html │ │ ├── crypto │ │ ├── Base58.html │ │ ├── EmptySR25591.html │ │ ├── ISR25591.html │ │ ├── JniSR25591.html │ │ ├── Nacl.Encrypted.html │ │ ├── Nacl.html │ │ ├── NaclTest.html │ │ ├── SR25519.html │ │ ├── Schnorrkel.html │ │ ├── TweetNaCl.InvalidCipherTextException.html │ │ ├── TweetNaCl.InvalidSignatureException.html │ │ ├── TweetNaCl.html │ │ ├── Types.Keypair.html │ │ ├── Types.Seedpair.html │ │ ├── Types.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html │ │ ├── package-frame.html │ │ ├── package-summary.html │ │ └── package-tree.html ├── overview-frame.html ├── overview-summary.html ├── overview-tree.html ├── overview.html ├── package-list ├── script.js ├── serialized-form.html └── stylesheet.css ├── docfiles ├── examples │ ├── promise │ │ ├── 01_simple_connect │ │ │ └── index.html │ │ ├── 02_listen_to_blocks │ │ │ └── index.html │ │ ├── 03_listen_to_balance_change │ │ │ └── index.html │ │ ├── 04_unsubscribe │ │ │ └── index.html │ │ ├── 05_read_storage │ │ │ └── index.html │ │ ├── 06_make_transfer │ │ │ └── index.html │ │ ├── 08_system_events │ │ │ └── index.html │ │ ├── 09_transfer_events │ │ │ └── index.html │ │ ├── 10_upgrade_chain │ │ │ └── index.html │ │ └── index.html │ └── rx │ │ ├── 01_simple_connect │ │ └── index.html │ │ ├── 02_listen_to_blocks │ │ └── index.html │ │ ├── 03_listen_to_balance_change │ │ └── index.html │ │ ├── 04_unsubscribe │ │ └── index.html │ │ ├── 05_read_storage │ │ └── index.html │ │ ├── 06_make_transfer │ │ └── index.html │ │ ├── 08_system_events │ │ └── index.html │ │ ├── 09_transfer_events │ │ └── index.html │ │ ├── 10_upgrade_chain │ │ └── index.html │ │ └── index.html └── overview.html ├── examples ├── .gitignore ├── build.gradle ├── gradle.properties ├── libs │ ├── libjni.dylib │ └── polkadot-java-1.0-SNAPSHOT.jar ├── settings.gradle ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── polkadot │ │ │ └── example │ │ │ ├── Democracy.java │ │ │ ├── Staking.java │ │ │ ├── TestingPairs.java │ │ │ ├── promise │ │ │ ├── E01_SimpleConnect.java │ │ │ ├── E02_ListenToBlocks.java │ │ │ ├── E03_ListenToBalanceChange.java │ │ │ ├── E04_Unsubscribe.java │ │ │ ├── E05_ReadStorage.java │ │ │ ├── E06_MakeTransfer.java │ │ │ ├── E08_SystemEvent.java │ │ │ ├── E09_TransferEvents.java │ │ │ └── E10_UpgradeChain.java │ │ │ └── rx │ │ │ ├── E01_SimpleConnect.java │ │ │ ├── E02_ListenToBlocks.java │ │ │ ├── E03_ListenToBalanceChange.java │ │ │ ├── E04_Unsubscribe.java │ │ │ ├── E05_ReadStorage.java │ │ │ ├── E06_MakeTransfer.java │ │ │ ├── E08_SystemEvent.java │ │ │ ├── E09_TransferEvents.java │ │ │ └── E10_UpgradeChain.java │ │ └── resources │ │ └── log4j2.xml └── test.wasm ├── examples_runnable ├── 20190511 │ ├── 01_simple_connect.sh │ ├── 02_listen_to_blocks_and_unsubscribe.sh │ ├── lib │ │ ├── Java-WebSocket-1.4.0.jar │ │ ├── animal-sniffer-annotations-1.17.jar │ │ ├── base64-2.3.9.jar │ │ ├── checker-qual-2.5.2.jar │ │ ├── commons-collections4-4.2.jar │ │ ├── commons-lang3-3.8.jar │ │ ├── error_prone_annotations-2.2.0.jar │ │ ├── failureaccess-1.0.1.jar │ │ ├── fastjson-1.2.48.jar │ │ ├── guava-27.1-jre.jar │ │ ├── j2objc-annotations-1.1.jar │ │ ├── jackson-annotations-2.8.5.jar │ │ ├── jackson-core-2.8.5.jar │ │ ├── jackson-databind-2.8.5.jar │ │ ├── jool-java-8-0.9.14.jar │ │ ├── joor-java-8-0.9.11.jar │ │ ├── joou-java-6-0.9.4.jar │ │ ├── jsonrpc4j-1.5.3.jar │ │ ├── jsr305-3.0.2.jar │ │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ │ ├── log4j-api-2.11.1.jar │ │ ├── log4j-core-2.11.1.jar │ │ ├── log4j-slf4j-impl-2.11.1.jar │ │ ├── lz4-java-1.5.1.jar │ │ ├── polkadot-java-1.0-SNAPSHOT.jar │ │ ├── promises-jvm-0.10.3.jar │ │ ├── reactive-streams-1.0.2.jar │ │ ├── rxjava-2.2.8.jar │ │ └── slf4j-api-1.7.25.jar │ └── log4j2.xml ├── 20190518 │ ├── 01_simple_connect.sh │ ├── 02_listen_to_blocks.sh │ ├── 03_listen_to_balance_change.sh │ ├── 04_unsubscribe.sh │ ├── 05_read_storage.sh │ ├── lib │ │ ├── Java-WebSocket-1.4.0.jar │ │ ├── animal-sniffer-annotations-1.17.jar │ │ ├── base64-2.3.9.jar │ │ ├── bcprov-jdk15on-1.60.jar │ │ ├── bitcoinj-core-0.15.2.jar │ │ ├── checker-qual-2.5.2.jar │ │ ├── commons-collections4-4.2.jar │ │ ├── commons-lang3-3.8.1.jar │ │ ├── commons-lang3-3.8.jar │ │ ├── commons-text-1.6.jar │ │ ├── error_prone_annotations-2.2.0.jar │ │ ├── failureaccess-1.0.1.jar │ │ ├── fastjson-1.2.48.jar │ │ ├── guava-27.1-jre.jar │ │ ├── j2objc-annotations-1.1.jar │ │ ├── jackson-annotations-2.8.5.jar │ │ ├── jackson-core-2.8.5.jar │ │ ├── jackson-databind-2.8.5.jar │ │ ├── jcip-annotations-1.0.jar │ │ ├── jool-java-8-0.9.14.jar │ │ ├── joor-java-8-0.9.11.jar │ │ ├── joou-java-6-0.9.4.jar │ │ ├── jsonrpc4j-1.5.3.jar │ │ ├── jsr305-3.0.2.jar │ │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ │ ├── log4j-api-2.11.1.jar │ │ ├── log4j-core-2.11.1.jar │ │ ├── log4j-slf4j-impl-2.11.1.jar │ │ ├── lz4-java-1.5.1.jar │ │ ├── okhttp-3.12.1.jar │ │ ├── okio-1.15.0.jar │ │ ├── polkadot-java-1.0-SNAPSHOT.jar │ │ ├── promises-jvm-0.10.3.jar │ │ ├── protobuf-java-3.6.1.jar │ │ ├── reactive-streams-1.0.2.jar │ │ ├── rxjava-2.2.8.jar │ │ ├── scrypt-1.4.0.jar │ │ └── slf4j-api-1.7.25.jar │ └── log4j2.xml ├── 20190525 │ ├── 01_simple_connect.sh │ ├── 02_listen_to_blocks.sh │ ├── 03_listen_to_balance_change.sh │ ├── 04_unsubscribe.sh │ ├── 05_read_storage.sh │ ├── 06_make_transfer.sh │ ├── 101_democracy.sh │ ├── 102_staking.sh │ ├── lib │ │ ├── Java-WebSocket-1.4.0.jar │ │ ├── animal-sniffer-annotations-1.17.jar │ │ ├── base64-2.3.9.jar │ │ ├── bcprov-jdk15on-1.60.jar │ │ ├── bitcoinj-core-0.15.2.jar │ │ ├── checker-qual-2.5.2.jar │ │ ├── commons-collections4-4.2.jar │ │ ├── commons-lang3-3.8.1.jar │ │ ├── commons-lang3-3.8.jar │ │ ├── commons-text-1.6.jar │ │ ├── eddsa-0.3.0.jar │ │ ├── error_prone_annotations-2.2.0.jar │ │ ├── failureaccess-1.0.1.jar │ │ ├── fastjson-1.2.48.jar │ │ ├── guava-27.1-jre.jar │ │ ├── j2objc-annotations-1.1.jar │ │ ├── jackson-annotations-2.8.5.jar │ │ ├── jackson-core-2.8.5.jar │ │ ├── jackson-databind-2.8.5.jar │ │ ├── jcip-annotations-1.0.jar │ │ ├── jool-java-8-0.9.14.jar │ │ ├── joor-java-8-0.9.11.jar │ │ ├── joou-java-6-0.9.4.jar │ │ ├── jsonrpc4j-1.5.3.jar │ │ ├── jsr305-3.0.2.jar │ │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ │ ├── log4j-api-2.11.1.jar │ │ ├── log4j-core-2.11.1.jar │ │ ├── log4j-slf4j-impl-2.11.1.jar │ │ ├── lz4-java-1.5.1.jar │ │ ├── okhttp-3.12.1.jar │ │ ├── okio-1.15.0.jar │ │ ├── polkadot-java-1.0-SNAPSHOT.jar │ │ ├── promises-jvm-0.10.3.jar │ │ ├── protobuf-java-3.6.1.jar │ │ ├── reactive-streams-1.0.2.jar │ │ ├── rxjava-2.2.8.jar │ │ ├── scrypt-1.4.0.jar │ │ └── slf4j-api-1.7.25.jar │ └── log4j2.xml ├── 20190601 │ ├── 01_simple_connect.sh │ ├── 02_listen_to_blocks.sh │ ├── 03_listen_to_balance_change.sh │ ├── 04_unsubscribe.sh │ ├── 05_read_storage.sh │ ├── 06_make_transfer.sh │ ├── 08_system_events.sh │ ├── 09_transfer_events.sh │ ├── 101_democracy.sh │ ├── 102_staking.sh │ ├── 10_upgrade_chain.sh │ ├── lib │ │ ├── Java-WebSocket-1.4.0.jar │ │ ├── animal-sniffer-annotations-1.17.jar │ │ ├── base64-2.3.9.jar │ │ ├── bcprov-jdk15on-1.60.jar │ │ ├── bitcoinj-core-0.15.2.jar │ │ ├── checker-qual-2.5.2.jar │ │ ├── commons-collections4-4.2.jar │ │ ├── commons-lang3-3.8.1.jar │ │ ├── commons-lang3-3.8.jar │ │ ├── commons-text-1.6.jar │ │ ├── eddsa-0.3.0.jar │ │ ├── error_prone_annotations-2.2.0.jar │ │ ├── failureaccess-1.0.1.jar │ │ ├── fastjson-1.2.48.jar │ │ ├── guava-27.1-jre.jar │ │ ├── j2objc-annotations-1.1.jar │ │ ├── jackson-annotations-2.8.5.jar │ │ ├── jackson-core-2.8.5.jar │ │ ├── jackson-databind-2.8.5.jar │ │ ├── jcip-annotations-1.0.jar │ │ ├── jool-java-8-0.9.14.jar │ │ ├── joor-java-8-0.9.11.jar │ │ ├── joou-java-6-0.9.4.jar │ │ ├── jsonrpc4j-1.5.3.jar │ │ ├── jsr305-3.0.2.jar │ │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ │ ├── log4j-api-2.11.1.jar │ │ ├── log4j-core-2.11.1.jar │ │ ├── log4j-slf4j-impl-2.11.1.jar │ │ ├── lz4-java-1.5.1.jar │ │ ├── okhttp-3.12.1.jar │ │ ├── okio-1.15.0.jar │ │ ├── polkadot-java-1.0-SNAPSHOT.jar │ │ ├── promises-jvm-0.10.3.jar │ │ ├── protobuf-java-3.6.1.jar │ │ ├── reactive-streams-1.0.2.jar │ │ ├── rxjava-2.2.8.jar │ │ ├── scrypt-1.4.0.jar │ │ └── slf4j-api-1.7.25.jar │ ├── libjni.dylib │ ├── log4j2.xml │ └── test.wasm └── 20190616 │ ├── 101_democracy.sh │ ├── 102_staking.sh │ ├── Promise_01_simple_connect.sh │ ├── Promise_02_listen_to_blocks.sh │ ├── Promise_03_listen_to_balance_change.sh │ ├── Promise_04_unsubscribe.sh │ ├── Promise_05_read_storage.sh │ ├── Promise_06_make_transfer.sh │ ├── Promise_08_system_events.sh │ ├── Promise_09_transfer_events.sh │ ├── Promise_10_upgrade_chain.sh │ ├── Rx_01_simple_connect.sh │ ├── Rx_02_listen_to_blocks.sh │ ├── Rx_03_listen_to_balance_change.sh │ ├── Rx_04_unsubscribe.sh │ ├── Rx_05_read_storage.sh │ ├── Rx_06_make_transfer.sh │ ├── Rx_08_system_events.sh │ ├── Rx_09_transfer_events.sh │ ├── Rx_10_upgrade_chain.sh │ ├── lib │ ├── Java-WebSocket-1.4.0.jar │ ├── animal-sniffer-annotations-1.17.jar │ ├── base64-2.3.9.jar │ ├── bcprov-jdk15on-1.60.jar │ ├── bitcoinj-core-0.15.2.jar │ ├── checker-qual-2.5.2.jar │ ├── commons-collections4-4.2.jar │ ├── commons-lang3-3.8.1.jar │ ├── commons-lang3-3.8.jar │ ├── commons-text-1.6.jar │ ├── eddsa-0.3.0.jar │ ├── error_prone_annotations-2.2.0.jar │ ├── failureaccess-1.0.1.jar │ ├── fastjson-1.2.48.jar │ ├── guava-27.1-jre.jar │ ├── j2objc-annotations-1.1.jar │ ├── jackson-annotations-2.8.5.jar │ ├── jackson-core-2.8.5.jar │ ├── jackson-databind-2.8.5.jar │ ├── jcip-annotations-1.0.jar │ ├── jool-java-8-0.9.14.jar │ ├── joor-java-8-0.9.11.jar │ ├── joou-java-6-0.9.4.jar │ ├── jsonrpc4j-1.5.3.jar │ ├── jsr305-3.0.2.jar │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ ├── log4j-api-2.11.1.jar │ ├── log4j-core-2.11.1.jar │ ├── log4j-slf4j-impl-2.11.1.jar │ ├── lz4-java-1.5.1.jar │ ├── okhttp-3.12.1.jar │ ├── okio-1.15.0.jar │ ├── polkadot-java-1.0-SNAPSHOT.jar │ ├── promises-jvm-0.10.3.jar │ ├── protobuf-java-3.6.1.jar │ ├── reactive-streams-1.0.2.jar │ ├── rxjava-2.2.8.jar │ ├── scrypt-1.4.0.jar │ └── slf4j-api-1.7.25.jar │ ├── libjni.dylib │ ├── log4j2.xml │ └── test.wasm ├── gendoc.sh ├── packages ├── .gitignore ├── build.gradle ├── data │ ├── erc20.json │ ├── erc20.wasm │ ├── incrementer-opt.wasm │ └── incrementer.json ├── gradle.properties ├── libs │ └── libjni.dylib ├── settings.gradle ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── polkadot │ │ │ │ ├── api │ │ │ │ ├── ApiBase.java │ │ │ │ ├── ApiUtils.java │ │ │ │ ├── README.md │ │ │ │ ├── SubmittableExtrinsic.java │ │ │ │ ├── Types.java │ │ │ │ ├── derive │ │ │ │ │ ├── Index.java │ │ │ │ │ ├── README.md │ │ │ │ │ ├── Types.java │ │ │ │ │ ├── accounts │ │ │ │ │ │ └── AccountFunctions.java │ │ │ │ │ ├── balances │ │ │ │ │ │ └── BalancesFunctions.java │ │ │ │ │ ├── chain │ │ │ │ │ │ └── ChainFunctions.java │ │ │ │ │ ├── democracy │ │ │ │ │ │ └── DemocracyFunctions.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ ├── session │ │ │ │ │ │ └── SessionFunctions.java │ │ │ │ │ └── staking │ │ │ │ │ │ └── StakingFunctions.java │ │ │ │ ├── package-info.java │ │ │ │ ├── promise │ │ │ │ │ └── ApiPromise.java │ │ │ │ └── rx │ │ │ │ │ └── ApiRx.java │ │ │ │ ├── common │ │ │ │ ├── EventEmitter.java │ │ │ │ ├── ExecutorsManager.java │ │ │ │ ├── HttpClient.java │ │ │ │ ├── NamedThreadFactory.java │ │ │ │ ├── ReflectionUtils.java │ │ │ │ └── keyring │ │ │ │ │ ├── Defaults.java │ │ │ │ │ ├── Keyring.java │ │ │ │ │ ├── Pairs.java │ │ │ │ │ ├── Types.java │ │ │ │ │ ├── address │ │ │ │ │ ├── AddressCodec.java │ │ │ │ │ └── Defaults.java │ │ │ │ │ └── pair │ │ │ │ │ ├── Defaults.java │ │ │ │ │ ├── Index.java │ │ │ │ │ ├── PairCodec.java │ │ │ │ │ └── Types.java │ │ │ │ ├── direct │ │ │ │ ├── IApi.java │ │ │ │ ├── IFunction.java │ │ │ │ ├── IModule.java │ │ │ │ ├── IRpcFunction.java │ │ │ │ ├── IRpcModule.java │ │ │ │ └── ISection.java │ │ │ │ ├── example │ │ │ │ ├── Democracy.java │ │ │ │ ├── Staking.java │ │ │ │ ├── TestingPairs.java │ │ │ │ ├── promise │ │ │ │ │ ├── E01_SimpleConnect.java │ │ │ │ │ ├── E02_ListenToBlocks.java │ │ │ │ │ ├── E03_ListenToBalanceChange.java │ │ │ │ │ ├── E04_Unsubscribe.java │ │ │ │ │ ├── E05_ReadStorage.java │ │ │ │ │ ├── E06_MakeTransfer.java │ │ │ │ │ ├── E08_SystemEvent.java │ │ │ │ │ ├── E09_TransferEvents.java │ │ │ │ │ └── E10_UpgradeChain.java │ │ │ │ └── rx │ │ │ │ │ ├── E01_SimpleConnect.java │ │ │ │ │ ├── E02_ListenToBlocks.java │ │ │ │ │ ├── E03_ListenToBalanceChange.java │ │ │ │ │ ├── E04_Unsubscribe.java │ │ │ │ │ ├── E05_ReadStorage.java │ │ │ │ │ ├── E06_MakeTransfer.java │ │ │ │ │ ├── E08_SystemEvent.java │ │ │ │ │ ├── E09_TransferEvents.java │ │ │ │ │ └── E10_UpgradeChain.java │ │ │ │ ├── rpc │ │ │ │ ├── core │ │ │ │ │ ├── IRpc.java │ │ │ │ │ ├── README.md │ │ │ │ │ ├── RpcCore.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── json │ │ │ │ │ ├── JsonAuthor.java │ │ │ │ │ ├── JsonChain.java │ │ │ │ │ ├── JsonRpc.java │ │ │ │ │ ├── JsonState.java │ │ │ │ │ ├── JsonSystem.java │ │ │ │ │ ├── README.md │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── types │ │ │ │ │ │ ├── JsonRpcMethod.java │ │ │ │ │ │ ├── JsonRpcMethodOpt.java │ │ │ │ │ │ ├── JsonRpcParam.java │ │ │ │ │ │ └── JsonRpcSection.java │ │ │ │ ├── provider │ │ │ │ │ ├── Constants.java │ │ │ │ │ ├── IProvider.java │ │ │ │ │ ├── IWsProvider.java │ │ │ │ │ ├── README.md │ │ │ │ │ ├── Types.java │ │ │ │ │ ├── coder │ │ │ │ │ │ └── RpcCoder.java │ │ │ │ │ ├── http │ │ │ │ │ │ └── HttpProvider.java │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── ws │ │ │ │ │ │ └── WsProvider.java │ │ │ │ └── rx │ │ │ │ │ ├── README.md │ │ │ │ │ ├── RpcRx.java │ │ │ │ │ ├── Types.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── type │ │ │ │ ├── extrinsics │ │ │ │ │ ├── CreateUnchecked.java │ │ │ │ │ ├── FromMetadata.java │ │ │ │ │ ├── Index.java │ │ │ │ │ ├── README.md │ │ │ │ │ ├── StaticMetadata.java │ │ │ │ │ └── package-info.java │ │ │ │ └── storage │ │ │ │ │ ├── CreateFunction.java │ │ │ │ │ ├── FromMetadata.java │ │ │ │ │ ├── README.md │ │ │ │ │ ├── Substrate.java │ │ │ │ │ ├── Types.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── types │ │ │ │ ├── Codec.java │ │ │ │ ├── CodecTypes.java │ │ │ │ ├── ContractAbi.java │ │ │ │ ├── Types.java │ │ │ │ ├── TypesUtils.java │ │ │ │ ├── codec │ │ │ │ │ ├── AbstractArray.java │ │ │ │ │ ├── AbstractInt.java │ │ │ │ │ ├── Base.java │ │ │ │ │ ├── CodecUtils.java │ │ │ │ │ ├── Compact.java │ │ │ │ │ ├── Compactable.java │ │ │ │ │ ├── CreateType.java │ │ │ │ │ ├── Enum.java │ │ │ │ │ ├── EnumType.java │ │ │ │ │ ├── Linkage.java │ │ │ │ │ ├── Option.java │ │ │ │ │ ├── Set.java │ │ │ │ │ ├── Struct.java │ │ │ │ │ ├── Tuple.java │ │ │ │ │ ├── TypeRegistry.java │ │ │ │ │ ├── U8a.java │ │ │ │ │ ├── U8aFixed.java │ │ │ │ │ ├── UInt.java │ │ │ │ │ └── Vector.java │ │ │ │ ├── metadata │ │ │ │ │ ├── MagicNumber.java │ │ │ │ │ ├── Metadata.java │ │ │ │ │ ├── MetadataUtils.java │ │ │ │ │ ├── MetadataVersioned.java │ │ │ │ │ ├── Types.java │ │ │ │ │ ├── v0 │ │ │ │ │ │ ├── Calls.java │ │ │ │ │ │ ├── Events.java │ │ │ │ │ │ ├── MetadataV0.java │ │ │ │ │ │ └── Modules.java │ │ │ │ │ ├── v1 │ │ │ │ │ │ ├── Calls.java │ │ │ │ │ │ ├── Events.java │ │ │ │ │ │ ├── MetadataV1.java │ │ │ │ │ │ ├── Storage.java │ │ │ │ │ │ └── ToV0.java │ │ │ │ │ ├── v2 │ │ │ │ │ │ ├── MetadataV2.java │ │ │ │ │ │ ├── Storage.java │ │ │ │ │ │ └── ToV1.java │ │ │ │ │ └── v3 │ │ │ │ │ │ ├── MetadataV3.java │ │ │ │ │ │ ├── Storage.java │ │ │ │ │ │ └── ToV2.java │ │ │ │ ├── primitive │ │ │ │ │ ├── Bool.java │ │ │ │ │ ├── Bytes.java │ │ │ │ │ ├── H160.java │ │ │ │ │ ├── H256.java │ │ │ │ │ ├── H512.java │ │ │ │ │ ├── I128.java │ │ │ │ │ ├── I16.java │ │ │ │ │ ├── I256.java │ │ │ │ │ ├── I32.java │ │ │ │ │ ├── I64.java │ │ │ │ │ ├── I8.java │ │ │ │ │ ├── Int.java │ │ │ │ │ ├── Method.java │ │ │ │ │ ├── Moment.java │ │ │ │ │ ├── Null.java │ │ │ │ │ ├── StorageData.java │ │ │ │ │ ├── StorageKey.java │ │ │ │ │ ├── Text.java │ │ │ │ │ ├── Type.java │ │ │ │ │ ├── U128.java │ │ │ │ │ ├── U16.java │ │ │ │ │ ├── U256.java │ │ │ │ │ ├── U32.java │ │ │ │ │ ├── U64.java │ │ │ │ │ ├── U8.java │ │ │ │ │ └── USize.java │ │ │ │ ├── rpc │ │ │ │ │ ├── ChainProperties.java │ │ │ │ │ ├── ExtrinsicStatus.java │ │ │ │ │ ├── Health.java │ │ │ │ │ ├── Json.java │ │ │ │ │ ├── NetworkState.java │ │ │ │ │ ├── PeerInfo.java │ │ │ │ │ ├── PendingExtrinsics.java │ │ │ │ │ ├── RuntimeVersion.java │ │ │ │ │ ├── SignedBlock.java │ │ │ │ │ └── StorageChangeSet.java │ │ │ │ └── type │ │ │ │ │ ├── AccountId.java │ │ │ │ │ ├── AccountIndex.java │ │ │ │ │ ├── AccountInfo.java │ │ │ │ │ ├── Address.java │ │ │ │ │ ├── Amount.java │ │ │ │ │ ├── AssetOf.java │ │ │ │ │ ├── AttestedCandidate.java │ │ │ │ │ ├── AuthorityId.java │ │ │ │ │ ├── Balance.java │ │ │ │ │ ├── BalanceLock.java │ │ │ │ │ ├── BftAuthoritySignature.java │ │ │ │ │ ├── Block.java │ │ │ │ │ ├── BlockNumber.java │ │ │ │ │ ├── CodeHash.java │ │ │ │ │ ├── Digest.java │ │ │ │ │ ├── Event.java │ │ │ │ │ ├── EventRecord.java │ │ │ │ │ ├── Exposure.java │ │ │ │ │ ├── Extrinsic.java │ │ │ │ │ ├── ExtrinsicEra.java │ │ │ │ │ ├── ExtrinsicSignature.java │ │ │ │ │ ├── Extrinsics.java │ │ │ │ │ ├── Gas.java │ │ │ │ │ ├── Hash.java │ │ │ │ │ ├── Header.java │ │ │ │ │ ├── Index.java │ │ │ │ │ ├── IndividualExposure.java │ │ │ │ │ ├── InherentOfflineReport.java │ │ │ │ │ ├── Justification.java │ │ │ │ │ ├── Key.java │ │ │ │ │ ├── KeyValue.java │ │ │ │ │ ├── LocKPeriods.java │ │ │ │ │ ├── LockIdentifier.java │ │ │ │ │ ├── MisbehaviorReport.java │ │ │ │ │ ├── NewAccountOutcome.java │ │ │ │ │ ├── Nonce.java │ │ │ │ │ ├── NonceCompact.java │ │ │ │ │ ├── Origin.java │ │ │ │ │ ├── ParaId.java │ │ │ │ │ ├── Perbill.java │ │ │ │ │ ├── Permill.java │ │ │ │ │ ├── PrefabWasmModule.java │ │ │ │ │ ├── PropIndex.java │ │ │ │ │ ├── Proposal.java │ │ │ │ │ ├── ProposalIndex.java │ │ │ │ │ ├── ReferendumIndex.java │ │ │ │ │ ├── ReferendumInfo.java │ │ │ │ │ ├── RewardDestination.java │ │ │ │ │ ├── Schedule.java │ │ │ │ │ ├── SeedOf.java │ │ │ │ │ ├── SessionKey.java │ │ │ │ │ ├── Signature.java │ │ │ │ │ ├── SignaturePayload.java │ │ │ │ │ ├── StakingLedger.java │ │ │ │ │ ├── StoredPendingChange.java │ │ │ │ │ ├── TreasuryProposal.java │ │ │ │ │ ├── UnlockChunk.java │ │ │ │ │ ├── ValidatorPrefs.java │ │ │ │ │ ├── VestingSchedule.java │ │ │ │ │ ├── Vote.java │ │ │ │ │ ├── VoteIndex.java │ │ │ │ │ ├── VoteThreshold.java │ │ │ │ │ └── WithdrawReasons.java │ │ │ │ └── utils │ │ │ │ ├── MapUtils.java │ │ │ │ ├── PackageScanner.java │ │ │ │ ├── RxUtils.java │ │ │ │ ├── Utils.java │ │ │ │ ├── UtilsCrypto.java │ │ │ │ └── crypto │ │ │ │ ├── Base58.java │ │ │ │ ├── EmptySR25591.java │ │ │ │ ├── ISR25591.java │ │ │ │ ├── JniSR25591.java │ │ │ │ ├── Nacl.java │ │ │ │ ├── NaclTest.java │ │ │ │ ├── SR25519.java │ │ │ │ ├── Schnorrkel.java │ │ │ │ ├── TweetNaCl.java │ │ │ │ └── Types.java │ │ └── resources │ │ │ └── log4j2.xml │ └── test │ │ └── java │ │ └── test │ │ └── org │ │ └── polkadot │ │ └── api │ │ ├── PromiseAlex.java │ │ ├── PromiseContract.java │ │ ├── PromiseQueries.java │ │ ├── PromiseTx.java │ │ ├── RxQueries.java │ │ ├── RxTx.java │ │ └── SingleAccountSigner.java └── test.wasm └── sr25519 ├── .gitignore ├── cpp ├── compile.sh ├── compile_mac.sh ├── jnimain.cpp ├── jnimain.h ├── org_polkadot_utils_crypto_SR25519.h └── sr25519.h ├── java ├── org │ └── polkadot │ │ └── utils │ │ └── crypto │ │ ├── SR25519.java │ │ ├── TestMain.java │ │ └── genhead.sh └── test.sh ├── libs ├── mac │ └── libjni.dylib ├── readme.md └── ubuntu64 │ └── libjni.so └── readme.md /doc/highlight-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/derive/accounts/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.derive.accounts 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.derive.accounts

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/derive/balances/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.derive.balances 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.derive.balances

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/derive/chain/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.derive.chain 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.derive.chain

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/derive/democracy/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.derive.democracy 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.derive.democracy

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/derive/session/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.derive.session 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.derive.session

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/derive/staking/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.derive.staking 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.derive.staking

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/promise/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.promise 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.promise

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/api/rx/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.api.rx 7 | 8 | 9 | 10 | 11 |

org.polkadot.api.rx

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/common/keyring/address/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.common.keyring.address 7 | 8 | 9 | 10 | 11 |

org.polkadot.common.keyring.address

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/org/polkadot/example/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.example 7 | 8 | 9 | 10 | 11 |

org.polkadot.example

12 |
13 |

Classes

14 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/org/polkadot/rpc/core/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.rpc.core 7 | 8 | 9 | 10 | 11 |

org.polkadot.rpc.core

12 |
13 |

Interfaces

14 | 17 |

Classes

18 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /doc/org/polkadot/rpc/json/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.rpc.json 7 | 8 | 9 | 10 | 11 |

org.polkadot.rpc.json

12 |
13 |

Classes

14 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/org/polkadot/rpc/json/types/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.rpc.json.types 7 | 8 | 9 | 10 | 11 |

org.polkadot.rpc.json.types

12 |
13 |

Classes

14 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/org/polkadot/rpc/provider/coder/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.rpc.provider.coder 7 | 8 | 9 | 10 | 11 |

org.polkadot.rpc.provider.coder

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/rpc/provider/http/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.rpc.provider.http 7 | 8 | 9 | 10 | 11 |

org.polkadot.rpc.provider.http

12 |
13 |

Classes

14 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/org/polkadot/rpc/provider/ws/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.rpc.provider.ws 7 | 8 | 9 | 10 | 11 |

org.polkadot.rpc.provider.ws

12 |
13 |

Classes

14 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /doc/org/polkadot/type/extrinsics/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.type.extrinsics 7 | 8 | 9 | 10 | 11 |

org.polkadot.type.extrinsics

12 |
13 |

Classes

14 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /doc/org/polkadot/utils/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.polkadot.utils 7 | 8 | 9 | 10 | 11 |

org.polkadot.utils

12 |
13 |

Classes

14 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Promise examples 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/package-list: -------------------------------------------------------------------------------- 1 | org.polkadot.api 2 | org.polkadot.api.derive 3 | org.polkadot.api.derive.accounts 4 | org.polkadot.api.derive.balances 5 | org.polkadot.api.derive.chain 6 | org.polkadot.api.derive.democracy 7 | org.polkadot.api.derive.session 8 | org.polkadot.api.derive.staking 9 | org.polkadot.api.promise 10 | org.polkadot.api.rx 11 | org.polkadot.common 12 | org.polkadot.common.keyring 13 | org.polkadot.common.keyring.address 14 | org.polkadot.common.keyring.pair 15 | org.polkadot.direct 16 | org.polkadot.example 17 | org.polkadot.example.promise 18 | org.polkadot.example.rx 19 | org.polkadot.rpc.core 20 | org.polkadot.rpc.json 21 | org.polkadot.rpc.json.types 22 | org.polkadot.rpc.provider 23 | org.polkadot.rpc.provider.coder 24 | org.polkadot.rpc.provider.http 25 | org.polkadot.rpc.provider.ws 26 | org.polkadot.rpc.rx 27 | org.polkadot.type.extrinsics 28 | org.polkadot.type.storage 29 | org.polkadot.types 30 | org.polkadot.types.codec 31 | org.polkadot.types.metadata 32 | org.polkadot.types.metadata.v0 33 | org.polkadot.types.metadata.v1 34 | org.polkadot.types.metadata.v2 35 | org.polkadot.types.metadata.v3 36 | org.polkadot.types.primitive 37 | org.polkadot.types.rpc 38 | org.polkadot.types.type 39 | org.polkadot.utils 40 | org.polkadot.utils.crypto 41 | -------------------------------------------------------------------------------- /doc/script.js: -------------------------------------------------------------------------------- 1 | function show(type) 2 | { 3 | count = 0; 4 | for (var key in methods) { 5 | var row = document.getElementById(key); 6 | if ((methods[key] & type) != 0) { 7 | row.style.display = ''; 8 | row.className = (count++ % 2) ? rowColor : altColor; 9 | } 10 | else 11 | row.style.display = 'none'; 12 | } 13 | updateTabs(type); 14 | } 15 | 16 | function updateTabs(type) 17 | { 18 | for (var value in tabs) { 19 | var sNode = document.getElementById(tabs[value][0]); 20 | var spanNode = sNode.firstChild; 21 | if (value == type) { 22 | sNode.className = activeTableTab; 23 | spanNode.innerHTML = tabs[value][1]; 24 | } 25 | else { 26 | sNode.className = tableTab; 27 | spanNode.innerHTML = "" + tabs[value][1] + ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/gradle.properties: -------------------------------------------------------------------------------- 1 | USERNAME=user 2 | PASSWORD=password -------------------------------------------------------------------------------- /examples/libs/libjni.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples/libs/libjni.dylib -------------------------------------------------------------------------------- /examples/libs/polkadot-java-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples/libs/polkadot-java-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /examples/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'polkadot-java-example' 2 | 3 | -------------------------------------------------------------------------------- /examples/src/main/java/org/polkadot/example/rx/E02_ListenToBlocks.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.example.rx; 2 | 3 | import io.reactivex.Observable; 4 | import org.polkadot.api.rx.ApiRx; 5 | import org.polkadot.rpc.provider.ws.WsProvider; 6 | import org.polkadot.types.type.Header; 7 | 8 | public class E02_ListenToBlocks { 9 | 10 | //static String endPoint = "wss://poc3-rpc.polkadot.io/"; 11 | //static String endPoint = "wss://substrate-rpc.parity.io/"; 12 | //static String endPoint = "ws://45.76.157.229:9944/"; 13 | static String endPoint = "ws://127.0.0.1:9944"; 14 | 15 | static void initEndPoint(String[] args) { 16 | if (args != null && args.length >= 1) { 17 | endPoint = args[0]; 18 | System.out.println(" connect to endpoint [" + endPoint + "]"); 19 | } else { 20 | System.out.println(" connect to default endpoint [" + endPoint + "]"); 21 | } 22 | } 23 | 24 | public static void main(String[] args) { 25 | initEndPoint(args); 26 | 27 | WsProvider wsProvider = new WsProvider(endPoint); 28 | 29 | Observable apiRxObservable = ApiRx.create(wsProvider); 30 | 31 | apiRxObservable.flatMap((apiRx) -> { 32 | return apiRx.rpc().chain().function("subscribeNewHead").invoke(); 33 | } 34 | 35 | ).subscribe((result) -> { 36 | Header header = (Header) result; 37 | System.out.println("Chain is at block: " + header.getBlockNumber()); 38 | }); 39 | 40 | 41 | try { 42 | Thread.sleep(20000); 43 | } catch (InterruptedException e) { 44 | e.printStackTrace(); 45 | } 46 | 47 | System.exit(0); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/src/main/java/org/polkadot/example/rx/E03_ListenToBalanceChange.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.example.rx; 2 | 3 | import io.reactivex.Observable; 4 | import org.polkadot.api.rx.ApiRx; 5 | import org.polkadot.rpc.provider.ws.WsProvider; 6 | 7 | public class E03_ListenToBalanceChange { 8 | static String Alice = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"; 9 | 10 | //static String endPoint = "wss://poc3-rpc.polkadot.io/"; 11 | //static String endPoint = "wss://substrate-rpc.parity.io/"; 12 | //static String endPoint = "ws://45.76.157.229:9944/"; 13 | static String endPoint = "ws://127.0.0.1:9944"; 14 | 15 | static void initEndPoint(String[] args) { 16 | if (args != null && args.length >= 1) { 17 | endPoint = args[0]; 18 | System.out.println(" connect to endpoint [" + endPoint + "]"); 19 | } else { 20 | System.out.println(" connect to default endpoint [" + endPoint + "]"); 21 | } 22 | } 23 | 24 | public static void main(String[] args) { 25 | initEndPoint(args); 26 | 27 | WsProvider wsProvider = new WsProvider(endPoint); 28 | 29 | Observable apiRxObservable = ApiRx.create(wsProvider); 30 | 31 | apiRxObservable.flatMap((apiRx) -> { 32 | return apiRx.query().section("balances").function("freeBalance").call(Alice); 33 | }).subscribe((result) -> { 34 | System.out.println("freeBalance result " + result); 35 | }); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples/test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples/test.wasm -------------------------------------------------------------------------------- /examples_runnable/20190511/01_simple_connect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.SimpleConnect 9 | -------------------------------------------------------------------------------- /examples_runnable/20190511/02_listen_to_blocks_and_unsubscribe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBlocks 9 | -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/Java-WebSocket-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/Java-WebSocket-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/animal-sniffer-annotations-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/animal-sniffer-annotations-1.17.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/base64-2.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/base64-2.3.9.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/checker-qual-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/checker-qual-2.5.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/commons-collections4-4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/commons-collections4-4.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/commons-lang3-3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/commons-lang3-3.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/error_prone_annotations-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/error_prone_annotations-2.2.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/fastjson-1.2.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/fastjson-1.2.48.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/guava-27.1-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/guava-27.1-jre.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/j2objc-annotations-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/j2objc-annotations-1.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/jackson-annotations-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/jackson-annotations-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/jackson-core-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/jackson-core-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/jackson-databind-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/jackson-databind-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/jool-java-8-0.9.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/jool-java-8-0.9.14.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/joor-java-8-0.9.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/joor-java-8-0.9.11.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/joou-java-6-0.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/joou-java-6-0.9.4.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/jsonrpc4j-1.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/jsonrpc4j-1.5.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/lz4-java-1.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/lz4-java-1.5.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/polkadot-java-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/polkadot-java-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/promises-jvm-0.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/promises-jvm-0.10.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/reactive-streams-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/reactive-streams-1.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/rxjava-2.2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/rxjava-2.2.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190511/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /examples_runnable/20190511/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples_runnable/20190518/01_simple_connect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.SimpleConnect wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190518/02_listen_to_blocks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBlocks wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190518/03_listen_to_balance_change.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBalanceChange wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190518/04_unsubscribe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Unsubscribe wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190518/05_read_storage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ReadStorage wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/Java-WebSocket-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/Java-WebSocket-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/animal-sniffer-annotations-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/animal-sniffer-annotations-1.17.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/base64-2.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/base64-2.3.9.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/bcprov-jdk15on-1.60.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/bcprov-jdk15on-1.60.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/bitcoinj-core-0.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/bitcoinj-core-0.15.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/checker-qual-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/checker-qual-2.5.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/commons-collections4-4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/commons-collections4-4.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/commons-lang3-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/commons-lang3-3.8.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/commons-lang3-3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/commons-lang3-3.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/commons-text-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/commons-text-1.6.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/error_prone_annotations-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/error_prone_annotations-2.2.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/fastjson-1.2.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/fastjson-1.2.48.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/guava-27.1-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/guava-27.1-jre.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/j2objc-annotations-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/j2objc-annotations-1.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jackson-annotations-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jackson-annotations-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jackson-core-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jackson-core-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jackson-databind-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jackson-databind-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jcip-annotations-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jcip-annotations-1.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jool-java-8-0.9.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jool-java-8-0.9.14.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/joor-java-8-0.9.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/joor-java-8-0.9.11.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/joou-java-6-0.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/joou-java-6-0.9.4.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jsonrpc4j-1.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jsonrpc4j-1.5.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/lz4-java-1.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/lz4-java-1.5.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/okhttp-3.12.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/okhttp-3.12.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/okio-1.15.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/okio-1.15.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/polkadot-java-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/polkadot-java-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/promises-jvm-0.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/promises-jvm-0.10.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/protobuf-java-3.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/protobuf-java-3.6.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/reactive-streams-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/reactive-streams-1.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/rxjava-2.2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/rxjava-2.2.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/scrypt-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/scrypt-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190518/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /examples_runnable/20190518/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples_runnable/20190525/01_simple_connect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.SimpleConnect wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/02_listen_to_blocks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBlocks wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/03_listen_to_balance_change.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBalanceChange wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/04_unsubscribe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Unsubscribe wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/05_read_storage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ReadStorage wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/06_make_transfer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.MakeTransfer ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/101_democracy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Democracy wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/102_staking.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Staking wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/Java-WebSocket-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/Java-WebSocket-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/animal-sniffer-annotations-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/animal-sniffer-annotations-1.17.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/base64-2.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/base64-2.3.9.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/bcprov-jdk15on-1.60.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/bcprov-jdk15on-1.60.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/bitcoinj-core-0.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/bitcoinj-core-0.15.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/checker-qual-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/checker-qual-2.5.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/commons-collections4-4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/commons-collections4-4.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/commons-lang3-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/commons-lang3-3.8.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/commons-lang3-3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/commons-lang3-3.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/commons-text-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/commons-text-1.6.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/eddsa-0.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/eddsa-0.3.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/error_prone_annotations-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/error_prone_annotations-2.2.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/fastjson-1.2.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/fastjson-1.2.48.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/guava-27.1-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/guava-27.1-jre.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/j2objc-annotations-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/j2objc-annotations-1.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jackson-annotations-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jackson-annotations-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jackson-core-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jackson-core-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jackson-databind-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jackson-databind-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jcip-annotations-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jcip-annotations-1.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jool-java-8-0.9.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jool-java-8-0.9.14.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/joor-java-8-0.9.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/joor-java-8-0.9.11.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/joou-java-6-0.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/joou-java-6-0.9.4.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jsonrpc4j-1.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jsonrpc4j-1.5.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/lz4-java-1.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/lz4-java-1.5.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/okhttp-3.12.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/okhttp-3.12.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/okio-1.15.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/okio-1.15.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/polkadot-java-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/polkadot-java-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/promises-jvm-0.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/promises-jvm-0.10.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/protobuf-java-3.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/protobuf-java-3.6.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/reactive-streams-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/reactive-streams-1.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/rxjava-2.2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/rxjava-2.2.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/scrypt-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/scrypt-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190525/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /examples_runnable/20190525/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples_runnable/20190601/01_simple_connect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.SimpleConnect wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/02_listen_to_blocks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBlocks wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/03_listen_to_balance_change.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ListenToBalanceChange wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/04_unsubscribe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Unsubscribe wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/05_read_storage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.ReadStorage wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/06_make_transfer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.MakeTransfer ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/08_system_events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.SystemEvent ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/09_transfer_events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.TransferEvents ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/101_democracy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Democracy wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/102_staking.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Staking wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/10_upgrade_chain.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.UpgradeChain ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/Java-WebSocket-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/Java-WebSocket-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/animal-sniffer-annotations-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/animal-sniffer-annotations-1.17.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/base64-2.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/base64-2.3.9.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/bcprov-jdk15on-1.60.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/bcprov-jdk15on-1.60.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/bitcoinj-core-0.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/bitcoinj-core-0.15.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/checker-qual-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/checker-qual-2.5.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/commons-collections4-4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/commons-collections4-4.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/commons-lang3-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/commons-lang3-3.8.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/commons-lang3-3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/commons-lang3-3.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/commons-text-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/commons-text-1.6.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/eddsa-0.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/eddsa-0.3.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/error_prone_annotations-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/error_prone_annotations-2.2.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/fastjson-1.2.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/fastjson-1.2.48.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/guava-27.1-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/guava-27.1-jre.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/j2objc-annotations-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/j2objc-annotations-1.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jackson-annotations-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jackson-annotations-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jackson-core-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jackson-core-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jackson-databind-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jackson-databind-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jcip-annotations-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jcip-annotations-1.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jool-java-8-0.9.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jool-java-8-0.9.14.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/joor-java-8-0.9.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/joor-java-8-0.9.11.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/joou-java-6-0.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/joou-java-6-0.9.4.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jsonrpc4j-1.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jsonrpc4j-1.5.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/lz4-java-1.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/lz4-java-1.5.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/okhttp-3.12.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/okhttp-3.12.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/okio-1.15.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/okio-1.15.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/polkadot-java-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/polkadot-java-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/promises-jvm-0.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/promises-jvm-0.10.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/protobuf-java-3.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/protobuf-java-3.6.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/reactive-streams-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/reactive-streams-1.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/rxjava-2.2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/rxjava-2.2.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/scrypt-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/scrypt-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /examples_runnable/20190601/libjni.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/libjni.dylib -------------------------------------------------------------------------------- /examples_runnable/20190601/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples_runnable/20190601/test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190601/test.wasm -------------------------------------------------------------------------------- /examples_runnable/20190616/101_democracy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Democracy wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/102_staking.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.Staking wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_01_simple_connect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E01_SimpleConnect wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_02_listen_to_blocks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E02_ListenToBlocks wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_03_listen_to_balance_change.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E03_ListenToBalanceChange ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_04_unsubscribe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E04_Unsubscribe ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_05_read_storage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E05_ReadStorage ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_06_make_transfer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E06_MakeTransfer ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_08_system_events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E08_SystemEvent ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_09_transfer_events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E09_TransferEvents ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Promise_10_upgrade_chain.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.promise.E10_UpgradeChain ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_01_simple_connect.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E01_SimpleConnect wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_02_listen_to_blocks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E02_ListenToBlocks wss://poc3-rpc.polkadot.io/ 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_03_listen_to_balance_change.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E03_ListenToBalanceChange ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_04_unsubscribe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E04_Unsubscribe ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_05_read_storage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E05_ReadStorage ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_06_make_transfer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E06_MakeTransfer ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_08_system_events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E08_SystemEvent ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_09_transfer_events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E09_TransferEvents ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/Rx_10_upgrade_chain.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | basepath=$(cd `dirname $0`; pwd) 3 | cd ${basepath} 4 | echo ${basepath} 5 | 6 | 7 | 8 | java -cp "./:./lib/*" org.polkadot.example.rx.E10_UpgradeChain ws://127.0.0.1:9944 9 | -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/Java-WebSocket-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/Java-WebSocket-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/animal-sniffer-annotations-1.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/animal-sniffer-annotations-1.17.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/base64-2.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/base64-2.3.9.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/bcprov-jdk15on-1.60.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/bcprov-jdk15on-1.60.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/bitcoinj-core-0.15.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/bitcoinj-core-0.15.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/checker-qual-2.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/checker-qual-2.5.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/commons-collections4-4.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/commons-collections4-4.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/commons-lang3-3.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/commons-lang3-3.8.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/commons-lang3-3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/commons-lang3-3.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/commons-text-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/commons-text-1.6.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/eddsa-0.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/eddsa-0.3.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/error_prone_annotations-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/error_prone_annotations-2.2.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/fastjson-1.2.48.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/fastjson-1.2.48.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/guava-27.1-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/guava-27.1-jre.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/j2objc-annotations-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/j2objc-annotations-1.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jackson-annotations-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jackson-annotations-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jackson-core-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jackson-core-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jackson-databind-2.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jackson-databind-2.8.5.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jcip-annotations-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jcip-annotations-1.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jool-java-8-0.9.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jool-java-8-0.9.14.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/joor-java-8-0.9.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/joor-java-8-0.9.11.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/joou-java-6-0.9.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/joou-java-6-0.9.4.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jsonrpc4j-1.5.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jsonrpc4j-1.5.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/log4j-api-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/log4j-api-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/log4j-core-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/log4j-core-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/log4j-slf4j-impl-2.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/log4j-slf4j-impl-2.11.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/lz4-java-1.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/lz4-java-1.5.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/okhttp-3.12.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/okhttp-3.12.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/okio-1.15.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/okio-1.15.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/polkadot-java-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/polkadot-java-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/promises-jvm-0.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/promises-jvm-0.10.3.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/protobuf-java-3.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/protobuf-java-3.6.1.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/reactive-streams-1.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/reactive-streams-1.0.2.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/rxjava-2.2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/rxjava-2.2.8.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/scrypt-1.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/scrypt-1.4.0.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/lib/slf4j-api-1.7.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/lib/slf4j-api-1.7.25.jar -------------------------------------------------------------------------------- /examples_runnable/20190616/libjni.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/libjni.dylib -------------------------------------------------------------------------------- /examples_runnable/20190616/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /examples_runnable/20190616/test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/examples_runnable/20190616/test.wasm -------------------------------------------------------------------------------- /gendoc.sh: -------------------------------------------------------------------------------- 1 | # To run the javadoc, download markdown-doclet 2 | # at https://repo1.maven.org/maven2/ch/raffael/markdown-doclet/markdown-doclet/1.4/markdown-doclet-1.4-all.jar 3 | # change the folder of markdown-doclet-1.4-all.jar in the command line below 4 | # Home of markdown-doclet is at https://github.com/Abnaxos/markdown-doclet 5 | 6 | cp -R docfiles doc/ 7 | 8 | javadoc -doclet ch.raffael.mddoclet.MarkdownDoclet -docletpath /markdown-doclet-1.4-all.jar -d doc -sourcepath packages/src/main/java -overview docfiles/overview.html -notimestamp -subpackages org.polkadot 9 | -------------------------------------------------------------------------------- /packages/data/erc20.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/packages/data/erc20.wasm -------------------------------------------------------------------------------- /packages/data/incrementer-opt.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/packages/data/incrementer-opt.wasm -------------------------------------------------------------------------------- /packages/data/incrementer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Incrementer", 3 | "deploy": { 4 | "args": [ 5 | { 6 | "name": "init_value", 7 | "type": "u32" 8 | } 9 | ] 10 | }, 11 | "messages": [ 12 | { 13 | "name": "inc", 14 | "selector": 257544423, 15 | "mutates": true, 16 | "args": [ 17 | { 18 | "name": "by", 19 | "type": "u32" 20 | } 21 | ], 22 | "return_type": null 23 | }, 24 | { 25 | "name": "get", 26 | "selector": 4266279973, 27 | "mutates": false, 28 | "args": [], 29 | "return_type": "u32" 30 | }, 31 | { 32 | "name": "compare", 33 | "selector": 363906316, 34 | "mutates": false, 35 | "args": [ 36 | { 37 | "name": "with", 38 | "type": "u32" 39 | } 40 | ], 41 | "return_type": "bool" 42 | } 43 | ] 44 | } -------------------------------------------------------------------------------- /packages/gradle.properties: -------------------------------------------------------------------------------- 1 | USERNAME=user 2 | PASSWORD=password -------------------------------------------------------------------------------- /packages/libs/libjni.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/packages/libs/libjni.dylib -------------------------------------------------------------------------------- /packages/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'polkadot-java' 2 | 3 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/api/ApiUtils.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.api; 2 | 3 | import org.polkadot.types.rpc.SignedBlock; 4 | import org.polkadot.types.type.EventRecord; 5 | import org.polkadot.utils.Utils; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | import java.util.List; 10 | import java.util.stream.Collectors; 11 | 12 | public class ApiUtils { 13 | private static final Logger logger = LoggerFactory.getLogger(ApiUtils.class); 14 | 15 | public static List filterEvents(byte[] extHash, SignedBlock signedBlock, List allEvents) { 16 | // extrinsics to hashes 17 | String myHash = Utils.u8aToHex(extHash); 18 | List allHashes = signedBlock.getBlock().getExtrinsics() 19 | .stream().map(ext -> ext.getHash().toHex()) 20 | .collect(Collectors.toList()); 21 | 22 | // find the index of our extrinsic in the block 23 | int index = allHashes.indexOf(myHash); 24 | // if we do get the block after finalized, it _should_ be there 25 | if (index < 0) { 26 | logger.warn("block {} Unable to find extrinsic {} inside {}", 27 | signedBlock.getBlock().getHeader().getHash(), myHash, allHashes); 28 | return null; 29 | } 30 | 31 | return allEvents.stream().filter(eventRecord -> { 32 | // only ApplyExtrinsic has the extrinsic index 33 | return eventRecord.getPhase().isApplyExtrinsic() && eventRecord.getPhase().asApplyExtrinsic().intValue() == index; 34 | }).collect(Collectors.toList()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/api/derive/README.md: -------------------------------------------------------------------------------- 1 | # @polkadot/api-derive 2 | 3 | Common functions used across Polkadot, derived from RPC calls and storage queries. 4 | 5 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/api/derive/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | # @polkadot/api-derive 3 | 4 | Common functions used across Polkadot, derived from RPC calls and storage queries. 5 | */ 6 | package org.polkadot.api.derive; 7 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/common/NamedThreadFactory.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.common; 2 | 3 | import java.util.concurrent.ThreadFactory; 4 | import java.util.concurrent.atomic.AtomicInteger; 5 | 6 | public class NamedThreadFactory implements ThreadFactory { 7 | private ThreadGroup group; 8 | private AtomicInteger threadCountor = new AtomicInteger(0); 9 | private String name; 10 | 11 | public NamedThreadFactory(String perfix) { 12 | this.name = perfix; 13 | group = new ThreadGroup(name); 14 | } 15 | 16 | @Override 17 | public Thread newThread(Runnable runnable) { 18 | Thread thread = new Thread(group, runnable, name + "-" + threadCountor.incrementAndGet()); 19 | return thread; 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public ThreadGroup getGroup() { 27 | return group; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/common/ReflectionUtils.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.common; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | public class ReflectionUtils { 6 | /** 7 | * Find DeclaredField recursively. 8 | * 9 | * @param object : the child object 10 | * @param fieldName : the field name in the parent object 11 | * @return the field object in the parent object 12 | */ 13 | public static Field getDeclaredField(Object object, String fieldName) { 14 | Field field = null; 15 | 16 | Class clazz = object.getClass(); 17 | 18 | for (; clazz != Object.class; clazz = clazz.getSuperclass()) { 19 | try { 20 | field = clazz.getDeclaredField(fieldName); 21 | return field; 22 | } catch (Exception e) { 23 | } 24 | } 25 | 26 | return null; 27 | } 28 | 29 | /** 30 | * Read field value directly, ignore private/protected and getter 31 | * 32 | * @param object : the child object 33 | * @param fieldName : the field name in the parent object 34 | * @return : the field value in the parent object 35 | */ 36 | 37 | public static T getField(Object object, String fieldName) { 38 | 39 | Field field = getDeclaredField(object, fieldName); 40 | field.setAccessible(true); 41 | 42 | try { 43 | return (T) field.get(object); 44 | } catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | 48 | return null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/common/keyring/Defaults.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.common.keyring; 2 | 3 | public class Defaults { 4 | 5 | // default substrate dev phrase 6 | public static final String DEV_PHRASE = "bottom drive obey lake curtain smoke basket hold race lonely fit walk"; 7 | 8 | // seed from the above phrase 9 | public static final String DEV_SEED = "0xfac7959dbfe72f052e5a0c3c8d6530f202b02fd8f9f5ca3580ec8deb7797479e"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/common/keyring/address/Defaults.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.common.keyring.address; 2 | 3 | import com.google.common.collect.Lists; 4 | 5 | import java.util.List; 6 | 7 | public class Defaults { 8 | 9 | //export type Prefix = 0 | 1 | 3 | 42 | 43 | 68 | 69; 10 | 11 | /** 12 | * const defaults = { 13 | * allowedDecodedLengths: [1, 2, 4, 8, 32], 14 | * // publicKey has prefix + 2 checksum bytes, short only prefix + 1 checksum byte 15 | * allowedEncodedLengths: [3, 4, 6, 10, 35], 16 | * allowedPrefix: [0, 1, 3, 42, 43, 68, 69] as Array, 17 | * prefix: 42 as Prefix 18 | * }; 19 | */ 20 | 21 | public static List allowedDecodedLengths = Lists.newArrayList(1, 2, 4, 8, 32); 22 | public static List allowedEncodedLengths = Lists.newArrayList(3, 4, 6, 10, 35); 23 | public static List allowedPrefix = Lists.newArrayList(0, 1, 3, 42, 43, 68, 69); 24 | public static byte prefix = 42; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/common/keyring/pair/Defaults.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.common.keyring.pair; 2 | 3 | import com.google.common.primitives.UnsignedBytes; 4 | 5 | public interface Defaults { 6 | 7 | 8 | int NONCE_LENGTH = 24; 9 | byte[] PKCS8_DIVIDER = new byte[]{UnsignedBytes.checkedCast(161), 35, 3, 33, 0}; 10 | byte[] PKCS8_HEADER = new byte[]{48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32}; 11 | int PUB_LENGTH = 32; 12 | int SEC_LENGTH = 64; 13 | int SEED_LENGTH = 32; 14 | 15 | /** 16 | * 17 | const NONCE_LENGTH = 24; 18 | const PKCS8_DIVIDER = new Uint8Array([161, 35, 3, 33, 0]); 19 | const PKCS8_HEADER = new Uint8Array([48, 83, 2, 1, 1, 48, 5, 6, 3, 43, 101, 112, 4, 34, 4, 32]); 20 | const PUB_LENGTH = 32; 21 | const SEC_LENGTH = 64; 22 | const SEED_LENGTH = 32; 23 | 24 | export { 25 | NONCE_LENGTH, 26 | PKCS8_DIVIDER, 27 | PKCS8_HEADER, 28 | PUB_LENGTH, 29 | SEC_LENGTH, 30 | SEED_LENGTH 31 | }; 32 | 33 | */ 34 | } 35 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/common/keyring/pair/Types.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.common.keyring.pair; 2 | 3 | public interface Types { 4 | class PairInfo { 5 | protected byte[] publicKey; 6 | protected byte[] secretKey; 7 | protected byte[] seed; 8 | 9 | public byte[] getPublicKey() { 10 | return publicKey; 11 | } 12 | 13 | public void setPublicKey(byte[] publicKey) { 14 | this.publicKey = publicKey; 15 | } 16 | 17 | public byte[] getSecretKey() { 18 | return secretKey; 19 | } 20 | 21 | public void setSecretKey(byte[] secretKey) { 22 | this.secretKey = secretKey; 23 | } 24 | 25 | public byte[] getSeed() { 26 | return seed; 27 | } 28 | 29 | public void setSeed(byte[] seed) { 30 | this.seed = seed; 31 | } 32 | // 33 | //public PairInfo(byte[] publicKey, byte[] secretKey, byte[] seed) { 34 | // this.publicKey = publicKey; 35 | // this.secretKey = secretKey; 36 | // this.seed = seed; 37 | //} 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/direct/IApi.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.direct; 2 | 3 | import org.polkadot.api.Types; 4 | import org.polkadot.types.rpc.RuntimeVersion; 5 | import org.polkadot.types.type.Hash; 6 | 7 | public interface IApi { 8 | 9 | Hash getGenesisHash(); 10 | 11 | RuntimeVersion getRuntimeVersion(); 12 | 13 | Types.Derive derive(); 14 | 15 | Types.QueryableStorage query(); 16 | 17 | Types.DecoratedRpc rpc(); 18 | 19 | Types.SubmittableExtrinsics tx(); 20 | 21 | Types.Signer getSigner(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/direct/IFunction.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.direct; 2 | 3 | 4 | public interface IFunction { 5 | } 6 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/direct/IModule.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.direct; 2 | 3 | import java.util.Set; 4 | 5 | public interface IModule { 6 | S section(String section); 7 | 8 | Set sectionNames(); 9 | 10 | default void addSection(String sectionName, S section) { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/direct/IRpcFunction.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.direct; 2 | 3 | import com.onehilltech.promises.Promise; 4 | 5 | public interface IRpcFunction extends IFunction { 6 | 7 | interface Unsubscribe { 8 | T unsubscribe(); 9 | } 10 | 11 | interface SubscribeCallback { 12 | void callback(T t); 13 | } 14 | 15 | Promise invoke(Object... params); 16 | 17 | default boolean isSubscribe() { 18 | return false; 19 | } 20 | 21 | default Promise unsubscribe(int subscriptionId) { 22 | //TODO 2019-06-11 11:00 23 | throw new UnsupportedOperationException(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/direct/IRpcModule.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.direct; 2 | 3 | import com.google.common.collect.Sets; 4 | import org.polkadot.rpc.core.IRpc; 5 | 6 | import java.util.Set; 7 | 8 | public interface IRpcModule extends IModule { 9 | IRpc.RpcInterfaceSection author(); 10 | 11 | IRpc.RpcInterfaceSection chain(); 12 | 13 | IRpc.RpcInterfaceSection state(); 14 | 15 | IRpc.RpcInterfaceSection system(); 16 | 17 | @Override 18 | default Set sectionNames() { 19 | return Sets.newHashSet("author", "chain", "state", "system"); 20 | } 21 | 22 | @Override 23 | default IRpc.RpcInterfaceSection section(String section) { 24 | switch (section) { 25 | case "author": 26 | return author(); 27 | case "chain": 28 | return chain(); 29 | case "state": 30 | return state(); 31 | case "system": 32 | return system(); 33 | default://TODO 2019-05-09 15:19 34 | throw new UnsupportedOperationException(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/direct/ISection.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.direct; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.Set; 9 | 10 | public abstract class ISection { 11 | private static final Logger logger = LoggerFactory.getLogger(ISection.class); 12 | 13 | protected Map functions = new HashMap<>(); 14 | 15 | public F function(String function) { 16 | return functions.get(function); 17 | } 18 | 19 | public boolean addFunction(String name, F function) { 20 | boolean result = true; 21 | if (this.functions.containsKey(name)) { 22 | logger.error(" dup function name {}, {}, {}", 23 | name, this.functions.get(name), function); 24 | result = false; 25 | } 26 | this.functions.put(name, function); 27 | return result; 28 | } 29 | 30 | public Set functionNames() { 31 | return this.functions.keySet(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/example/rx/E03_ListenToBalanceChange.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.example.rx; 2 | 3 | import io.reactivex.Observable; 4 | import org.polkadot.api.rx.ApiRx; 5 | import org.polkadot.rpc.provider.ws.WsProvider; 6 | 7 | public class E03_ListenToBalanceChange { 8 | static String Alice = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"; 9 | 10 | //static String endPoint = "wss://poc3-rpc.polkadot.io/"; 11 | //static String endPoint = "wss://substrate-rpc.parity.io/"; 12 | //static String endPoint = "ws://45.76.157.229:9944/"; 13 | static String endPoint = "ws://127.0.0.1:9944"; 14 | 15 | static void initEndPoint(String[] args) { 16 | if (args != null && args.length >= 1) { 17 | endPoint = args[0]; 18 | System.out.println(" connect to endpoint [" + endPoint + "]"); 19 | } else { 20 | System.out.println(" connect to default endpoint [" + endPoint + "]"); 21 | } 22 | } 23 | 24 | public static void main(String[] args) { 25 | initEndPoint(args); 26 | 27 | WsProvider wsProvider = new WsProvider(endPoint); 28 | 29 | Observable apiRxObservable = ApiRx.create(wsProvider); 30 | 31 | apiRxObservable.flatMap((apiRx) -> { 32 | return apiRx.query().section("balances").function("freeBalance").call(Alice); 33 | }).subscribe((result) -> { 34 | System.out.println("freeBalance result " + result); 35 | }); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/core/IRpc.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.core; 2 | 3 | 4 | import com.onehilltech.promises.Promise; 5 | import org.polkadot.direct.IRpcFunction; 6 | import org.polkadot.direct.ISection; 7 | 8 | public interface IRpc { 9 | 10 | //abstract class RpcInterfaceMethod implements IRpcFunction { 11 | // String subscription; 12 | // 13 | // @Override 14 | // public abstract Promise invoke(Object... params); 15 | // 16 | // abstract Promise unsubscribe(int id); 17 | //} 18 | 19 | //T : () -> {} 20 | //T : codec 21 | //abstract class RpcInterfaceMethodNew implements IFunction { 22 | // //String subscription; 23 | // 24 | // abstract Promise invoke(Object... params); 25 | // 26 | // //abstract Promise<> unsubscribe(int id); 27 | //} 28 | 29 | 30 | class RpcInterfaceSection extends ISection { 31 | //Map methods = new HashMap<>(); 32 | 33 | //@Override 34 | //public IFunction function(String function) { 35 | // return methods.get(function); 36 | //} 37 | } 38 | 39 | RpcInterfaceSection author(); 40 | 41 | RpcInterfaceSection chain(); 42 | 43 | RpcInterfaceSection state(); 44 | 45 | RpcInterfaceSection system(); 46 | 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/json/JsonRpc.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.json; 2 | 3 | import org.polkadot.rpc.json.types.JsonRpcSection; 4 | 5 | public class JsonRpc { 6 | 7 | public static final JsonRpcSection author = JsonAuthor.author; 8 | public static final JsonRpcSection chain = JsonChain.chain; 9 | public static final JsonRpcSection state = JsonState.state; 10 | public static final JsonRpcSection system = JsonSystem.system; 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/json/README.md: -------------------------------------------------------------------------------- 1 | # @polkadot/jsonrpc 2 | 3 | A definition of all the methods exposed in a general Polkadot client application. These are used not only to provide a comprehensive code-generated document of the available methods, but are also used in the API to auto-generate endpoints with the required type-checking. 4 | 5 | For a list of currently exposed methods, see the [method documentation](docs/METHODS_RPC.md). 6 | 7 | ## Usage 8 | 9 | Installation - 10 | 11 | ``` 12 | yarn add @polkadot/jsonrpc 13 | ``` 14 | 15 | ## Adding methods 16 | 17 | As methods are added, simply adding the name, inputs & output will prepare it for use. 18 | 19 | - Add the method to the correct file in [src/rpc/](src/rpc/) (Input/Output types as cross-referenced from the canonical implementation and match one-to-one) 20 | - Should a new type be required, add it to the type list, [src/types.js](src/types.js) (Required for TSLint type checking) 21 | 22 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/json/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | # @polkadot/jsonrpc 3 | 4 | A definition of all the methods exposed in a general Polkadot client application. These are used not only to provide a comprehensive code-generated document of the available methods, but are also used in the API to auto-generate endpoints with the required type-checking. 5 | 6 | For a list of currently exposed methods, see the [method documentation](docs/METHODS_RPC.md). 7 | 8 | ## Usage 9 | 10 | Installation - 11 | 12 | ``` 13 | yarn add @polkadot/jsonrpc 14 | ``` 15 | 16 | ## Adding methods 17 | 18 | As methods are added, simply adding the name, inputs & output will prepare it for use. 19 | 20 | - Add the method to the correct file in [src/rpc/](src/rpc/) (Input/Output types as cross-referenced from the canonical implementation and match one-to-one) 21 | - Should a new type be required, add it to the type list, [src/types.js](src/types.js) (Required for TSLint type checking) 22 | */ 23 | package org.polkadot.rpc.json; 24 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/json/types/JsonRpcParam.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.json.types; 2 | 3 | 4 | public class JsonRpcParam { 5 | private boolean isOptional; 6 | private String name; 7 | //private String type; 8 | private String type; 9 | 10 | public JsonRpcParam(String name, String type, boolean isOptional) { 11 | this.isOptional = isOptional; 12 | this.name = name; 13 | this.type = type; 14 | } 15 | 16 | public JsonRpcParam(String name, String type) { 17 | this(name, type, false); 18 | } 19 | 20 | public boolean isOptional() { 21 | return isOptional; 22 | } 23 | 24 | public void setOptional(boolean optional) { 25 | isOptional = optional; 26 | } 27 | 28 | public java.lang.String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(java.lang.String name) { 33 | this.name = name; 34 | } 35 | 36 | public String getType() { 37 | return type; 38 | } 39 | 40 | public void setType(String type) { 41 | this.type = type; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/json/types/JsonRpcSection.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.json.types; 2 | 3 | import java.util.Map; 4 | 5 | public class JsonRpcSection { 6 | 7 | public boolean isDeprecated; 8 | public boolean isHidden; 9 | public String description; 10 | public String section; 11 | public Map rpcMethods; 12 | 13 | public JsonRpcSection(boolean isDeprecated, boolean isHidden, String description, String section, Map rpcMethods) { 14 | this.isDeprecated = isDeprecated; 15 | this.isHidden = isHidden; 16 | this.description = description; 17 | this.section = section; 18 | this.rpcMethods = rpcMethods; 19 | } 20 | 21 | //isDeprecated: boolean, 22 | //isHidden: boolean, 23 | //description: string, 24 | //section: string, 25 | //methods: { 26 | //[index: string]: RpcInterfaceMethod 27 | //} 28 | } 29 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/provider/Constants.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.provider; 2 | 3 | public interface Constants { 4 | 5 | String HTTP_URL = "http://127.0.0.1:9933"; 6 | String WS_URL = "ws://127.0.0.1:9944"; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/provider/IWsProvider.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.provider; 2 | 3 | public interface IWsProvider extends IProvider { 4 | void connect(); 5 | } 6 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/provider/README.md: -------------------------------------------------------------------------------- 1 | # @polkadot/rpc-provider 2 | 3 | Generic transport providers to handle the transport of method calls to and from Polkadot clients from applications interacting with it. It provides an interface to making RPC calls and is generally, unless you are operating at a low-level and taking care of encoding and decoding of parameters/results, it won't be directly used, rather only passed to a higher-level interface. 4 | 5 | ## Provider Selection 6 | 7 | There are two flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets. It is generally recommended to use the [[WsProvider]] since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client. 8 | 9 | ## Usage 10 | 11 | WebSocket Initialisation - 12 | 13 | ```java 14 | import org.polkadot.rpc.provider.ws.WsProvider; 15 | 16 | // this is the actual default endpoint 17 | const provider = new WsProvider('ws://127.0.0.1:9944'); 18 | const version = provider.send('client_version', []); 19 | 20 | System.out.println('client version', version); 21 | ``` 22 | 23 | HTTP Initialisation - 24 | 25 | ```java 26 | import org.polkadot.rpc.provider.http.HttpProvider; 27 | 28 | // this is the actual default endpoint 29 | const provider = new HttpProvider('http://127.0.0.1:9933'); 30 | const version = provider.send('chain_getBlockHash', []); 31 | 32 | System.out.println('latest block Hash', hash); 33 | ``` 34 | 35 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/provider/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | # @polkadot/rpc-provider 3 | 4 | Generic transport providers to handle the transport of method calls to and from Polkadot clients from applications interacting with it. It provides an interface to making RPC calls and is generally, unless you are operating at a low-level and taking care of encoding and decoding of parameters/results, it won't be directly used, rather only passed to a higher-level interface. 5 | 6 | ## Provider Selection 7 | 8 | There are two flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets. It is generally recommended to use the {@link org.polkadot.rpc.provider.ws.WsProvider} since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client. 9 | 10 | ## Usage 11 | 12 | WebSocket Initialisation - 13 | 14 | ```java 15 | import org.polkadot.rpc.provider.ws.WsProvider; 16 | 17 | // this is the actual default endpoint 18 | const provider = new WsProvider('ws://127.0.0.1:9944'); 19 | const version = provider.send('client_version', []); 20 | 21 | System.out.print("client version "); 22 | System.out.println(version); 23 | ``` 24 | 25 | HTTP Initialisation - 26 | 27 | ```java 28 | import org.polkadot.rpc.provider.http.HttpProvider; 29 | 30 | // this is the actual default endpoint 31 | const provider = new HttpProvider('http://127.0.0.1:9933'); 32 | const version = provider.send('chain_getBlockHash', []); 33 | 34 | System.out.print("latest block Hash "); 35 | System.out.println(hash); 36 | ``` 37 | */ 38 | package org.polkadot.rpc.provider; 39 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/rx/README.md: -------------------------------------------------------------------------------- 1 | # @polkadot/rpc-rx 2 | 3 | An RxJs wrapper around the [@polkadot/rpc-core](../rpc-core). 4 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/rx/Types.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.rpc.rx; 2 | 3 | import io.reactivex.Observable; 4 | import org.polkadot.common.EventEmitter; 5 | import org.polkadot.direct.IRpcModule; 6 | import org.polkadot.rpc.provider.IProvider; 7 | 8 | import java.util.LinkedHashMap; 9 | 10 | public interface Types { 11 | 12 | interface IRpcRx extends IRpcModule { 13 | void on(IProvider.ProviderInterfaceEmitted type, EventEmitter.EventListener callback); 14 | Observable isConnected(); 15 | } 16 | 17 | interface RpcRxOnCb { 18 | Object callback(Object... args); 19 | } 20 | 21 | interface RpcRxInterfaceMethod { 22 | Observable call(Object... params); 23 | } 24 | 25 | class RpcRxInterfaceSection extends LinkedHashMap { 26 | 27 | } 28 | 29 | abstract class RpcRxInterface { 30 | public RpcRxInterfaceSection author; 31 | public RpcRxInterfaceSection chain; 32 | public RpcRxInterfaceSection state; 33 | public RpcRxInterfaceSection system; 34 | 35 | abstract Observable isConnected(); 36 | 37 | abstract void on(IProvider.ProviderInterfaceEmitted type, EventEmitter.EventListener handler); 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/rpc/rx/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | # @polkadot/rpc-rx 3 | 4 | An RxJs wrapper around the [@polkadot/rpc-core](../rpc-core). 5 | */ 6 | package org.polkadot.rpc.rx; 7 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/extrinsics/Index.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.type.extrinsics; 2 | 3 | import org.polkadot.types.primitive.Method; 4 | 5 | public class Index { 6 | 7 | public static final Method.ModulesWithMethods extrinsics = new Method.ModulesWithMethods(); 8 | } 9 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/extrinsics/README.md: -------------------------------------------------------------------------------- 1 | # @polkadot/extrinsics 2 | 3 | Base extrinsic definitions & codecs 4 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/extrinsics/StaticMetadata.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.type.extrinsics; 2 | 3 | public class StaticMetadata { 4 | } 5 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/extrinsics/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | # @polkadot/extrinsics 3 | 4 | Base extrinsic definitions & codecs 5 | */ 6 | package org.polkadot.type.extrinsics; 7 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/storage/README.md: -------------------------------------------------------------------------------- 1 | # @polkadot/storage 2 | 3 | An base interface to the storage layer 4 | 5 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/storage/Types.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.type.storage; 2 | 3 | import org.polkadot.direct.IModule; 4 | import org.polkadot.direct.ISection; 5 | import org.polkadot.types.primitive.StorageKey; 6 | 7 | public interface Types { 8 | 9 | class ModuleStorage extends ISection { 10 | 11 | } 12 | 13 | interface Storage extends IModule { 14 | //[key: string]: ModuleStorage; // Will hold modules returned by state_getMetadata 15 | // substrate: { [key in Substrate]: StorageFunction }; 16 | ModuleStorage substrate(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/type/storage/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | # @polkadot/storage 3 | 4 | An base interface to the storage layer 5 | */ 6 | package org.polkadot.type.storage; 7 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/Codec.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types; 2 | 3 | public interface Codec { 4 | int getEncodedLength(); 5 | 6 | boolean isEmpty(); 7 | 8 | //TODO 2019-05-07 19:13 override equals 9 | boolean eq(Object other); 10 | 11 | String toHex(); 12 | 13 | Object toJson(); 14 | 15 | //String toString(); 16 | 17 | default byte[] toU8a() { 18 | return toU8a(false); 19 | } 20 | 21 | byte[] toU8a(boolean isBare); 22 | 23 | //TODO 2019-05-07 18:27 start check 24 | //public static Types.ConstructorCodec builder(); 25 | static Types.ConstructorCodec getConstructorCodec() { 26 | //return TypesUtils.getConstructorCodec(Thread.currentThread().getStackTrace()[1].getClassName()); 27 | return null; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/CodecTypes.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types; 2 | 3 | public enum CodecTypes { 4 | //TODO 2019-04-26 17:54 5 | Text, 6 | ChainProperties, 7 | } 8 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/codec/Base.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.codec; 2 | 3 | public class Base { 4 | protected T raw; 5 | 6 | public Base(T t) { 7 | this.raw = t; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/codec/Compactable.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.codec; 2 | 3 | import org.polkadot.types.Codec; 4 | 5 | import java.math.BigInteger; 6 | 7 | public interface Compactable extends Codec { 8 | BigInteger toBn(); 9 | 10 | long toNumber(); 11 | 12 | int bitLength(); 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/codec/UInt.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.codec; 2 | 3 | 4 | import org.polkadot.utils.Utils; 5 | 6 | /** 7 | * UInt 8 | * A generic unsigned integer codec. For Substrate all numbers are LE encoded, 9 | * this handles the encoding and decoding of those numbers. Upon construction 10 | * the bitLength is provided and any additional use keeps the number to this 11 | * length. This extends `BN`, so all methods available on a normal `BN` object 12 | * is available here. 13 | * @noInheritDoc 14 | */ 15 | public class UInt extends AbstractInt implements Compactable{ 16 | public UInt(Object value, int bitLength, boolean isHexJson) { 17 | super(false, value, bitLength, isHexJson); 18 | } 19 | 20 | public UInt(Object value, int bitLength) { 21 | super(false, value, bitLength, false); 22 | } 23 | 24 | /** 25 | * Returns a hex string representation of the value 26 | */ 27 | @Override 28 | public String toHex() { 29 | return Utils.bnToHex(this, false, false, this.bitLength()); 30 | } 31 | 32 | /** 33 | * @param isBare true when the value has none of the type-specific prefixes (internal) 34 | * Encodes the value as a Uint8Array as per the parity-codec specifications 35 | */ 36 | @Override 37 | public byte[] toU8a(boolean isBare) { 38 | return Utils.bnToU8a(this, true, false, this.bitLength()); 39 | } 40 | 41 | @Override 42 | public long toNumber() { 43 | return this.longValue(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/metadata/MagicNumber.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.metadata; 2 | 3 | import org.polkadot.types.primitive.U32; 4 | 5 | public class MagicNumber extends U32 { 6 | 7 | 8 | //export const MAGIC_NUMBER = new U32(0x6174656d); // `meta`, reversed for LE encoding 9 | //export const MAGIC_ERROR = -61746; 10 | public final static U32 MAGIC_NUMBER = new U32(0x6174656d);// `meta`, reversed for LE encoding 11 | public final static int MAGIC_ERROR = -61746; 12 | 13 | public MagicNumber(Object value) { 14 | super(value); 15 | assert this.eq(MAGIC_NUMBER) : "MagicNumber: expected " + MAGIC_NUMBER.toHex() + ", found " + this.toHex() + " " + MAGIC_ERROR; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/metadata/Types.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.metadata; 2 | 3 | import java.util.List; 4 | 5 | public interface Types { 6 | interface MetadataInterface { 7 | List getUniqTypes(boolean throwError); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/metadata/v1/Events.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.metadata.v1; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.TypesUtils; 5 | import org.polkadot.types.codec.Struct; 6 | import org.polkadot.types.codec.Vector; 7 | import org.polkadot.types.primitive.Text; 8 | import org.polkadot.types.primitive.Type; 9 | 10 | public interface Events { 11 | 12 | 13 | /** 14 | * The definition of an event 15 | */ 16 | class MetadataEvent extends Struct { 17 | 18 | public MetadataEvent(Object value) { 19 | super(new Types.ConstructorDef() 20 | .add("name", Text.class) 21 | .add("args", Vector.with(TypesUtils.getConstructorCodec(Type.class))) 22 | .add("docs", Vector.with(TypesUtils.getConstructorCodec(Text.class))) 23 | , value); 24 | } 25 | 26 | 27 | /** 28 | * The {@link org.polkadot.types.type} for args 29 | */ 30 | public Vector getArgs() { 31 | return this.getField("args"); 32 | } 33 | 34 | /** 35 | * The {@link org.polkadot.types.primitive.Text} documentation 36 | */ 37 | public Vector getDocs() { 38 | return this.getField("docs"); 39 | } 40 | 41 | /** 42 | * The call name 43 | */ 44 | public Text getName() { 45 | return this.getField("name"); 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/metadata/v2/ToV1.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.metadata.v2; 2 | 3 | import org.polkadot.types.metadata.v1.MetadataV1; 4 | 5 | public class ToV1 { 6 | 7 | public static MetadataV1 toV1(MetadataV2 v2) { 8 | return new MetadataV1(v2); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/metadata/v3/ToV2.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.metadata.v3; 2 | 3 | import org.polkadot.types.metadata.v2.MetadataV2; 4 | 5 | public class ToV2 { 6 | public static MetadataV2 toV2(MetadataV3 v3) { 7 | return new MetadataV2(v3); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/H160.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.U8aFixed; 4 | 5 | /** 6 | * Hash containing 160 bits (20 bytes), typically used in blocks, extrinsics and 7 | * as a sane default for fixed-length hash representations. 8 | */ 9 | public class H160 extends U8aFixed { 10 | public H160(Object value) { 11 | super(value, 160); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/H256.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.U8aFixed; 4 | 5 | /** 6 | * Hash containing 256 bits (32 bytes), typically used in blocks, extrinsics and 7 | * as a sane default for fixed-length hash representations. 8 | */ 9 | public class H256 extends U8aFixed { 10 | // constructor (value?: AnyU8a) { 11 | public H256(Object value) { 12 | super(value, 256); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/H512.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.U8aFixed; 4 | 5 | 6 | /** 7 | * Hash containing 512 bits (64 bytes), typically used for signatures 8 | */ 9 | public class H512 extends U8aFixed { 10 | public H512(Object value) { 11 | super(value, 512); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/I128.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | /** 4 | * An 128-bit signed integer 5 | */ 6 | public class I128 extends Int { 7 | public I128(Object value) { 8 | super(value, 128, true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/I16.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | /** 4 | * An 16-bit signed integer 5 | */ 6 | public class I16 extends Int { 7 | public I16(Object value) { 8 | super(value, 16, true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/I256.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | 4 | /** 5 | * An 256-bit signed integer 6 | */ 7 | public class I256 extends Int { 8 | public I256(Object value) { 9 | super(value, 256, true); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/I32.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | /** 4 | * An 32-bit signed integer 5 | */ 6 | public class I32 extends Int { 7 | public I32(Object value) { 8 | super(value, 32, true); 9 | } 10 | } -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/I64.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | 4 | /** 5 | * An 64-bit signed integer 6 | */ 7 | public class I64 extends Int { 8 | public I64(Object value) { 9 | super(value, 64, true); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/I8.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | /** 4 | * An 8-bit signed integer 5 | */ 6 | public class I8 extends Int { 7 | public I8(Object value) { 8 | super(value, 8, true); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/Int.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.AbstractInt; 4 | import org.polkadot.utils.Utils; 5 | 6 | /** 7 | * A generic signed integer codec. For Substrate all numbers are LE encoded, 8 | * this handles the encoding and decoding of those numbers. Upon construction 9 | * the bitLength is provided and any additional use keeps the number to this 10 | * length. This extends `BN`, so all methods available on a normal `BN` object 11 | * is available here. 12 | * @noInheritDoc 13 | */ 14 | public class Int extends AbstractInt { 15 | //constructor (value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isHexJson: boolean = true) { 16 | public Int(Object value, int bitLength, boolean isHexJson) { 17 | super(true, value, bitLength, isHexJson); 18 | } 19 | 20 | 21 | /** 22 | * Returns a hex string representation of the value 23 | */ 24 | @Override 25 | public String toHex() { 26 | return Utils.bnToHex(this, false, true, this.bitLength()); 27 | } 28 | 29 | 30 | /** 31 | * @param isBare true when the value has none of the type-specific prefixes (internal) 32 | * Encodes the value as a Uint8Array as per the parity-codec specifications 33 | */ 34 | @Override 35 | public byte[] toU8a(boolean isBare) { 36 | return Utils.bnToU8a(this, true, true, this.bitLength()); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/Null.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.Codec; 4 | 5 | /** 6 | * Implements a type that does not contain anything (apart from `null`) 7 | */ 8 | public class Null implements Codec { 9 | /** 10 | * The length of the value when encoded as a Uint8Array 11 | */ 12 | @Override 13 | public int getEncodedLength() { 14 | return 0; 15 | } 16 | 17 | /** 18 | * Checks if the value is an empty value (always true) 19 | */ 20 | @Override 21 | public boolean isEmpty() { 22 | return true; 23 | } 24 | 25 | /** 26 | * Compares the value of the input to see if there is a match 27 | */ 28 | @Override 29 | public boolean eq(Object other) { 30 | return other instanceof Null || other == null; 31 | } 32 | 33 | /** 34 | * Returns a hex string representation of the value 35 | */ 36 | @Override 37 | public String toHex() { 38 | return "0x"; 39 | } 40 | 41 | /** 42 | * Converts the Object to JSON, typically used for RPC transfers 43 | */ 44 | @Override 45 | public Object toJson() { 46 | return null; 47 | } 48 | 49 | /** 50 | * Returns the string representation of the value 51 | */ 52 | @Override 53 | public String toString() { 54 | return ""; 55 | } 56 | 57 | /** 58 | * Encodes the value as a Uint8Array as per the parity-codec specifications 59 | * @param isBare true when the value has none of the type-specific prefixes (internal) 60 | */ 61 | @Override 62 | public byte[] toU8a(boolean isBare) { 63 | return new byte[0]; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/StorageData.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | 4 | /** 5 | * Data retrieved via Storage queries and data for KeyValue pairs 6 | */ 7 | public class StorageData extends Bytes { 8 | public StorageData(Object value) { 9 | super(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/U128.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.UInt; 4 | 5 | 6 | /** 7 | * An 128-bit unsigned integer 8 | */ 9 | public class U128 extends UInt { 10 | public U128(Object value) { 11 | super(value, 128); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/U16.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | 4 | import org.polkadot.types.codec.UInt; 5 | 6 | /** 7 | * An 16-bit unsigned integer 8 | */ 9 | public class U16 extends UInt { 10 | public U16(Object value) { 11 | super(value, 16); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/U256.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.UInt; 4 | 5 | /** 6 | * An 256-bit unsigned integer 7 | */ 8 | public class U256 extends UInt { 9 | public U256(Object value) { 10 | super(value, 256); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/U32.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | 4 | import org.polkadot.types.codec.UInt; 5 | 6 | /** 7 | * An 32-bit unsigned integer 8 | */ 9 | public class U32 extends UInt { 10 | public U32(Object value) { 11 | super(value, 32); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/U64.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.UInt; 4 | 5 | /** 6 | * An 64-bit unsigned integer 7 | */ 8 | public class U64 extends UInt { 9 | // constructor (value?: AnyNumber) { 10 | public U64(Object value) { 11 | super(value, 64); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/U8.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | import org.polkadot.types.codec.UInt; 4 | 5 | /** 6 | * An 8-bit unsigned integer 7 | */ 8 | public class U8 extends UInt { 9 | public U8(Object value) { 10 | super(value, 8); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/primitive/USize.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.primitive; 2 | 3 | /** 4 | * A System default unsigned number, typically used in RPC to report non-consensus 5 | * data. It is a wrapper for {@link org.polkadot.types.primitive.U64} as a 64-binary default 6 | */ 7 | public class USize extends U64 { 8 | public USize(Object value) { 9 | super(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/rpc/ChainProperties.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.rpc; 2 | 3 | 4 | import java.util.Objects; 5 | 6 | /** 7 | * Wraps the properties retrieved from the chain via the `system.properties` RPC call. 8 | */ 9 | public class ChainProperties extends Json { 10 | 11 | 12 | public ChainProperties(Object value) { 13 | super(value); 14 | } 15 | 16 | /** 17 | * The token decimals, if defined (de-facto standard only) 18 | */ 19 | public Double getTokenDecimals() { 20 | Object tokenDecimals = this.get("tokenDecimals"); 21 | return tokenDecimals == null 22 | ? null 23 | : Double.parseDouble(tokenDecimals.toString()); 24 | } 25 | 26 | /** 27 | * The token system, if defined (de-facto standard only) 28 | */ 29 | public String getTokenSymbol() { 30 | return Objects.toString(this.get("tokenSymbol"), null); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/rpc/Health.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.rpc; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.codec.Struct; 5 | import org.polkadot.types.primitive.Bool; 6 | import org.polkadot.types.primitive.USize; 7 | import org.polkadot.utils.MapUtils; 8 | 9 | import java.util.Map; 10 | 11 | /** 12 | * A system health indicator, reported back over RPC 13 | */ 14 | public class Health extends Struct { 15 | public static Map JSON_MAP = MapUtils.ofMap( 16 | "isSyncing", "is_syncing", 17 | "shouldHavePeers", "should_have_peers"); 18 | 19 | 20 | public Health(Object value) { 21 | super(new Types.ConstructorDef() 22 | .add("peers", USize.class) 23 | .add("isSyncing", Bool.class) 24 | .add("shouldHavePeers", Bool.class) 25 | , value); 26 | } 27 | 28 | 29 | /** 30 | * The sync status 31 | */ 32 | public Bool isSyncing() { 33 | return this.getField("isSyncing"); 34 | } 35 | 36 | /** 37 | * The numbers of peers as {@link org.polkadot.types.primitive.U32} 38 | */ 39 | public USize getPeers() { 40 | return this.getField("peers"); 41 | } 42 | 43 | /** 44 | * Should this node have peers (not active on --dev) 45 | */ 46 | public Bool shouldHavePeers() { 47 | return this.getField("shouldHavePeers"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/rpc/NetworkState.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.rpc; 2 | 3 | /** 4 | * Wraps the properties retrieved from the chain via the `system.network_state` RPC call. 5 | */ 6 | public class NetworkState extends Json { 7 | public NetworkState(Object value) { 8 | super(value); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/rpc/PendingExtrinsics.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.rpc; 2 | 3 | import org.polkadot.types.type.Extrinsics; 4 | 5 | /** 6 | * A list of pending {@link org.polkadot.types.type.Extrinsics} 7 | */ 8 | public class PendingExtrinsics extends Extrinsics { 9 | public PendingExtrinsics(Object value) { 10 | super(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/rpc/SignedBlock.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.rpc; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.codec.Struct; 5 | import org.polkadot.types.type.Block; 6 | import org.polkadot.types.type.Hash; 7 | import org.polkadot.types.type.Justification; 8 | 9 | /** 10 | * A Block that has been signed and contains a Justification 11 | */ 12 | public class SignedBlock extends Struct { 13 | public static class SignedBlockValue { 14 | Block.BlockValue block; 15 | byte[] justification; 16 | } 17 | 18 | // constructor (value?: SignedBlockValue | Uint8Array) { 19 | public SignedBlock(Object value) { 20 | super(new Types.ConstructorDef() 21 | .add("block", Block.class) 22 | .add("justification", Justification.class) 23 | , value); 24 | } 25 | 26 | 27 | /** 28 | * The wrapped Block 29 | */ 30 | public Block getBlock() { 31 | return this.getField("block"); 32 | } 33 | 34 | /** 35 | * Block/header {@link org.polkadot.types.type.Hash} 36 | */ 37 | public Hash getHash() { 38 | return this.getBlock().getHash(); 39 | } 40 | 41 | /** 42 | * The wrapped Justification 43 | */ 44 | public Justification getJustification() { 45 | return this.getField("justification"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/rpc/StorageChangeSet.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.rpc; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.TypesUtils; 5 | import org.polkadot.types.codec.Struct; 6 | import org.polkadot.types.codec.Vector; 7 | import org.polkadot.types.type.Hash; 8 | import org.polkadot.types.type.KeyValue; 9 | 10 | 11 | /** 12 | * A set of storage changes. It contains the Block hash and 13 | * a list of the actual changes that took place as an array of 14 | * KeyValueOption 15 | */ 16 | public class StorageChangeSet extends Struct { 17 | //type StorageChangeSetValue = { 18 | // block?: AnyU8a, 19 | //changes?: Array 20 | //}; 21 | //constructor (value?: StorageChangeSetValue | Uint8Array) { 22 | public StorageChangeSet(Object value) { 23 | super(new Types.ConstructorDef() 24 | .add("block", Hash.class) 25 | .add("changes", Vector.with(TypesUtils.getConstructorCodec(KeyValue.KeyValueOption.class))) 26 | , value); 27 | } 28 | 29 | public Vector getChanges() { 30 | return this.getField("changes"); 31 | } 32 | 33 | public Hash getBlock(){ 34 | return this.getField("block"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/AccountInfo.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.codec.Struct; 5 | import org.polkadot.types.primitive.Bytes; 6 | import org.polkadot.types.primitive.U64; 7 | 8 | /** 9 | * An Account information structure for contracts 10 | */ 11 | public class AccountInfo extends Struct { 12 | public AccountInfo(Object value) { 13 | super(new Types.ConstructorDef() 14 | .add("trieId", Bytes.class) 15 | .add("currentMemStored", U64.class) 16 | , value 17 | ); 18 | } 19 | 20 | 21 | /** 22 | * The size of stored value in octet 23 | */ 24 | public U64 getCurrentMemStored() { 25 | return this.getField("currentMemStored"); 26 | } 27 | 28 | /** 29 | * Unique ID for the subtree encoded as a byte 30 | */ 31 | public Bytes getTrieId() { 32 | return this.getField("trieId"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Amount.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | /** 4 | * The Substrate Amount representation as a {@link org.polkadot.types.type.Balance}. 5 | */ 6 | public class Amount extends Balance { 7 | public Amount(Object value) { 8 | super(value); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/AssetOf.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | /** 4 | * The Substrate AssetOf representation as a {@link org.polkadot.types.type.Balance}. 5 | */ 6 | public class AssetOf extends Balance { 7 | public AssetOf(Object value) { 8 | super(value); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/AuthorityId.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | // Wrapper for a AuthorityId. Same as an normal AccountId, i.e. a wrapper 5 | // around publicKey, however specialized since it specifically points to 6 | // an authority. 7 | public class AuthorityId extends AccountId { 8 | public AuthorityId(Object value) { 9 | super(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Balance.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.primitive.U128; 5 | 6 | /** 7 | * The Substrate Balance representation as a {@link org.polkadot.types.primitive.U128}. 8 | */ 9 | public class Balance extends U128 { 10 | public Balance(Object value) { 11 | super(value); 12 | } 13 | 14 | 15 | public static class BalanceOf extends Balance { 16 | public BalanceOf(Object value) { 17 | super(value); 18 | } 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/BalanceLock.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.Types; 5 | import org.polkadot.types.codec.Struct; 6 | 7 | /** 8 | * The Substrate BalanceLock for staking 9 | */ 10 | public class BalanceLock extends Struct { 11 | 12 | public BalanceLock(Object value) { 13 | super(new Types.ConstructorDef() 14 | .add("id", LockIdentifier.class) 15 | .add("amount", Balance.class) 16 | .add("until", BlockNumber.class) 17 | .add("reasons", WithdrawReasons.class) 18 | , value); 19 | } 20 | 21 | /** 22 | * The amount 23 | */ 24 | public Balance getAmount() { 25 | return this.getField("amount"); 26 | } 27 | 28 | /** 29 | * The lock id 30 | */ 31 | public LockIdentifier getId() { 32 | return this.getField("id"); 33 | } 34 | 35 | /** 36 | * The reasons 37 | */ 38 | public WithdrawReasons getReasons() { 39 | return this.getField("reasons"); 40 | } 41 | 42 | /** 43 | * Until when this is available 44 | */ 45 | public BlockNumber getUntil() { 46 | return this.getField("until"); 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/BlockNumber.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U64; 4 | 5 | /** 6 | * A representation of a Substrate BlockNumber, implemented as a {@link org.polkadot.types.primitive.U64} 7 | */ 8 | public class BlockNumber extends U64 { 9 | public BlockNumber(Object value) { 10 | super(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/CodeHash.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | /** 4 | * @description 5 | * The default contract code hash that is used accross the system. It is a 6 | * wrapper around {@link org.polkadot.types.type.Hash}, representing a 32-byte blake2b (Substrate) value 7 | */ 8 | public class CodeHash extends Hash { 9 | public CodeHash(Object value) { 10 | super(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Exposure.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.TypesUtils; 5 | import org.polkadot.types.codec.Compact; 6 | import org.polkadot.types.codec.Struct; 7 | import org.polkadot.types.codec.Vector; 8 | 9 | /** 10 | * A snapshot of the stake backing a single validator in the system 11 | */ 12 | public class Exposure extends Struct { 13 | 14 | public Exposure(Object value) { 15 | super(new Types.ConstructorDef() 16 | .add("total", Compact.with(TypesUtils.getConstructorCodec(Balance.class))) 17 | .add("own", Compact.with(TypesUtils.getConstructorCodec(Balance.class))) 18 | .add("others", Vector.with(TypesUtils.getConstructorCodec(IndividualExposure.class))) 19 | , value); 20 | } 21 | 22 | 23 | /** 24 | * The validator"s own stash that is exposed 25 | */ 26 | public Balance getOwn() { 27 | Compact own = this.getField("own"); 28 | return new Balance(own.toBn()); 29 | } 30 | 31 | /** 32 | * The total balance backing this validator 33 | */ 34 | public Balance getTotal() { 35 | 36 | Compact own = this.getField("total"); 37 | return new Balance(own.toBn()); 38 | } 39 | 40 | /** 41 | * The portions of nominators stashes that are exposed 42 | */ 43 | public Vector getOthers() { 44 | return this.getField("others"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/ExtrinsicEra.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.apache.commons.lang3.ArrayUtils; 4 | import org.polkadot.types.codec.U8a; 5 | import org.polkadot.utils.Utils; 6 | 7 | /** 8 | * The era for an extrinsic, indicating either a mortal or immortal extrinsic 9 | */ 10 | public class ExtrinsicEra extends U8a { 11 | //constructor (value?: AnyU8a) { 12 | public ExtrinsicEra(Object value) { 13 | super(decodeExtrinsicEra(value)); 14 | } 15 | 16 | static byte[] decodeExtrinsicEra(Object value) { 17 | if (value != null) { 18 | byte[] u8a = Utils.u8aToU8a(value); 19 | 20 | if (u8a.length == 0) { 21 | return new byte[]{0}; 22 | } 23 | // If we have a zero byte, it is immortal (1 byte in length), otherwise we have 24 | // the era details following as another byte 25 | return ArrayUtils.subarray(u8a, 0, (u8a[0] == 0) ? 1 : 2); 26 | } 27 | 28 | return new byte[]{0}; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Extrinsics.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.TypesUtils; 4 | import org.polkadot.types.codec.Vector; 5 | 6 | /** 7 | * A {@link org.polkadot.types.codec.Vector} of {@link org.polkadot.type.extrinsics} 8 | */ 9 | public class Extrinsics extends Vector { 10 | public Extrinsics(Object value) { 11 | super(TypesUtils.getConstructorCodec(Extrinsic.class), value); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Gas.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U64; 4 | 5 | /** 6 | * A gas number type for Substrate, extending {@link org.polkadot.types.primitive.U64} 7 | */ 8 | public class Gas extends U64 { 9 | public Gas(Object value) { 10 | super(value); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Hash.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.Types; 5 | import org.polkadot.types.primitive.H256; 6 | 7 | /** 8 | * The default hash that is used accross the system. It is basically just a thin 9 | * wrapper around {@link org.polkadot.types.primitive.H256}, representing a 32-byte blake2b (Substrate) value 10 | */ 11 | public class Hash extends H256 implements Types.IHash { 12 | public Hash(Object value) { 13 | super(value); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Index.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U64; 4 | 5 | // 6 | // NOTE Nonce is renamed to Index 7 | //export { default as Index } from './Nonce'; 8 | 9 | /** 10 | * The Nonce or number of transactions sent by a specific account. Generally used 11 | * with extrinsics to determine the order of execution. implemented as a Substrate 12 | * U64 13 | * @see org.polkadot.types.type.Nonce 14 | */ 15 | public class Index extends U64 { 16 | public Index(Object value) { 17 | super(value); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/IndividualExposure.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.TypesUtils; 5 | import org.polkadot.types.codec.Compact; 6 | import org.polkadot.types.codec.Struct; 7 | 8 | /** 9 | * The Substrate IndividualExposure for staking 10 | */ 11 | public class IndividualExposure extends Struct { 12 | public IndividualExposure(Object value) { 13 | super(new Types.ConstructorDef() 14 | .add("who", AccountId.class) 15 | .add("value", Compact.with(TypesUtils.getConstructorCodec(Balance.class))) 16 | , value); 17 | } 18 | 19 | /** 20 | * The value 21 | */ 22 | public Balance getValue() { 23 | Compact compact = this.getField("value"); 24 | return new Balance(compact.toBn()); 25 | } 26 | 27 | /** 28 | * The AccountId 29 | */ 30 | public AccountId getWho() { 31 | return this.getField("who"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/InherentOfflineReport.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.codec.Tuple; 5 | 6 | /** 7 | * Describes the offline-reporting extrinsic 8 | */ 9 | //export default class InherentOfflineReport extends Tuple.with({}) { 10 | public class InherentOfflineReport extends Tuple { 11 | public InherentOfflineReport() { 12 | super(new Types.ConstructorDef(), null); 13 | } 14 | } -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Key.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.Bytes; 4 | 5 | 6 | /** 7 | * The Substrate Key representation as a {@link org.polkadot.types.primitive.Bytes} (`vec`). 8 | */ 9 | public class Key extends Bytes { 10 | public Key(Object value) { 11 | super(value); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/LocKPeriods.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.primitive.I8; 5 | 6 | /** 7 | * @description 8 | * A number of lock periods. 9 | */ 10 | public class LocKPeriods extends I8 { 11 | public LocKPeriods(Object value) { 12 | super(value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/LockIdentifier.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.codec.U8aFixed; 5 | 6 | /** 7 | * @description 8 | * The Substrate LockIdentifier for staking 9 | */ 10 | public class LockIdentifier extends U8aFixed { 11 | public LockIdentifier(Object value) { 12 | super(value, 64); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/NewAccountOutcome.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import com.google.common.collect.Lists; 4 | import org.polkadot.types.codec.Enum; 5 | 6 | /** 7 | * Enum to track the outcome for creation of an AccountId 8 | */ 9 | public class NewAccountOutcome extends Enum { 10 | //constructor (index?: U8a | Uint8Array | number) { 11 | public NewAccountOutcome(int index) { 12 | super(Lists.newArrayList( 13 | "NoHint", 14 | "GoodHint", 15 | "BadHint"), index); 16 | } 17 | } -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Nonce.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.primitive.U64; 5 | 6 | /** 7 | * The Nonce or number of transactions sent by a specific account. Generally used 8 | * with extrinsics to determine the order of execution. implemented as a Substrate 9 | * {@link org.polkadot.types.primitive.U64} 10 | */ 11 | public class Nonce extends U64 { 12 | public Nonce(Object value) { 13 | super(value); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/NonceCompact.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.TypesUtils; 4 | import org.polkadot.types.codec.Compact; 5 | 6 | 7 | /** 8 | * The Compact or number of transactions sent by a specific account. Generally used 9 | * with extrinsics to determine the order of execution. 10 | */ 11 | //export default class NonceCompact extends Compact.with(Nonce) { 12 | public class NonceCompact extends Compact { 13 | public NonceCompact(Object value) { 14 | super(TypesUtils.getConstructorCodec(Nonce.class), value); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Origin.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.Null; 4 | 5 | /** 6 | * Where Origin occurs, it should be ignored as an internal-only value, so it should 7 | * never actually be constructed 8 | */ 9 | public class Origin extends Null { 10 | 11 | public Origin() { 12 | super(); 13 | throw new RuntimeException("Origin should not be constructed, it is only a placeholder for compatibility"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/ParaId.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U32; 4 | 5 | 6 | /** 7 | * Identifier for a deployed parachain implemented as a {@link org.polkadot.types.primitive.U32} 8 | */ 9 | public class ParaId extends U32 { 10 | public ParaId(Object value) { 11 | super(value); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Perbill.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U32; 4 | 5 | /** 6 | * Parts per billion (see also {@link org.polkadot.types.type.Permill}) 7 | */ 8 | // TODO We need to think about the toNumber() and toString() here, so we 9 | // want to multiply by 1_000_000_000 for those purposes? 10 | public class Perbill extends U32 { 11 | public Perbill(Object value) { 12 | super(value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Permill.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U32; 4 | 5 | /** 6 | * @description 7 | * Parts per million (See also {@link org.polkadot.types.type.Perbill}) 8 | */ 9 | // TODO We need to think about the toNumber() and toString() here, so we 10 | // want to multiply by 1_000_000 for those purposes? 11 | public class Permill extends U32 { 12 | public Permill(Object value) { 13 | super(value); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/PropIndex.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U32; 4 | 5 | /** 6 | * An increasing number that represents a specific public proposal index in the 7 | * system, implemented as a {@link org.polkadot.types.primitive.U32} 8 | */ 9 | public class PropIndex extends U32 { 10 | public PropIndex(Object value) { 11 | super(value); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Proposal.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.metadata.v0.Modules; 4 | import org.polkadot.types.primitive.Method; 5 | 6 | /** 7 | * A proposal in the system. It just extends {@link org.polkadot.types.primitive.Method} (Proposal = Call in Rust) 8 | */ 9 | public class Proposal extends Method { 10 | public Proposal(Object value, Modules.FunctionMetadata meta) { 11 | super(value, meta); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/ProposalIndex.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.primitive.U32; 5 | 6 | /** 7 | * @description 8 | * An increasing number that represents a specific council proposal index in 9 | * the system, implemented as {@link org.polkadot.types.primitive.U32} 10 | */ 11 | public class ProposalIndex extends U32 { 12 | public ProposalIndex(Object value) { 13 | super(value); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/ReferendumIndex.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.U32; 4 | 5 | 6 | /** 7 | * An increasing number that represents a specific referendum in the system. It 8 | * is unique per chain. Implemented as {@link org.polkadot.types.primitive.U32} 9 | */ 10 | public class ReferendumIndex extends U32 { 11 | public ReferendumIndex(Object value) { 12 | super(value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/ReferendumInfo.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.Types; 5 | import org.polkadot.types.codec.Struct; 6 | 7 | /** 8 | * Info regarding an ongoing referendum 9 | */ 10 | public class ReferendumInfo extends Struct { 11 | // constructor (value?: ReferendumInfoValue | Uint8Array | Map) { 12 | public ReferendumInfo(Object value) { 13 | super(new Types.ConstructorDef() 14 | .add("end", BlockNumber.class) 15 | .add("proposal", Proposal.class) 16 | .add("threshold", VoteThreshold.class) 17 | .add("delay", BlockNumber.class), 18 | value); 19 | } 20 | 21 | /** 22 | * When voting on this referendum will end 23 | */ 24 | public BlockNumber getEnd() { 25 | return this.getField("end"); 26 | } 27 | 28 | /** 29 | * The proposal being voted on 30 | */ 31 | public Proposal getProposal() { 32 | return this.getField("proposal"); 33 | } 34 | 35 | /** 36 | * The thresholding mechanism to determine whether it passed 37 | */ 38 | public VoteThreshold getThreshold() { 39 | return this.getField("threshold"); 40 | } 41 | 42 | /** 43 | * The delay (in blocks) to wait after a successful referendum before deploying 44 | */ 45 | public BlockNumber getDelay() { 46 | return this.getField("delay"); 47 | } 48 | 49 | public static class ReferendumInfoValue { 50 | BlockNumber end; 51 | Proposal proposal; 52 | VoteThreshold threshold; 53 | BlockNumber delay; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/RewardDestination.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import com.google.common.collect.Lists; 5 | import org.polkadot.types.codec.Enum; 6 | 7 | /** 8 | * A destination account for payment 9 | */ 10 | public class RewardDestination extends Enum { 11 | public RewardDestination(Object value) { 12 | super(Lists.newArrayList( 13 | // Pay into the stash account, increasing the amount at stake accordingly. 14 | "Staked", 15 | // Pay into the stash account, not increasing the amount at stake. 16 | "Stash", 17 | // Pay into the controller account. 18 | "Controller" 19 | ), value 20 | ); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/SeedOf.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | /** 4 | * @description 5 | * The Substrate SeedOf representation as a {@link org.polkadot.types.type.Hash}. 6 | */ 7 | public class SeedOf extends Hash { 8 | public SeedOf(Object value) { 9 | super(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/SessionKey.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | /** 4 | * Wrapper for a SessionKey. Same as an normal AuthorityId, i.e. a wrapper 5 | * around publicKey. 6 | */ 7 | public class SessionKey extends AuthorityId { 8 | public SessionKey(Object value) { 9 | super(value); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Signature.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.H512; 4 | 5 | /** 6 | * The default signature that is used accross the system. It is currectly defined 7 | * as a 512-bit value, represented by a {@link org.polkadot.types.primitive.H512}. 8 | */ 9 | public class Signature extends H512 { 10 | public Signature(Object value) { 11 | super(value); 12 | } 13 | 14 | 15 | /** 16 | * The default Ed25519 that is used accross the system. It is currectly defined 17 | * as a 512-bit value, represented by a {@link org.polkadot.types.primitive.H512}. 18 | */ 19 | public static class Ed25519Signature extends Signature { 20 | public Ed25519Signature(Object value) { 21 | super(value); 22 | } 23 | } 24 | 25 | /** 26 | * The default Sr25519 signature that is used accross the system. It is currectly defined 27 | * as a 512-bit value, represented by a {@link org.polkadot.types.primitive.H512}. 28 | */ 29 | public static class Sr25519Signature extends Signature { 30 | public Sr25519Signature(Object value) { 31 | super(value); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/TreasuryProposal.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.Types; 5 | import org.polkadot.types.codec.Struct; 6 | 7 | /** 8 | * A Proposal made for Treasury 9 | */ 10 | public class TreasuryProposal extends Struct { 11 | public TreasuryProposal(Object value) { 12 | super(new Types.ConstructorDef() 13 | .add("proposer", AccountId.class) 14 | .add("value", Balance.class) 15 | .add("beneficiary", AccountId.class) 16 | .add("bond", Balance.class) 17 | , value); 18 | } 19 | 20 | 21 | /** 22 | * The beneficiary 23 | */ 24 | public AccountId getBeneficiary() { 25 | return this.getField("beneficiary"); 26 | } 27 | 28 | /** 29 | * The bond 30 | */ 31 | public Balance getBond() { 32 | return this.getField("bond"); 33 | } 34 | 35 | /** 36 | * The proposer 37 | */ 38 | public AccountId getProposer() { 39 | return this.getField("proposer"); 40 | } 41 | 42 | /** 43 | * The bond 44 | */ 45 | public Balance getValue() { 46 | return this.getField("value"); 47 | } 48 | } -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/UnlockChunk.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.TypesUtils; 5 | import org.polkadot.types.codec.Compact; 6 | import org.polkadot.types.codec.Struct; 7 | 8 | import java.math.BigInteger; 9 | 10 | 11 | /** 12 | * Just a Balance/BlockNumber tuple to encode when a chunk of funds will be unlocked 13 | */ 14 | public class UnlockChunk extends Struct { 15 | 16 | public UnlockChunk(Object value) { 17 | super(new Types.ConstructorDef() 18 | .add("value", Compact.with(TypesUtils.getConstructorCodec(Balance.class))) 19 | .add("era", Compact.with(TypesUtils.getConstructorCodec(BlockNumber.class))) 20 | , value); 21 | } 22 | 23 | /** 24 | * Era number at which point it'll be unlocked 25 | */ 26 | public BlockNumber getEra() { 27 | Compact era = this.getField("era"); 28 | BigInteger bigInteger = era.toBn(); 29 | return new BlockNumber(bigInteger); 30 | } 31 | 32 | /** 33 | * Amount of funds to be unlocked 34 | */ 35 | public Balance getValue() { 36 | Compact value = this.getField("value"); 37 | BigInteger bigInteger = value.toBn(); 38 | return new Balance(bigInteger); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/ValidatorPrefs.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.Types; 4 | import org.polkadot.types.TypesUtils; 5 | import org.polkadot.types.codec.Compact; 6 | import org.polkadot.types.codec.Struct; 7 | import org.polkadot.types.primitive.U32; 8 | 9 | /** 10 | * Validator preferences 11 | */ 12 | public class ValidatorPrefs extends Struct { 13 | public ValidatorPrefs(Object value) { 14 | super(new Types.ConstructorDef() 15 | .add("unstakeThreshold", Compact.with(TypesUtils.getConstructorCodec(U32.class))) 16 | .add("validatorPayment", Compact.with(TypesUtils.getConstructorCodec(Balance.class))) 17 | , value); 18 | } 19 | 20 | 21 | /** 22 | * The unstake threshold as {@link org.polkadot.types.primitive.U32} 23 | */ 24 | public U32 getUnstakeThreshold() { 25 | return this.getField("unstakeThreshold"); 26 | } 27 | 28 | /** 29 | * The payment config for the validator as a {@link org.polkadot.types.codec.Compact} {@link org.polkadot.types.type.Balance} 30 | */ 31 | public Compact getValidatorPayment() { 32 | return this.getField("validatorPayment"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/VestingSchedule.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.Types; 5 | import org.polkadot.types.codec.Struct; 6 | 7 | /** 8 | * Struct to encode the vesting schedule of an individual account 9 | */ 10 | public class VestingSchedule extends Struct { 11 | public VestingSchedule(Object value) { 12 | super(new Types.ConstructorDef() 13 | .add("offset", Balance.class) 14 | .add("perBlock", Balance.class) 15 | , value); 16 | } 17 | 18 | 19 | /** 20 | * The offset as {@link org.polkadot.types.type.Balance} 21 | */ 22 | public Balance getOffset() { 23 | return this.getField("offset"); 24 | } 25 | 26 | /** 27 | * The perBlock value as {@link org.polkadot.types.type.Balance} 28 | */ 29 | public Balance getPerBlock() { 30 | return this.getField("perBlock"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/Vote.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import org.polkadot.types.primitive.I8; 4 | 5 | import java.math.BigInteger; 6 | 7 | /** 8 | * A number of lock periods, plus a vote, one way or the other. 9 | */ 10 | public class Vote extends I8 { 11 | public Vote(Object value) { 12 | super(decodeVote(value)); 13 | } 14 | 15 | static Object decodeVote(Object value) { 16 | if (value instanceof Boolean) { 17 | return ((Boolean) value).booleanValue() 18 | ? -1 : 0; 19 | } 20 | return value; 21 | } 22 | 23 | 24 | /** 25 | * true is the wrapped value is a positive vote 26 | */ 27 | public boolean isAye() { 28 | return this.compareTo(BigInteger.ZERO) <= 0; 29 | } 30 | 31 | /** 32 | * true is the wrapped value is a negative vote 33 | */ 34 | public boolean isNay() { 35 | return !this.isAye(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/VoteIndex.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | 4 | import org.polkadot.types.primitive.U32; 5 | 6 | /** 7 | * @description 8 | * Voting index, implemented as a {@link org.polkadot.types.primitive.U32} 9 | */ 10 | public class VoteIndex extends U32 { 11 | public VoteIndex(Object value) { 12 | super(value); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/VoteThreshold.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import com.google.common.collect.Lists; 4 | import org.polkadot.types.codec.Enum; 5 | 6 | /** 7 | * Voting threshold, used inside proposals to set change the voting tally 8 | */ 9 | public class VoteThreshold extends Enum { 10 | // constructor (index?: number | Uint8Array) { 11 | public VoteThreshold(Object index) { 12 | super(Lists.newArrayList( 13 | "Super majority approval", 14 | "Super majority rejection", 15 | "Simple majority") 16 | , index); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/types/type/WithdrawReasons.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.types.type; 2 | 3 | import com.google.common.collect.Lists; 4 | import org.polkadot.types.codec.Set; 5 | import org.polkadot.utils.MapUtils; 6 | 7 | /** 8 | * The Substrate WithdrawReasons for staking 9 | */ 10 | public class WithdrawReasons extends Set { 11 | 12 | 13 | public WithdrawReasons(Object value) { 14 | super(new SetValues( 15 | MapUtils.ofMap( 16 | "TransactionPayment", 0b00000001, 17 | "Transfer", 0b00000010, 18 | "Reserve", 0b00000100 19 | )), 20 | value == null 21 | ? Lists.newArrayList("header", "body", "justification") 22 | : value); 23 | } 24 | 25 | 26 | /** 27 | * In order to reserve some funds for a later return or repatriation 28 | */ 29 | public boolean isReserve() { 30 | return this.values().contains("Reserve"); 31 | } 32 | 33 | /** 34 | * In order to pay for (system) transaction costs 35 | */ 36 | public boolean isTransactionPayment() { 37 | return this.values().contains("TransactionPayment"); 38 | } 39 | 40 | /** 41 | * In order to transfer ownership 42 | */ 43 | public boolean isTransfer() { 44 | return this.values().contains("Transfer"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/utils/RxUtils.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.utils; 2 | 3 | import com.onehilltech.promises.Promise; 4 | import io.reactivex.Observable; 5 | import io.reactivex.ObservableEmitter; 6 | import io.reactivex.ObservableOnSubscribe; 7 | 8 | public class RxUtils { 9 | 10 | public static Observable fromPromise(Promise promise) { 11 | return Observable.create(new ObservableOnSubscribe() { 12 | @Override 13 | public void subscribe(ObservableEmitter emitter) throws Exception { 14 | promise.then((result) -> { 15 | emitter.onNext(result); 16 | emitter.onComplete(); 17 | return null; 18 | })._catch(err -> { 19 | emitter.onError(err); 20 | return null; 21 | }); 22 | } 23 | }); 24 | } 25 | 26 | public static Observable fromPromise(Promise promise, ObservableOnSubscribe observableOnSubscribe) { 27 | return Observable.create(observableOnSubscribe); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/utils/crypto/EmptySR25591.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.utils.crypto; 2 | 3 | public class EmptySR25591 implements ISR25591 { 4 | public void sr25519_derive_keypair_hard( 5 | byte[] keypair_out, 6 | byte[] pair_ptr, 7 | byte[] cc_ptr 8 | ) 9 | { 10 | } 11 | 12 | public void sr25519_derive_keypair_soft( 13 | byte[] keypair_out, 14 | byte[] pair_ptr, 15 | byte[] cc_ptr 16 | ) 17 | { 18 | } 19 | 20 | public void sr25519_derive_public_soft( 21 | byte[] keypair_out, 22 | byte[] pair_ptr, 23 | byte[] cc_ptr 24 | ) 25 | { 26 | } 27 | 28 | public void sr25519_keypair_from_seed( 29 | byte[] keypair_out, 30 | byte[] seed_ptr 31 | ) 32 | { 33 | } 34 | 35 | public void sr25519_sign( 36 | byte[] signature_out, 37 | byte[] public_ptr, 38 | byte[] secret_ptr, 39 | byte[] message_ptr, 40 | int message_length 41 | ) 42 | { 43 | } 44 | 45 | public boolean sr25519_verify( 46 | byte[] signature_ptr, 47 | byte[] message_ptr, 48 | int message_length, 49 | byte[] public_ptr 50 | ) 51 | { 52 | return false; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/utils/crypto/ISR25591.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.utils.crypto; 2 | 3 | public interface ISR25591 4 | { 5 | public static final int SR25519_CHAINCODE_SIZE = 32; 6 | 7 | public static final int SR25519_KEYPAIR_SIZE = 96; 8 | 9 | public static final int SR25519_PUBLIC_SIZE = 32; 10 | 11 | public static final int SR25519_SECRET_SIZE = 64; 12 | 13 | public static final int SR25519_SEED_SIZE = 32; 14 | 15 | public static final int SR25519_SIGNATURE_SIZE = 64; 16 | 17 | void sr25519_derive_keypair_hard( 18 | byte[] keypair_out, 19 | byte[] pair_ptr, 20 | byte[] cc_ptr 21 | ); 22 | void sr25519_derive_keypair_soft( 23 | byte[] keypair_out, 24 | byte[] pair_ptr, 25 | byte[] cc_ptr 26 | ); 27 | void sr25519_derive_public_soft( 28 | byte[] keypair_out, 29 | byte[] pair_ptr, 30 | byte[] cc_ptr 31 | ); 32 | void sr25519_keypair_from_seed( 33 | byte[] keypair_out, 34 | byte[] seed_ptr 35 | ); 36 | void sr25519_sign( 37 | byte[] signature_out, 38 | byte[] public_ptr, 39 | byte[] secret_ptr, 40 | byte[] message_ptr, 41 | int message_length 42 | ); 43 | boolean sr25519_verify( 44 | byte[] signature_ptr, 45 | byte[] message_ptr, 46 | int message_length, 47 | byte[] public_ptr 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /packages/src/main/java/org/polkadot/utils/crypto/Types.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.utils.crypto; 2 | 3 | public interface Types { 4 | 5 | class Keypair { 6 | byte[] publicKey; 7 | byte[] secretKey; 8 | 9 | public Keypair(byte[] publicKey, byte[] secretKey) { 10 | this.publicKey = publicKey; 11 | this.secretKey = secretKey; 12 | } 13 | 14 | public byte[] getPublicKey() { 15 | return publicKey; 16 | } 17 | 18 | public byte[] getSecretKey() { 19 | return secretKey; 20 | } 21 | } 22 | 23 | class Seedpair { 24 | byte[] publicKey; 25 | byte[] seed; 26 | 27 | public byte[] getPublicKey() { 28 | return publicKey; 29 | } 30 | 31 | public byte[] getSeed() { 32 | return seed; 33 | } 34 | } 35 | 36 | //enum KeypairType { 37 | // ed25519, sr25519 38 | //} 39 | 40 | String KeypairType_ED = "ed25519"; 41 | String KeypairType_SR = "sr25519"; 42 | } 43 | -------------------------------------------------------------------------------- /packages/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | %d %p %c{1.} [%t] %m%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/src/test/java/test/org/polkadot/api/SingleAccountSigner.java: -------------------------------------------------------------------------------- 1 | package test.org.polkadot.api; 2 | 3 | import com.onehilltech.promises.Promise; 4 | import org.polkadot.common.keyring.Types; 5 | import org.polkadot.types.Types.IExtrinsic; 6 | import org.polkadot.types.Types.SignatureOptions; 7 | 8 | public class SingleAccountSigner implements org.polkadot.api.Types.Signer { 9 | 10 | static int id = 0; 11 | private Types.KeyringPair keyringPair; 12 | 13 | public SingleAccountSigner(Types.KeyringPair keyringPair) { 14 | this.keyringPair = keyringPair; 15 | } 16 | 17 | 18 | @Override 19 | public Promise sign(IExtrinsic extrinsic, String address, SignatureOptions options) { 20 | if (this.keyringPair == null || !this.keyringPair.address().equals(address)) { 21 | throw new RuntimeException("does not have the keyringPair"); 22 | } 23 | extrinsic.sign(this.keyringPair, options); 24 | 25 | return Promise.value(++id); 26 | } 27 | 28 | @Override 29 | public void update(int id, Object status) { 30 | //TODO 2019-07-05 21:48 31 | throw new UnsupportedOperationException(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/test.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/packages/test.wasm -------------------------------------------------------------------------------- /sr25519/.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.a 3 | *.o 4 | -------------------------------------------------------------------------------- /sr25519/cpp/compile.sh: -------------------------------------------------------------------------------- 1 | #/usr/bin/bash 2 | 3 | # if the .sh doesn't work, such as jni.h not found, try to run the command in the terminal 4 | g++ -shared -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux jnimain.cpp -L . -lsr25519crust -o ../java/out/libjni.so 5 | 6 | 7 | -------------------------------------------------------------------------------- /sr25519/cpp/compile_mac.sh: -------------------------------------------------------------------------------- 1 | #/usr/bin/bash 2 | 3 | # if the .sh doesn't work, such as jni.h not found, try to run the command in the terminal 4 | g++ -shared -framework Security -framework Foundation -v -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin jnimain.cpp -L . -lsr25519crust -lstdc++ -o ../java/out/libjni.dylib 5 | 6 | 7 | -------------------------------------------------------------------------------- /sr25519/cpp/jnimain.h: -------------------------------------------------------------------------------- 1 | #ifndef JNIMAIN_H 2 | #define JNIMAIN_H 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /sr25519/java/org/polkadot/utils/crypto/SR25519.java: -------------------------------------------------------------------------------- 1 | package org.polkadot.utils.crypto; 2 | 3 | public class SR25519 4 | { 5 | public static final int SR25519_CHAINCODE_SIZE = 32; 6 | 7 | public static final int SR25519_KEYPAIR_SIZE = 96; 8 | 9 | public static final int SR25519_PUBLIC_SIZE = 32; 10 | 11 | public static final int SR25519_SECRET_SIZE = 64; 12 | 13 | public static final int SR25519_SEED_SIZE = 32; 14 | 15 | public static final int SR25519_SIGNATURE_SIZE = 64; 16 | 17 | 18 | static { 19 | System.loadLibrary("jni"); 20 | } 21 | 22 | public native void test1(byte[] input, byte[] output); 23 | 24 | public native void sr25519_derive_keypair_hard( 25 | byte[] keypair_out, 26 | byte[] pair_ptr, 27 | byte[] cc_ptr 28 | ); 29 | public native void sr25519_derive_keypair_soft( 30 | byte[] keypair_out, 31 | byte[] pair_ptr, 32 | byte[] cc_ptr 33 | ); 34 | public native void sr25519_derive_public_soft( 35 | byte[] keypair_out, 36 | byte[] pair_ptr, 37 | byte[] cc_ptr 38 | ); 39 | public native void sr25519_keypair_from_seed( 40 | byte[] keypair_out, 41 | byte[] seed_ptr 42 | ); 43 | public native void sr25519_sign( 44 | byte[] signature_out, 45 | byte[] public_ptr, 46 | byte[] secret_ptr, 47 | byte[] message_ptr, 48 | int message_length 49 | ); 50 | public native boolean sr25519_verify( 51 | byte[] signature_ptr, 52 | byte[] message_ptr, 53 | int message_length, 54 | byte[] public_ptr 55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /sr25519/java/org/polkadot/utils/crypto/genhead.sh: -------------------------------------------------------------------------------- 1 | 2 | javac -h ../../../../../cpp/ SR25519.java 3 | -------------------------------------------------------------------------------- /sr25519/java/test.sh: -------------------------------------------------------------------------------- 1 | javac -cp org/polkadot/utils/crypto/ -d out org/polkadot/utils/crypto/SR25519.java org/polkadot/utils/crypto/TestMain.java 2 | java -Djava.library.path=out -cp out org.polkadot.utils.crypto.TestMain 3 | -------------------------------------------------------------------------------- /sr25519/libs/mac/libjni.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/sr25519/libs/mac/libjni.dylib -------------------------------------------------------------------------------- /sr25519/libs/readme.md: -------------------------------------------------------------------------------- 1 | To use the JNI, copy the libjni.so in proper platform to the folder where 2 | Java `System.loadLibrary("jni")` can find the shared library. 3 | 4 | Note to pass the library folder to Java, you can use, 5 | `java -Djava.library.path=FOLDER blahblah` 6 | See test.sh in ../java folder as a reference. 7 | -------------------------------------------------------------------------------- /sr25519/libs/ubuntu64/libjni.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/polkadot-java/api/9e155fd0e239ec5b0405879c13522be7b78daade/sr25519/libs/ubuntu64/libjni.so -------------------------------------------------------------------------------- /sr25519/readme.md: -------------------------------------------------------------------------------- 1 | To build sr25519 C++ wrapper, get it from https://github.com/Warchant/sr25519-crust, 2 | then 3 | cmake .. -DCMAKE_BUILD_TYPE=Release -DTESTING=OFF -DBUILD_SHARED_LIBS=FALSE 4 | then 5 | make 6 | then copy libsr25519crust.a to the folder sr25519/cpp (same as jnimain.cpp) 7 | 8 | --------------------------------------------------------------------------------