Package org.polkadot.types.type
Class Extrinsic
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<java.lang.String,Codec>
-
- org.polkadot.types.codec.Struct
-
- org.polkadot.types.type.Extrinsic
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.String,Codec>,Codec,Types.IExtrinsic,Types.IMethod
- Direct Known Subclasses:
SubmittableExtrinsic.SubmittableExtrinsicImpl
public class Extrinsic extends Struct implements Types.IExtrinsic
Representation of an Extrinsic in the system. It contains the actual call, (optional) signature and encodes with an actual length prefix Can be: - signed, to create a transaction - left as is, to create an inherent- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExtrinsic.ExtrinsicValue
-
Constructor Summary
Constructors Constructor Description Extrinsic(java.lang.Object value)
-
Method Summary
Modifier and Type Method Description ExtrinsicaddSignature(java.lang.Object signer, byte[] signature, java.lang.Object nonce, byte[] era)Add an ExtrinsicSignature to the extrinsic (already generated)java.util.List<Codec>getArgs()The arguments passed to for the call, exposes args so it is compatible withMethodTypes.ConstructorDefgetArgsDef()Thge argument defintions, compatible withMethodbyte[]getCallIndex()The actual `[sectionIndex, methodIndex]` as used in the Methodbyte[]getData()The actual data for the MethodintgetEncodedLength()The length of the value when encoded as a Uint8ArrayU8agetHash()Convernience function, encodes the extrinsic and returns the actual hashModules.FunctionMetadatagetMeta()The FunctionMetadata that describes the extrinsicMethodgetMethod()TheMethodthis extrinsic wrapsExtrinsicSignaturegetSignature()The ExtrinsicSignaturebooleanhasOrigin()`true` is method has `Origin` argument (compatibility withMethod)booleanisSigned()`true` id the extrinsic is signedintlength()The length of the encoded valueExtrinsicsign(Types.KeyringPair account, Types.SignatureOptions options)Sign the extrinsic with a specific keypairjava.lang.StringtoHex()Returns a hex string representation of the valuejava.lang.ObjecttoJson()Converts the Object to JSON, typically used for RPC transfersbyte[]toU8a(boolean isBare)Encodes the value as a Uint8Array as per the parity-codec specifications-
Methods inherited from class org.polkadot.types.codec.Struct
builder, eq, getField, isEmpty, toArray, toString, with
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Method Detail
-
getArgs
public java.util.List<Codec> getArgs()
The arguments passed to for the call, exposes args so it is compatible withMethod- Specified by:
getArgsin interfaceTypes.IMethod
-
getArgsDef
public Types.ConstructorDef getArgsDef()
Thge argument defintions, compatible withMethod- Specified by:
getArgsDefin interfaceTypes.IMethod
-
getCallIndex
public byte[] getCallIndex()
The actual `[sectionIndex, methodIndex]` as used in the Method- Specified by:
getCallIndexin interfaceTypes.IMethod
-
getData
public byte[] getData()
The actual data for the Method- Specified by:
getDatain interfaceTypes.IMethod
-
getEncodedLength
public int getEncodedLength()
The length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec- Overrides:
getEncodedLengthin classStruct
-
getHash
public U8a getHash()
Convernience function, encodes the extrinsic and returns the actual hash- Specified by:
getHashin interfaceTypes.IExtrinsic
-
hasOrigin
public boolean hasOrigin()
`true` is method has `Origin` argument (compatibility withMethod)- Specified by:
hasOriginin interfaceTypes.IMethod
-
isSigned
public boolean isSigned()
`true` id the extrinsic is signed- Specified by:
isSignedin interfaceTypes.IExtrinsic
-
length
public int length()
The length of the encoded value
-
getMeta
public Modules.FunctionMetadata getMeta()
The FunctionMetadata that describes the extrinsic- Specified by:
getMetain interfaceTypes.IMethod
-
getMethod
public Method getMethod()
TheMethodthis extrinsic wraps- Specified by:
getMethodin interfaceTypes.IExtrinsic
-
getSignature
public ExtrinsicSignature getSignature()
The ExtrinsicSignature- Specified by:
getSignaturein interfaceTypes.IExtrinsic
-
addSignature
public Extrinsic addSignature(java.lang.Object signer, byte[] signature, java.lang.Object nonce, byte[] era)
Add an ExtrinsicSignature to the extrinsic (already generated)- Specified by:
addSignaturein interfaceTypes.IExtrinsic
-
sign
public Extrinsic sign(Types.KeyringPair account, Types.SignatureOptions options)
Sign the extrinsic with a specific keypair- Specified by:
signin interfaceTypes.IExtrinsic
-
toHex
public java.lang.String toHex()
Returns a hex string representation of the value
-
toJson
public java.lang.Object toJson()
Converts the Object to JSON, typically used for RPC transfers
-
toU8a
public byte[] toU8a(boolean isBare)
Description copied from class:StructEncodes the value as a Uint8Array as per the parity-codec specifications
-
-