update @0x/contract-artifacts and @0x/contract-wrappers

This commit is contained in:
xianny 2020-06-03 13:44:10 -07:00
parent b8d51fc4e8
commit fbaf55cb25
6 changed files with 302 additions and 2 deletions

View File

@ -17,6 +17,14 @@
{
"note": "Added `ERC20BridgeSampler.sampleBuysFromKyberNetwork`",
"pr": 2551
},
{
"note": "Added `ERC20BridgeSampler.sampleBuysFromUniswapV2",
"pr": 2595
},
{
"note": "Added `ERC20BridgeSampler.sampleSellsFromUniswapV2",
"pr": 2595
}
]
},

File diff suppressed because one or more lines are too long

View File

@ -178,6 +178,18 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "address[]", "name": "path", "type": "address[]" },
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }
],
"name": "sampleBuysFromUniswapV2",
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
@ -244,6 +256,18 @@
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{ "internalType": "address[]", "name": "path", "type": "address[]" },
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
],
"name": "sampleSellsFromUniswapV2",
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
@ -326,6 +350,14 @@
},
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
},
"sampleBuysFromUniswapV2(address[],uint256[])": {
"details": "Sample buy quotes from UniswapV2.",
"params": {
"makerTokenAmounts": "Maker token buy amount for each sample.",
"path": "Token route."
},
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
},
"sampleSellsFromCurve(address,int128,int128,uint256[])": {
"details": "Sample sell quotes from Curve.",
"params": {
@ -372,6 +404,14 @@
"takerTokenAmounts": "Taker token sell amount for each sample."
},
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
},
"sampleSellsFromUniswapV2(address[],uint256[])": {
"details": "Sample sell quotes from UniswapV2.",
"params": {
"path": "Token route.",
"takerTokenAmounts": "Taker token sell amount for each sample."
},
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
}
}
},

View File

@ -21,6 +21,14 @@
{
"note": "Added `ERC20BridgeSampler.sampleBuysFromKyberNetwork`",
"pr": 2551
},
{
"note": "Added `ERC20BridgeSampler.sampleBuysFromUniswapV2",
"pr": 2595
},
{
"note": "Added `ERC20BridgeSampler.sampleSellsFromUniswapV2",
"pr": 2595
}
]
},

View File

@ -561,6 +561,29 @@ export class ERC20BridgeSamplerContract extends BaseContract {
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
{
name: 'path',
type: 'address[]',
},
{
name: 'makerTokenAmounts',
type: 'uint256[]',
},
],
name: 'sampleBuysFromUniswapV2',
outputs: [
{
name: 'takerTokenAmounts',
type: 'uint256[]',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
@ -735,6 +758,29 @@ export class ERC20BridgeSamplerContract extends BaseContract {
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
{
name: 'path',
type: 'address[]',
},
{
name: 'takerTokenAmounts',
type: 'uint256[]',
},
],
name: 'sampleSellsFromUniswapV2',
outputs: [
{
name: 'makerTokenAmounts',
type: 'uint256[]',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
] as ContractAbi;
return abi;
}
@ -1182,6 +1228,34 @@ export class ERC20BridgeSamplerContract extends BaseContract {
},
};
}
/**
* Sample buy quotes from UniswapV2.
* @param path Token route.
* @param makerTokenAmounts Maker token buy amount for each sample.
* @returns takerTokenAmounts Taker amounts sold at each maker token amount.
*/
public sampleBuysFromUniswapV2(path: string[], makerTokenAmounts: BigNumber[]): ContractFunctionObj<BigNumber[]> {
const self = (this as any) as ERC20BridgeSamplerContract;
assert.isArray('path', path);
assert.isArray('makerTokenAmounts', makerTokenAmounts);
const functionSignature = 'sampleBuysFromUniswapV2(address[],uint256[])';
return {
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber[]> {
BaseContract._assertCallParams(callData, defaultBlock);
const rawCallResult = await self._performCallAsync(
{ ...callData, data: this.getABIEncodedTransactionData() },
defaultBlock,
);
const abiEncoder = self._lookupAbiEncoder(functionSignature);
BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);
return abiEncoder.strictDecodeReturnValue<BigNumber[]>(rawCallResult);
},
getABIEncodedTransactionData(): string {
return self._strictEncodeArguments(functionSignature, [path, makerTokenAmounts]);
},
};
}
/**
* Sample sell quotes from Curve.
* @param curveAddress Address of the Curve contract.
@ -1423,6 +1497,34 @@ export class ERC20BridgeSamplerContract extends BaseContract {
},
};
}
/**
* Sample sell quotes from UniswapV2.
* @param path Token route.
* @param takerTokenAmounts Taker token sell amount for each sample.
* @returns makerTokenAmounts Maker amounts bought at each taker token amount.
*/
public sampleSellsFromUniswapV2(path: string[], takerTokenAmounts: BigNumber[]): ContractFunctionObj<BigNumber[]> {
const self = (this as any) as ERC20BridgeSamplerContract;
assert.isArray('path', path);
assert.isArray('takerTokenAmounts', takerTokenAmounts);
const functionSignature = 'sampleSellsFromUniswapV2(address[],uint256[])';
return {
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber[]> {
BaseContract._assertCallParams(callData, defaultBlock);
const rawCallResult = await self._performCallAsync(
{ ...callData, data: this.getABIEncodedTransactionData() },
defaultBlock,
);
const abiEncoder = self._lookupAbiEncoder(functionSignature);
BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);
return abiEncoder.strictDecodeReturnValue<BigNumber[]>(rawCallResult);
},
getABIEncodedTransactionData(): string {
return self._strictEncodeArguments(functionSignature, [path, takerTokenAmounts]);
},
};
}
constructor(
address: string,

View File

@ -540,6 +540,29 @@ export class IERC20BridgeSamplerContract extends BaseContract {
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
{
name: 'path',
type: 'address[]',
},
{
name: 'makerTokenAmounts',
type: 'uint256[]',
},
],
name: 'sampleBuysFromUniswapV2',
outputs: [
{
name: 'takerTokenAmounts',
type: 'uint256[]',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
@ -683,6 +706,29 @@ export class IERC20BridgeSamplerContract extends BaseContract {
stateMutability: 'view',
type: 'function',
},
{
constant: true,
inputs: [
{
name: 'path',
type: 'address[]',
},
{
name: 'takerTokenAmounts',
type: 'uint256[]',
},
],
name: 'sampleSellsFromUniswapV2',
outputs: [
{
name: 'makerTokenAmounts',
type: 'uint256[]',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
] as ContractAbi;
return abi;
}
@ -1128,6 +1174,34 @@ export class IERC20BridgeSamplerContract extends BaseContract {
},
};
}
/**
* Sample buy quotes from UniswapV2.
* @param path Token route.
* @param makerTokenAmounts Maker token buy amount for each sample.
* @returns takerTokenAmounts Taker amounts sold at each maker token amount.
*/
public sampleBuysFromUniswapV2(path: string[], makerTokenAmounts: BigNumber[]): ContractFunctionObj<BigNumber[]> {
const self = (this as any) as IERC20BridgeSamplerContract;
assert.isArray('path', path);
assert.isArray('makerTokenAmounts', makerTokenAmounts);
const functionSignature = 'sampleBuysFromUniswapV2(address[],uint256[])';
return {
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber[]> {
BaseContract._assertCallParams(callData, defaultBlock);
const rawCallResult = await self._performCallAsync(
{ ...callData, data: this.getABIEncodedTransactionData() },
defaultBlock,
);
const abiEncoder = self._lookupAbiEncoder(functionSignature);
BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);
return abiEncoder.strictDecodeReturnValue<BigNumber[]>(rawCallResult);
},
getABIEncodedTransactionData(): string {
return self._strictEncodeArguments(functionSignature, [path, makerTokenAmounts]);
},
};
}
/**
* Sample sell quotes from Curve.
* @param curveAddress Address of the Curve contract.
@ -1326,6 +1400,34 @@ export class IERC20BridgeSamplerContract extends BaseContract {
},
};
}
/**
* Sample sell quotes from UniswapV2.
* @param path Token route.
* @param takerTokenAmounts Taker token sell amount for each sample.
* @returns makerTokenAmounts Maker amounts bought at each taker token amount.
*/
public sampleSellsFromUniswapV2(path: string[], takerTokenAmounts: BigNumber[]): ContractFunctionObj<BigNumber[]> {
const self = (this as any) as IERC20BridgeSamplerContract;
assert.isArray('path', path);
assert.isArray('takerTokenAmounts', takerTokenAmounts);
const functionSignature = 'sampleSellsFromUniswapV2(address[],uint256[])';
return {
async callAsync(callData: Partial<CallData> = {}, defaultBlock?: BlockParam): Promise<BigNumber[]> {
BaseContract._assertCallParams(callData, defaultBlock);
const rawCallResult = await self._performCallAsync(
{ ...callData, data: this.getABIEncodedTransactionData() },
defaultBlock,
);
const abiEncoder = self._lookupAbiEncoder(functionSignature);
BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);
return abiEncoder.strictDecodeReturnValue<BigNumber[]>(rawCallResult);
},
getABIEncodedTransactionData(): string {
return self._strictEncodeArguments(functionSignature, [path, takerTokenAmounts]);
},
};
}
constructor(
address: string,