@nibgate/sdk 0.2.16 → 0.2.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nibgate/sdk",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "description": "Framework-agnostic browser and server package for creator-owned gated content, unlock events, and receipts.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -122,7 +122,19 @@ export function createEvmGatewayUnlock(resource, options = {}) {
122
122
  network,
123
123
  signer: {
124
124
  address: currentAddress,
125
- signTypedData: (typedData) => evm.request({ method: 'eth_signTypedData_v4', params: [currentAddress, stringifyJson(typedData)] })
125
+ signTypedData: async (typedData) => {
126
+ const { createWalletClient, custom } = await import('viem');
127
+ const wc = createWalletClient({ transport: custom(evm) });
128
+ // Use viem's signTypedData — handles EIP-712 encoding correctly
129
+ // across all wallets (MetaMask, Rabby, etc.)
130
+ return wc.signTypedData({
131
+ account: currentAddress,
132
+ domain: typedData.domain,
133
+ types: typedData.types,
134
+ primaryType: typedData.primaryType,
135
+ message: typedData.message
136
+ });
137
+ }
126
138
  },
127
139
  clientModule: options.circleClientModule
128
140
  });