Skip to main content

Function: assertCanonicalV2Dto

assertCanonicalV2Dto(method, dto): void

Asserts that dto is EXACTLY what the builder of method produces for its own fields — the same fields, canonical decimal text, builder key order, nothing extra (no signature). The submit* methods use it so that what an app showed a user (a DTO it built) is byte for byte what gets signed; a DTO edited by hand, or built elsewhere, is refused rather than signed.

Parameters​

ParameterType
methodV2WriteMethod
dtoRecord<string, unknown>

Returns​

void

Throws​

GSwapSDKError INVALID_DTO or DTO_NOT_CANONICAL.