@trustvc/trustvc 1.4.0 → 1.4.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.
@@ -29,8 +29,17 @@ const calldata = /* @__PURE__ */ __name(async (provider, functionSignature, cont
29
29
  });
30
30
  return ethers$1.ethers.utils.getAddress(ethers$1.ethers.utils.hexDataSlice(result, 12));
31
31
  }, "calldata");
32
- const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleEscrowFactoryAddress, tokenRegistryAddress, tokenId) => {
32
+ const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleEscrowFactoryAddress, tokenRegistryAddress, tokenId, options) => {
33
33
  try {
34
+ if (options?.titleEscrowVersion === "v4") {
35
+ return await calldata(
36
+ provider,
37
+ "getAddress(address,uint256)",
38
+ titleEscrowFactoryAddress,
39
+ ["address", "uint256"],
40
+ [tokenRegistryAddress, tokenId]
41
+ );
42
+ }
34
43
  return await calldata(
35
44
  provider,
36
45
  "getEscrowAddress(address,uint256)",
@@ -39,6 +48,15 @@ const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleE
39
48
  [tokenRegistryAddress, tokenId]
40
49
  );
41
50
  } catch {
51
+ if (options?.titleEscrowVersion === "v4") {
52
+ return await calldata(
53
+ provider,
54
+ "getEscrowAddress(address,uint256)",
55
+ titleEscrowFactoryAddress,
56
+ ["address", "uint256"],
57
+ [tokenRegistryAddress, tokenId]
58
+ );
59
+ }
42
60
  return await calldata(
43
61
  provider,
44
62
  "getAddress(address,uint256)",
@@ -48,7 +66,7 @@ const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleE
48
66
  );
49
67
  }
50
68
  }, "resolveTitleEscrowAddress");
51
- const getTitleEscrowAddress = /* @__PURE__ */ __name(async (tokenRegistryAddress, tokenId, provider) => {
69
+ const getTitleEscrowAddress = /* @__PURE__ */ __name(async (tokenRegistryAddress, tokenId, provider, options) => {
52
70
  const Contract = ethers.getEthersContractFromProvider(provider);
53
71
  const tokenRegistryAbi = [
54
72
  "function titleEscrowFactory() external view returns (address)",
@@ -64,7 +82,8 @@ const getTitleEscrowAddress = /* @__PURE__ */ __name(async (tokenRegistryAddress
64
82
  provider,
65
83
  titleEscrowFactoryAddress,
66
84
  tokenRegistryAddress,
67
- tokenId
85
+ tokenId,
86
+ options
68
87
  );
69
88
  }, "getTitleEscrowAddress");
70
89
  const checkSupportsInterface = /* @__PURE__ */ __name(async (titleEscrowAddress, interfaceId, provider) => {
@@ -27,8 +27,17 @@ const calldata = /* @__PURE__ */ __name(async (provider, functionSignature, cont
27
27
  });
28
28
  return ethers.utils.getAddress(ethers.utils.hexDataSlice(result, 12));
29
29
  }, "calldata");
30
- const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleEscrowFactoryAddress, tokenRegistryAddress, tokenId) => {
30
+ const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleEscrowFactoryAddress, tokenRegistryAddress, tokenId, options) => {
31
31
  try {
32
+ if (options?.titleEscrowVersion === "v4") {
33
+ return await calldata(
34
+ provider,
35
+ "getAddress(address,uint256)",
36
+ titleEscrowFactoryAddress,
37
+ ["address", "uint256"],
38
+ [tokenRegistryAddress, tokenId]
39
+ );
40
+ }
32
41
  return await calldata(
33
42
  provider,
34
43
  "getEscrowAddress(address,uint256)",
@@ -37,6 +46,15 @@ const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleE
37
46
  [tokenRegistryAddress, tokenId]
38
47
  );
39
48
  } catch {
49
+ if (options?.titleEscrowVersion === "v4") {
50
+ return await calldata(
51
+ provider,
52
+ "getEscrowAddress(address,uint256)",
53
+ titleEscrowFactoryAddress,
54
+ ["address", "uint256"],
55
+ [tokenRegistryAddress, tokenId]
56
+ );
57
+ }
40
58
  return await calldata(
41
59
  provider,
42
60
  "getAddress(address,uint256)",
@@ -46,7 +64,7 @@ const resolveTitleEscrowAddress = /* @__PURE__ */ __name(async (provider, titleE
46
64
  );
47
65
  }
48
66
  }, "resolveTitleEscrowAddress");
49
- const getTitleEscrowAddress = /* @__PURE__ */ __name(async (tokenRegistryAddress, tokenId, provider) => {
67
+ const getTitleEscrowAddress = /* @__PURE__ */ __name(async (tokenRegistryAddress, tokenId, provider, options) => {
50
68
  const Contract = getEthersContractFromProvider(provider);
51
69
  const tokenRegistryAbi = [
52
70
  "function titleEscrowFactory() external view returns (address)",
@@ -62,7 +80,8 @@ const getTitleEscrowAddress = /* @__PURE__ */ __name(async (tokenRegistryAddress
62
80
  provider,
63
81
  titleEscrowFactoryAddress,
64
82
  tokenRegistryAddress,
65
- tokenId
83
+ tokenId,
84
+ options
66
85
  );
67
86
  }, "getTitleEscrowAddress");
68
87
  const checkSupportsInterface = /* @__PURE__ */ __name(async (titleEscrowAddress, interfaceId, provider) => {
@@ -8,7 +8,9 @@ declare const TitleEscrowInterface: {
8
8
  V4: string;
9
9
  V5: string;
10
10
  };
11
- declare const getTitleEscrowAddress: (tokenRegistryAddress: string, tokenId: string, provider: Provider | ethers.Provider) => Promise<string>;
11
+ declare const getTitleEscrowAddress: (tokenRegistryAddress: string, tokenId: string, provider: Provider | ethers.Provider, options?: {
12
+ titleEscrowVersion?: "v4" | "v5";
13
+ }) => Promise<string>;
12
14
  interface TitleEscrowVersionParams {
13
15
  tokenRegistryAddress?: string;
14
16
  tokenId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustvc/trustvc",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "TrustVC library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -116,10 +116,10 @@
116
116
  "@tradetrust-tt/tradetrust": "^6.10.1",
117
117
  "@tradetrust-tt/tradetrust-utils": "^2.2.1",
118
118
  "@tradetrust-tt/tt-verify": "^9.3.1",
119
- "@trustvc/w3c-context": "^1.2.1",
120
- "@trustvc/w3c-credential-status": "^1.2.1",
119
+ "@trustvc/w3c-context": "^1.2.2",
120
+ "@trustvc/w3c-credential-status": "^1.2.2",
121
121
  "@trustvc/w3c-issuer": "^1.2.1",
122
- "@trustvc/w3c-vc": "^1.2.3",
122
+ "@trustvc/w3c-vc": "^1.2.4",
123
123
  "did-resolver": "^4.1.0",
124
124
  "ethers": "^5.7.2",
125
125
  "ethersV6": "npm:ethers@^6.13.5",