@clober/v2-sdk 0.0.11 → 0.0.13

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.
@@ -62,7 +62,7 @@ export declare const BOOK_VIEWER_ABI: readonly [{
62
62
  readonly type: "uint256";
63
63
  }, {
64
64
  readonly internalType: "uint256";
65
- readonly name: "spendBaseAmount";
65
+ readonly name: "spentBaseAmount";
66
66
  readonly type: "uint256";
67
67
  }];
68
68
  readonly stateMutability: "view";
@@ -101,7 +101,7 @@ export declare const BOOK_VIEWER_ABI: readonly [{
101
101
  readonly type: "uint256";
102
102
  }, {
103
103
  readonly internalType: "uint256";
104
- readonly name: "spendBaseAmount";
104
+ readonly name: "spentBaseAmount";
105
105
  readonly type: "uint256";
106
106
  }];
107
107
  readonly stateMutability: "view";
@@ -87,13 +87,13 @@ export declare const limitOrder: (args: {
87
87
  transaction: Transaction;
88
88
  result: {
89
89
  make: CurrencyFlow;
90
- take: CurrencyFlow;
90
+ taken: CurrencyFlow;
91
91
  };
92
92
  }>;
93
93
  /**
94
94
  * Executes a market order on the specified chain for trading tokens.
95
95
  * If only `amountIn` is provided, spend the specified amount of input tokens.
96
- * If `amountIn` and `amountOut` are provided, take the appropriate amount of output tokens with the specified input amount.
96
+ * If only `amountOut` is provided, take the specified amount of output tokens.
97
97
  *
98
98
  * @param {CHAIN_IDS} chainId The chain ID.
99
99
  * @param {`0x${string}`} userAddress The Ethereum address of the user placing the order.
@@ -106,7 +106,7 @@ export declare const limitOrder: (args: {
106
106
  * @param {string} [options.rpcUrl] The RPC URL of the blockchain.
107
107
  * @param {number} [options.slippage] The maximum slippage percentage allowed for the order.
108
108
  * if the slippage is not provided, unlimited slippage is allowed.
109
- * @returns {Promise<{ transaction: Transaction, result: { spend: CurrencyFlow, take: CurrencyFlow } }>}
109
+ * @returns {Promise<{ transaction: Transaction, result: { spent: CurrencyFlow, taken: CurrencyFlow } }>}
110
110
  * Promise resolving to the transaction object representing the market order with the result of the order.
111
111
  * @example
112
112
  * import { signERC20Permit, marketOrder } from '@clober/v2-sdk'
@@ -134,7 +134,7 @@ export declare const marketOrder: (args: {
134
134
  userAddress: `0x${string}`;
135
135
  inputToken: `0x${string}`;
136
136
  outputToken: `0x${string}`;
137
- amountIn: string;
137
+ amountIn?: string;
138
138
  amountOut?: string;
139
139
  options?: {
140
140
  erc20PermitParam?: ERC20PermitParam;
@@ -143,8 +143,8 @@ export declare const marketOrder: (args: {
143
143
  }) => Promise<{
144
144
  transaction: Transaction;
145
145
  result: {
146
- take: CurrencyFlow;
147
- spend: CurrencyFlow;
146
+ taken: CurrencyFlow;
147
+ spent: CurrencyFlow;
148
148
  };
149
149
  }>;
150
150
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/call.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,WAAW,EACZ,MAAM,QAAQ,CAAA;AAkBf;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU;aAOV,SAAS;gBACN,KAAK,MAAM,EAAE;iBACZ,KAAK,MAAM,EAAE;cAChB,cAAc;sCAqC3B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,UAAU;aAUV,SAAS;iBACL,KAAK,MAAM,EAAE;gBACd,KAAK,MAAM,EAAE;iBACZ,KAAK,MAAM,EAAE;YAClB,MAAM;WACP,MAAM;cACH;QACR,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;QACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,cAAc;;iBAEL,WAAW;YAChB;QACN,IAAI,EAAE,YAAY,CAAA;QAClB,IAAI,EAAE,YAAY,CAAA;KACnB;EAiIJ,CAAA;AAED;;;;;;;;;;;;;;;;;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iBACC,WAAW;YAAU,YAAY,EAAE;EA+E/D,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,WAAW;aAOX,SAAS;iBACL,KAAK,MAAM,EAAE;QACtB,MAAM;cACA,cAAc;;iBACC,WAAW;YAAU,YAAY;EAY7D,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,YAAY;aAOZ,SAAS;iBACL,KAAK,MAAM,EAAE;SACrB,MAAM,EAAE;cACH,cAAc;;iBACC,WAAW;YAAU,YAAY,EAAE;EAiF/D,CAAA"}
@@ -41,14 +41,14 @@ export declare class Book {
41
41
  amountOut: bigint;
42
42
  }) => {
43
43
  takenQuoteAmount: bigint;
44
- spendBaseAmount: bigint;
44
+ spentBaseAmount: bigint;
45
45
  };
46
46
  spend: ({ limitPrice, amountIn, }: {
47
47
  limitPrice: bigint;
48
48
  amountIn: bigint;
49
49
  }) => {
50
50
  takenQuoteAmount: bigint;
51
- spendBaseAmount: bigint;
51
+ spentBaseAmount: bigint;
52
52
  };
53
53
  }
54
54
  //# sourceMappingURL=book.d.ts.map
@@ -26,16 +26,16 @@ export declare class Market {
26
26
  amountOut: bigint;
27
27
  }) => {
28
28
  takenQuoteAmount: bigint;
29
- spendBaseAmount: bigint;
29
+ spentBaseAmount: bigint;
30
30
  bookId: bigint;
31
31
  };
32
- spend: ({ spendBase, limitPrice, amountIn, }: {
33
- spendBase: boolean;
32
+ spend: ({ spentBase, limitPrice, amountIn, }: {
33
+ spentBase: boolean;
34
34
  limitPrice: bigint;
35
35
  amountIn: bigint;
36
36
  }) => {
37
37
  takenQuoteAmount: bigint;
38
- spendBaseAmount: bigint;
38
+ spentBaseAmount: bigint;
39
39
  bookId: bigint;
40
40
  };
41
41
  }
@@ -43,7 +43,7 @@ export declare const getMarket: (args: {
43
43
  * @example
44
44
  * import { getExpectedOutput } from '@clober/v2-sdk'
45
45
  *
46
- * const { takenAmount, spendAmount } = await getExpectedOutput({
46
+ * const { takenAmount, spentAmount } = await getExpectedOutput({
47
47
  * chainId: 421614,
48
48
  * inputToken: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
49
49
  * outputToken: '0x0000000000000000000000000000000000000000',
@@ -60,7 +60,7 @@ export declare const getExpectedOutput: (args: {
60
60
  } & DefaultOptions;
61
61
  }) => Promise<{
62
62
  takenAmount: string;
63
- spendAmount: string;
63
+ spentAmount: string;
64
64
  bookId: bigint;
65
65
  }>;
66
66
  /**
@@ -73,11 +73,11 @@ export declare const getExpectedOutput: (args: {
73
73
  * @param options
74
74
  * @param options.limitPrice The maximum limit price to take.
75
75
  * @param options.rpcUrl The RPC URL of the blockchain.
76
- * @returns A Promise resolving to an object containing the taken amount, spend amount and result of the calculation.
76
+ * @returns A Promise resolving to an object containing the taken amount, spent amount and result of the calculation.
77
77
  * @example
78
78
  * import { getExpectedInput } from '@clober/v2-sdk'
79
79
  *
80
- * const { takenAmount, spendAmount } = await getExpectedInput({
80
+ * const { takenAmount, spentAmount } = await getExpectedInput({
81
81
  * chainId: 421614,
82
82
  * inputToken: '0x00bfd44e79fb7f6dd5887a9426c8ef85a0cd23e0',
83
83
  * outputToken: '0x0000000000000000000000000000000000000000',
@@ -94,7 +94,7 @@ export declare const getExpectedInput: (args: {
94
94
  } & DefaultOptions;
95
95
  }) => Promise<{
96
96
  takenAmount: string;
97
- spendAmount: string;
97
+ spentAmount: string;
98
98
  bookId: bigint;
99
99
  }>;
100
100
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clober/v2-sdk",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "🛠 An SDK for building applications on top of Clober V2",
5
5
  "files": [
6
6
  "dist"