mirror of
https://github.com/wharfkit/signing-request.git
synced 2026-07-21 16:03:29 +00:00
Add request validation in constructor
This commit is contained in:
@@ -354,6 +354,12 @@ export class SigningRequest {
|
||||
abiProvider?: AbiProvider,
|
||||
signature?: abi.RequestSignature,
|
||||
) {
|
||||
if (data.broadcast === true && data.req[0] === 'identity') {
|
||||
throw new Error('Invalid request (identity request cannot be broadcast)')
|
||||
}
|
||||
if (data.broadcast === false && data.broadcast == null) {
|
||||
throw new Error('Invalid request (nothing to do, no broadcast or callback set)')
|
||||
}
|
||||
this.version = version
|
||||
this.data = data
|
||||
this.textEncoder = textEncoder
|
||||
|
||||
Reference in New Issue
Block a user