@cowprotocol/sdk-contracts-ts 2.5.0 → 3.0.1
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.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -6
- package/dist/index.mjs +12 -6
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1314,6 +1314,6 @@ declare function getTypedDataV3Signer(signer: Signer): AbstractSigner<unknown>;
|
|
|
1314
1314
|
*/
|
|
1315
1315
|
declare function getIntChainIdTypedDataV4Signer(signer: Signer): AbstractSigner<unknown>;
|
|
1316
1316
|
|
|
1317
|
-
declare const CONTRACTS_PKG_VERSION = "
|
|
1317
|
+
declare const CONTRACTS_PKG_VERSION = "3.0.1";
|
|
1318
1318
|
|
|
1319
1319
|
export { AllowListReader, Api, type ApiCall, type ApiError, type ArtifactDeployment, BUY_ETH_ADDRESS, type BatchSwapStep, type BuyAmountAfterFee, CANCELLATIONS_TYPE_FIELDS, CONTRACTS_PKG_VERSION, CONTRACT_NAMES, type CallError, type CommonQuoteQuery, type ContractName, type EcdsaSignature as ContractsEcdsaSignature, type EcdsaSigningScheme as ContractsEcdsaSigningScheme, type Order as ContractsOrder, type OrderCancellations as ContractsOrderCancellations, OrderKind as ContractsOrderKind, type Signature as ContractsSignature, SigningScheme as ContractsSigningScheme, type Trade as ContractsTrade, ContractsTs, DEPLOYER_CONTRACT, type DeploymentArguments, EIP1271_MAGICVALUE, EIP173_PROXY_ABI, type Eip1271Signature, type Eip1271SignatureData, type EncodedSettlement, type EncodedSwap, Environment, type EstimateTradeAmountQuery, FLAG_MASKS, type FlagKey, type FlagOptions, type FlagValue, type GetExecutedSellAmountQuery, GetQuoteErrorType, type GetQuoteResponse, type HashLike, type Interaction, type InteractionLike, InteractionStage, LIMIT_CONCURRENT_REQUESTS, type MaybeNamedArtifactArtifactDeployment, type NamedArtifactDeployment, type NormalizedOrder, ORDER_TYPE_FIELDS, ORDER_TYPE_HASH, ORDER_UID_LENGTH, OrderBalance, type OrderDetailResponse, type OrderFlags, type OrderRefunds, type OrderUidParams, PRE_SIGNED, type PlaceOrderQuery, type PreSignSignature, type Prices, QuotePriceQuality, type QuoteQuery, SALT, type SellAmountAfterFee, type SellAmountBeforeFee, SettlementEncoder, SettlementReader, type Swap, SwapEncoder, type SwapExecution, type Timestamp, TokenRegistry, type TradeExecution, type TradeFlags, type TradeSimulation, type TradeSimulationBalanceDelta, type TradeSimulationResult, TradeSimulator, apiUrl, computeOrderUid, decodeEip1271SignatureData, decodeOrder, decodeOrderFlags, decodeSignatureOwner, decodeSigningScheme, decodeTradeFlags, deterministicDeploymentAddress, ecdsaSignTypedData, encodeEip1271SignatureData, encodeOrderFlags, encodeSignatureData, encodeSigningScheme, encodeSwapStep, encodeTrade, encodeTradeFlags, extractOrderUidParams, getIntChainIdTypedDataV4Signer, getTypedDataV3Signer, getTypedDataVersionedSigner, grantRequiredRoles, hashOrder, hashOrderCancellation, hashOrderCancellations, hashTypedData, hashify, implementationAddress, normalizeBuyTokenBalance, normalizeInteraction, normalizeInteractions, normalizeOrder, ownerAddress, packOrderUidParams, signOrder, signOrderCancellation, signOrderCancellations, timestamp };
|
package/dist/index.d.ts
CHANGED
|
@@ -1314,6 +1314,6 @@ declare function getTypedDataV3Signer(signer: Signer): AbstractSigner<unknown>;
|
|
|
1314
1314
|
*/
|
|
1315
1315
|
declare function getIntChainIdTypedDataV4Signer(signer: Signer): AbstractSigner<unknown>;
|
|
1316
1316
|
|
|
1317
|
-
declare const CONTRACTS_PKG_VERSION = "
|
|
1317
|
+
declare const CONTRACTS_PKG_VERSION = "3.0.1";
|
|
1318
1318
|
|
|
1319
1319
|
export { AllowListReader, Api, type ApiCall, type ApiError, type ArtifactDeployment, BUY_ETH_ADDRESS, type BatchSwapStep, type BuyAmountAfterFee, CANCELLATIONS_TYPE_FIELDS, CONTRACTS_PKG_VERSION, CONTRACT_NAMES, type CallError, type CommonQuoteQuery, type ContractName, type EcdsaSignature as ContractsEcdsaSignature, type EcdsaSigningScheme as ContractsEcdsaSigningScheme, type Order as ContractsOrder, type OrderCancellations as ContractsOrderCancellations, OrderKind as ContractsOrderKind, type Signature as ContractsSignature, SigningScheme as ContractsSigningScheme, type Trade as ContractsTrade, ContractsTs, DEPLOYER_CONTRACT, type DeploymentArguments, EIP1271_MAGICVALUE, EIP173_PROXY_ABI, type Eip1271Signature, type Eip1271SignatureData, type EncodedSettlement, type EncodedSwap, Environment, type EstimateTradeAmountQuery, FLAG_MASKS, type FlagKey, type FlagOptions, type FlagValue, type GetExecutedSellAmountQuery, GetQuoteErrorType, type GetQuoteResponse, type HashLike, type Interaction, type InteractionLike, InteractionStage, LIMIT_CONCURRENT_REQUESTS, type MaybeNamedArtifactArtifactDeployment, type NamedArtifactDeployment, type NormalizedOrder, ORDER_TYPE_FIELDS, ORDER_TYPE_HASH, ORDER_UID_LENGTH, OrderBalance, type OrderDetailResponse, type OrderFlags, type OrderRefunds, type OrderUidParams, PRE_SIGNED, type PlaceOrderQuery, type PreSignSignature, type Prices, QuotePriceQuality, type QuoteQuery, SALT, type SellAmountAfterFee, type SellAmountBeforeFee, SettlementEncoder, SettlementReader, type Swap, SwapEncoder, type SwapExecution, type Timestamp, TokenRegistry, type TradeExecution, type TradeFlags, type TradeSimulation, type TradeSimulationBalanceDelta, type TradeSimulationResult, TradeSimulator, apiUrl, computeOrderUid, decodeEip1271SignatureData, decodeOrder, decodeOrderFlags, decodeSignatureOwner, decodeSigningScheme, decodeTradeFlags, deterministicDeploymentAddress, ecdsaSignTypedData, encodeEip1271SignatureData, encodeOrderFlags, encodeSignatureData, encodeSigningScheme, encodeSwapStep, encodeTrade, encodeTradeFlags, extractOrderUidParams, getIntChainIdTypedDataV4Signer, getTypedDataV3Signer, getTypedDataVersionedSigner, grantRequiredRoles, hashOrder, hashOrderCancellation, hashOrderCancellations, hashTypedData, hashify, implementationAddress, normalizeBuyTokenBalance, normalizeInteraction, normalizeInteractions, normalizeOrder, ownerAddress, packOrderUidParams, signOrder, signOrderCancellation, signOrderCancellations, timestamp };
|
package/dist/index.js
CHANGED
|
@@ -894,16 +894,16 @@ var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
|
894
894
|
return Environment2;
|
|
895
895
|
})(Environment || {});
|
|
896
896
|
var LIMIT_CONCURRENT_REQUESTS = 5;
|
|
897
|
-
var PARTNER_PROD_BASE_URL = "https://partners.cow.
|
|
898
|
-
var PARTNER_DEV_BASE_URL = "https://partners.barn.cow.
|
|
897
|
+
var PARTNER_PROD_BASE_URL = "https://partners.cow.fi";
|
|
898
|
+
var PARTNER_DEV_BASE_URL = "https://partners.barn.cow.fi";
|
|
899
899
|
function apiUrl(environment, network, apiKey) {
|
|
900
900
|
let baseUrl;
|
|
901
901
|
switch (environment) {
|
|
902
902
|
case 0 /* Dev */:
|
|
903
|
-
baseUrl = apiKey ? PARTNER_DEV_BASE_URL : "https://barn.api.cow.
|
|
903
|
+
baseUrl = apiKey ? PARTNER_DEV_BASE_URL : "https://barn.api.cow.fi";
|
|
904
904
|
break;
|
|
905
905
|
case 1 /* Prod */:
|
|
906
|
-
baseUrl = apiKey ? PARTNER_PROD_BASE_URL : "https://api.cow.
|
|
906
|
+
baseUrl = apiKey ? PARTNER_PROD_BASE_URL : "https://api.cow.fi";
|
|
907
907
|
break;
|
|
908
908
|
default:
|
|
909
909
|
throw new Error("Invalid environment");
|
|
@@ -997,7 +997,13 @@ async function estimateTradeAmount({
|
|
|
997
997
|
const estimatedAmount = kind == "sell" /* SELL */ ? quote.buyAmount : quote.sellAmount;
|
|
998
998
|
return (0, import_sdk_common9.getGlobalAdapter)().utils.toBigIntish(estimatedAmount);
|
|
999
999
|
}
|
|
1000
|
-
async function placeOrder({
|
|
1000
|
+
async function placeOrder({
|
|
1001
|
+
order,
|
|
1002
|
+
signature,
|
|
1003
|
+
baseUrl,
|
|
1004
|
+
from,
|
|
1005
|
+
apiKey
|
|
1006
|
+
}) {
|
|
1001
1007
|
const normalizedOrder = normalizeOrder(order);
|
|
1002
1008
|
const adapter = (0, import_sdk_common9.getGlobalAdapter)();
|
|
1003
1009
|
return await call(
|
|
@@ -1201,7 +1207,7 @@ function getIntChainIdTypedDataV4Signer(signer) {
|
|
|
1201
1207
|
}
|
|
1202
1208
|
|
|
1203
1209
|
// src/generated/packageVersion.ts
|
|
1204
|
-
var CONTRACTS_PKG_VERSION = "
|
|
1210
|
+
var CONTRACTS_PKG_VERSION = "3.0.1";
|
|
1205
1211
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1206
1212
|
0 && (module.exports = {
|
|
1207
1213
|
AllowListReader,
|
package/dist/index.mjs
CHANGED
|
@@ -807,16 +807,16 @@ var Environment = /* @__PURE__ */ ((Environment2) => {
|
|
|
807
807
|
return Environment2;
|
|
808
808
|
})(Environment || {});
|
|
809
809
|
var LIMIT_CONCURRENT_REQUESTS = 5;
|
|
810
|
-
var PARTNER_PROD_BASE_URL = "https://partners.cow.
|
|
811
|
-
var PARTNER_DEV_BASE_URL = "https://partners.barn.cow.
|
|
810
|
+
var PARTNER_PROD_BASE_URL = "https://partners.cow.fi";
|
|
811
|
+
var PARTNER_DEV_BASE_URL = "https://partners.barn.cow.fi";
|
|
812
812
|
function apiUrl(environment, network, apiKey) {
|
|
813
813
|
let baseUrl;
|
|
814
814
|
switch (environment) {
|
|
815
815
|
case 0 /* Dev */:
|
|
816
|
-
baseUrl = apiKey ? PARTNER_DEV_BASE_URL : "https://barn.api.cow.
|
|
816
|
+
baseUrl = apiKey ? PARTNER_DEV_BASE_URL : "https://barn.api.cow.fi";
|
|
817
817
|
break;
|
|
818
818
|
case 1 /* Prod */:
|
|
819
|
-
baseUrl = apiKey ? PARTNER_PROD_BASE_URL : "https://api.cow.
|
|
819
|
+
baseUrl = apiKey ? PARTNER_PROD_BASE_URL : "https://api.cow.fi";
|
|
820
820
|
break;
|
|
821
821
|
default:
|
|
822
822
|
throw new Error("Invalid environment");
|
|
@@ -910,7 +910,13 @@ async function estimateTradeAmount({
|
|
|
910
910
|
const estimatedAmount = kind == "sell" /* SELL */ ? quote.buyAmount : quote.sellAmount;
|
|
911
911
|
return getGlobalAdapter7().utils.toBigIntish(estimatedAmount);
|
|
912
912
|
}
|
|
913
|
-
async function placeOrder({
|
|
913
|
+
async function placeOrder({
|
|
914
|
+
order,
|
|
915
|
+
signature,
|
|
916
|
+
baseUrl,
|
|
917
|
+
from,
|
|
918
|
+
apiKey
|
|
919
|
+
}) {
|
|
914
920
|
const normalizedOrder = normalizeOrder(order);
|
|
915
921
|
const adapter = getGlobalAdapter7();
|
|
916
922
|
return await call(
|
|
@@ -1114,7 +1120,7 @@ function getIntChainIdTypedDataV4Signer(signer) {
|
|
|
1114
1120
|
}
|
|
1115
1121
|
|
|
1116
1122
|
// src/generated/packageVersion.ts
|
|
1117
|
-
var CONTRACTS_PKG_VERSION = "
|
|
1123
|
+
var CONTRACTS_PKG_VERSION = "3.0.1";
|
|
1118
1124
|
export {
|
|
1119
1125
|
AllowListReader,
|
|
1120
1126
|
Api,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cowprotocol/sdk-contracts-ts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "TypeScript contract bindings for CoW Protocol SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cowprotocol/sdk-common": "0.10.
|
|
23
|
-
"@cowprotocol/sdk-config": "
|
|
22
|
+
"@cowprotocol/sdk-common": "0.10.2",
|
|
23
|
+
"@cowprotocol/sdk-config": "2.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/jest": "^29.5.5",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"tsup": "^7.2.0",
|
|
34
34
|
"typescript": "^5.2.2",
|
|
35
35
|
"viem": "^2.28.4",
|
|
36
|
-
"@cowprotocol/sdk-ethers-v5-adapter": "0.4.
|
|
36
|
+
"@cowprotocol/sdk-ethers-v5-adapter": "0.4.4",
|
|
37
|
+
"@cowprotocol/sdk-ethers-v6-adapter": "0.4.4",
|
|
37
38
|
"@cow-sdk/typescript-config": "0.0.0-beta.0",
|
|
38
|
-
"@cowprotocol/sdk-
|
|
39
|
-
"@cowprotocol/sdk-viem-adapter": "0.3.17"
|
|
39
|
+
"@cowprotocol/sdk-viem-adapter": "0.3.18"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|