@gala-chain/api ∙ API
API > DryRunDto
Class: DryRunDto
Contents
- Description
- Remarks
- Extends
- Constructors
- new DryRunDto()
- Properties
- callerPublicKey
- dto
- dtoExpiresAt
- dtoOperation
- method
- multisig
- prefix
- signature
- signerAddress
- signerPublicKey
- uniqueKey
- Methods
- expiresInMs()
- getAllSignatures()
- isSignatureValid()
- serialize()
- sign()
- signed()
- validate()
- validateOrReject()
- withOperation()
- withSigner()
- deserialize()
Description
Input for the DryRun chaincode method defined on the GalaContract class.
Use a DryRunDto and the DryRun chaincode method to simulate the
execution of a chaincode contract method. The results of the DryRun
will not be written chain. Instead, the Read/Write set that would have resulted from
the transaction will be returned to the consuming client for analysis.
Remarks
Authorization is not checked for DryRun execution. This allows application,
administrative, game server identities etc. to simulate a transaction result
without prompting the end user to sign the input first. This helps avoid
replay attacks (as the unique id would not be written to chain in a DryRun)
and also allows applications to present certain outcomes to the end user
before they decide to sign and authorize the transaction.
Example use case: Executing a DryRun on a given method, and then processing
the results for FeeChannelPaymentReceipt or FeeUserPaymentReceipt objects
can yield the exepcted/estimated fee prior to executing a transaction. The
estimated fee can then be presented to an end user for them to decide whether
or not they want to authorize the transaction.
Extends
Constructors
new DryRunDto()
new DryRunDto():
DryRunDto
Inherited from
Properties
callerPublicKey
readonlycallerPublicKey?:string
Description
The identity used for the transaction simulation.
Source
chain-api/src/types/dtos.ts:482
dto
dto?:
ChainCallDTO
Description
A input to be used for the DryRun execution. For example, if the
method to be DryRun is TransferToken, then a TransferTokenDto should
be provided here.
Source
chain-api/src/types/dtos.ts:494
dtoExpiresAt
dtoExpiresAt?:
number
Inherited from
Source
chain-api/src/types/dtos.ts:224
dtoOperation
dtoOperation?:
string
Inherited from
Source
chain-api/src/types/dtos.ts:217
method
readonlymethod:string
Description
The contract method intended for DryRun execution.
Example
Source
chain-api/src/types/dtos.ts:473
multisig
multisig?:
string[]
Inherited from
Source
chain-api/src/types/dtos.ts:206
prefix
prefix?:
string
Inherited from
Source
chain-api/src/types/dtos.ts:169
signature
signature?:
string
Inherited from
Source
chain-api/src/types/dtos.ts:193
signerAddress
signerAddress?:
UserRef
Inherited from
Source
chain-api/src/types/dtos.ts:176
signerPublicKey
signerPublicKey?:
string
Inherited from
Source
chain-api/src/types/dtos.ts:183
uniqueKey
uniqueKey?:
string
Inherited from
Source
chain-api/src/types/dtos.ts:160
Methods
expiresInMs()
expiresInMs(
ms):DryRunDto
Parameters
▪ ms: number
Inherited from
Source
chain-api/src/types/dtos.ts:339
getAllSignatures()
getAllSignatures():
string[]
Inherited from
Source
chain-api/src/types/dtos.ts:276
isSignatureValid()
isSignatureValid(
publicKey):boolean
Parameters
▪ publicKey: string
Inherited from
Source
chain-api/src/types/dtos.ts:357
serialize()
serialize():
string
Returns
string
Inherited from
Description
Serialze this object to string in a determinsitic fashion. See Hyperledger Fabric's documentation on JSON Determinism for more details.
Source
chain-api/src/types/dtos.ts:248
sign()
sign(
privateKey,useDer):void
Parameters
▪ privateKey: string
▪ useDer: boolean= false
Inherited from
Source
chain-api/src/types/dtos.ts:280
signed()
signed(
privateKey,useDer):DryRunDto
Creates a signed copy of current object.
Parameters
▪ privateKey: string
▪ useDer: boolean= false
Inherited from
Source
chain-api/src/types/dtos.ts:333
validate()
validate():
Promise\<ValidationError[]>
Inherited from
Source
chain-api/src/types/dtos.ts:226
validateOrReject()
validateOrReject():
Promise\<void>
Inherited from
Source
chain-api/src/types/dtos.ts:230
withOperation()
withOperation(
operation):DryRunDto
Parameters
▪ operation: string
Inherited from
Source
chain-api/src/types/dtos.ts:345
withSigner()
withSigner(
ref):DryRunDto
Parameters
▪ ref: UserRef
Inherited from
Source
chain-api/src/types/dtos.ts:351
deserialize()
staticdeserialize\<T>(constructor,object):T
Type parameters
▪ T
Parameters
▪ constructor: ClassConstructor\<Inferred\<T, ChainCallDTO>>
ClassConstructor that extends ChainCallDTO
▪ object: string | Record\<string, unknown> | Record\<string, unknown>[]
serialized string or plain object to be instantiated via the provided ClassConstructor
Returns
An instantiated class created with the provided ClassConstructor
Inherited from
Description
Instantiate a class instance from a serialized object using the provided ClassConstructor.