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
1212 public struct Options
1313 {
1414 public GaslessOptions ? gasless ;
15+ public string ipfsGatewayUrl ;
1516 }
1617
1718 /// <summary>
Original file line number Diff line number Diff line change 11/// --- Thirdweb Brige ---
22import { ethers } from "./ethers.js" ;
3+ import { ThirdwebStorage } from "https://esm.sh/@thirdweb-dev/storage?bundle" ;
34import { ThirdwebSDK } from "https://esm.sh/@thirdweb-dev/sdk?bundle" ;
45
56const separator = "/" ;
@@ -24,7 +25,16 @@ const w = window;
2425w . bridge = { } ;
2526w . bridge . initialize = ( chain , options ) => {
2627 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 ) ;
2838 w . thirdweb = sdk ;
2939} ;
3040
You can’t perform that action at this time.
0 commit comments