@nibgate/sdk 0.2.15 → 0.2.17
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/nibgate.js +19 -3
- package/dist/nibgate.js.map +2 -2
- package/dist/nibgate.min.js +33 -33
- package/dist/nibgate.min.js.map +3 -3
- package/package.json +1 -1
- package/src/browser/evm-gateway.js +23 -3
package/dist/nibgate.js
CHANGED
|
@@ -1222,12 +1222,28 @@ var Nibgate = (() => {
|
|
|
1222
1222
|
async function checkout(input) {
|
|
1223
1223
|
const evm = provider();
|
|
1224
1224
|
if (!evm) throw new Error(options.noWalletMessage || "Install or open an EVM wallet to continue.");
|
|
1225
|
-
|
|
1225
|
+
const currentAccounts = await evm.request({ method: "eth_accounts" }).catch(() => walletAddress ? [walletAddress] : []);
|
|
1226
|
+
const currentAddress = Array.isArray(currentAccounts) && currentAccounts[0] ? currentAccounts[0] : walletAddress || await connect();
|
|
1227
|
+
if (currentAddress !== walletAddress) walletAddress = currentAddress;
|
|
1226
1228
|
const gatewayWallet = await createCircleGatewayBrowserAdapter2({
|
|
1227
1229
|
network,
|
|
1228
1230
|
signer: {
|
|
1229
|
-
address:
|
|
1230
|
-
signTypedData: (typedData) =>
|
|
1231
|
+
address: currentAddress,
|
|
1232
|
+
signTypedData: (typedData) => {
|
|
1233
|
+
const enriched = {
|
|
1234
|
+
...typedData,
|
|
1235
|
+
types: {
|
|
1236
|
+
EIP712Domain: [
|
|
1237
|
+
{ name: "name", type: "string" },
|
|
1238
|
+
{ name: "version", type: "string" },
|
|
1239
|
+
{ name: "chainId", type: "uint256" },
|
|
1240
|
+
{ name: "verifyingContract", type: "address" }
|
|
1241
|
+
],
|
|
1242
|
+
...typedData.types
|
|
1243
|
+
}
|
|
1244
|
+
};
|
|
1245
|
+
return evm.request({ method: "eth_signTypedData_v4", params: [currentAddress, stringifyJson(enriched)] });
|
|
1246
|
+
}
|
|
1231
1247
|
},
|
|
1232
1248
|
clientModule: options.circleClientModule
|
|
1233
1249
|
});
|