@flaunch/sdk 0.4.0 → 0.4.2

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.
@@ -0,0 +1,333 @@
1
+ export declare const MulticallAbi: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly components: readonly [{
4
+ readonly internalType: "address";
5
+ readonly name: "target";
6
+ readonly type: "address";
7
+ }, {
8
+ readonly internalType: "bytes";
9
+ readonly name: "callData";
10
+ readonly type: "bytes";
11
+ }];
12
+ readonly internalType: "struct Multicall3.Call[]";
13
+ readonly name: "calls";
14
+ readonly type: "tuple[]";
15
+ }];
16
+ readonly name: "aggregate";
17
+ readonly outputs: readonly [{
18
+ readonly internalType: "uint256";
19
+ readonly name: "blockNumber";
20
+ readonly type: "uint256";
21
+ }, {
22
+ readonly internalType: "bytes[]";
23
+ readonly name: "returnData";
24
+ readonly type: "bytes[]";
25
+ }];
26
+ readonly stateMutability: "payable";
27
+ readonly type: "function";
28
+ }, {
29
+ readonly inputs: readonly [{
30
+ readonly components: readonly [{
31
+ readonly internalType: "address";
32
+ readonly name: "target";
33
+ readonly type: "address";
34
+ }, {
35
+ readonly internalType: "bool";
36
+ readonly name: "allowFailure";
37
+ readonly type: "bool";
38
+ }, {
39
+ readonly internalType: "bytes";
40
+ readonly name: "callData";
41
+ readonly type: "bytes";
42
+ }];
43
+ readonly internalType: "struct Multicall3.Call3[]";
44
+ readonly name: "calls";
45
+ readonly type: "tuple[]";
46
+ }];
47
+ readonly name: "aggregate3";
48
+ readonly outputs: readonly [{
49
+ readonly components: readonly [{
50
+ readonly internalType: "bool";
51
+ readonly name: "success";
52
+ readonly type: "bool";
53
+ }, {
54
+ readonly internalType: "bytes";
55
+ readonly name: "returnData";
56
+ readonly type: "bytes";
57
+ }];
58
+ readonly internalType: "struct Multicall3.Result[]";
59
+ readonly name: "returnData";
60
+ readonly type: "tuple[]";
61
+ }];
62
+ readonly stateMutability: "payable";
63
+ readonly type: "function";
64
+ }, {
65
+ readonly inputs: readonly [{
66
+ readonly components: readonly [{
67
+ readonly internalType: "address";
68
+ readonly name: "target";
69
+ readonly type: "address";
70
+ }, {
71
+ readonly internalType: "bool";
72
+ readonly name: "allowFailure";
73
+ readonly type: "bool";
74
+ }, {
75
+ readonly internalType: "uint256";
76
+ readonly name: "value";
77
+ readonly type: "uint256";
78
+ }, {
79
+ readonly internalType: "bytes";
80
+ readonly name: "callData";
81
+ readonly type: "bytes";
82
+ }];
83
+ readonly internalType: "struct Multicall3.Call3Value[]";
84
+ readonly name: "calls";
85
+ readonly type: "tuple[]";
86
+ }];
87
+ readonly name: "aggregate3Value";
88
+ readonly outputs: readonly [{
89
+ readonly components: readonly [{
90
+ readonly internalType: "bool";
91
+ readonly name: "success";
92
+ readonly type: "bool";
93
+ }, {
94
+ readonly internalType: "bytes";
95
+ readonly name: "returnData";
96
+ readonly type: "bytes";
97
+ }];
98
+ readonly internalType: "struct Multicall3.Result[]";
99
+ readonly name: "returnData";
100
+ readonly type: "tuple[]";
101
+ }];
102
+ readonly stateMutability: "payable";
103
+ readonly type: "function";
104
+ }, {
105
+ readonly inputs: readonly [{
106
+ readonly components: readonly [{
107
+ readonly internalType: "address";
108
+ readonly name: "target";
109
+ readonly type: "address";
110
+ }, {
111
+ readonly internalType: "bytes";
112
+ readonly name: "callData";
113
+ readonly type: "bytes";
114
+ }];
115
+ readonly internalType: "struct Multicall3.Call[]";
116
+ readonly name: "calls";
117
+ readonly type: "tuple[]";
118
+ }];
119
+ readonly name: "blockAndAggregate";
120
+ readonly outputs: readonly [{
121
+ readonly internalType: "uint256";
122
+ readonly name: "blockNumber";
123
+ readonly type: "uint256";
124
+ }, {
125
+ readonly internalType: "bytes32";
126
+ readonly name: "blockHash";
127
+ readonly type: "bytes32";
128
+ }, {
129
+ readonly components: readonly [{
130
+ readonly internalType: "bool";
131
+ readonly name: "success";
132
+ readonly type: "bool";
133
+ }, {
134
+ readonly internalType: "bytes";
135
+ readonly name: "returnData";
136
+ readonly type: "bytes";
137
+ }];
138
+ readonly internalType: "struct Multicall3.Result[]";
139
+ readonly name: "returnData";
140
+ readonly type: "tuple[]";
141
+ }];
142
+ readonly stateMutability: "payable";
143
+ readonly type: "function";
144
+ }, {
145
+ readonly inputs: readonly [];
146
+ readonly name: "getBasefee";
147
+ readonly outputs: readonly [{
148
+ readonly internalType: "uint256";
149
+ readonly name: "basefee";
150
+ readonly type: "uint256";
151
+ }];
152
+ readonly stateMutability: "view";
153
+ readonly type: "function";
154
+ }, {
155
+ readonly inputs: readonly [{
156
+ readonly internalType: "uint256";
157
+ readonly name: "blockNumber";
158
+ readonly type: "uint256";
159
+ }];
160
+ readonly name: "getBlockHash";
161
+ readonly outputs: readonly [{
162
+ readonly internalType: "bytes32";
163
+ readonly name: "blockHash";
164
+ readonly type: "bytes32";
165
+ }];
166
+ readonly stateMutability: "view";
167
+ readonly type: "function";
168
+ }, {
169
+ readonly inputs: readonly [];
170
+ readonly name: "getBlockNumber";
171
+ readonly outputs: readonly [{
172
+ readonly internalType: "uint256";
173
+ readonly name: "blockNumber";
174
+ readonly type: "uint256";
175
+ }];
176
+ readonly stateMutability: "view";
177
+ readonly type: "function";
178
+ }, {
179
+ readonly inputs: readonly [];
180
+ readonly name: "getChainId";
181
+ readonly outputs: readonly [{
182
+ readonly internalType: "uint256";
183
+ readonly name: "chainid";
184
+ readonly type: "uint256";
185
+ }];
186
+ readonly stateMutability: "view";
187
+ readonly type: "function";
188
+ }, {
189
+ readonly inputs: readonly [];
190
+ readonly name: "getCurrentBlockCoinbase";
191
+ readonly outputs: readonly [{
192
+ readonly internalType: "address";
193
+ readonly name: "coinbase";
194
+ readonly type: "address";
195
+ }];
196
+ readonly stateMutability: "view";
197
+ readonly type: "function";
198
+ }, {
199
+ readonly inputs: readonly [];
200
+ readonly name: "getCurrentBlockDifficulty";
201
+ readonly outputs: readonly [{
202
+ readonly internalType: "uint256";
203
+ readonly name: "difficulty";
204
+ readonly type: "uint256";
205
+ }];
206
+ readonly stateMutability: "view";
207
+ readonly type: "function";
208
+ }, {
209
+ readonly inputs: readonly [];
210
+ readonly name: "getCurrentBlockGasLimit";
211
+ readonly outputs: readonly [{
212
+ readonly internalType: "uint256";
213
+ readonly name: "gaslimit";
214
+ readonly type: "uint256";
215
+ }];
216
+ readonly stateMutability: "view";
217
+ readonly type: "function";
218
+ }, {
219
+ readonly inputs: readonly [];
220
+ readonly name: "getCurrentBlockTimestamp";
221
+ readonly outputs: readonly [{
222
+ readonly internalType: "uint256";
223
+ readonly name: "timestamp";
224
+ readonly type: "uint256";
225
+ }];
226
+ readonly stateMutability: "view";
227
+ readonly type: "function";
228
+ }, {
229
+ readonly inputs: readonly [{
230
+ readonly internalType: "address";
231
+ readonly name: "addr";
232
+ readonly type: "address";
233
+ }];
234
+ readonly name: "getEthBalance";
235
+ readonly outputs: readonly [{
236
+ readonly internalType: "uint256";
237
+ readonly name: "balance";
238
+ readonly type: "uint256";
239
+ }];
240
+ readonly stateMutability: "view";
241
+ readonly type: "function";
242
+ }, {
243
+ readonly inputs: readonly [];
244
+ readonly name: "getLastBlockHash";
245
+ readonly outputs: readonly [{
246
+ readonly internalType: "bytes32";
247
+ readonly name: "blockHash";
248
+ readonly type: "bytes32";
249
+ }];
250
+ readonly stateMutability: "view";
251
+ readonly type: "function";
252
+ }, {
253
+ readonly inputs: readonly [{
254
+ readonly internalType: "bool";
255
+ readonly name: "requireSuccess";
256
+ readonly type: "bool";
257
+ }, {
258
+ readonly components: readonly [{
259
+ readonly internalType: "address";
260
+ readonly name: "target";
261
+ readonly type: "address";
262
+ }, {
263
+ readonly internalType: "bytes";
264
+ readonly name: "callData";
265
+ readonly type: "bytes";
266
+ }];
267
+ readonly internalType: "struct Multicall3.Call[]";
268
+ readonly name: "calls";
269
+ readonly type: "tuple[]";
270
+ }];
271
+ readonly name: "tryAggregate";
272
+ readonly outputs: readonly [{
273
+ readonly components: readonly [{
274
+ readonly internalType: "bool";
275
+ readonly name: "success";
276
+ readonly type: "bool";
277
+ }, {
278
+ readonly internalType: "bytes";
279
+ readonly name: "returnData";
280
+ readonly type: "bytes";
281
+ }];
282
+ readonly internalType: "struct Multicall3.Result[]";
283
+ readonly name: "returnData";
284
+ readonly type: "tuple[]";
285
+ }];
286
+ readonly stateMutability: "payable";
287
+ readonly type: "function";
288
+ }, {
289
+ readonly inputs: readonly [{
290
+ readonly internalType: "bool";
291
+ readonly name: "requireSuccess";
292
+ readonly type: "bool";
293
+ }, {
294
+ readonly components: readonly [{
295
+ readonly internalType: "address";
296
+ readonly name: "target";
297
+ readonly type: "address";
298
+ }, {
299
+ readonly internalType: "bytes";
300
+ readonly name: "callData";
301
+ readonly type: "bytes";
302
+ }];
303
+ readonly internalType: "struct Multicall3.Call[]";
304
+ readonly name: "calls";
305
+ readonly type: "tuple[]";
306
+ }];
307
+ readonly name: "tryBlockAndAggregate";
308
+ readonly outputs: readonly [{
309
+ readonly internalType: "uint256";
310
+ readonly name: "blockNumber";
311
+ readonly type: "uint256";
312
+ }, {
313
+ readonly internalType: "bytes32";
314
+ readonly name: "blockHash";
315
+ readonly type: "bytes32";
316
+ }, {
317
+ readonly components: readonly [{
318
+ readonly internalType: "bool";
319
+ readonly name: "success";
320
+ readonly type: "bool";
321
+ }, {
322
+ readonly internalType: "bytes";
323
+ readonly name: "returnData";
324
+ readonly type: "bytes";
325
+ }];
326
+ readonly internalType: "struct Multicall3.Result[]";
327
+ readonly name: "returnData";
328
+ readonly type: "tuple[]";
329
+ }];
330
+ readonly stateMutability: "payable";
331
+ readonly type: "function";
332
+ }];
333
+ //# sourceMappingURL=Multicall.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Multicall.d.ts","sourceRoot":"","sources":["../../src/abi/Multicall.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAubf,CAAC"}
@@ -26,5 +26,11 @@ export declare class ReadFlaunch {
26
26
  * @returns Promise<string> - The token's metadata URI
27
27
  */
28
28
  tokenURI(tokenId: bigint): Promise<string>;
29
+ /**
30
+ * Gets the memecoin address for a given token ID
31
+ * @param tokenId - The ID of the token
32
+ * @returns Promise<Address> - The address of the memecoin
33
+ */
34
+ memecoin(tokenId: bigint): Promise<`0x${string}`>;
29
35
  }
30
36
  //# sourceMappingURL=FlaunchClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FlaunchClient.d.ts","sourceRoot":"","sources":["../../src/clients/FlaunchClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAMX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAE3C;;;GAGG;AACH,qBAAa,WAAW;IACtB,SAAgB,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAEnD;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;;OAIG;IACH,OAAO,CAAC,WAAW,EAAE,OAAO;IAM5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM;CAKzB"}
1
+ {"version":3,"file":"FlaunchClient.d.ts","sourceRoot":"","sources":["../../src/clients/FlaunchClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAMX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAE3C;;;GAGG;AACH,qBAAa,WAAW;IACtB,SAAgB,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAEnD;;;;;OAKG;gBACS,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAW1D;;;;OAIG;IACH,OAAO,CAAC,WAAW,EAAE,OAAO;IAM5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM;IAMxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM;CAKzB"}
@@ -0,0 +1,16 @@
1
+ import { type ReadContract, type Address, type Drift, type HexString } from "@delvtech/drift";
2
+ import { MulticallAbi } from "../abi/Multicall";
3
+ export type MulticallABI = typeof MulticallAbi;
4
+ export declare class ReadMulticall {
5
+ readonly address: Address;
6
+ readonly contract: ReadContract<MulticallABI>;
7
+ constructor(drift: Drift);
8
+ aggregate3(calls: {
9
+ target: Address;
10
+ callData: HexString;
11
+ }[]): Promise<readonly {
12
+ success: boolean;
13
+ returnData: `0x${string}`;
14
+ }[]>;
15
+ }
16
+ //# sourceMappingURL=MulticallClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MulticallClient.d.ts","sourceRoot":"","sources":["../../src/clients/MulticallClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAE/C,qBAAa,aAAa;IAExB,SAAgB,OAAO,EAAE,OAAO,CACe;IAE/C,SAAgB,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;gBAEzC,KAAK,EAAE,KAAK;IAOxB,UAAU,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,EAAE;;;;CAS7D"}
@@ -2,6 +2,7 @@ import { type ReadContract, type Address, type Drift, type ReadWriteContract, ty
2
2
  import { RevenueManagerAbi } from "../abi/RevenueManager";
3
3
  export type RevenueManagerABI = typeof RevenueManagerAbi;
4
4
  export declare class ReadRevenueManager {
5
+ drift: Drift;
5
6
  readonly contract: ReadContract<RevenueManagerABI>;
6
7
  constructor(address: Address, drift?: Drift);
7
8
  /**
@@ -15,6 +16,31 @@ export declare class ReadRevenueManager {
15
16
  * @returns Promise<Address> - The protocol recipient address
16
17
  */
17
18
  protocolRecipient(): Promise<`0x${string}`>;
19
+ /**
20
+ * Gets the total number of tokens managed by the revenue manager
21
+ * @returns Promise<bigint> - The total count of tokens
22
+ */
23
+ tokensCount(): Promise<bigint>;
24
+ /**
25
+ * Gets all tokens created by a specific creator address
26
+ * @param creator - The address of the creator to query tokens for
27
+ * @param sortByDesc - Optional boolean to sort tokens in descending order (default: false)
28
+ * @returns Promise<Array<{flaunch: Address, tokenId: bigint}>> - Array of token objects containing flaunch address and token ID
29
+ */
30
+ allTokensByCreator(creator: Address, sortByDesc?: boolean): Promise<readonly {
31
+ flaunch: `0x${string}`;
32
+ tokenId: bigint;
33
+ }[]>;
34
+ /**
35
+ * Gets all tokens currently managed by the revenue manager contract
36
+ * @dev Uses multicall to batch requests for better performance
37
+ * @param sortByDesc - Optional boolean to sort tokens in descending order (default: false)
38
+ * @returns Promise<Array<{flaunch: Address, tokenId: bigint}>> - Array of token objects containing flaunch address and token ID
39
+ */
40
+ allTokensInManager(sortByDesc?: boolean): Promise<{
41
+ flaunch: `0x${string}`;
42
+ tokenId: bigint;
43
+ }[]>;
18
44
  }
19
45
  export declare class ReadWriteRevenueManager extends ReadRevenueManager {
20
46
  contract: ReadWriteContract<RevenueManagerABI>;
@@ -1 +1 @@
1
- {"version":3,"file":"RevenueManagerClient.d.ts","sourceRoot":"","sources":["../../src/clients/RevenueManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC;AAEzD,qBAAa,kBAAkB;IAC7B,SAAgB,QAAQ,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;gBAE9C,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAO1D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO;IAMzB;;;OAGG;IACH,iBAAiB;CAGlB;AAED,qBAAa,uBAAwB,SAAQ,kBAAkB;IACrD,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;gBAGrD,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAK,CAAC,gBAAgB,CAAiB;IAKhD;;;OAGG;IACH,aAAa;IAIb;;;OAGG;IACH,YAAY;IAIZ;;;;OAIG;IACH,qBAAqB,CACnB,aAAa,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;CAMzD"}
1
+ {"version":3,"file":"RevenueManagerClient.d.ts","sourceRoot":"","sources":["../../src/clients/RevenueManagerClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EAEV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC;AAEzD,qBAAa,kBAAkB;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,SAAgB,QAAQ,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;gBAE9C,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,KAAqB;IAQ1D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO;IAMzB;;;OAGG;IACH,iBAAiB;IAIjB;;;OAGG;IACG,WAAW;IAKjB;;;;;OAKG;IACG,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,GAAE,OAAe;;;;IAYtE;;;;;OAKG;IACG,kBAAkB,CAAC,UAAU,GAAE,OAAe;;;;CA0BrD;AAED,qBAAa,uBAAwB,SAAQ,kBAAkB;IACrD,QAAQ,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;gBAGrD,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,KAAK,CAAC,gBAAgB,CAAiB;IAKhD;;;OAGG;IACH,aAAa;IAIb;;;OAGG;IACH,YAAY;IAIZ;;;;OAIG;IACH,qBAAqB,CACnB,aAAa,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;CAMzD"}
@@ -16,9 +16,22 @@ const uint256ToBytes32 = (value) => {
16
16
  return viem.pad(viem.encodeAbiParameters([{ type: "uint256", name: "value" }], [value]), { size: 32, dir: "right" });
17
17
  };
18
18
 
19
+ // List of public IPFS gateways to cycle through
20
+ const IPFS_GATEWAYS = [
21
+ "https://gateway.pinata.cloud/ipfs/",
22
+ "https://ipfs.io/ipfs/",
23
+ "https://dweb.link/ipfs/",
24
+ ];
25
+ // Counter to track the current gateway index
26
+ let currentGatewayIndex = 0;
19
27
  const resolveIPFS = (value) => {
20
28
  if (value.startsWith("ipfs://")) {
21
- return `https://gateway.pinata.cloud/ipfs/${value.slice(7)}`;
29
+ const cid = value.slice(7);
30
+ // Get the next gateway and increment the counter
31
+ const gateway = IPFS_GATEWAYS[currentGatewayIndex];
32
+ // Update the counter, cycling back to 0 when we reach the end
33
+ currentGatewayIndex = (currentGatewayIndex + 1) % IPFS_GATEWAYS.length;
34
+ return `${gateway}${cid}`;
22
35
  }
23
36
  return value;
24
37
  };