@cowprotocol/sdk-viem-adapter 0.1.2 → 0.1.3

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 CHANGED
@@ -81,13 +81,7 @@ declare class ViemUtils implements AdapterUtils {
81
81
  name: string;
82
82
  type: string;
83
83
  }>>, value: Record<string, unknown>, signature: `0x${string}`): Promise<`0x${string}`>;
84
- encodeFunction(abi: Array<{
85
- name: string;
86
- inputs: Array<{
87
- type: string;
88
- }>;
89
- type: string;
90
- }>, functionName: string, args: ContractValue[]): string;
84
+ encodeFunction(abi: Abi, functionName: string, args: ContractValue[]): string;
91
85
  decodeFunctionData(abi: Array<{
92
86
  name: string;
93
87
  inputs: Array<{
package/dist/index.d.ts CHANGED
@@ -81,13 +81,7 @@ declare class ViemUtils implements AdapterUtils {
81
81
  name: string;
82
82
  type: string;
83
83
  }>>, value: Record<string, unknown>, signature: `0x${string}`): Promise<`0x${string}`>;
84
- encodeFunction(abi: Array<{
85
- name: string;
86
- inputs: Array<{
87
- type: string;
88
- }>;
89
- type: string;
90
- }>, functionName: string, args: ContractValue[]): string;
84
+ encodeFunction(abi: Abi, functionName: string, args: ContractValue[]): string;
91
85
  decodeFunctionData(abi: Array<{
92
86
  name: string;
93
87
  inputs: Array<{
package/dist/index.js CHANGED
@@ -335,7 +335,7 @@ var ViemUtils = class {
335
335
  return (0, import_viem2.decodeAbiParameters)(types, data);
336
336
  }
337
337
  id(text) {
338
- return (0, import_viem2.keccak256)((0, import_viem2.stringToHex)(text));
338
+ return (0, import_viem2.keccak256)((0, import_viem2.toBytes)(text));
339
339
  }
340
340
  toBigIntish(value) {
341
341
  if (typeof value === "number")
package/dist/index.mjs CHANGED
@@ -30,7 +30,6 @@ import {
30
30
  getAddress,
31
31
  encodeAbiParameters,
32
32
  decodeAbiParameters as decodeAbiParameters2,
33
- stringToHex,
34
33
  hexToBigInt,
35
34
  slice,
36
35
  parseAbi as parseAbi2,
@@ -44,7 +43,8 @@ import {
44
43
  isAddress,
45
44
  isHex,
46
45
  parseUnits,
47
- sliceHex
46
+ sliceHex,
47
+ toBytes
48
48
  } from "viem";
49
49
 
50
50
  // src/ViemInterfaceWrapper.ts
@@ -356,7 +356,7 @@ var ViemUtils = class {
356
356
  return decodeAbiParameters2(types, data);
357
357
  }
358
358
  id(text) {
359
- return keccak256(stringToHex(text));
359
+ return keccak256(toBytes(text));
360
360
  }
361
361
  toBigIntish(value) {
362
362
  if (typeof value === "number")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-viem-adapter",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Viem adapter for CoW Protocol SDK",
5
5
  "main": "dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -13,7 +13,7 @@
13
13
  "access": "public"
14
14
  },
15
15
  "dependencies": {
16
- "@cowprotocol/sdk-common": "0.2.1"
16
+ "@cowprotocol/sdk-common": "0.2.2"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "viem": "^2.28.4"