How to use the @0x/json-schemas.schemas.eip712TypedDataSchema function in @0x/json-schemas

To help you get started, we’ve selected a few @0x/json-schemas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / packages / web3-wrapper / src / web3_wrapper.ts View on Github external
public async signTypedDataAsync(address: string, typedData: any): Promise {
        assert.isETHAddressHex('address', address);
        assert.doesConformToSchema('typedData', typedData, schemas.eip712TypedDataSchema);
        const signData = await this.sendRawPayloadAsync({
            method: 'eth_signTypedData',
            params: [address, typedData],
        });
        return signData;
    }
    /**
github 0xProject / 0x-monorepo / packages / order-utils / src / eip712_utils.ts View on Github external
assert.isString('primaryType', primaryType);
        const typedData = {
            types: {
                EIP712Domain: constants.DEFAULT_DOMAIN_SCHEMA.parameters,
                ...types,
            },
            domain: {
                name: domain.name === undefined ? constants.EXCHANGE_DOMAIN_NAME : domain.name,
                version: domain.version === undefined ? constants.EXCHANGE_DOMAIN_VERSION : domain.version,
                chainId: domain.chainId,
                verifyingContract: domain.verifyingContract,
            },
            message,
            primaryType,
        };
        assert.doesConformToSchema('typedData', typedData, schemas.eip712TypedDataSchema);
        return typedData;
    },
    /**