File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
WebGLTemplates/Thirdweb/lib Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public class ThirdwebSDK
12
12
public struct Options
13
13
{
14
14
public GaslessOptions ? gasless ;
15
+ public string ipfsGatewayUrl ;
15
16
}
16
17
17
18
/// <summary>
Original file line number Diff line number Diff line change 1
1
/// --- Thirdweb Brige ---
2
2
import { ethers } from "./ethers.js" ;
3
+ import { ThirdwebStorage } from "https://esm.sh/@thirdweb-dev/storage?bundle" ;
3
4
import { ThirdwebSDK } from "https://esm.sh/@thirdweb-dev/sdk?bundle" ;
4
5
5
6
const separator = "/" ;
@@ -24,7 +25,16 @@ const w = window;
24
25
w . bridge = { } ;
25
26
w . bridge . initialize = ( chain , options ) => {
26
27
console . debug ( "thirdwebSDK initialization:" , chain , options ) ;
27
- const sdk = new ThirdwebSDK ( chain , JSON . parse ( options ) ) ;
28
+ const sdkOptions = JSON . parse ( options ) ;
29
+ let storage = new ThirdwebStorage ( ) ;
30
+ if ( sdkOptions && sdkOptions . ipfsGatewayUrl ) {
31
+ storage = new ThirdwebStorage ( {
32
+ gatewayUrls : {
33
+ "ipfs://" : [ sdkOptions . ipfsGatewayUrl ] ,
34
+ } ,
35
+ } ) ;
36
+ }
37
+ const sdk = new ThirdwebSDK ( chain , sdkOptions , storage ) ;
28
38
w . thirdweb = sdk ;
29
39
} ;
30
40
You can’t perform that action at this time.
0 commit comments