@nibgate/sdk 0.2.15 → 0.2.16
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 +5 -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 +7 -3
package/dist/nibgate.js
CHANGED
|
@@ -1222,12 +1222,14 @@ 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) => evm.request({ method: "eth_signTypedData_v4", params: [
|
|
1231
|
+
address: currentAddress,
|
|
1232
|
+
signTypedData: (typedData) => evm.request({ method: "eth_signTypedData_v4", params: [currentAddress, stringifyJson(typedData)] })
|
|
1231
1233
|
},
|
|
1232
1234
|
clientModule: options.circleClientModule
|
|
1233
1235
|
});
|