@verbeth/sdk 0.1.6 → 0.1.7

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/README.md CHANGED
@@ -45,10 +45,10 @@ MPL-2.0
45
45
 
46
46
  ## Links
47
47
 
48
- - [GitHub Repository](https://github.com/okrame/verbeth-sdk)
48
+ - [GitHub Repository](https://github.com/okrame/verbeth)
49
49
  - [Demo App](https://verbeth-demo.vercel.app/)
50
- - [Contract Source](https://github.com/okrame/verbeth-sdk/tree/main/packages/contracts)
50
+ - [Contract Source](https://github.com/okrame/verbeth/tree/main/packages/contracts)
51
51
 
52
52
  ---
53
53
 
54
- **Questions or feedback?** Open an issue on [GitHub](https://github.com/okrame/verbeth-sdk/issues).
54
+ **Questions or feedback?** Open an issue on [GitHub](https://github.com/okrame/verbeth/issues).
@@ -1,16 +1,15 @@
1
1
  // packages/sdk/src/addresses.ts
2
- // Deterministic deployment - same addresses on Base Mainnet & Sepolia
2
+ // Deterministic deployment
3
3
  export const VERBETH_CONFIG = {
4
4
  verbethProxy: '0x82C9c5475D63e4C9e959280e9066aBb24973a663',
5
5
  verbethImpl: '0x51670aB6eDE1d1B11C654CCA53b7D42080802326',
6
- creationBlock: 36053269,
6
+ creationBlock: 37097547, // *** only base sepolia for now
7
7
  };
8
- // Per-chain module setup helpers (for Safe session module)
8
+ // helpers for Safe session module
9
9
  export const MODULE_SETUP_HELPERS = {
10
- 8453: '0xc022F74924BDB4b62D830234d89b066359bF67c0', // Base Mainnet
11
- 84532: '0xbd59Fea46D308eDF3b75C22a6f64AC68feFc731A', // Base Sepolia
10
+ 8453: '0xc022F74924BDB4b62D830234d89b066359bF67c0',
11
+ 84532: '0xbd59Fea46D308eDF3b75C22a6f64AC68feFc731A',
12
12
  };
13
- // Helper functions
14
13
  export function getVerbethAddress() {
15
14
  return VERBETH_CONFIG.verbethProxy;
16
15
  }
@@ -21,9 +21,9 @@ export declare function deriveIdentityKeys(signer: any, address: string): Promis
21
21
  /**
22
22
  * Create the binding proof that ties the derived keys to the Safe address.
23
23
  */
24
- export declare function createBindingProof(signer: any, address: string, derivedKeys: DerivedIdentityKeys, executorSafeAddress: string, ctx?: IdentityContext): Promise<IdentityProof>;
25
- export declare function deriveIdentityKeyPairWithProof(signer: any, address: string, executorSafeAddress?: string, ctx?: IdentityContext): Promise<DerivedIdentityWithProof>;
26
- export declare function deriveIdentityWithUnifiedKeys(signer: Signer, address: string, executorSafeAddress?: string, ctx?: IdentityContext): Promise<{
24
+ export declare function createBindingProof(signer: any, address: string, derivedKeys: DerivedIdentityKeys, executorAddress: string, ctx?: IdentityContext): Promise<IdentityProof>;
25
+ export declare function deriveIdentityKeyPairWithProof(signer: any, address: string, executorAddress?: string, ctx?: IdentityContext): Promise<DerivedIdentityWithProof>;
26
+ export declare function deriveIdentityWithUnifiedKeys(signer: Signer, address: string, executorAddress?: string, ctx?: IdentityContext): Promise<{
27
27
  identityProof: IdentityProof;
28
28
  identityPubKey: Uint8Array;
29
29
  signingPubKey: Uint8Array;
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/identity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAqC,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAwE7E,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,OAAO,EAAE,eAAe,CAAC;IACzB,2DAA2D;IAC3D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE,aAAa,EAAE,aAAa,CAAC;CAC9B;AAMD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAA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M,CAAC;CACtB;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACnE,aAAa,EAAE,aAAa,CAAC;CAC9B;AAMD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CA8D9B;AAMD;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,mBAAmB,EAChC,eAAe,EAAE,MAAM,EACvB,GAAG,CAAC,EAAE,eAAe,GACpB,OAAO,CAAC,aAAa,CAAC,CAsBxB;AAID,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,MAAM,EACf,eAAe,CAAC,EAAE,MAAM,EACxB,GAAG,CAAC,EAAE,eAAe,GACpB,OAAO,CAAC,wBAAwB,CAAC,CAcnC;AAED,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,eAAe,CAAC,EAAE,MAAM,EACxB,GAAG,CAAC,EAAE,eAAe,GACpB,OAAO,CAAC;IACT,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,UAAU,CAAC;IAC3B,aAAa,EAAE,UAAU,CAAC;IAC1B,cAAc,EAAE,UAAU,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,CAqBD"}
@@ -50,13 +50,13 @@ function buildSeedMessage(addrLower) {
50
50
  ];
51
51
  return lines.join("\n");
52
52
  }
53
- function buildBindingMessage(addrLower, pkEd25519Hex, pkX25519Hex, executorSafeAddress, ctx) {
53
+ function buildBindingMessage(addrLower, pkEd25519Hex, pkX25519Hex, executorAddress, ctx) {
54
54
  const lines = [
55
55
  "VerbEth Key Binding v1",
56
56
  `Address: ${addrLower}`,
57
57
  `PkEd25519: ${pkEd25519Hex}`,
58
58
  `PkX25519: ${pkX25519Hex}`,
59
- `ExecutorSafeAddress: ${executorSafeAddress ?? ""}`,
59
+ `ExecutorAddress: ${executorAddress ?? ""}`,
60
60
  ];
61
61
  if (typeof ctx?.chainId === "number")
62
62
  lines.push(`ChainId: ${ctx.chainId}`);
@@ -129,10 +129,10 @@ export async function deriveIdentityKeys(signer, address) {
129
129
  /**
130
130
  * Create the binding proof that ties the derived keys to the Safe address.
131
131
  */
132
- export async function createBindingProof(signer, address, derivedKeys, executorSafeAddress, ctx) {
132
+ export async function createBindingProof(signer, address, derivedKeys, executorAddress, ctx) {
133
133
  const addrLower = address.toLowerCase();
134
- const executorSafeAddressLower = executorSafeAddress.toLowerCase();
135
- const message = buildBindingMessage(addrLower, derivedKeys.pkEd25519Hex, derivedKeys.pkX25519Hex, executorSafeAddressLower, ctx);
134
+ const executorAddressLower = executorAddress.toLowerCase();
135
+ const message = buildBindingMessage(addrLower, derivedKeys.pkEd25519Hex, derivedKeys.pkX25519Hex, executorAddressLower, ctx);
136
136
  const signature = await signer.signMessage(message);
137
137
  const messageRawHex = ("0x" +
138
138
  Buffer.from(message, "utf-8").toString("hex"));
@@ -143,16 +143,16 @@ export async function createBindingProof(signer, address, derivedKeys, executorS
143
143
  };
144
144
  }
145
145
  // this is when the Safe address is known upfront
146
- export async function deriveIdentityKeyPairWithProof(signer, address, executorSafeAddress, ctx) {
146
+ export async function deriveIdentityKeyPairWithProof(signer, address, executorAddress, ctx) {
147
147
  const derivedKeys = await deriveIdentityKeys(signer, address);
148
- const identityProof = await createBindingProof(signer, address, derivedKeys, executorSafeAddress ?? "", ctx);
148
+ const identityProof = await createBindingProof(signer, address, derivedKeys, executorAddress ?? "", ctx);
149
149
  return {
150
150
  ...derivedKeys,
151
151
  identityProof,
152
152
  };
153
153
  }
154
- export async function deriveIdentityWithUnifiedKeys(signer, address, executorSafeAddress, ctx) {
155
- const result = await deriveIdentityKeyPairWithProof(signer, address, executorSafeAddress, ctx);
154
+ export async function deriveIdentityWithUnifiedKeys(signer, address, executorAddress, ctx) {
155
+ const result = await deriveIdentityKeyPairWithProof(signer, address, executorAddress, ctx);
156
156
  const unifiedPubKeys = encodeUnifiedPubKeys(result.keyPair.publicKey, result.keyPair.signingPublicKey);
157
157
  return {
158
158
  identityProof: result.identityProof,
@@ -5,7 +5,7 @@ export declare function parseBindingMessage(message: string): {
5
5
  address?: string;
6
6
  pkEd25519?: `0x${string}`;
7
7
  pkX25519?: `0x${string}`;
8
- executorSafeAddress?: string;
8
+ executorAddress?: string;
9
9
  context?: string;
10
10
  version?: string;
11
11
  chainId?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,eAAe,EAGhB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAGd,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CA4BA;AAED,MAAM,MAAM,MAAM,GACd,OAAO,QAAQ,EAAE,eAAe,GAChC,OAAO,QAAQ,EAAE,eAAe,GAChC;IAAE,OAAO,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;A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AAC,CAmBvB;AAED,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAIxD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,CAAC,CA+DlB"}
@@ -23,9 +23,9 @@ export function parseBindingMessage(message) {
23
23
  if (key === "pkx25519") {
24
24
  out.pkX25519 = hexlify(val);
25
25
  }
26
- if (key === "executorsafeaddress" || key === "executorsafe") {
26
+ if (key === "executoraddress" || key === "executorsafe") {
27
27
  if (val)
28
- out.executorSafeAddress = getAddress(val);
28
+ out.executorAddress = getAddress(val);
29
29
  }
30
30
  if (key === "context")
31
31
  out.context = val;
@@ -94,8 +94,8 @@ export async function verifyIdentityProof(identityProof, address, expectedUnifie
94
94
  console.error("Unexpected binding header:", parsed.header);
95
95
  return false;
96
96
  }
97
- if (!parsed.executorSafeAddress ||
98
- getAddress(parsed.executorSafeAddress) !== getAddress(inputAddress)) {
97
+ if (!parsed.executorAddress ||
98
+ getAddress(parsed.executorAddress) !== getAddress(inputAddress)) {
99
99
  console.error("Binding message Safe address mismatch");
100
100
  return false;
101
101
  }
@@ -1,16 +1,15 @@
1
1
  // packages/sdk/src/addresses.ts
2
- // Deterministic deployment - same addresses on Base Mainnet & Sepolia
2
+ // Deterministic deployment
3
3
  export const VERBETH_CONFIG = {
4
4
  verbethProxy: '0x82C9c5475D63e4C9e959280e9066aBb24973a663',
5
5
  verbethImpl: '0x51670aB6eDE1d1B11C654CCA53b7D42080802326',
6
- creationBlock: 36053269,
6
+ creationBlock: 37097547, // *** only base sepolia for now
7
7
  };
8
- // Per-chain module setup helpers (for Safe session module)
8
+ // helpers for Safe session module
9
9
  export const MODULE_SETUP_HELPERS = {
10
- 8453: '0xc022F74924BDB4b62D830234d89b066359bF67c0', // Base Mainnet
11
- 84532: '0xbd59Fea46D308eDF3b75C22a6f64AC68feFc731A', // Base Sepolia
10
+ 8453: '0xc022F74924BDB4b62D830234d89b066359bF67c0',
11
+ 84532: '0xbd59Fea46D308eDF3b75C22a6f64AC68feFc731A',
12
12
  };
13
- // Helper functions
14
13
  export function getVerbethAddress() {
15
14
  return VERBETH_CONFIG.verbethProxy;
16
15
  }
@@ -21,9 +21,9 @@ export declare function deriveIdentityKeys(signer: any, address: string): Promis
21
21
  /**
22
22
  * Create the binding proof that ties the derived keys to the Safe address.
23
23
  */
24
- export declare function createBindingProof(signer: any, address: string, derivedKeys: DerivedIdentityKeys, executorSafeAddress: string, ctx?: IdentityContext): Promise<IdentityProof>;
25
- export declare function deriveIdentityKeyPairWithProof(signer: any, address: string, executorSafeAddress?: string, ctx?: IdentityContext): Promise<DerivedIdentityWithProof>;
26
- export declare function deriveIdentityWithUnifiedKeys(signer: Signer, address: string, executorSafeAddress?: string, ctx?: IdentityContext): Promise<{
24
+ export declare function createBindingProof(signer: any, address: string, derivedKeys: DerivedIdentityKeys, executorAddress: string, ctx?: IdentityContext): Promise<IdentityProof>;
25
+ export declare function deriveIdentityKeyPairWithProof(signer: any, address: string, executorAddress?: string, ctx?: IdentityContext): Promise<DerivedIdentityWithProof>;
26
+ export declare function deriveIdentityWithUnifiedKeys(signer: Signer, address: string, executorAddress?: string, ctx?: IdentityContext): Promise<{
27
27
  identityProof: IdentityProof;
28
28
  identityPubKey: Uint8Array;
29
29
  signingPubKey: Uint8Array;
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAqC,MAAM,QAAQ,CAAC;AAGnE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAwE7E,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,OAAO,EAAE,eAAe,CAAC;IACzB,2DAA2D;IAC3D,iBAAiB,EAAE,MAAM,CA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{
50
50
  ];
51
51
  return lines.join("\n");
52
52
  }
53
- function buildBindingMessage(addrLower, pkEd25519Hex, pkX25519Hex, executorSafeAddress, ctx) {
53
+ function buildBindingMessage(addrLower, pkEd25519Hex, pkX25519Hex, executorAddress, ctx) {
54
54
  const lines = [
55
55
  "VerbEth Key Binding v1",
56
56
  `Address: ${addrLower}`,
57
57
  `PkEd25519: ${pkEd25519Hex}`,
58
58
  `PkX25519: ${pkX25519Hex}`,
59
- `ExecutorSafeAddress: ${executorSafeAddress ?? ""}`,
59
+ `ExecutorAddress: ${executorAddress ?? ""}`,
60
60
  ];
61
61
  if (typeof ctx?.chainId === "number")
62
62
  lines.push(`ChainId: ${ctx.chainId}`);
@@ -129,10 +129,10 @@ export async function deriveIdentityKeys(signer, address) {
129
129
  /**
130
130
  * Create the binding proof that ties the derived keys to the Safe address.
131
131
  */
132
- export async function createBindingProof(signer, address, derivedKeys, executorSafeAddress, ctx) {
132
+ export async function createBindingProof(signer, address, derivedKeys, executorAddress, ctx) {
133
133
  const addrLower = address.toLowerCase();
134
- const executorSafeAddressLower = executorSafeAddress.toLowerCase();
135
- const message = buildBindingMessage(addrLower, derivedKeys.pkEd25519Hex, derivedKeys.pkX25519Hex, executorSafeAddressLower, ctx);
134
+ const executorAddressLower = executorAddress.toLowerCase();
135
+ const message = buildBindingMessage(addrLower, derivedKeys.pkEd25519Hex, derivedKeys.pkX25519Hex, executorAddressLower, ctx);
136
136
  const signature = await signer.signMessage(message);
137
137
  const messageRawHex = ("0x" +
138
138
  Buffer.from(message, "utf-8").toString("hex"));
@@ -143,16 +143,16 @@ export async function createBindingProof(signer, address, derivedKeys, executorS
143
143
  };
144
144
  }
145
145
  // this is when the Safe address is known upfront
146
- export async function deriveIdentityKeyPairWithProof(signer, address, executorSafeAddress, ctx) {
146
+ export async function deriveIdentityKeyPairWithProof(signer, address, executorAddress, ctx) {
147
147
  const derivedKeys = await deriveIdentityKeys(signer, address);
148
- const identityProof = await createBindingProof(signer, address, derivedKeys, executorSafeAddress ?? "", ctx);
148
+ const identityProof = await createBindingProof(signer, address, derivedKeys, executorAddress ?? "", ctx);
149
149
  return {
150
150
  ...derivedKeys,
151
151
  identityProof,
152
152
  };
153
153
  }
154
- export async function deriveIdentityWithUnifiedKeys(signer, address, executorSafeAddress, ctx) {
155
- const result = await deriveIdentityKeyPairWithProof(signer, address, executorSafeAddress, ctx);
154
+ export async function deriveIdentityWithUnifiedKeys(signer, address, executorAddress, ctx) {
155
+ const result = await deriveIdentityKeyPairWithProof(signer, address, executorAddress, ctx);
156
156
  const unifiedPubKeys = encodeUnifiedPubKeys(result.keyPair.publicKey, result.keyPair.signingPublicKey);
157
157
  return {
158
158
  identityProof: result.identityProof,
@@ -5,7 +5,7 @@ export declare function parseBindingMessage(message: string): {
5
5
  address?: string;
6
6
  pkEd25519?: `0x${string}`;
7
7
  pkX25519?: `0x${string}`;
8
- executorSafeAddress?: string;
8
+ executorAddress?: string;
9
9
  context?: string;
10
10
  version?: string;
11
11
  chainId?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,eAAe,EAGhB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAGd,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CA4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,EAAE,eAAe,GAChC;IAAE,OAAO,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC;AAe5E,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CAmBvB;AAED,eAAO,MAAM,cAAc,uEAC2C,CAAC;AAEvE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAIxD;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,CAAC,CA+DlB"}
package/dist/src/utils.js CHANGED
@@ -23,9 +23,9 @@ export function parseBindingMessage(message) {
23
23
  if (key === "pkx25519") {
24
24
  out.pkX25519 = hexlify(val);
25
25
  }
26
- if (key === "executorsafeaddress" || key === "executorsafe") {
26
+ if (key === "executoraddress" || key === "executorsafe") {
27
27
  if (val)
28
- out.executorSafeAddress = getAddress(val);
28
+ out.executorAddress = getAddress(val);
29
29
  }
30
30
  if (key === "context")
31
31
  out.context = val;
@@ -94,8 +94,8 @@ export async function verifyIdentityProof(identityProof, address, expectedUnifie
94
94
  console.error("Unexpected binding header:", parsed.header);
95
95
  return false;
96
96
  }
97
- if (!parsed.executorSafeAddress ||
98
- getAddress(parsed.executorSafeAddress) !== getAddress(inputAddress)) {
97
+ if (!parsed.executorAddress ||
98
+ getAddress(parsed.executorAddress) !== getAddress(inputAddress)) {
99
99
  console.error("Binding message Safe address mismatch");
100
100
  return false;
101
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verbeth/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "main": "dist/src/index.js",
6
6
  "module": "dist/esm/src/index.js",