@cowprotocol/cow-sdk 2.3.1 → 2.4.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/common/chains.d.ts +4 -0
  2. package/dist/common/configs.d.ts +48 -0
  3. package/dist/common/consts.d.ts +17 -0
  4. package/dist/composable/conditionalorder.d.ts +160 -0
  5. package/dist/composable/extensible.d.ts +6 -0
  6. package/dist/composable/generated/ComposableCoW.d.ts +340 -0
  7. package/dist/composable/generated/ExtensibleFallbackHandler.d.ts +282 -0
  8. package/dist/composable/generated/TWAP.d.ts +141 -0
  9. package/dist/composable/generated/common.d.ts +21 -0
  10. package/dist/composable/generated/factories/ComposableCoW__factory.d.ts +475 -0
  11. package/dist/composable/generated/factories/ExtensibleFallbackHandler__factory.d.ts +389 -0
  12. package/dist/composable/generated/factories/TWAP__factory.d.ts +260 -0
  13. package/dist/composable/generated/factories/index.d.ts +3 -0
  14. package/dist/composable/generated/index.d.ts +7 -0
  15. package/dist/composable/index.d.ts +4 -0
  16. package/dist/composable/multiplexer.d.ts +221 -0
  17. package/dist/composable/types/index.d.ts +1 -0
  18. package/dist/composable/types/twap.d.ts +114 -0
  19. package/dist/index-856e1ad2.js +29 -0
  20. package/dist/index-856e1ad2.js.map +1 -0
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +4 -4
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.modern.mjs +1 -1
  25. package/dist/index.module.js +4 -4
  26. package/dist/index.module.js.map +1 -1
  27. package/dist/order-book/api.d.ts +202 -8
  28. package/dist/order-book/request.d.ts +33 -0
  29. package/dist/order-book/transformOrder.d.ts +7 -1
  30. package/dist/order-book/types.d.ts +3 -0
  31. package/dist/order-signing/orderSigningUtils.d.ts +79 -2
  32. package/dist/order-signing/types.d.ts +28 -1
  33. package/dist/order-signing/utils.d.ts +17 -5
  34. package/dist/package.json +15 -6
  35. package/dist/subgraph/api.d.ts +54 -0
  36. package/dist/subgraph/queries.d.ts +11 -0
  37. package/dist/utils-16a884bc.js +2 -0
  38. package/dist/utils-16a884bc.js.map +1 -0
  39. package/dist/utils-3ea4a36c.js +2 -0
  40. package/dist/utils-3ea4a36c.js.map +1 -0
  41. package/dist/utils-6743154b.js +2 -0
  42. package/dist/utils-6743154b.js.map +1 -0
  43. package/package.json +15 -6
  44. package/dist/index-b3af985a.js +0 -29
  45. package/dist/index-b3af985a.js.map +0 -1
  46. package/dist/order-book/transformError.d.ts +0 -6
  47. package/dist/utils-1129d544.js +0 -2
  48. package/dist/utils-1129d544.js.map +0 -1
  49. package/dist/utils-53748714.js +0 -2
  50. package/dist/utils-53748714.js.map +0 -1
  51. package/dist/utils-e73b1f14.js +0 -2
  52. package/dist/utils-e73b1f14.js.map +0 -1
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Supported chains and their `chainId` for the SDK.
3
+ * @enum
4
+ */
1
5
  export declare enum SupportedChainId {
2
6
  MAINNET = 1,
3
7
  GOERLI = 5,
@@ -1,6 +1,16 @@
1
1
  import { SupportedChainId } from './chains';
2
2
  import { BackoffOptions } from 'exponential-backoff';
3
3
  import { RateLimiterOpts } from 'limiter/dist/esm';
4
+ /**
5
+ * IPFS configuration.
6
+ *
7
+ * For production use, consider using {@link Pinata: https://www.pinata.cloud/}
8
+ * @property {string} [uri] The URI of the IPFS node to use.
9
+ * @property {string} [writeUri] The URI of the IPFS node to use for writing.
10
+ * @property {string} [readUri] The URI of the IPFS node to use for reading.
11
+ * @property {string} [pinataApiKey] The API key to use for Pinata.
12
+ * @property {string} [pinataApiSecret] The API secret to use for Pinata.
13
+ */
4
14
  export interface IpfsConfig {
5
15
  uri?: string;
6
16
  writeUri?: string;
@@ -8,17 +18,55 @@ export interface IpfsConfig {
8
18
  pinataApiKey?: string;
9
19
  pinataApiSecret?: string;
10
20
  }
21
+ /**
22
+ * @property {RateLimiterOpts} [limiterOpts] The options to use for the rate limiter.
23
+ * @property {BackoffOptions} [backoffOpts] The options to use for the backoff.
24
+ */
11
25
  export interface RequestOptions {
12
26
  limiterOpts?: RateLimiterOpts;
13
27
  backoffOpts?: BackoffOptions;
14
28
  }
29
+ /**
30
+ * The environment to use for the Cow API.
31
+ */
15
32
  export type CowEnv = 'prod' | 'staging';
33
+ /**
34
+ * Override some properties of the {@link ApiContext}.
35
+ */
16
36
  export type PartialApiContext = Partial<ApiContext>;
37
+ /**
38
+ * @property {string} [1] The base URL for the mainnet API.
39
+ * @property {string} [5] The base URL for the Goerli testnet API.
40
+ * @property {string} [100] The base URL for the Gnosis Chain API.
41
+ */
17
42
  export type ApiBaseUrls = Record<SupportedChainId, string>;
43
+ /**
44
+ * Define the context to use for the CoW Protocol API.
45
+ *
46
+ * CoW Protocol is a set of smart contracts and off-chain services, deployed on **multiple chains**.
47
+ * {@link SupportedChainId Supported chains} are:
48
+ * - Mainnet
49
+ * - Goerli
50
+ * - Gnosis Chain
51
+ *
52
+ * Each chain has it's own API, and each API has it's own base URL.
53
+ *
54
+ * Options may be selectively overridden by passing a {@link PartialApiContext} to the constructor.
55
+ * @see {@link https://api.cow.fi/docs/#/}
56
+ * @property {SupportedChainId} chainId The `chainId`` corresponding to this CoW Protocol API instance.
57
+ * @property {CowEnv} env The environment that this context corresponds to.
58
+ * @property {ApiBaseUrls} [baseUrls] URls that may be used to connect to this context.
59
+ */
18
60
  export interface ApiContext {
19
61
  chainId: SupportedChainId;
20
62
  env: CowEnv;
21
63
  baseUrls?: ApiBaseUrls;
22
64
  }
65
+ /**
66
+ * The list of available environments.
67
+ */
23
68
  export declare const ENVS_LIST: CowEnv[];
69
+ /**
70
+ * The default CoW Protocol API context.
71
+ */
24
72
  export declare const DEFAULT_COW_API_CONTEXT: ApiContext;
@@ -1,3 +1,20 @@
1
1
  import { SupportedChainId } from './chains';
2
+ export declare const BUY_ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
3
+ export declare const EXTENSIBLE_FALLBACK_HANDLER = "0x2f55e8b20D0B9FEFA187AA7d00B6Cbe563605bF5";
4
+ export declare const COMPOSABLE_COW = "0xfdaFc9d1902f4e0b84f65F49f244b32b31013b74";
5
+ /**
6
+ * The list of supported chains.
7
+ */
2
8
  export declare const ALL_SUPPORTED_CHAIN_IDS: SupportedChainId[];
9
+ /**
10
+ * An object containing the addresses of the CoW Protocol settlement contracts for each supported chain.
11
+ */
3
12
  export declare const COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS: Record<number, string>;
13
+ /**
14
+ * An object containing the addresses of the `ExtensibleFallbackHandler` contracts for each supported chain.
15
+ */
16
+ export declare const EXTENSIBLE_FALLBACK_HANDLER_CONTRACT_ADDRESS: Record<number, string>;
17
+ /**
18
+ * An object containing the addresses of the `ComposableCow` contracts for each supported chain.
19
+ */
20
+ export declare const COMPOSABLE_COW_CONTRACT_ADDRESS: Record<number, string>;
@@ -0,0 +1,160 @@
1
+ import { BigNumber, ethers } from 'ethers';
2
+ import { ContextFactory } from './multiplexer';
3
+ export declare const CONDITIONAL_ORDER_PARAMS_ABI: string[];
4
+ export type ConditionalOrderParams = {
5
+ readonly handler: string;
6
+ readonly salt: string;
7
+ readonly staticInput: string;
8
+ };
9
+ /**
10
+ * An abstract base class from which all conditional orders should inherit.
11
+ *
12
+ * This class provides some basic functionality to help with handling conditional orders,
13
+ * such as:
14
+ * - Validating the conditional order
15
+ * - Creating a human-readable string representation of the conditional order
16
+ * - Serializing the conditional order for use with the `IConditionalOrder` struct
17
+ * - Getting any dependencies for the conditional order
18
+ * - Getting the off-chain input for the conditional order
19
+ *
20
+ * **NOTE**: Instances of conditional orders have an `id` property that is a `keccak256` hash of
21
+ * the serialized conditional order.
22
+ */
23
+ export declare abstract class BaseConditionalOrder<T, P> {
24
+ readonly handler: string;
25
+ readonly salt: string;
26
+ readonly staticInput: T;
27
+ readonly hasOffChainInput: boolean;
28
+ /**
29
+ * A constructor that provides some basic validation for the conditional order.
30
+ *
31
+ * This constructor **MUST** be called by any class that inherits from `BaseConditionalOrder`.
32
+ *
33
+ * **NOTE**: The salt is optional and will be randomly generated if not provided.
34
+ * @param handler The address of the handler for the conditional order.
35
+ * @param salt A 32-byte string used to salt the conditional order.
36
+ * @param staticInput The static input for the conditional order.
37
+ * @param hasOffChainInput Whether the conditional order has off-chain input.
38
+ * @throws If the handler is not a valid ethereum address.
39
+ * @throws If the salt is not a valid 32-byte string.
40
+ */
41
+ constructor(handler: string, salt: string | undefined, staticInput: P, hasOffChainInput?: boolean);
42
+ /**
43
+ * Get the concrete type of the conditional order.
44
+ * @returns {string} The concrete type of the conditional order.
45
+ */
46
+ abstract get orderType(): string;
47
+ /**
48
+ * Get the context dependency for the conditional order.
49
+ *
50
+ * This is used when calling `createWithContext` or `setRootWithContext` on a ComposableCoW-enabled Safe.
51
+ * @returns The context dependency.
52
+ */
53
+ get context(): ContextFactory | undefined;
54
+ /**
55
+ * Get the calldata for creating the conditional order.
56
+ *
57
+ * This will automatically determine whether or not to use `create` or `createWithContext` based on the
58
+ * order type's context dependency.
59
+ *
60
+ * **NOTE**: By default, this will cause the create to emit the `ConditionalOrderCreated` event.
61
+ * @returns The calldata for creating the conditional order.
62
+ */
63
+ get createCalldata(): string;
64
+ /**
65
+ * Get the calldata for removing a conditional order that was created as a single order.
66
+ * @returns The calldata for removing the conditional order.
67
+ */
68
+ get removeCalldata(): string;
69
+ /**
70
+ * Calculate the id of the conditional order.
71
+ *
72
+ * This is a `keccak256` hash of the serialized conditional order.
73
+ * @returns The id of the conditional order.
74
+ */
75
+ get id(): string;
76
+ /**
77
+ * Get the `leaf` of the conditional order. This is the data that is used to create the merkle tree.
78
+ *
79
+ * For the purposes of this library, the `leaf` is the `ConditionalOrderParams` struct.
80
+ * @returns The `leaf` of the conditional order.
81
+ * @see ConditionalOrderParams
82
+ */
83
+ get leaf(): ConditionalOrderParams;
84
+ /**
85
+ * Calculate the id of the conditional order.
86
+ * @param leaf The `leaf` representing the conditional order.
87
+ * @returns The id of the conditional order.
88
+ * @see ConditionalOrderParams
89
+ */
90
+ static leafToId(leaf: ConditionalOrderParams): string;
91
+ /**
92
+ * If the conditional order has off-chain input, return it!
93
+ *
94
+ * **NOTE**: This should be overridden by any conditional order that has off-chain input.
95
+ * @returns The off-chain input.
96
+ */
97
+ get offChainInput(): string;
98
+ /**
99
+ * Helper method for validating ABI types.
100
+ * @param types ABI types to validate against.
101
+ * @param values The values to validate.
102
+ * @returns {boolean} Whether the values are valid ABI for the given types.
103
+ */
104
+ protected static isValidAbi(types: readonly (string | ethers.utils.ParamType)[], values: any[]): boolean;
105
+ /**
106
+ * Create a human-readable string representation of the conditional order.
107
+ * @param tokenFormatter An optional function that takes an address and an amount and returns a human-readable string.
108
+ */
109
+ abstract toString(tokenFormatter?: (address: string, amount: BigNumber) => string): string;
110
+ /**
111
+ * Serializes the conditional order into it's ABI-encoded form.
112
+ *
113
+ * @returns The equivalent of `IConditionalOrder.Params` for the conditional order.
114
+ */
115
+ abstract serialize(): string;
116
+ /**
117
+ * Encode the `staticInput` for the conditional order.
118
+ * @returns The ABI-encoded `staticInput` for the conditional order.
119
+ * @see ConditionalOrderParams
120
+ */
121
+ abstract encodeStaticInput(): string;
122
+ /**
123
+ * A helper function for generically serializing a conditional order's static input.
124
+ * @param orderDataTypes ABI types for the order's data struct.
125
+ * @param staticInput The order's data struct.
126
+ * @returns An ABI-encoded representation of the order's data struct.
127
+ */
128
+ protected encodeStaticInputHelper(orderDataTypes: string[], staticInput: T): string;
129
+ /**
130
+ * Apply any transformations to the parameters that are passed in to the constructor.
131
+ *
132
+ * **NOTE**: This should be overridden by any conditional order that requires transformations.
133
+ * This implementation is a no-op.
134
+ * @param params {P} Parameters that are passed in to the constructor.
135
+ * @returns {T} The static input for the conditional order.
136
+ */
137
+ protected transformParamsToData(params: P): T;
138
+ /**
139
+ * Encode the `ConditionalOrderParams` for the conditional order.
140
+ * @param leaf The `ConditionalOrderParams` struct representing the conditional order as taken from a merkle tree.
141
+ * @returns The ABI-encoded conditional order.
142
+ * @see ConditionalOrderParams
143
+ */
144
+ static encodeParams(leaf: ConditionalOrderParams): string;
145
+ /**
146
+ * Decode the `ConditionalOrderParams` for the conditional order.
147
+ * @param encoded The encoded conditional order.
148
+ * @returns The decoded conditional order.
149
+ */
150
+ static decodeParams(encoded: string): ConditionalOrderParams;
151
+ /**
152
+ * A helper function for generically deserializing a conditional order.
153
+ * @param s The ABI-encoded `IConditionalOrder.Params` struct to deserialize.
154
+ * @param handler Address of the handler for the conditional order.
155
+ * @param orderDataTypes ABI types for the order's data struct.
156
+ * @param callback A callback function that takes the deserialized data struct and the salt and returns an instance of the class.
157
+ * @returns An instance of the conditional order class.
158
+ */
159
+ protected static deserializeHelper<T>(s: string, handler: string, orderDataTypes: string[], callback: (d: any, salt: string) => T): T;
160
+ }
@@ -0,0 +1,6 @@
1
+ import { providers } from 'ethers';
2
+ import { SupportedChainId } from '../common';
3
+ export declare function isExtensibleFallbackHandler(handler: string, chainId: SupportedChainId): boolean;
4
+ export declare function isComposableCow(handler: string, chainId: SupportedChainId): boolean;
5
+ export declare function getDomainVerifier(safe: string, domain: string, chainId: SupportedChainId, provider: providers.Provider): Promise<string>;
6
+ export declare function createSetDomainVerifierTx(domain: string, verifier: string): string;
@@ -0,0 +1,340 @@
1
+ import type { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction, Signer, utils } from "ethers";
2
+ import type { FunctionFragment, Result, EventFragment } from "@ethersproject/abi";
3
+ import type { Listener, Provider } from "@ethersproject/providers";
4
+ import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from "./common";
5
+ export declare namespace IConditionalOrder {
6
+ type ConditionalOrderParamsStruct = {
7
+ handler: string;
8
+ salt: BytesLike;
9
+ staticInput: BytesLike;
10
+ };
11
+ type ConditionalOrderParamsStructOutput = [string, string, string] & {
12
+ handler: string;
13
+ salt: string;
14
+ staticInput: string;
15
+ };
16
+ }
17
+ export declare namespace ComposableCoW {
18
+ type ProofStruct = {
19
+ location: BigNumberish;
20
+ data: BytesLike;
21
+ };
22
+ type ProofStructOutput = [BigNumber, string] & {
23
+ location: BigNumber;
24
+ data: string;
25
+ };
26
+ }
27
+ export declare namespace GPv2Order {
28
+ type DataStruct = {
29
+ sellToken: string;
30
+ buyToken: string;
31
+ receiver: string;
32
+ sellAmount: BigNumberish;
33
+ buyAmount: BigNumberish;
34
+ validTo: BigNumberish;
35
+ appData: BytesLike;
36
+ feeAmount: BigNumberish;
37
+ kind: BytesLike;
38
+ partiallyFillable: boolean;
39
+ sellTokenBalance: BytesLike;
40
+ buyTokenBalance: BytesLike;
41
+ };
42
+ type DataStructOutput = [
43
+ string,
44
+ string,
45
+ string,
46
+ BigNumber,
47
+ BigNumber,
48
+ number,
49
+ string,
50
+ BigNumber,
51
+ string,
52
+ boolean,
53
+ string,
54
+ string
55
+ ] & {
56
+ sellToken: string;
57
+ buyToken: string;
58
+ receiver: string;
59
+ sellAmount: BigNumber;
60
+ buyAmount: BigNumber;
61
+ validTo: number;
62
+ appData: string;
63
+ feeAmount: BigNumber;
64
+ kind: string;
65
+ partiallyFillable: boolean;
66
+ sellTokenBalance: string;
67
+ buyTokenBalance: string;
68
+ };
69
+ }
70
+ export interface ComposableCoWInterface extends utils.Interface {
71
+ functions: {
72
+ "cabinet(address,bytes32)": FunctionFragment;
73
+ "create((address,bytes32,bytes),bool)": FunctionFragment;
74
+ "createWithContext((address,bytes32,bytes),address,bytes,bool)": FunctionFragment;
75
+ "domainSeparator()": FunctionFragment;
76
+ "getTradeableOrderWithSignature(address,(address,bytes32,bytes),bytes,bytes32[])": FunctionFragment;
77
+ "hash((address,bytes32,bytes))": FunctionFragment;
78
+ "isValidSafeSignature(address,address,bytes32,bytes32,bytes32,bytes,bytes)": FunctionFragment;
79
+ "remove(bytes32)": FunctionFragment;
80
+ "roots(address)": FunctionFragment;
81
+ "setRoot(bytes32,(uint256,bytes))": FunctionFragment;
82
+ "setRootWithContext(bytes32,(uint256,bytes),address,bytes)": FunctionFragment;
83
+ "setSwapGuard(address)": FunctionFragment;
84
+ "singleOrders(address,bytes32)": FunctionFragment;
85
+ "swapGuards(address)": FunctionFragment;
86
+ };
87
+ getFunction(nameOrSignatureOrTopic: "cabinet" | "create" | "createWithContext" | "domainSeparator" | "getTradeableOrderWithSignature" | "hash" | "isValidSafeSignature" | "remove" | "roots" | "setRoot" | "setRootWithContext" | "setSwapGuard" | "singleOrders" | "swapGuards"): FunctionFragment;
88
+ encodeFunctionData(functionFragment: "cabinet", values: [string, BytesLike]): string;
89
+ encodeFunctionData(functionFragment: "create", values: [IConditionalOrder.ConditionalOrderParamsStruct, boolean]): string;
90
+ encodeFunctionData(functionFragment: "createWithContext", values: [
91
+ IConditionalOrder.ConditionalOrderParamsStruct,
92
+ string,
93
+ BytesLike,
94
+ boolean
95
+ ]): string;
96
+ encodeFunctionData(functionFragment: "domainSeparator", values?: undefined): string;
97
+ encodeFunctionData(functionFragment: "getTradeableOrderWithSignature", values: [
98
+ string,
99
+ IConditionalOrder.ConditionalOrderParamsStruct,
100
+ BytesLike,
101
+ BytesLike[]
102
+ ]): string;
103
+ encodeFunctionData(functionFragment: "hash", values: [IConditionalOrder.ConditionalOrderParamsStruct]): string;
104
+ encodeFunctionData(functionFragment: "isValidSafeSignature", values: [
105
+ string,
106
+ string,
107
+ BytesLike,
108
+ BytesLike,
109
+ BytesLike,
110
+ BytesLike,
111
+ BytesLike
112
+ ]): string;
113
+ encodeFunctionData(functionFragment: "remove", values: [BytesLike]): string;
114
+ encodeFunctionData(functionFragment: "roots", values: [string]): string;
115
+ encodeFunctionData(functionFragment: "setRoot", values: [BytesLike, ComposableCoW.ProofStruct]): string;
116
+ encodeFunctionData(functionFragment: "setRootWithContext", values: [BytesLike, ComposableCoW.ProofStruct, string, BytesLike]): string;
117
+ encodeFunctionData(functionFragment: "setSwapGuard", values: [string]): string;
118
+ encodeFunctionData(functionFragment: "singleOrders", values: [string, BytesLike]): string;
119
+ encodeFunctionData(functionFragment: "swapGuards", values: [string]): string;
120
+ decodeFunctionResult(functionFragment: "cabinet", data: BytesLike): Result;
121
+ decodeFunctionResult(functionFragment: "create", data: BytesLike): Result;
122
+ decodeFunctionResult(functionFragment: "createWithContext", data: BytesLike): Result;
123
+ decodeFunctionResult(functionFragment: "domainSeparator", data: BytesLike): Result;
124
+ decodeFunctionResult(functionFragment: "getTradeableOrderWithSignature", data: BytesLike): Result;
125
+ decodeFunctionResult(functionFragment: "hash", data: BytesLike): Result;
126
+ decodeFunctionResult(functionFragment: "isValidSafeSignature", data: BytesLike): Result;
127
+ decodeFunctionResult(functionFragment: "remove", data: BytesLike): Result;
128
+ decodeFunctionResult(functionFragment: "roots", data: BytesLike): Result;
129
+ decodeFunctionResult(functionFragment: "setRoot", data: BytesLike): Result;
130
+ decodeFunctionResult(functionFragment: "setRootWithContext", data: BytesLike): Result;
131
+ decodeFunctionResult(functionFragment: "setSwapGuard", data: BytesLike): Result;
132
+ decodeFunctionResult(functionFragment: "singleOrders", data: BytesLike): Result;
133
+ decodeFunctionResult(functionFragment: "swapGuards", data: BytesLike): Result;
134
+ events: {
135
+ "ConditionalOrderCreated(address,(address,bytes32,bytes))": EventFragment;
136
+ "MerkleRootSet(address,bytes32,(uint256,bytes))": EventFragment;
137
+ "SwapGuardSet(address,address)": EventFragment;
138
+ };
139
+ getEvent(nameOrSignatureOrTopic: "ConditionalOrderCreated"): EventFragment;
140
+ getEvent(nameOrSignatureOrTopic: "MerkleRootSet"): EventFragment;
141
+ getEvent(nameOrSignatureOrTopic: "SwapGuardSet"): EventFragment;
142
+ }
143
+ export interface ConditionalOrderCreatedEventObject {
144
+ owner: string;
145
+ params: IConditionalOrder.ConditionalOrderParamsStructOutput;
146
+ }
147
+ export type ConditionalOrderCreatedEvent = TypedEvent<[
148
+ string,
149
+ IConditionalOrder.ConditionalOrderParamsStructOutput
150
+ ], ConditionalOrderCreatedEventObject>;
151
+ export type ConditionalOrderCreatedEventFilter = TypedEventFilter<ConditionalOrderCreatedEvent>;
152
+ export interface MerkleRootSetEventObject {
153
+ owner: string;
154
+ root: string;
155
+ proof: ComposableCoW.ProofStructOutput;
156
+ }
157
+ export type MerkleRootSetEvent = TypedEvent<[
158
+ string,
159
+ string,
160
+ ComposableCoW.ProofStructOutput
161
+ ], MerkleRootSetEventObject>;
162
+ export type MerkleRootSetEventFilter = TypedEventFilter<MerkleRootSetEvent>;
163
+ export interface SwapGuardSetEventObject {
164
+ owner: string;
165
+ swapGuard: string;
166
+ }
167
+ export type SwapGuardSetEvent = TypedEvent<[
168
+ string,
169
+ string
170
+ ], SwapGuardSetEventObject>;
171
+ export type SwapGuardSetEventFilter = TypedEventFilter<SwapGuardSetEvent>;
172
+ export interface ComposableCoW extends BaseContract {
173
+ connect(signerOrProvider: Signer | Provider | string): this;
174
+ attach(addressOrName: string): this;
175
+ deployed(): Promise<this>;
176
+ interface: ComposableCoWInterface;
177
+ queryFilter<TEvent extends TypedEvent>(event: TypedEventFilter<TEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TEvent>>;
178
+ listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>;
179
+ listeners(eventName?: string): Array<Listener>;
180
+ removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this;
181
+ removeAllListeners(eventName?: string): this;
182
+ off: OnEvent<this>;
183
+ on: OnEvent<this>;
184
+ once: OnEvent<this>;
185
+ removeListener: OnEvent<this>;
186
+ functions: {
187
+ cabinet(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<[string]>;
188
+ create(params: IConditionalOrder.ConditionalOrderParamsStruct, dispatch: boolean, overrides?: Overrides & {
189
+ from?: string;
190
+ }): Promise<ContractTransaction>;
191
+ createWithContext(params: IConditionalOrder.ConditionalOrderParamsStruct, factory: string, data: BytesLike, dispatch: boolean, overrides?: Overrides & {
192
+ from?: string;
193
+ }): Promise<ContractTransaction>;
194
+ domainSeparator(overrides?: CallOverrides): Promise<[string]>;
195
+ getTradeableOrderWithSignature(owner: string, params: IConditionalOrder.ConditionalOrderParamsStruct, offchainInput: BytesLike, proof: BytesLike[], overrides?: CallOverrides): Promise<[
196
+ GPv2Order.DataStructOutput,
197
+ string
198
+ ] & {
199
+ order: GPv2Order.DataStructOutput;
200
+ signature: string;
201
+ }>;
202
+ hash(params: IConditionalOrder.ConditionalOrderParamsStruct, overrides?: CallOverrides): Promise<[string]>;
203
+ isValidSafeSignature(safe: string, sender: string, _hash: BytesLike, _domainSeparator: BytesLike, arg4: BytesLike, encodeData: BytesLike, payload: BytesLike, overrides?: CallOverrides): Promise<[string] & {
204
+ magic: string;
205
+ }>;
206
+ remove(singleOrderHash: BytesLike, overrides?: Overrides & {
207
+ from?: string;
208
+ }): Promise<ContractTransaction>;
209
+ roots(arg0: string, overrides?: CallOverrides): Promise<[string]>;
210
+ setRoot(root: BytesLike, proof: ComposableCoW.ProofStruct, overrides?: Overrides & {
211
+ from?: string;
212
+ }): Promise<ContractTransaction>;
213
+ setRootWithContext(root: BytesLike, proof: ComposableCoW.ProofStruct, factory: string, data: BytesLike, overrides?: Overrides & {
214
+ from?: string;
215
+ }): Promise<ContractTransaction>;
216
+ setSwapGuard(swapGuard: string, overrides?: Overrides & {
217
+ from?: string;
218
+ }): Promise<ContractTransaction>;
219
+ singleOrders(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<[boolean]>;
220
+ swapGuards(arg0: string, overrides?: CallOverrides): Promise<[string]>;
221
+ };
222
+ cabinet(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<string>;
223
+ create(params: IConditionalOrder.ConditionalOrderParamsStruct, dispatch: boolean, overrides?: Overrides & {
224
+ from?: string;
225
+ }): Promise<ContractTransaction>;
226
+ createWithContext(params: IConditionalOrder.ConditionalOrderParamsStruct, factory: string, data: BytesLike, dispatch: boolean, overrides?: Overrides & {
227
+ from?: string;
228
+ }): Promise<ContractTransaction>;
229
+ domainSeparator(overrides?: CallOverrides): Promise<string>;
230
+ getTradeableOrderWithSignature(owner: string, params: IConditionalOrder.ConditionalOrderParamsStruct, offchainInput: BytesLike, proof: BytesLike[], overrides?: CallOverrides): Promise<[
231
+ GPv2Order.DataStructOutput,
232
+ string
233
+ ] & {
234
+ order: GPv2Order.DataStructOutput;
235
+ signature: string;
236
+ }>;
237
+ hash(params: IConditionalOrder.ConditionalOrderParamsStruct, overrides?: CallOverrides): Promise<string>;
238
+ isValidSafeSignature(safe: string, sender: string, _hash: BytesLike, _domainSeparator: BytesLike, arg4: BytesLike, encodeData: BytesLike, payload: BytesLike, overrides?: CallOverrides): Promise<string>;
239
+ remove(singleOrderHash: BytesLike, overrides?: Overrides & {
240
+ from?: string;
241
+ }): Promise<ContractTransaction>;
242
+ roots(arg0: string, overrides?: CallOverrides): Promise<string>;
243
+ setRoot(root: BytesLike, proof: ComposableCoW.ProofStruct, overrides?: Overrides & {
244
+ from?: string;
245
+ }): Promise<ContractTransaction>;
246
+ setRootWithContext(root: BytesLike, proof: ComposableCoW.ProofStruct, factory: string, data: BytesLike, overrides?: Overrides & {
247
+ from?: string;
248
+ }): Promise<ContractTransaction>;
249
+ setSwapGuard(swapGuard: string, overrides?: Overrides & {
250
+ from?: string;
251
+ }): Promise<ContractTransaction>;
252
+ singleOrders(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<boolean>;
253
+ swapGuards(arg0: string, overrides?: CallOverrides): Promise<string>;
254
+ callStatic: {
255
+ cabinet(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<string>;
256
+ create(params: IConditionalOrder.ConditionalOrderParamsStruct, dispatch: boolean, overrides?: CallOverrides): Promise<void>;
257
+ createWithContext(params: IConditionalOrder.ConditionalOrderParamsStruct, factory: string, data: BytesLike, dispatch: boolean, overrides?: CallOverrides): Promise<void>;
258
+ domainSeparator(overrides?: CallOverrides): Promise<string>;
259
+ getTradeableOrderWithSignature(owner: string, params: IConditionalOrder.ConditionalOrderParamsStruct, offchainInput: BytesLike, proof: BytesLike[], overrides?: CallOverrides): Promise<[
260
+ GPv2Order.DataStructOutput,
261
+ string
262
+ ] & {
263
+ order: GPv2Order.DataStructOutput;
264
+ signature: string;
265
+ }>;
266
+ hash(params: IConditionalOrder.ConditionalOrderParamsStruct, overrides?: CallOverrides): Promise<string>;
267
+ isValidSafeSignature(safe: string, sender: string, _hash: BytesLike, _domainSeparator: BytesLike, arg4: BytesLike, encodeData: BytesLike, payload: BytesLike, overrides?: CallOverrides): Promise<string>;
268
+ remove(singleOrderHash: BytesLike, overrides?: CallOverrides): Promise<void>;
269
+ roots(arg0: string, overrides?: CallOverrides): Promise<string>;
270
+ setRoot(root: BytesLike, proof: ComposableCoW.ProofStruct, overrides?: CallOverrides): Promise<void>;
271
+ setRootWithContext(root: BytesLike, proof: ComposableCoW.ProofStruct, factory: string, data: BytesLike, overrides?: CallOverrides): Promise<void>;
272
+ setSwapGuard(swapGuard: string, overrides?: CallOverrides): Promise<void>;
273
+ singleOrders(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<boolean>;
274
+ swapGuards(arg0: string, overrides?: CallOverrides): Promise<string>;
275
+ };
276
+ filters: {
277
+ "ConditionalOrderCreated(address,(address,bytes32,bytes))"(owner?: string | null, params?: null): ConditionalOrderCreatedEventFilter;
278
+ ConditionalOrderCreated(owner?: string | null, params?: null): ConditionalOrderCreatedEventFilter;
279
+ "MerkleRootSet(address,bytes32,(uint256,bytes))"(owner?: string | null, root?: null, proof?: null): MerkleRootSetEventFilter;
280
+ MerkleRootSet(owner?: string | null, root?: null, proof?: null): MerkleRootSetEventFilter;
281
+ "SwapGuardSet(address,address)"(owner?: string | null, swapGuard?: null): SwapGuardSetEventFilter;
282
+ SwapGuardSet(owner?: string | null, swapGuard?: null): SwapGuardSetEventFilter;
283
+ };
284
+ estimateGas: {
285
+ cabinet(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
286
+ create(params: IConditionalOrder.ConditionalOrderParamsStruct, dispatch: boolean, overrides?: Overrides & {
287
+ from?: string;
288
+ }): Promise<BigNumber>;
289
+ createWithContext(params: IConditionalOrder.ConditionalOrderParamsStruct, factory: string, data: BytesLike, dispatch: boolean, overrides?: Overrides & {
290
+ from?: string;
291
+ }): Promise<BigNumber>;
292
+ domainSeparator(overrides?: CallOverrides): Promise<BigNumber>;
293
+ getTradeableOrderWithSignature(owner: string, params: IConditionalOrder.ConditionalOrderParamsStruct, offchainInput: BytesLike, proof: BytesLike[], overrides?: CallOverrides): Promise<BigNumber>;
294
+ hash(params: IConditionalOrder.ConditionalOrderParamsStruct, overrides?: CallOverrides): Promise<BigNumber>;
295
+ isValidSafeSignature(safe: string, sender: string, _hash: BytesLike, _domainSeparator: BytesLike, arg4: BytesLike, encodeData: BytesLike, payload: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
296
+ remove(singleOrderHash: BytesLike, overrides?: Overrides & {
297
+ from?: string;
298
+ }): Promise<BigNumber>;
299
+ roots(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;
300
+ setRoot(root: BytesLike, proof: ComposableCoW.ProofStruct, overrides?: Overrides & {
301
+ from?: string;
302
+ }): Promise<BigNumber>;
303
+ setRootWithContext(root: BytesLike, proof: ComposableCoW.ProofStruct, factory: string, data: BytesLike, overrides?: Overrides & {
304
+ from?: string;
305
+ }): Promise<BigNumber>;
306
+ setSwapGuard(swapGuard: string, overrides?: Overrides & {
307
+ from?: string;
308
+ }): Promise<BigNumber>;
309
+ singleOrders(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<BigNumber>;
310
+ swapGuards(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;
311
+ };
312
+ populateTransaction: {
313
+ cabinet(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<PopulatedTransaction>;
314
+ create(params: IConditionalOrder.ConditionalOrderParamsStruct, dispatch: boolean, overrides?: Overrides & {
315
+ from?: string;
316
+ }): Promise<PopulatedTransaction>;
317
+ createWithContext(params: IConditionalOrder.ConditionalOrderParamsStruct, factory: string, data: BytesLike, dispatch: boolean, overrides?: Overrides & {
318
+ from?: string;
319
+ }): Promise<PopulatedTransaction>;
320
+ domainSeparator(overrides?: CallOverrides): Promise<PopulatedTransaction>;
321
+ getTradeableOrderWithSignature(owner: string, params: IConditionalOrder.ConditionalOrderParamsStruct, offchainInput: BytesLike, proof: BytesLike[], overrides?: CallOverrides): Promise<PopulatedTransaction>;
322
+ hash(params: IConditionalOrder.ConditionalOrderParamsStruct, overrides?: CallOverrides): Promise<PopulatedTransaction>;
323
+ isValidSafeSignature(safe: string, sender: string, _hash: BytesLike, _domainSeparator: BytesLike, arg4: BytesLike, encodeData: BytesLike, payload: BytesLike, overrides?: CallOverrides): Promise<PopulatedTransaction>;
324
+ remove(singleOrderHash: BytesLike, overrides?: Overrides & {
325
+ from?: string;
326
+ }): Promise<PopulatedTransaction>;
327
+ roots(arg0: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
328
+ setRoot(root: BytesLike, proof: ComposableCoW.ProofStruct, overrides?: Overrides & {
329
+ from?: string;
330
+ }): Promise<PopulatedTransaction>;
331
+ setRootWithContext(root: BytesLike, proof: ComposableCoW.ProofStruct, factory: string, data: BytesLike, overrides?: Overrides & {
332
+ from?: string;
333
+ }): Promise<PopulatedTransaction>;
334
+ setSwapGuard(swapGuard: string, overrides?: Overrides & {
335
+ from?: string;
336
+ }): Promise<PopulatedTransaction>;
337
+ singleOrders(arg0: string, arg1: BytesLike, overrides?: CallOverrides): Promise<PopulatedTransaction>;
338
+ swapGuards(arg0: string, overrides?: CallOverrides): Promise<PopulatedTransaction>;
339
+ };
340
+ }