Update json-schemas for SRA v1
This commit is contained in:
		@@ -1,4 +1,12 @@
 | 
			
		||||
[
 | 
			
		||||
    {
 | 
			
		||||
        "version": "2.0.0",
 | 
			
		||||
        "changes": [
 | 
			
		||||
            {
 | 
			
		||||
                "note": "Upgrade Relayer API schemas for relayer API V1"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
        "version": "1.0.1-rc.3",
 | 
			
		||||
        "changes": [
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								packages/json-schemas/schemas/paginated_collection_schema.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								packages/json-schemas/schemas/paginated_collection_schema.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
export const paginatedCollectionSchema = {
 | 
			
		||||
    id: '/PaginatedCollection',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        total: { $ref: '/Number' },
 | 
			
		||||
        per_page: { $ref: '/Number' },
 | 
			
		||||
        page: { $ref: '/Number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['total', 'per_page', 'page'],
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
export const relayerApiAssetDataPairsResponseSchema = {
 | 
			
		||||
    id: '/RelayerApiAssetDataPairsResponse',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    allOf: [
 | 
			
		||||
        { $ref: '/PaginatedCollection' },
 | 
			
		||||
        {
 | 
			
		||||
            properties: {
 | 
			
		||||
                records: { $ref: '/RelayerApiAssetDataPairs' },
 | 
			
		||||
            },
 | 
			
		||||
            required: ['records'],
 | 
			
		||||
        },
 | 
			
		||||
    ],
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const relayerApiAssetDataPairsSchema = {
 | 
			
		||||
    id: '/RelayerApiAssetDataPairs',
 | 
			
		||||
    type: 'array',
 | 
			
		||||
    items: {
 | 
			
		||||
        properties: {
 | 
			
		||||
            assetDataA: { $ref: '/RelayerApiAssetDataTradeInfo' },
 | 
			
		||||
            assetDataB: { $ref: '/RelayerApiAssetDataTradeInfo' },
 | 
			
		||||
        },
 | 
			
		||||
        required: ['assetDataA', 'assetDataB'],
 | 
			
		||||
        type: 'object',
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const relayerApiAssetDataTradeInfoSchema = {
 | 
			
		||||
    id: '/RelayerApiAssetDataTradeInfo',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        assetData: { $ref: '/Hex' },
 | 
			
		||||
        minAmount: { $ref: '/Number' },
 | 
			
		||||
        maxAmount: { $ref: '/Number' },
 | 
			
		||||
        precision: { type: 'number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['assetData'],
 | 
			
		||||
};
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
export const relayerApiFeesPayloadSchema = {
 | 
			
		||||
    id: '/RelayerApiFeesPayload',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        exchangeContractAddress: { $ref: '/Address' },
 | 
			
		||||
        maker: { $ref: '/Address' },
 | 
			
		||||
        taker: { $ref: '/Address' },
 | 
			
		||||
        makerTokenAddress: { $ref: '/Address' },
 | 
			
		||||
        takerTokenAddress: { $ref: '/Address' },
 | 
			
		||||
        makerTokenAmount: { $ref: '/Number' },
 | 
			
		||||
        takerTokenAmount: { $ref: '/Number' },
 | 
			
		||||
        expirationUnixTimestampSec: { $ref: '/Number' },
 | 
			
		||||
        salt: { $ref: '/Number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: [
 | 
			
		||||
        'exchangeContractAddress',
 | 
			
		||||
        'maker',
 | 
			
		||||
        'taker',
 | 
			
		||||
        'makerTokenAddress',
 | 
			
		||||
        'takerTokenAddress',
 | 
			
		||||
        'expirationUnixTimestampSec',
 | 
			
		||||
        'salt',
 | 
			
		||||
    ],
 | 
			
		||||
};
 | 
			
		||||
@@ -1,10 +0,0 @@
 | 
			
		||||
export const relayerApiFeesResponseSchema = {
 | 
			
		||||
    id: '/RelayerApiFeesResponse',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        makerFee: { $ref: '/Number' },
 | 
			
		||||
        takerFee: { $ref: '/Number' },
 | 
			
		||||
        feeRecipient: { $ref: '/Address' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['makerFee', 'takerFee', 'feeRecipient'],
 | 
			
		||||
};
 | 
			
		||||
@@ -1,23 +0,0 @@
 | 
			
		||||
export const relayerApiOrderbookChannelSubscribeSchema = {
 | 
			
		||||
    id: '/RelayerApiOrderbookChannelSubscribe',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        type: { enum: ['subscribe'] },
 | 
			
		||||
        channel: { enum: ['orderbook'] },
 | 
			
		||||
        requestId: { type: 'number' },
 | 
			
		||||
        payload: { $ref: '/RelayerApiOrderbookChannelSubscribePayload' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['type', 'channel', 'requestId', 'payload'],
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const relayerApiOrderbookChannelSubscribePayload = {
 | 
			
		||||
    id: '/RelayerApiOrderbookChannelSubscribePayload',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        baseTokenAddress: { $ref: '/Address' },
 | 
			
		||||
        quoteTokenAddress: { $ref: '/Address' },
 | 
			
		||||
        snapshot: { type: 'boolean' },
 | 
			
		||||
        limit: { type: 'number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['baseTokenAddress', 'quoteTokenAddress'],
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,24 @@
 | 
			
		||||
export const relayerApiOrderConfigPayloadSchema = {
 | 
			
		||||
    id: '/RelayerApiOrderConfigPayload',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        makerAddress: { $ref: '/Address' },
 | 
			
		||||
        takerAddress: { $ref: '/Address' },
 | 
			
		||||
        makerAssetAmount: { $ref: '/Number' },
 | 
			
		||||
        takerAssetAmount: { $ref: '/Number' },
 | 
			
		||||
        makerAssetData: { $ref: '/Hex' },
 | 
			
		||||
        takerAssetData: { $ref: '/Hex' },
 | 
			
		||||
        exchangeAddress: { $ref: '/Address' },
 | 
			
		||||
        expirationTimeSeconds: { $ref: '/Number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: [
 | 
			
		||||
        'makerAddress',
 | 
			
		||||
        'takerAddress',
 | 
			
		||||
        'makerAssetAmount',
 | 
			
		||||
        'takerAssetAmount',
 | 
			
		||||
        'makerAssetData',
 | 
			
		||||
        'takerAssetData',
 | 
			
		||||
        'exchangeAddress',
 | 
			
		||||
        'expirationTimeSeconds',
 | 
			
		||||
    ],
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,11 @@
 | 
			
		||||
export const relayerApiOrderConfigResponseSchema = {
 | 
			
		||||
    id: '/RelayerApiOrderConfigResponse',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        makerFee: { $ref: '/Number' },
 | 
			
		||||
        takerFee: { $ref: '/Number' },
 | 
			
		||||
        feeRecipientAddress: { $ref: '/Address' },
 | 
			
		||||
        senderAddress: { $ref: '/Address' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['makerFee', 'takerFee', 'feeRecipientAddress', 'senderAddress'],
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,9 @@
 | 
			
		||||
export const relayerApiOrderSchema = {
 | 
			
		||||
    id: '/RelayerApiOrder',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        order: { $ref: '/Order' },
 | 
			
		||||
        remainingFillableAmount: { $ref: '/Number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['order', 'remainingFillableAmount'],
 | 
			
		||||
};
 | 
			
		||||
@@ -1,21 +0,0 @@
 | 
			
		||||
export const relayerApiOrderbookChannelSnapshotSchema = {
 | 
			
		||||
    id: '/RelayerApiOrderbookChannelSnapshot',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        type: { enum: ['snapshot'] },
 | 
			
		||||
        channel: { enum: ['orderbook'] },
 | 
			
		||||
        requestId: { type: 'number' },
 | 
			
		||||
        payload: { $ref: '/RelayerApiOrderbookChannelSnapshotPayload' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['type', 'channel', 'requestId', 'payload'],
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const relayerApiOrderbookChannelSnapshotPayload = {
 | 
			
		||||
    id: '/RelayerApiOrderbookChannelSnapshotPayload',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        bids: { $ref: '/signedOrdersSchema' },
 | 
			
		||||
        asks: { $ref: '/signedOrdersSchema' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['bids', 'asks'],
 | 
			
		||||
};
 | 
			
		||||
@@ -1,11 +0,0 @@
 | 
			
		||||
export const relayerApiOrderbookChannelUpdateSchema = {
 | 
			
		||||
    id: '/RelayerApiOrderbookChannelUpdate',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        type: { enum: ['update'] },
 | 
			
		||||
        channel: { enum: ['orderbook'] },
 | 
			
		||||
        requestId: { type: 'number' },
 | 
			
		||||
        payload: { $ref: '/SignedOrder' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['type', 'channel', 'requestId', 'payload'],
 | 
			
		||||
};
 | 
			
		||||
@@ -2,8 +2,8 @@ export const relayerApiOrderBookResponseSchema = {
 | 
			
		||||
    id: '/RelayerApiOrderBookResponse',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        bids: { $ref: '/signedOrdersSchema' },
 | 
			
		||||
        asks: { $ref: '/signedOrdersSchema' },
 | 
			
		||||
        bids: { $ref: '/RelayerApiOrdersResponse' },
 | 
			
		||||
        asks: { $ref: '/RelayerApiOrdersResponse' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['bids', 'asks'],
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,26 @@
 | 
			
		||||
export const relayerApiOrdersChannelSubscribeSchema = {
 | 
			
		||||
    id: '/RelayerApiOrdersChannelSubscribe',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        type: { enum: ['subscribe'] },
 | 
			
		||||
        channel: { enum: ['orders'] },
 | 
			
		||||
        requestId: { type: 'string' },
 | 
			
		||||
        payload: { $ref: '/RelayerApiOrdersChannelSubscribePayload' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['type', 'channel', 'requestId'],
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const relayerApiOrdersChannelSubscribePayload = {
 | 
			
		||||
    id: '/RelayerApiOrdersChannelSubscribePayload',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        makerAssetProxyId: { $ref: '/Address' },
 | 
			
		||||
        takerAssetProxyId: { $ref: '/Address' },
 | 
			
		||||
        networkId: { type: 'number' },
 | 
			
		||||
        makerAssetAddress: { $ref: '/Address' },
 | 
			
		||||
        takerAssetAddress: { $ref: '/Address' },
 | 
			
		||||
        makerAssetData: { $ref: '/Hex' },
 | 
			
		||||
        takerAssetData: { $ref: '/Hex' },
 | 
			
		||||
        traderAssetData: { $ref: '/Hex' },
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,11 @@
 | 
			
		||||
export const relayerApiOrdersChannelUpdateSchema = {
 | 
			
		||||
    id: '/RelayerApiOrdersChannelUpdate',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        type: { enum: ['update'] },
 | 
			
		||||
        channel: { enum: ['orders'] },
 | 
			
		||||
        requestId: { type: 'string' },
 | 
			
		||||
        payload: { $ref: '/RelayerApiOrders' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['type', 'channel', 'requestId', 'payload'],
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,13 @@
 | 
			
		||||
export const relayerApiOrdersResponseSchema = {
 | 
			
		||||
    id: '/RelayerApiOrdersResponse',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    allOf: [
 | 
			
		||||
        { $ref: '/PaginatedCollection' },
 | 
			
		||||
        {
 | 
			
		||||
            properties: {
 | 
			
		||||
                records: { $ref: '/RelayerApiOrders' },
 | 
			
		||||
            },
 | 
			
		||||
            required: ['records'],
 | 
			
		||||
        },
 | 
			
		||||
    ],
 | 
			
		||||
};
 | 
			
		||||
@@ -0,0 +1,5 @@
 | 
			
		||||
export const relayerApiOrdersSchema = {
 | 
			
		||||
    id: '/RelayerApiOrders',
 | 
			
		||||
    type: 'array',
 | 
			
		||||
    items: { $ref: '/RelayerApiOrder' },
 | 
			
		||||
};
 | 
			
		||||
@@ -1,24 +0,0 @@
 | 
			
		||||
export const relayerApiTokenPairsResponseSchema = {
 | 
			
		||||
    id: '/RelayerApiTokenPairsResponse',
 | 
			
		||||
    type: 'array',
 | 
			
		||||
    items: {
 | 
			
		||||
        properties: {
 | 
			
		||||
            tokenA: { $ref: '/RelayerApiTokenTradeInfo' },
 | 
			
		||||
            tokenB: { $ref: '/RelayerApiTokenTradeInfo' },
 | 
			
		||||
        },
 | 
			
		||||
        required: ['tokenA', 'tokenB'],
 | 
			
		||||
        type: 'object',
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const relayerApiTokenTradeInfoSchema = {
 | 
			
		||||
    id: '/RelayerApiTokenTradeInfo',
 | 
			
		||||
    type: 'object',
 | 
			
		||||
    properties: {
 | 
			
		||||
        address: { $ref: '/Address' },
 | 
			
		||||
        minAmount: { $ref: '/Number' },
 | 
			
		||||
        maxAmount: { $ref: '/Number' },
 | 
			
		||||
        precision: { type: 'number' },
 | 
			
		||||
    },
 | 
			
		||||
    required: ['address'],
 | 
			
		||||
};
 | 
			
		||||
@@ -5216,9 +5216,9 @@ ethereumjs-wallet@~0.6.0:
 | 
			
		||||
    utf8 "^2.1.1"
 | 
			
		||||
    uuid "^2.0.1"
 | 
			
		||||
 | 
			
		||||
ethers@3.0.22:
 | 
			
		||||
  version "3.0.22"
 | 
			
		||||
  resolved "https://registry.npmjs.org/ethers/-/ethers-3.0.22.tgz#7fab1ea16521705837aa43c15831877b2716b436"
 | 
			
		||||
ethers@0xproject/ethers.js#eip-838-reasons, ethers@3.0.22:
 | 
			
		||||
  version "3.0.18"
 | 
			
		||||
  resolved "https://codeload.github.com/0xproject/ethers.js/tar.gz/b91342bd200d142af0165d6befddf783c8ae8447"
 | 
			
		||||
  dependencies:
 | 
			
		||||
    aes-js "3.0.0"
 | 
			
		||||
    bn.js "^4.4.0"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user