Skip to content

Commit 90fd6af

Browse files
committed
Update cdn url, make onramp configurable
1 parent 9d6c1db commit 90fd6af

4 files changed

Lines changed: 11 additions & 12 deletions

File tree

Packages/com.walletconnect.web3modal/Plugins/Web3Modal.jslib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mergeInto(LibraryManager.library, {
6969
const enableOnramp = parameters.enableOnramp;
7070

7171
// Load the scripts and initialize the configuration
72-
import("https://cdn.jsdelivr.net/npm/@web3modal/cdn@4.2.4-cn-webgl.2/dist/wagmi.js").then(CDNW3M => {
72+
import("https://cdn.jsdelivr.net/npm/@web3modal/cdn@5.0.1/dist/wagmi.js").then(CDNW3M => {
7373
const { WagmiCore, Chains, Web3modal, Connectors } = CDNW3M;
7474
const { createWeb3Modal } = Web3modal;
7575
const { coinbaseWallet, walletConnect, injected } = Connectors;
@@ -94,12 +94,12 @@ mergeInto(LibraryManager.library, {
9494
});
9595

9696
reconnect(config);
97-
97+
9898
const modal = createWeb3Modal({
9999
wagmiConfig: config,
100100
projectId,
101101
enableOnramp: enableOnramp,
102-
disableAppend: true
102+
disableAppend: true,
103103
});
104104

105105
// Store the configuration and modal globally

Packages/com.walletconnect.web3modal/Runtime/Connectors/WebGl/WebGlConnector.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ protected override async Task InitializeAsyncCore(Web3ModalConfig web3ModalConfi
4242
projectId = walletConnectConfig.Id,
4343
metadata = walletConnectConfig.Metadata,
4444
chains = viemChainNames,
45-
enableEmail = true, // TODO: make configurable
46-
enableOnramp = true // TODO: make configurable
45+
enableOnramp = web3ModalConfig.enableOnramp,
4746
};
4847

4948
var parametersJson = JsonConvert.SerializeObject(parameters);
@@ -70,7 +69,6 @@ protected override ConnectionProposal ConnectCore()
7069

7170
protected override async Task<bool> TryResumeSessionAsyncCore()
7271
{
73-
7472
var getAccountResult = await WagmiInterop.GetAccountAsync();
7573

7674
if (getAccountResult.isConnected)
@@ -176,7 +174,6 @@ internal class WebGlInitializeParameters
176174
public Metadata metadata;
177175
public string[] chains;
178176

179-
public bool enableEmail;
180177
public bool enableOnramp;
181178
}
182179
#endif

Packages/com.walletconnect.web3modal/Runtime/Web3ModalConfig.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ public class Web3ModalConfig
1111

1212
public ushort connectViewWalletsCountMobile = 3;
1313
public ushort connectViewWalletsCountDesktop = 2;
14-
14+
15+
public bool enableOnramp = true; // Currently supported only in WebGL
16+
1517
public Chain[] supportedChains =
1618
{
1719
ChainConstants.Chains.Ethereum,

Packages/com.walletconnect.web3modal/Runtime/WebGL/Modal/ModalInterop.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ namespace WalletConnect.Web3Modal.WebGl.Modal
1010
{
1111
public static class ModalInterop
1212
{
13-
#if UNITY_WEBGL
14-
[DllImport("__Internal")]
13+
#if UNITY_WEBGL
14+
[DllImport("__Internal")]
1515
#endif
1616
private static extern void ModalCall(int id, string methodName, string payload, InteropService.ExternalMethodCallback callback);
1717

18-
#if UNITY_WEBGL
19-
[DllImport("__Internal")]
18+
#if UNITY_WEBGL
19+
[DllImport("__Internal")]
2020
#endif
2121
private static extern void ModalSubscribeState(Action<string> callback);
2222

0 commit comments

Comments
 (0)