@goodaofi/bonds-sdk 3.0.156 → 3.0.160
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/main.js
CHANGED
|
@@ -26654,7 +26654,7 @@ bn$1.exports;
|
|
|
26654
26654
|
var bnExports = bn$1.exports;
|
|
26655
26655
|
var BN$1 = /*@__PURE__*/getDefaultExportFromCjs(bnExports);
|
|
26656
26656
|
|
|
26657
|
-
const version$j = "logger/5.
|
|
26657
|
+
const version$j = "logger/5.8.0";
|
|
26658
26658
|
|
|
26659
26659
|
let _permanentCensorErrors = false;
|
|
26660
26660
|
let _censorErrors = false;
|
|
@@ -27005,7 +27005,7 @@ class Logger {
|
|
|
27005
27005
|
Logger.errors = ErrorCode;
|
|
27006
27006
|
Logger.levels = LogLevel;
|
|
27007
27007
|
|
|
27008
|
-
const version$i = "bytes/5.
|
|
27008
|
+
const version$i = "bytes/5.8.0";
|
|
27009
27009
|
|
|
27010
27010
|
const logger$o = new Logger(version$i);
|
|
27011
27011
|
///////////////////////////////
|
|
@@ -27405,7 +27405,7 @@ function splitSignature(signature) {
|
|
|
27405
27405
|
return result;
|
|
27406
27406
|
}
|
|
27407
27407
|
|
|
27408
|
-
const version$h = "bignumber/5.
|
|
27408
|
+
const version$h = "bignumber/5.8.0";
|
|
27409
27409
|
|
|
27410
27410
|
var BN = BN$1.BN;
|
|
27411
27411
|
const logger$n = new Logger(version$h);
|
|
@@ -28050,7 +28050,7 @@ class FixedNumber {
|
|
|
28050
28050
|
const ONE = FixedNumber.from(1);
|
|
28051
28051
|
const BUMP = FixedNumber.from("0.5");
|
|
28052
28052
|
|
|
28053
|
-
const version$g = "properties/5.
|
|
28053
|
+
const version$g = "properties/5.8.0";
|
|
28054
28054
|
|
|
28055
28055
|
var __awaiter$8 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28056
28056
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -28175,7 +28175,7 @@ class Description {
|
|
|
28175
28175
|
}
|
|
28176
28176
|
}
|
|
28177
28177
|
|
|
28178
|
-
const version$f = "abi/5.
|
|
28178
|
+
const version$f = "abi/5.8.0";
|
|
28179
28179
|
|
|
28180
28180
|
const logger$k = new Logger(version$f);
|
|
28181
28181
|
const _constructorGuard$1 = {};
|
|
@@ -29828,7 +29828,7 @@ function keccak256(data) {
|
|
|
29828
29828
|
return '0x' + sha3.keccak_256(arrayify(data));
|
|
29829
29829
|
}
|
|
29830
29830
|
|
|
29831
|
-
const version$e = "rlp/5.
|
|
29831
|
+
const version$e = "rlp/5.8.0";
|
|
29832
29832
|
|
|
29833
29833
|
const logger$i = new Logger(version$e);
|
|
29834
29834
|
function arrayifyInteger(value) {
|
|
@@ -29945,7 +29945,7 @@ function decode$2(data) {
|
|
|
29945
29945
|
return decoded.result;
|
|
29946
29946
|
}
|
|
29947
29947
|
|
|
29948
|
-
const version$d = "address/5.
|
|
29948
|
+
const version$d = "address/5.8.0";
|
|
29949
29949
|
|
|
29950
29950
|
const logger$h = new Logger(version$d);
|
|
29951
29951
|
function getChecksumAddress(address) {
|
|
@@ -30420,7 +30420,7 @@ class NumberCoder extends Coder {
|
|
|
30420
30420
|
}
|
|
30421
30421
|
}
|
|
30422
30422
|
|
|
30423
|
-
const version$c = "strings/5.
|
|
30423
|
+
const version$c = "strings/5.8.0";
|
|
30424
30424
|
|
|
30425
30425
|
const logger$f = new Logger(version$c);
|
|
30426
30426
|
///////////////////////////////
|
|
@@ -30788,7 +30788,7 @@ function id(text) {
|
|
|
30788
30788
|
return keccak256(toUtf8Bytes(text));
|
|
30789
30789
|
}
|
|
30790
30790
|
|
|
30791
|
-
const version$b = "hash/5.
|
|
30791
|
+
const version$b = "hash/5.8.0";
|
|
30792
30792
|
|
|
30793
30793
|
function decode$1(textData) {
|
|
30794
30794
|
textData = atob(textData);
|
|
@@ -32459,7 +32459,7 @@ var multicallV2Abi = [
|
|
|
32459
32459
|
}
|
|
32460
32460
|
];
|
|
32461
32461
|
|
|
32462
|
-
const version$a = "abstract-provider/5.
|
|
32462
|
+
const version$a = "abstract-provider/5.8.0";
|
|
32463
32463
|
|
|
32464
32464
|
var __awaiter$6 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
32465
32465
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -32521,7 +32521,7 @@ class Provider {
|
|
|
32521
32521
|
}
|
|
32522
32522
|
}
|
|
32523
32523
|
|
|
32524
|
-
const version$9 = "abstract-signer/5.
|
|
32524
|
+
const version$9 = "abstract-signer/5.8.0";
|
|
32525
32525
|
|
|
32526
32526
|
var __awaiter$5 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
32527
32527
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -34198,12 +34198,15 @@ utils.encode = utils_1.encode;
|
|
|
34198
34198
|
// Represent num in a w-NAF form
|
|
34199
34199
|
function getNAF(num, w, bits) {
|
|
34200
34200
|
var naf = new Array(Math.max(num.bitLength(), bits) + 1);
|
|
34201
|
-
|
|
34201
|
+
var i;
|
|
34202
|
+
for (i = 0; i < naf.length; i += 1) {
|
|
34203
|
+
naf[i] = 0;
|
|
34204
|
+
}
|
|
34202
34205
|
|
|
34203
34206
|
var ws = 1 << (w + 1);
|
|
34204
34207
|
var k = num.clone();
|
|
34205
34208
|
|
|
34206
|
-
for (
|
|
34209
|
+
for (i = 0; i < naf.length; i++) {
|
|
34207
34210
|
var z;
|
|
34208
34211
|
var mod = k.andln(ws - 1);
|
|
34209
34212
|
if (k.isOdd()) {
|
|
@@ -36089,8 +36092,8 @@ KeyPair.prototype.sign = function sign(msg, enc, options) {
|
|
|
36089
36092
|
return this.ec.sign(msg, this, enc, options);
|
|
36090
36093
|
};
|
|
36091
36094
|
|
|
36092
|
-
KeyPair.prototype.verify = function verify(msg, signature) {
|
|
36093
|
-
return this.ec.verify(msg, signature, this);
|
|
36095
|
+
KeyPair.prototype.verify = function verify(msg, signature, options) {
|
|
36096
|
+
return this.ec.verify(msg, signature, this, undefined, options);
|
|
36094
36097
|
};
|
|
36095
36098
|
|
|
36096
36099
|
KeyPair.prototype.inspect = function inspect() {
|
|
@@ -36136,6 +36139,10 @@ function getLength(buf, p) {
|
|
|
36136
36139
|
return false;
|
|
36137
36140
|
}
|
|
36138
36141
|
|
|
36142
|
+
if(buf[p.place] === 0x00) {
|
|
36143
|
+
return false;
|
|
36144
|
+
}
|
|
36145
|
+
|
|
36139
36146
|
var val = 0;
|
|
36140
36147
|
for (var i = 0, off = p.place; i < octetLen; i++, off++) {
|
|
36141
36148
|
val <<= 8;
|
|
@@ -36184,6 +36191,9 @@ Signature.prototype._importDER = function _importDER(data, enc) {
|
|
|
36184
36191
|
if (rlen === false) {
|
|
36185
36192
|
return false;
|
|
36186
36193
|
}
|
|
36194
|
+
if ((data[p.place] & 128) !== 0) {
|
|
36195
|
+
return false;
|
|
36196
|
+
}
|
|
36187
36197
|
var r = data.slice(p.place, rlen + p.place);
|
|
36188
36198
|
p.place += rlen;
|
|
36189
36199
|
if (data[p.place++] !== 0x02) {
|
|
@@ -36196,6 +36206,9 @@ Signature.prototype._importDER = function _importDER(data, enc) {
|
|
|
36196
36206
|
if (data.length !== slen + p.place) {
|
|
36197
36207
|
return false;
|
|
36198
36208
|
}
|
|
36209
|
+
if ((data[p.place] & 128) !== 0) {
|
|
36210
|
+
return false;
|
|
36211
|
+
}
|
|
36199
36212
|
var s = data.slice(p.place, slen + p.place);
|
|
36200
36213
|
if (r[0] === 0) {
|
|
36201
36214
|
if (r[1] & 0x80) {
|
|
@@ -36341,8 +36354,27 @@ EC.prototype.genKeyPair = function genKeyPair(options) {
|
|
|
36341
36354
|
}
|
|
36342
36355
|
};
|
|
36343
36356
|
|
|
36344
|
-
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly) {
|
|
36345
|
-
var
|
|
36357
|
+
EC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) {
|
|
36358
|
+
var byteLength;
|
|
36359
|
+
if (BN$1.isBN(msg) || typeof msg === 'number') {
|
|
36360
|
+
msg = new BN$1(msg, 16);
|
|
36361
|
+
byteLength = msg.byteLength();
|
|
36362
|
+
} else if (typeof msg === 'object') {
|
|
36363
|
+
// BN assumes an array-like input and asserts length
|
|
36364
|
+
byteLength = msg.length;
|
|
36365
|
+
msg = new BN$1(msg, 16);
|
|
36366
|
+
} else {
|
|
36367
|
+
// BN converts the value to string
|
|
36368
|
+
var str = msg.toString();
|
|
36369
|
+
// HEX encoding
|
|
36370
|
+
byteLength = (str.length + 1) >>> 1;
|
|
36371
|
+
msg = new BN$1(str, 16);
|
|
36372
|
+
}
|
|
36373
|
+
// Allow overriding
|
|
36374
|
+
if (typeof bitLength !== 'number') {
|
|
36375
|
+
bitLength = byteLength * 8;
|
|
36376
|
+
}
|
|
36377
|
+
var delta = bitLength - this.n.bitLength();
|
|
36346
36378
|
if (delta > 0)
|
|
36347
36379
|
msg = msg.ushrn(delta);
|
|
36348
36380
|
if (!truncOnly && msg.cmp(this.n) >= 0)
|
|
@@ -36359,8 +36391,18 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
36359
36391
|
if (!options)
|
|
36360
36392
|
options = {};
|
|
36361
36393
|
|
|
36394
|
+
if (typeof msg !== 'string' && typeof msg !== 'number' && !BN$1.isBN(msg)) {
|
|
36395
|
+
assert$5(typeof msg === 'object' && msg && typeof msg.length === 'number',
|
|
36396
|
+
'Expected message to be an array-like, a hex string, or a BN instance');
|
|
36397
|
+
assert$5((msg.length >>> 0) === msg.length); // non-negative 32-bit integer
|
|
36398
|
+
for (var i = 0; i < msg.length; i++) assert$5((msg[i] & 255) === msg[i]);
|
|
36399
|
+
}
|
|
36400
|
+
|
|
36362
36401
|
key = this.keyFromPrivate(key, enc);
|
|
36363
|
-
msg = this._truncateToN(
|
|
36402
|
+
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
36403
|
+
|
|
36404
|
+
// Would fail further checks, but let's make the error message clear
|
|
36405
|
+
assert$5(!msg.isNeg(), 'Can not sign a negative message');
|
|
36364
36406
|
|
|
36365
36407
|
// Zero-extend key to provide enough entropy
|
|
36366
36408
|
var bytes = this.n.byteLength();
|
|
@@ -36369,6 +36411,9 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
36369
36411
|
// Zero-extend nonce to have the same byte size as N
|
|
36370
36412
|
var nonce = msg.toArray('be', bytes);
|
|
36371
36413
|
|
|
36414
|
+
// Recheck nonce to be bijective to msg
|
|
36415
|
+
assert$5((new BN$1(nonce)).eq(msg), 'Can not sign message');
|
|
36416
|
+
|
|
36372
36417
|
// Instantiate Hmac_DRBG
|
|
36373
36418
|
var drbg = new hmacDrbg({
|
|
36374
36419
|
hash: this.hash,
|
|
@@ -36416,8 +36461,11 @@ EC.prototype.sign = function sign(msg, key, enc, options) {
|
|
|
36416
36461
|
}
|
|
36417
36462
|
};
|
|
36418
36463
|
|
|
36419
|
-
EC.prototype.verify = function verify(msg, signature$1, key, enc) {
|
|
36420
|
-
|
|
36464
|
+
EC.prototype.verify = function verify(msg, signature$1, key, enc, options) {
|
|
36465
|
+
if (!options)
|
|
36466
|
+
options = {};
|
|
36467
|
+
|
|
36468
|
+
msg = this._truncateToN(msg, false, options.msgBitLength);
|
|
36421
36469
|
key = this.keyFromPublic(key, enc);
|
|
36422
36470
|
signature$1 = new signature(signature$1, 'hex');
|
|
36423
36471
|
|
|
@@ -36509,7 +36557,7 @@ var elliptic_1 = createCommonjsModule(function (module, exports$1) {
|
|
|
36509
36557
|
|
|
36510
36558
|
var elliptic = exports$1;
|
|
36511
36559
|
|
|
36512
|
-
elliptic.version = /*RicMoo:ethers*/{ version: "6.
|
|
36560
|
+
elliptic.version = /*RicMoo:ethers*/{ version: "6.6.1" }.version;
|
|
36513
36561
|
elliptic.utils = utils_1$1;
|
|
36514
36562
|
elliptic.rand = /*RicMoo:ethers:require(brorand)*/(function() { throw new Error('unsupported'); });
|
|
36515
36563
|
elliptic.curve = curve_1;
|
|
@@ -36522,7 +36570,7 @@ elliptic.eddsa = /*RicMoo:ethers:require(./elliptic/eddsa)*/(null);
|
|
|
36522
36570
|
|
|
36523
36571
|
var EC$1 = elliptic_1.ec;
|
|
36524
36572
|
|
|
36525
|
-
const version$8 = "signing-key/5.
|
|
36573
|
+
const version$8 = "signing-key/5.8.0";
|
|
36526
36574
|
|
|
36527
36575
|
const logger$8 = new Logger(version$8);
|
|
36528
36576
|
let _curve = null;
|
|
@@ -36593,7 +36641,7 @@ function computePublicKey(key, compressed) {
|
|
|
36593
36641
|
return logger$8.throwArgumentError("invalid public or private key", "key", "[REDACTED]");
|
|
36594
36642
|
}
|
|
36595
36643
|
|
|
36596
|
-
const version$7 = "transactions/5.
|
|
36644
|
+
const version$7 = "transactions/5.8.0";
|
|
36597
36645
|
|
|
36598
36646
|
const logger$7 = new Logger(version$7);
|
|
36599
36647
|
var TransactionTypes;
|
|
@@ -36863,7 +36911,7 @@ function parse$1(rawTransaction) {
|
|
|
36863
36911
|
});
|
|
36864
36912
|
}
|
|
36865
36913
|
|
|
36866
|
-
const version$6 = "contracts/5.
|
|
36914
|
+
const version$6 = "contracts/5.8.0";
|
|
36867
36915
|
|
|
36868
36916
|
var __awaiter$4 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36869
36917
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -37618,7 +37666,7 @@ class BaseContract {
|
|
|
37618
37666
|
logger$6.throwError("events require a provider or a signer with a provider", Logger.errors.UNSUPPORTED_OPERATION, { operation: "once" });
|
|
37619
37667
|
}
|
|
37620
37668
|
runningEvent.addListener(listener, once);
|
|
37621
|
-
// Track this running event and its listeners (may already be there; but no
|
|
37669
|
+
// Track this running event and its listeners (may already be there; but no harm in updating)
|
|
37622
37670
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
|
37623
37671
|
// If we are not polling the provider, start polling
|
|
37624
37672
|
if (!this._wrappedEmits[runningEvent.tag]) {
|
|
@@ -37865,7 +37913,7 @@ function sha256(data) {
|
|
|
37865
37913
|
return "0x" + (hash.sha256().update(arrayify(data)).digest("hex"));
|
|
37866
37914
|
}
|
|
37867
37915
|
|
|
37868
|
-
const version$5 = "networks/5.
|
|
37916
|
+
const version$5 = "networks/5.8.0";
|
|
37869
37917
|
|
|
37870
37918
|
const logger$5 = new Logger(version$5);
|
|
37871
37919
|
function isRenetworkable(value) {
|
|
@@ -37925,6 +37973,12 @@ function ethDefaultProvider(network) {
|
|
|
37925
37973
|
}
|
|
37926
37974
|
catch (error) { }
|
|
37927
37975
|
}
|
|
37976
|
+
if (providers.QuickNodeProvider && options.quicknode !== "-") {
|
|
37977
|
+
try {
|
|
37978
|
+
providerList.push(new providers.QuickNodeProvider(network, options.quicknode));
|
|
37979
|
+
}
|
|
37980
|
+
catch (error) { }
|
|
37981
|
+
}
|
|
37928
37982
|
if (providerList.length === 0) {
|
|
37929
37983
|
return null;
|
|
37930
37984
|
}
|
|
@@ -38002,9 +38056,15 @@ const networks = {
|
|
|
38002
38056
|
kintsugi: { chainId: 1337702, name: "kintsugi" },
|
|
38003
38057
|
sepolia: {
|
|
38004
38058
|
chainId: 11155111,
|
|
38059
|
+
ensAddress: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
|
|
38005
38060
|
name: "sepolia",
|
|
38006
38061
|
_defaultProvider: ethDefaultProvider("sepolia")
|
|
38007
38062
|
},
|
|
38063
|
+
holesky: {
|
|
38064
|
+
chainId: 17000,
|
|
38065
|
+
name: "holesky",
|
|
38066
|
+
_defaultProvider: ethDefaultProvider("holesky")
|
|
38067
|
+
},
|
|
38008
38068
|
// ETC (See: #351)
|
|
38009
38069
|
classic: {
|
|
38010
38070
|
chainId: 61,
|
|
@@ -38025,7 +38085,11 @@ const networks = {
|
|
|
38025
38085
|
name: "matic",
|
|
38026
38086
|
_defaultProvider: ethDefaultProvider("matic")
|
|
38027
38087
|
},
|
|
38028
|
-
maticmum: {
|
|
38088
|
+
maticmum: {
|
|
38089
|
+
chainId: 80001,
|
|
38090
|
+
name: "maticmum",
|
|
38091
|
+
_defaultProvider: ethDefaultProvider("maticmum")
|
|
38092
|
+
},
|
|
38029
38093
|
optimism: {
|
|
38030
38094
|
chainId: 10,
|
|
38031
38095
|
name: "optimism",
|
|
@@ -38033,9 +38097,11 @@ const networks = {
|
|
|
38033
38097
|
},
|
|
38034
38098
|
"optimism-kovan": { chainId: 69, name: "optimism-kovan" },
|
|
38035
38099
|
"optimism-goerli": { chainId: 420, name: "optimism-goerli" },
|
|
38100
|
+
"optimism-sepolia": { chainId: 11155420, name: "optimism-sepolia" },
|
|
38036
38101
|
arbitrum: { chainId: 42161, name: "arbitrum" },
|
|
38037
38102
|
"arbitrum-rinkeby": { chainId: 421611, name: "arbitrum-rinkeby" },
|
|
38038
38103
|
"arbitrum-goerli": { chainId: 421613, name: "arbitrum-goerli" },
|
|
38104
|
+
"arbitrum-sepolia": { chainId: 421614, name: "arbitrum-sepolia" },
|
|
38039
38105
|
bnb: { chainId: 56, name: "bnb" },
|
|
38040
38106
|
bnbt: { chainId: 97, name: "bnbt" },
|
|
38041
38107
|
};
|
|
@@ -38111,7 +38177,7 @@ function getNetwork(network) {
|
|
|
38111
38177
|
};
|
|
38112
38178
|
}
|
|
38113
38179
|
|
|
38114
|
-
const version$4 = "web/5.
|
|
38180
|
+
const version$4 = "web/5.8.0";
|
|
38115
38181
|
|
|
38116
38182
|
var __awaiter$3 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
38117
38183
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -38758,7 +38824,7 @@ var bech32 = {
|
|
|
38758
38824
|
|
|
38759
38825
|
var bech32$1 = /*@__PURE__*/getDefaultExportFromCjs(bech32);
|
|
38760
38826
|
|
|
38761
|
-
const version$3 = "providers/5.
|
|
38827
|
+
const version$3 = "providers/5.8.0";
|
|
38762
38828
|
|
|
38763
38829
|
const logger$3 = new Logger(version$3);
|
|
38764
38830
|
class Formatter {
|
|
@@ -41822,7 +41888,7 @@ class JsonRpcProvider extends BaseProvider {
|
|
|
41822
41888
|
}
|
|
41823
41889
|
}
|
|
41824
41890
|
|
|
41825
|
-
const version$2 = "units/5.
|
|
41891
|
+
const version$2 = "units/5.8.0";
|
|
41826
41892
|
|
|
41827
41893
|
const logger = new Logger(version$2);
|
|
41828
41894
|
const names$2 = [
|
|
@@ -41866,7 +41932,7 @@ lodash.exports;
|
|
|
41866
41932
|
var undefined$1;
|
|
41867
41933
|
|
|
41868
41934
|
/** Used as the semantic version number. */
|
|
41869
|
-
var VERSION = '4.17.
|
|
41935
|
+
var VERSION = '4.17.23';
|
|
41870
41936
|
|
|
41871
41937
|
/** Used as the size to enable large array optimizations. */
|
|
41872
41938
|
var LARGE_ARRAY_SIZE = 200;
|
|
@@ -45620,7 +45686,7 @@ lodash.exports;
|
|
|
45620
45686
|
if (isArray(iteratee)) {
|
|
45621
45687
|
return function(value) {
|
|
45622
45688
|
return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
|
|
45623
|
-
}
|
|
45689
|
+
};
|
|
45624
45690
|
}
|
|
45625
45691
|
return iteratee;
|
|
45626
45692
|
});
|
|
@@ -46224,8 +46290,47 @@ lodash.exports;
|
|
|
46224
46290
|
*/
|
|
46225
46291
|
function baseUnset(object, path) {
|
|
46226
46292
|
path = castPath(path, object);
|
|
46227
|
-
|
|
46228
|
-
|
|
46293
|
+
|
|
46294
|
+
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
46295
|
+
var index = -1,
|
|
46296
|
+
length = path.length;
|
|
46297
|
+
|
|
46298
|
+
if (!length) {
|
|
46299
|
+
return true;
|
|
46300
|
+
}
|
|
46301
|
+
|
|
46302
|
+
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
|
46303
|
+
|
|
46304
|
+
while (++index < length) {
|
|
46305
|
+
var key = path[index];
|
|
46306
|
+
|
|
46307
|
+
// skip non-string keys (e.g., Symbols, numbers)
|
|
46308
|
+
if (typeof key !== 'string') {
|
|
46309
|
+
continue;
|
|
46310
|
+
}
|
|
46311
|
+
|
|
46312
|
+
// Always block "__proto__" anywhere in the path if it's not expected
|
|
46313
|
+
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
46314
|
+
return false;
|
|
46315
|
+
}
|
|
46316
|
+
|
|
46317
|
+
// Block "constructor.prototype" chains
|
|
46318
|
+
if (key === 'constructor' &&
|
|
46319
|
+
(index + 1) < length &&
|
|
46320
|
+
typeof path[index + 1] === 'string' &&
|
|
46321
|
+
path[index + 1] === 'prototype') {
|
|
46322
|
+
|
|
46323
|
+
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
|
46324
|
+
if (isRootPrimitive && index === 0) {
|
|
46325
|
+
continue;
|
|
46326
|
+
}
|
|
46327
|
+
|
|
46328
|
+
return false;
|
|
46329
|
+
}
|
|
46330
|
+
}
|
|
46331
|
+
|
|
46332
|
+
var obj = parent(object, path);
|
|
46333
|
+
return obj == null || delete obj[toKey(last(path))];
|
|
46229
46334
|
}
|
|
46230
46335
|
|
|
46231
46336
|
/**
|
|
@@ -59162,6 +59267,7 @@ const QUERY_KEYS = {
|
|
|
59162
59267
|
PRE_TGE_LIST: 'Goomoney-SDK-preTGEList',
|
|
59163
59268
|
PRE_TGE_USER_BONDS: 'Goomoney-SDK-preTGEUserBonds',
|
|
59164
59269
|
USER_TOKENS_BALANCES: 'Goomoney-SDK-userTokensBalances',
|
|
59270
|
+
REFUND_DATA: 'Goomoney-SDK-refundData',
|
|
59165
59271
|
};
|
|
59166
59272
|
|
|
59167
59273
|
// Prod URLS. Do not make changes here
|
|
@@ -71418,7 +71524,7 @@ const YourBondsMenu = ({ handleSort, }) => {
|
|
|
71418
71524
|
return (jsx$2("div", { className: "bonds-menu", children: jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsx$2(Flex$1, { sx: { width: '100%', maxWidth: '300px' } }) }), jsxs("div", { className: "headers-container", sx: { pr: ['0', '0', '0', '20px'] }, children: [jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('claimable'), children: ["CLAIMABLE", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('pending'), children: ["PENDING", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "your-bonds-table-headers", onClick: () => handleSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2(Flex$1, { className: "claim-all-button-container", children: SDKConfig.referenceId === 'apebond' && jsx$2(ClaimAll, {}) })] })] }) }));
|
|
71419
71525
|
};
|
|
71420
71526
|
|
|
71421
|
-
var
|
|
71527
|
+
var launchBondsABI = [
|
|
71422
71528
|
{
|
|
71423
71529
|
anonymous: false,
|
|
71424
71530
|
inputs: [
|
|
@@ -73851,7 +73957,7 @@ const fetchPreTGEUserBonds = (chains, tokenPrices, preTGEList, account, apiUrl)
|
|
|
73851
73957
|
name: 'trueBillPrice',
|
|
73852
73958
|
},
|
|
73853
73959
|
];
|
|
73854
|
-
const res = yield multicall(bond.chainId,
|
|
73960
|
+
const res = yield multicall(bond.chainId, launchBondsABI, calls);
|
|
73855
73961
|
const billId = (_g = res[0][0][0]) === null || _g === void 0 ? void 0 : _g.toString();
|
|
73856
73962
|
let userOwnedBillsData;
|
|
73857
73963
|
if (billId) {
|
|
@@ -73871,7 +73977,7 @@ const fetchPreTGEUserBonds = (chains, tokenPrices, preTGEList, account, apiUrl)
|
|
|
73871
73977
|
params: [billId],
|
|
73872
73978
|
},
|
|
73873
73979
|
];
|
|
73874
|
-
const billData = yield multicall(bond.chainId,
|
|
73980
|
+
const billData = yield multicall(bond.chainId, launchBondsABI, billDataCalls);
|
|
73875
73981
|
userOwnedBillsData = {
|
|
73876
73982
|
address: (_l = bond.contractAddress[bond.chainId]) !== null && _l !== void 0 ? _l : '',
|
|
73877
73983
|
id: billId,
|
|
@@ -73953,7 +74059,7 @@ const PreTgeActions = ({ userBond }) => {
|
|
|
73953
74059
|
setLoading(true);
|
|
73954
74060
|
writeContractAsync({
|
|
73955
74061
|
address: userBond.contractAddress[userBond.chainId],
|
|
73956
|
-
abi:
|
|
74062
|
+
abi: launchBondsABI,
|
|
73957
74063
|
functionName: 'redeem',
|
|
73958
74064
|
chain: userBond.chainId,
|
|
73959
74065
|
account,
|
|
@@ -73983,7 +74089,7 @@ const PreTgeActions = ({ userBond }) => {
|
|
|
73983
74089
|
return;
|
|
73984
74090
|
writeContractAsync({
|
|
73985
74091
|
address: userBond.contractAddress[userBond.chainId],
|
|
73986
|
-
abi:
|
|
74092
|
+
abi: launchBondsABI,
|
|
73987
74093
|
functionName: 'claim',
|
|
73988
74094
|
args: [(_b = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _b === void 0 ? void 0 : _b.id],
|
|
73989
74095
|
chain: userBond.chainId,
|
|
@@ -74079,6 +74185,8 @@ const getSaleInfo = (isFake, apiAddress) => __awaiter$9(void 0, void 0, void 0,
|
|
|
74079
74185
|
currentStage: null,
|
|
74080
74186
|
nextStage: null,
|
|
74081
74187
|
isInBreakPeriod: false,
|
|
74188
|
+
isRefundPeriod: false,
|
|
74189
|
+
refundStage: null,
|
|
74082
74190
|
totalHardCap: 0,
|
|
74083
74191
|
totalBilled: 0,
|
|
74084
74192
|
overallProgress: 0,
|
|
@@ -74089,12 +74197,13 @@ const getSaleInfo = (isFake, apiAddress) => __awaiter$9(void 0, void 0, void 0,
|
|
|
74089
74197
|
}
|
|
74090
74198
|
});
|
|
74091
74199
|
const transformSaleData = (rawData, isFake) => {
|
|
74200
|
+
var _a;
|
|
74092
74201
|
const now = Math.floor(Date.now() / 1000);
|
|
74093
74202
|
const gooTGEPrice = 4;
|
|
74094
74203
|
const stages = rawData.map((stage, index) => {
|
|
74095
|
-
var _a;
|
|
74096
74204
|
// Override startTime for refund stage
|
|
74097
|
-
const startTime = stage.key === 'refund' ? 1858530087 : stage.startTime
|
|
74205
|
+
// const startTime = stage.key === 'refund' ? 1858530087 : stage.startTime
|
|
74206
|
+
var _a;
|
|
74098
74207
|
const hardCapSats = parseInt(stage.hardCapSats);
|
|
74099
74208
|
const totalBilledSats = parseInt(stage.totalBilledSats);
|
|
74100
74209
|
const activeReservationsSats = parseInt(stage.activeReservationsSats);
|
|
@@ -74135,12 +74244,12 @@ const transformSaleData = (rawData, isFake) => {
|
|
|
74135
74244
|
});
|
|
74136
74245
|
const progressPercentage = hardCapSats > 0 ? (totalBilledSats / hardCapSats) * 100 : 0;
|
|
74137
74246
|
const remainingPercentage = hardCapSats > 0 ? ((hardCapSats - totalBilledSats) / hardCapSats) * 100 : 50;
|
|
74138
|
-
const isActive = now >= startTime && now < stage.endTime;
|
|
74247
|
+
const isActive = now >= stage.startTime && now < stage.endTime;
|
|
74139
74248
|
const hasEnded = now >= stage.endTime;
|
|
74140
74249
|
return {
|
|
74141
74250
|
stageNumber,
|
|
74142
74251
|
key: stage.key,
|
|
74143
|
-
startTime,
|
|
74252
|
+
startTime: stage.startTime,
|
|
74144
74253
|
endTime: stage.endTime,
|
|
74145
74254
|
hardCapSats,
|
|
74146
74255
|
totalBilledSats,
|
|
@@ -74166,11 +74275,16 @@ const transformSaleData = (rawData, isFake) => {
|
|
|
74166
74275
|
const nextStage = stages.filter((stage) => now < stage.startTime).sort((a, b) => a.startTime - b.startTime)[0] || null;
|
|
74167
74276
|
// Determine if we're in a break period (between stages)
|
|
74168
74277
|
const isInBreakPeriod = !currentStage && nextStage !== null;
|
|
74278
|
+
// Find refund stage by key and determine if we're in refund period
|
|
74279
|
+
const refundStage = stages.find((stage) => stage.key === 'refund') || null;
|
|
74280
|
+
const isRefundPeriod = (_a = refundStage === null || refundStage === void 0 ? void 0 : refundStage.isActive) !== null && _a !== void 0 ? _a : false;
|
|
74169
74281
|
return {
|
|
74170
74282
|
stages,
|
|
74171
74283
|
currentStage,
|
|
74172
74284
|
nextStage,
|
|
74173
74285
|
isInBreakPeriod,
|
|
74286
|
+
isRefundPeriod,
|
|
74287
|
+
refundStage,
|
|
74174
74288
|
totalHardCap,
|
|
74175
74289
|
totalBilled,
|
|
74176
74290
|
overallProgress,
|
|
@@ -74242,7 +74356,7 @@ const fetchGooPreTGEUserBonds = (chains, tokenPrices, gooContracts, account, api
|
|
|
74242
74356
|
name: 'trueBillPrice',
|
|
74243
74357
|
},
|
|
74244
74358
|
];
|
|
74245
|
-
const res = yield multicall(contract.chainId,
|
|
74359
|
+
const res = yield multicall(contract.chainId, launchBondsABI, calls);
|
|
74246
74360
|
const billId = (_a = res[0][0][0]) === null || _a === void 0 ? void 0 : _a.toString();
|
|
74247
74361
|
let userOwnedBillsData;
|
|
74248
74362
|
if (billId) {
|
|
@@ -74262,7 +74376,7 @@ const fetchGooPreTGEUserBonds = (chains, tokenPrices, gooContracts, account, api
|
|
|
74262
74376
|
params: [billId],
|
|
74263
74377
|
},
|
|
74264
74378
|
];
|
|
74265
|
-
const billData = yield multicall(contract.chainId,
|
|
74379
|
+
const billData = yield multicall(contract.chainId, launchBondsABI, billDataCalls);
|
|
74266
74380
|
userOwnedBillsData = {
|
|
74267
74381
|
address: contract.address,
|
|
74268
74382
|
id: billId,
|
|
@@ -77272,7 +77386,7 @@ const getPreTGEBondsData = (chain, tokenPrices, preTGEBonds, apiUrl) => __awaite
|
|
|
77272
77386
|
},
|
|
77273
77387
|
];
|
|
77274
77388
|
});
|
|
77275
|
-
const vals = yield multicall(chainId,
|
|
77389
|
+
const vals = yield multicall(chainId, launchBondsABI, launchBondsCalls);
|
|
77276
77390
|
const chunkSize = vals.length / preTGEBonds.length;
|
|
77277
77391
|
const chunkedBills = lodashExports.chunk(vals, chunkSize);
|
|
77278
77392
|
const returnedBills = chunkedBills === null || chunkedBills === void 0 ? void 0 : chunkedBills.map((chunk, index) => {
|
|
@@ -80501,7 +80615,7 @@ const PreTGEBuyComponent = ({ bondAddress, bondChain, onDismiss, handlePurchased
|
|
|
80501
80615
|
const args = [amount, maxPrice, address];
|
|
80502
80616
|
yield writeContractAsync({
|
|
80503
80617
|
address: (_f = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _f === void 0 ? void 0 : _f[bond.chainId],
|
|
80504
|
-
abi:
|
|
80618
|
+
abi: launchBondsABI,
|
|
80505
80619
|
functionName: 'deposit',
|
|
80506
80620
|
args: args,
|
|
80507
80621
|
chain: bond.chainId,
|
|
@@ -99840,7 +99954,7 @@ const BondRowsByChain = ({ contractsByChain }) => {
|
|
|
99840
99954
|
};
|
|
99841
99955
|
|
|
99842
99956
|
const ProgressBar = ({ saleInfo }) => {
|
|
99843
|
-
var _a, _b, _c, _d;
|
|
99957
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
99844
99958
|
const nextStageNumber = (_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _a === void 0 ? void 0 : _a.stageNumber;
|
|
99845
99959
|
const stage = (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) && nextStageNumber
|
|
99846
99960
|
? saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages.find((stage) => stage.stageNumber === nextStageNumber - 1)
|
|
@@ -99872,6 +99986,9 @@ const ProgressBar = ({ saleInfo }) => {
|
|
|
99872
99986
|
currency: 'USD',
|
|
99873
99987
|
maximumFractionDigits: 0,
|
|
99874
99988
|
});
|
|
99989
|
+
// Determine if we're in refund or TGE period
|
|
99990
|
+
const isRefundPeriod = (_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod) !== null && _e !== void 0 ? _e : false;
|
|
99991
|
+
const isTGEPeriod = ((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _f === void 0 ? void 0 : _f.key) === 'tge';
|
|
99875
99992
|
const endTime = useMemo(() => {
|
|
99876
99993
|
const timestamp = stage === null || stage === void 0 ? void 0 : stage.endTime;
|
|
99877
99994
|
if (!timestamp)
|
|
@@ -99938,15 +100055,27 @@ const ProgressBar = ({ saleInfo }) => {
|
|
|
99938
100055
|
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
99939
100056
|
mb: '0.2rem',
|
|
99940
100057
|
mt: '1rem',
|
|
99941
|
-
}, children:
|
|
100058
|
+
}, children: isRefundPeriod
|
|
100059
|
+
? 'Refund Period'
|
|
100060
|
+
: isTGEPeriod
|
|
100061
|
+
? 'TGE'
|
|
100062
|
+
: 'Stage ' + stageNumber + ' Progress' }), jsx$2(Text, { sx: { fontSize: '22px', fontWeight: '700' }, children: `${timeLeft}` })] })) ] }), jsx$2(Text, { sx: {
|
|
99942
100063
|
fontSize: '12px',
|
|
99943
100064
|
fontWeight: '400',
|
|
99944
100065
|
textAlign: 'right',
|
|
99945
100066
|
ml: '10px',
|
|
99946
100067
|
color: 'var(--theme-ui-colors-textDisabledButton)',
|
|
99947
100068
|
}, children: (stage === null || stage === void 0 ? void 0 : stage.hasEnded)
|
|
99948
|
-
?
|
|
99949
|
-
|
|
100069
|
+
? ((_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _g === void 0 ? void 0 : _g.key) === 'refund'
|
|
100070
|
+
? 'Refund Period starts: ' + nextStageStartTime + ' UTC'
|
|
100071
|
+
: ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.key) === 'tge'
|
|
100072
|
+
? 'TGE starts: ' + nextStageStartTime + ' UTC'
|
|
100073
|
+
: 'Stage ' + nextStageNumber + ' starts: ' + nextStageStartTime + ' UTC'
|
|
100074
|
+
: isRefundPeriod
|
|
100075
|
+
? 'Refund Period Ends: ' + endTime + ' UTC'
|
|
100076
|
+
: isTGEPeriod
|
|
100077
|
+
? 'TGE Ends: ' + endTime + ' UTC'
|
|
100078
|
+
: 'Stage ' + stageNumber + ' Ends: ' + endTime + ' UTC' })] }), jsx$2(Flex$1, { sx: { width: ['100%'], alignItems: 'center', flexDirection: 'row', my: '1rem' }, children: jsx$2(Box$1, { style: {
|
|
99950
100079
|
width: '100%',
|
|
99951
100080
|
height: '11px',
|
|
99952
100081
|
backgroundColor: 'var(--theme-ui-colors-white4)',
|
|
@@ -100401,13 +100530,203 @@ const CountdownTimer = ({ targetTime }) => {
|
|
|
100401
100530
|
}, children: [jsx$2(CounterCard, { digit: (countdown === null || countdown === void 0 ? void 0 : countdown.days) || 0, text: "Days" }), jsx$2(Colon, {}), jsx$2(CounterCard, { digit: (countdown === null || countdown === void 0 ? void 0 : countdown.hours) || 0, text: "Hours" }), jsx$2(Colon, {}), jsx$2(CounterCard, { digit: (countdown === null || countdown === void 0 ? void 0 : countdown.minutes) || 0, text: "Minutes" }), jsx$2(Colon, {}), jsx$2(CounterCard, { digit: (countdown === null || countdown === void 0 ? void 0 : countdown.seconds) || 0, text: "Seconds" })] })));
|
|
100402
100531
|
};
|
|
100403
100532
|
|
|
100533
|
+
function useRefundData() {
|
|
100534
|
+
var _a, _b, _c;
|
|
100535
|
+
const { address } = useAccount();
|
|
100536
|
+
const { chains } = useSDKConfig();
|
|
100537
|
+
const apiUrl = (_b = (_a = useSDKConfig()) === null || _a === void 0 ? void 0 : _a.urls) === null || _b === void 0 ? void 0 : _b.apiV2;
|
|
100538
|
+
const { data: saleInfo, isLoading: isSaleInfoLoading } = useSaleInfo();
|
|
100539
|
+
// Get stage 1 and stage 2 contracts (refundable stages)
|
|
100540
|
+
// Check by stageNumber since key naming may vary
|
|
100541
|
+
const refundableStages = (_c = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages) === null || _c === void 0 ? void 0 : _c.filter((stage) => stage.stageNumber === 1 || stage.stageNumber === 2);
|
|
100542
|
+
console.log('Refundable stages:', refundableStages);
|
|
100543
|
+
console.log('All stages from saleInfo:', saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.stages);
|
|
100544
|
+
// Flatten ALL contracts from refundable stages across ALL chains
|
|
100545
|
+
const allContracts = [];
|
|
100546
|
+
refundableStages === null || refundableStages === void 0 ? void 0 : refundableStages.forEach((stage) => {
|
|
100547
|
+
console.log(`Stage ${stage.stageNumber} (${stage.key}) contractsByChain:`, stage.contractsByChain);
|
|
100548
|
+
Object.entries(stage.contractsByChain).forEach(([chainId, contracts]) => {
|
|
100549
|
+
contracts.forEach((contract) => {
|
|
100550
|
+
console.log(`Adding contract: ${contract.address} on chain ${chainId} for stage ${stage.stageNumber}`);
|
|
100551
|
+
allContracts.push(Object.assign(Object.assign({}, contract), { chainId: parseInt(chainId), stageKey: stage.key, stageNumber: stage.stageNumber }));
|
|
100552
|
+
});
|
|
100553
|
+
});
|
|
100554
|
+
});
|
|
100555
|
+
console.log('All contracts to check for refund:', allContracts);
|
|
100556
|
+
return useQuery({
|
|
100557
|
+
queryKey: [QUERY_KEYS.REFUND_DATA, address, allContracts === null || allContracts === void 0 ? void 0 : allContracts.length],
|
|
100558
|
+
queryFn: () => fetchRefundData(chains, allContracts, address, apiUrl),
|
|
100559
|
+
refetchInterval: 30000,
|
|
100560
|
+
refetchOnWindowFocus: true,
|
|
100561
|
+
enabled: !isSaleInfoLoading && allContracts.length > 0 && !!address,
|
|
100562
|
+
});
|
|
100563
|
+
}
|
|
100564
|
+
const fetchRefundData = (chains, contracts, account, apiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
100565
|
+
try {
|
|
100566
|
+
console.log('fetchRefundData called with:', { chains, contractCount: contracts.length, account });
|
|
100567
|
+
// Filter out invalid contracts
|
|
100568
|
+
const validContracts = contracts.filter((contract) => contract.address !== '0x0000000000000000000000000000000000000000' && contract.address !== '');
|
|
100569
|
+
console.log('Valid contracts after filtering:', validContracts.length, validContracts);
|
|
100570
|
+
const results = yield Promise.all(validContracts.map((contract) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
100571
|
+
try {
|
|
100572
|
+
const calls = [
|
|
100573
|
+
{
|
|
100574
|
+
address: contract.address,
|
|
100575
|
+
name: 'accountInfo',
|
|
100576
|
+
params: [account],
|
|
100577
|
+
},
|
|
100578
|
+
{
|
|
100579
|
+
address: contract.address,
|
|
100580
|
+
name: 'accountStatus',
|
|
100581
|
+
params: [account],
|
|
100582
|
+
},
|
|
100583
|
+
];
|
|
100584
|
+
console.log(`Calling multicall for ${contract.address} on chain ${contract.chainId}`);
|
|
100585
|
+
const res = yield multicall(contract.chainId, launchBondsABI, calls);
|
|
100586
|
+
console.log(`Multicall result for ${contract.address}:`, res);
|
|
100587
|
+
const depositAmount = res[0].depositAmount.toString();
|
|
100588
|
+
const hasRefunded = res[1].hasRefunded;
|
|
100589
|
+
console.log(`Contract ${contract.address}: depositAmount=${depositAmount}, hasRefunded=${hasRefunded}`);
|
|
100590
|
+
return {
|
|
100591
|
+
address: contract.address,
|
|
100592
|
+
chainId: contract.chainId,
|
|
100593
|
+
type: contract.type,
|
|
100594
|
+
stageKey: contract.stageKey,
|
|
100595
|
+
stageNumber: contract.stageNumber,
|
|
100596
|
+
depositAmount,
|
|
100597
|
+
depositAmountBTC: Number(depositAmount) / 100000000,
|
|
100598
|
+
hasRefunded,
|
|
100599
|
+
principalToken: contract.principalToken,
|
|
100600
|
+
};
|
|
100601
|
+
}
|
|
100602
|
+
catch (error) {
|
|
100603
|
+
console.error(`Error fetching refund data for ${contract.address} on chain ${contract.chainId}:`, error);
|
|
100604
|
+
return null;
|
|
100605
|
+
}
|
|
100606
|
+
})));
|
|
100607
|
+
const validResults = results.filter((r) => r !== null);
|
|
100608
|
+
// Filter to only show contracts with deposits
|
|
100609
|
+
const contractsWithDeposits = validResults.filter((r) => r.depositAmountBTC > 0.00000001);
|
|
100610
|
+
const totalDepositBTC = contractsWithDeposits.reduce((sum, c) => sum + c.depositAmountBTC, 0);
|
|
100611
|
+
return {
|
|
100612
|
+
contracts: contractsWithDeposits,
|
|
100613
|
+
totalDepositBTC,
|
|
100614
|
+
};
|
|
100615
|
+
}
|
|
100616
|
+
catch (e) {
|
|
100617
|
+
console.error('fetchRefundData error:', e);
|
|
100618
|
+
reportError$1({
|
|
100619
|
+
apiUrl,
|
|
100620
|
+
error: e,
|
|
100621
|
+
extraInfo: { type: 'fetchRefundData', contracts, e },
|
|
100622
|
+
account,
|
|
100623
|
+
});
|
|
100624
|
+
return {
|
|
100625
|
+
contracts: [],
|
|
100626
|
+
totalDepositBTC: 0,
|
|
100627
|
+
};
|
|
100628
|
+
}
|
|
100629
|
+
});
|
|
100630
|
+
|
|
100631
|
+
const RefundRow = ({ contract, onRefundSuccess }) => {
|
|
100632
|
+
const { address: account } = useAccount();
|
|
100633
|
+
const chainId = useChainId();
|
|
100634
|
+
const { switchChain } = useSwitchChain();
|
|
100635
|
+
const { writeContractAsync } = useWriteContract();
|
|
100636
|
+
const { addToastError, addToastSuccess } = usePopups();
|
|
100637
|
+
const [txHash, setTxHash] = useState();
|
|
100638
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
100639
|
+
const { isLoading: isConfirming, isSuccess: isConfirmed } = useMonitorTxHash(txHash, contract.chainId);
|
|
100640
|
+
const needsChainSwitch = chainId !== contract.chainId;
|
|
100641
|
+
const chainName = NETWORK_LABEL[contract.chainId] || `Chain ${contract.chainId}`;
|
|
100642
|
+
const tokenSymbol = contract.type === 'goo' ? 'GOO' : 'sGOO';
|
|
100643
|
+
const handleRefund = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
100644
|
+
if (needsChainSwitch) {
|
|
100645
|
+
switchChain === null || switchChain === void 0 ? void 0 : switchChain({ chainId: contract.chainId });
|
|
100646
|
+
return;
|
|
100647
|
+
}
|
|
100648
|
+
setIsLoading(true);
|
|
100649
|
+
try {
|
|
100650
|
+
const hash = yield writeContractAsync({
|
|
100651
|
+
address: contract.address,
|
|
100652
|
+
abi: launchBondsABI,
|
|
100653
|
+
functionName: 'redeemRefund',
|
|
100654
|
+
args: [],
|
|
100655
|
+
chain: contract.chainId,
|
|
100656
|
+
account,
|
|
100657
|
+
});
|
|
100658
|
+
if (hash) {
|
|
100659
|
+
setTxHash(hash);
|
|
100660
|
+
addToastSuccess('Refund transaction submitted!');
|
|
100661
|
+
onRefundSuccess();
|
|
100662
|
+
}
|
|
100663
|
+
}
|
|
100664
|
+
catch (error) {
|
|
100665
|
+
console.error('Refund error:', error);
|
|
100666
|
+
addToastError((error === null || error === void 0 ? void 0 : error.shortMessage) || 'Failed to process refund');
|
|
100667
|
+
}
|
|
100668
|
+
finally {
|
|
100669
|
+
setIsLoading(false);
|
|
100670
|
+
}
|
|
100671
|
+
});
|
|
100672
|
+
const loading = isLoading || (isConfirming && !isConfirmed);
|
|
100673
|
+
if (contract.hasRefunded) {
|
|
100674
|
+
return (jsxs(Flex, { sx: {
|
|
100675
|
+
width: '100%',
|
|
100676
|
+
background: 'white2',
|
|
100677
|
+
p: '20px',
|
|
100678
|
+
borderRadius: 'normal',
|
|
100679
|
+
mb: '10px',
|
|
100680
|
+
alignItems: 'center',
|
|
100681
|
+
justifyContent: 'space-between',
|
|
100682
|
+
opacity: 0.6,
|
|
100683
|
+
}, children: [jsxs(Flex, { sx: { alignItems: 'center', gap: '15px' }, children: [jsx$2(TokenImage, { symbol: tokenSymbol, size: 40, chain: contract.chainId }), jsxs(Flex, { sx: { flexDirection: 'column' }, children: [jsx$2(Text, { sx: { fontSize: '16px', fontWeight: 'bold' }, children: tokenSymbol }), jsxs(Text, { sx: { fontSize: '12px', opacity: 0.7 }, children: ["Stage ", contract.stageNumber, " \u2022 ", chainName] })] })] }), jsxs(Flex, { sx: { alignItems: 'center', gap: '20px' }, children: [jsxs(Text, { sx: { fontSize: '14px', fontWeight: 500 }, children: [contract.depositAmountBTC.toFixed(8), " BTC"] }), jsx$2(Button, { disabled: true, sx: { minWidth: '120px' }, children: "REFUNDED" })] })] }));
|
|
100684
|
+
}
|
|
100685
|
+
return (jsxs(Flex, { sx: {
|
|
100686
|
+
width: '100%',
|
|
100687
|
+
background: 'white2',
|
|
100688
|
+
p: '20px',
|
|
100689
|
+
borderRadius: 'normal',
|
|
100690
|
+
mb: '10px',
|
|
100691
|
+
alignItems: 'center',
|
|
100692
|
+
justifyContent: 'space-between',
|
|
100693
|
+
flexDirection: ['column', 'column', 'row', 'row'],
|
|
100694
|
+
gap: ['15px', '15px', '0', '0'],
|
|
100695
|
+
}, children: [jsxs(Flex, { sx: { alignItems: 'center', gap: '15px' }, children: [jsx$2(TokenImage, { symbol: tokenSymbol, size: 40, chain: contract.chainId }), jsxs(Flex, { sx: { flexDirection: 'column' }, children: [jsx$2(Text, { sx: { fontSize: '16px', fontWeight: 'bold' }, children: tokenSymbol }), jsxs(Text, { sx: { fontSize: '12px', opacity: 0.7 }, children: ["Stage ", contract.stageNumber, " \u2022 ", chainName] })] })] }), jsxs(Flex, { sx: { alignItems: 'center', gap: '20px', flexDirection: ['column', 'column', 'row', 'row'] }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: ['center', 'center', 'flex-end', 'flex-end'] }, children: [jsxs(Text, { sx: { fontSize: '16px', fontWeight: 'bold' }, children: [contract.depositAmountBTC.toFixed(8), " BTC"] }), jsx$2(Text, { sx: { fontSize: '12px', opacity: 0.7 }, children: "Deposited" })] }), jsx$2(Button, { onClick: handleRefund, disabled: loading, load: loading, sx: { minWidth: '140px' }, variant: needsChainSwitch ? 'secondary' : 'primary', children: loading ? 'PROCESSING...' : needsChainSwitch ? `SWITCH CHAIN` : 'REFUND' })] })] }));
|
|
100696
|
+
};
|
|
100697
|
+
const RefundView = () => {
|
|
100698
|
+
const { address } = useAccount();
|
|
100699
|
+
const { data: refundData, isLoading, refetch } = useRefundData();
|
|
100700
|
+
const handleRefundSuccess = () => {
|
|
100701
|
+
// Refetch data after successful refund
|
|
100702
|
+
setTimeout(() => refetch(), 2000);
|
|
100703
|
+
};
|
|
100704
|
+
if (!address) {
|
|
100705
|
+
return (jsxs(Flex, { sx: { width: '100%', flexDirection: 'column', alignItems: 'center', p: '40px' }, children: [jsx$2(Text, { sx: { fontSize: '18px', fontWeight: 'bold', mb: '20px' }, children: "Connect wallet to view your refundable deposits" }), jsx$2(ConnectButton, {})] }));
|
|
100706
|
+
}
|
|
100707
|
+
if (isLoading) {
|
|
100708
|
+
return (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', p: '60px', width: '100%' }, children: jsx$2(Spinner, {}) }));
|
|
100709
|
+
}
|
|
100710
|
+
const contracts = (refundData === null || refundData === void 0 ? void 0 : refundData.contracts) || [];
|
|
100711
|
+
const hasDeposits = contracts.length > 0;
|
|
100712
|
+
return (jsx$2(Flex, { sx: { width: '100%', flexDirection: 'column', p: ['10px', '20px', '20px', '40px'] }, children: !hasDeposits ? (jsxs(Flex, { sx: {
|
|
100713
|
+
width: '100%',
|
|
100714
|
+
background: 'white2',
|
|
100715
|
+
p: '40px',
|
|
100716
|
+
borderRadius: 'normal',
|
|
100717
|
+
alignItems: 'center',
|
|
100718
|
+
justifyContent: 'center',
|
|
100719
|
+
flexDirection: 'column',
|
|
100720
|
+
}, children: [jsx$2(Text, { sx: { fontSize: '16px', fontWeight: 500, opacity: 0.7 }, children: "No refundable deposits found" }), jsx$2(Text, { sx: { fontSize: '14px', opacity: 0.5, mt: '10px' }, children: "You have not participated in Stage 1 or Stage 2 on the selected chain." })] })) : (jsx$2(Fragment$1, { children: contracts.map((contract) => (jsx$2(RefundRow, { contract: contract, onRefundSuccess: handleRefundSuccess }, `${contract.address}-${contract.chainId}`))) })) }));
|
|
100721
|
+
};
|
|
100722
|
+
|
|
100404
100723
|
var BondsViewOptions;
|
|
100405
100724
|
(function (BondsViewOptions) {
|
|
100406
100725
|
BondsViewOptions["BONDSMARKET"] = "Bonds Market";
|
|
100407
100726
|
BondsViewOptions["YOURBONDS"] = "Your Bonds";
|
|
100408
100727
|
})(BondsViewOptions || (BondsViewOptions = {}));
|
|
100409
100728
|
const GooSale = () => {
|
|
100410
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
100729
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
100411
100730
|
// Fetch data
|
|
100412
100731
|
const { data: chainFilterOption, setChainFilterOption } = useChainFilterOption();
|
|
100413
100732
|
const { data: saleInfo, isLoading: isLoadingSaleInfo } = useSaleInfo();
|
|
@@ -100468,11 +100787,20 @@ const GooSale = () => {
|
|
|
100468
100787
|
});
|
|
100469
100788
|
return filtered;
|
|
100470
100789
|
}, [(_d = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _d === void 0 ? void 0 : _d.contractsByChain, chainFilterOption]);
|
|
100471
|
-
|
|
100790
|
+
// Dynamic title based on current period (hidden during refund period)
|
|
100791
|
+
const pageTitle = useMemo(() => {
|
|
100792
|
+
var _a;
|
|
100793
|
+
if (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod)
|
|
100794
|
+
return null;
|
|
100795
|
+
if (((_a = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _a === void 0 ? void 0 : _a.key) === 'tge')
|
|
100796
|
+
return 'GOO Token Generation Event';
|
|
100797
|
+
return 'Buy GOO at a discount';
|
|
100798
|
+
}, [saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod, (_e = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.currentStage) === null || _e === void 0 ? void 0 : _e.key]);
|
|
100799
|
+
return (jsxs(Flex, { className: "bonds-container", children: [jsx$2(CheckUrl, {}), pageTitle && (jsx$2(Flex, { sx: { justifyContent: 'center', alignItems: 'center', width: '100%' }, children: jsx$2(Text, { sx: { fontSize: '24px', fontWeight: 700, opacity: '0.9' }, children: pageTitle }) })), ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) && (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) && !isLoadingSaleInfo && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'center', mt: '40px', flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Text, { sx: { fontSize: '20px', fontWeight: 'bold', mb: '20px' }, children: [((_f = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _f === void 0 ? void 0 : _f.key) === 'refund'
|
|
100472
100800
|
? 'Refund Period '
|
|
100473
|
-
: ((
|
|
100801
|
+
: ((_g = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _g === void 0 ? void 0 : _g.key) === 'tge'
|
|
100474
100802
|
? 'TGE '
|
|
100475
|
-
: 'Stage ' + ((
|
|
100803
|
+
: 'Stage ' + ((_h = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _h === void 0 ? void 0 : _h.stageNumber) + ' ', "starts in:"] }), jsx$2(CountdownTimer, { targetTime: ((_j = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _j === void 0 ? void 0 : _j.startTime) || 0 }), !(((_k = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _k === void 0 ? void 0 : _k.key) === 'refund' || ((_l = saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) === null || _l === void 0 ? void 0 : _l.key) === 'tge') ? (jsxs(Fragment$1, { children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', mt: '30px' }, children: [address && (jsxs(Flex, { sx: { mr: '1rem', p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { mr: '10px' }, children: jsx$2(Svg, { icon: "wallet" }) }), jsxs(Text, { sx: { fontSize: '14px', fontWeight: 400 }, children: [address === null || address === void 0 ? void 0 : address.slice(0, 4), "...", address === null || address === void 0 ? void 0 : address.slice((address === null || address === void 0 ? void 0 : address.length) - 4, address === null || address === void 0 ? void 0 : address.length)] })] })), jsx$2(Flex, { sx: { fontSize: '18px', fontWeight: 500 }, children: "Are You Eligible?" })] }), !address ? (jsx$2(Flex, { sx: { my: '20px', width: '100%' }, children: jsx$2(ConnectButton, {}) })) : (whitelisted === null ||
|
|
100476
100804
|
(whitelisted === undefined && !cbBTCBalanceChecked && (jsx$2(Button, { sx: { m: '20px', width: '100%' }, onClick: handleCheckEligibility, children: "CHECK ELIGIBILITY" }))))] }), whitelisted !== null && whitelisted !== undefined && (jsxs(Flex, { sx: {
|
|
100477
100805
|
flexDirection: 'row',
|
|
100478
100806
|
alignItems: 'center',
|
|
@@ -100489,7 +100817,19 @@ const GooSale = () => {
|
|
|
100489
100817
|
p: '20px',
|
|
100490
100818
|
m: '20px',
|
|
100491
100819
|
borderRadius: 'normal',
|
|
100492
|
-
}, children: cbBTCBalanceChecked && (jsx$2(Flex, { sx: { flexDirection: 'column', alignItems: 'center', gap: '10px', mt: '10px' }, children: isCbBTCBalanceLoading ? (jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: "Checking BTC balance across all chains..." })) : cbBTCBalance ? (jsxs(Fragment$1, { children: [cbBTCBalance.isEligible ? (addToWhitelistSuccess ? (jsx$2(Text, { color: "primaryButton", sx: { fontSize: '12px', fontWeight: 700 }, children: "\u2713 Successfully added to whitelist! Please refresh to see your tier." })) : addToWhitelistError ? (jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, color: 'error' }, children: "Failed to add to whitelist. Please try again." })) : (jsx$2(Fragment$1, { children: jsx$2(Flex, { sx: { flexDirection: 'row', alignItems: 'center' }, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["You ", jsx$2("span", { sx: { fontWeight: 700 }, children: "ARE" }), " eligible for the sale"] }) }) }))) : (jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', gap: '10px' }, children: [jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["You are ", jsx$2("span", { sx: { fontWeight: 700 }, children: "NOT" }), " eligible for the sale"] }), jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, color: 'error' }, children: "You need at least 0.001 BTC to be whitelisted" })] })), jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["Total BTC Balance: ", cbBTCBalance.balance] }), cbBTCBalance.chainsWithBalance && cbBTCBalance.chainsWithBalance.length > 0 && (jsx$2(Flex, { sx: { flexDirection: 'column', gap: '5px', mt: '5px' }, children: cbBTCBalance.chainsWithBalance.map((chain) => (jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', gap: '10px' }, children: [jsx$2(TokenImage, { symbol: chain.symbol, size: 25, chain: chain.chainId }), jsxs(Text, { sx: { fontSize: '10px', fontWeight: 400, opacity: 0.7 }, children: [chain.balance, " ", chain.symbol] })] }, chain.chainId))) })), cbBTCBalance.isEligible && (jsx$2(Button, { sx: { width: '100%' }, onClick: () => addToWhitelist(), disabled: isAddingToWhitelist, children: isAddingToWhitelist ? 'ADDING TO WHITELIST...' : 'ADD ME TO WHITELIST' }))] })) : (jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: "Unable to fetch BTC balance. Please try again." })) })) }))] })) : (jsx$2(Fragment$1, {}))] })), jsxs(Flex, { sx: {
|
|
100820
|
+
}, children: cbBTCBalanceChecked && (jsx$2(Flex, { sx: { flexDirection: 'column', alignItems: 'center', gap: '10px', mt: '10px' }, children: isCbBTCBalanceLoading ? (jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: "Checking BTC balance across all chains..." })) : cbBTCBalance ? (jsxs(Fragment$1, { children: [cbBTCBalance.isEligible ? (addToWhitelistSuccess ? (jsx$2(Text, { color: "primaryButton", sx: { fontSize: '12px', fontWeight: 700 }, children: "\u2713 Successfully added to whitelist! Please refresh to see your tier." })) : addToWhitelistError ? (jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, color: 'error' }, children: "Failed to add to whitelist. Please try again." })) : (jsx$2(Fragment$1, { children: jsx$2(Flex, { sx: { flexDirection: 'row', alignItems: 'center' }, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["You ", jsx$2("span", { sx: { fontWeight: 700 }, children: "ARE" }), " eligible for the sale"] }) }) }))) : (jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', gap: '10px' }, children: [jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["You are ", jsx$2("span", { sx: { fontWeight: 700 }, children: "NOT" }), " eligible for the sale"] }), jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, color: 'error' }, children: "You need at least 0.001 BTC to be whitelisted" })] })), jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["Total BTC Balance: ", cbBTCBalance.balance] }), cbBTCBalance.chainsWithBalance && cbBTCBalance.chainsWithBalance.length > 0 && (jsx$2(Flex, { sx: { flexDirection: 'column', gap: '5px', mt: '5px' }, children: cbBTCBalance.chainsWithBalance.map((chain) => (jsxs(Flex, { sx: { flexDirection: 'row', alignItems: 'center', gap: '10px' }, children: [jsx$2(TokenImage, { symbol: chain.symbol, size: 25, chain: chain.chainId }), jsxs(Text, { sx: { fontSize: '10px', fontWeight: 400, opacity: 0.7 }, children: [chain.balance, " ", chain.symbol] })] }, chain.chainId))) })), cbBTCBalance.isEligible && (jsx$2(Button, { sx: { width: '100%' }, onClick: () => addToWhitelist(), disabled: isAddingToWhitelist, children: isAddingToWhitelist ? 'ADDING TO WHITELIST...' : 'ADD ME TO WHITELIST' }))] })) : (jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400 }, children: "Unable to fetch BTC balance. Please try again." })) })) }))] })) : (jsx$2(Fragment$1, {}))] })), jsxs(Flex, { sx: {
|
|
100821
|
+
width: '100%',
|
|
100822
|
+
alignItems: 'center',
|
|
100823
|
+
px: '12%',
|
|
100824
|
+
pt: ((saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) || currentStageSoldOut) && (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.nextStage) ? '4rem' : '1rem',
|
|
100825
|
+
pb: '4rem',
|
|
100826
|
+
}, children: [jsx$2(StepBubble, { number: 1, title: 'STAGE 1', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 2, title: 'STAGE 2', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 3, title: 'REFUND', currentStep: currentStageNumber, loading: false }), jsx$2(StepBubble, { number: 4, title: 'TGE', currentStep: currentStageNumber, loading: false, hideBar: true })] }), jsx$2(Divider, { sx: { width: '100%', height: '2px', backgroundColor: 'white2' } }), jsx$2(ProgressBar, { saleInfo: saleInfo }), (saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isRefundPeriod) ? (
|
|
100827
|
+
// Refund period - show refund view for ALL chains
|
|
100828
|
+
jsx$2(RefundView, {})) : !(saleInfo === null || saleInfo === void 0 ? void 0 : saleInfo.isInBreakPeriod) && !currentStageSoldOut ? (
|
|
100829
|
+
// Active sale period - show normal bonds market / your goo tabs
|
|
100830
|
+
jsxs(Fragment$1, { children: [jsx$2(BondsMenu, { setChainFilterOption: handleChainFilterChange, chainFilterOption: chainFilterOption, handleToogle: handleToogle }), activeView === BondsViewOptions.BONDSMARKET && filteredContractsByChain && !isLoadingSaleInfo ? (jsx$2(BondRowsByChain, { contractsByChain: filteredContractsByChain })) : activeView === BondsViewOptions.YOURBONDS && !isLoadingSaleInfo ? (jsx$2(YourGoo, { yourGoo: yourGoo, isLoading: isLoading, isFetching: isFetching })) : (jsx$2(Fragment$1, {}))] })) : userParticipated ? (
|
|
100831
|
+
// Break period but user has participated - show their goo
|
|
100832
|
+
jsxs(Fragment$1, { children: [jsx$2(Divider, { sx: { width: '100%', height: '2px', backgroundColor: 'white2', my: '1rem' } }), jsx$2(YourGoo, { yourGoo: yourGoo, isLoading: isLoading, isFetching: isFetching })] })) : (jsx$2(Fragment$1, {}))] }));
|
|
100493
100833
|
};
|
|
100494
100834
|
|
|
100495
100835
|
const GooSaleWithProviders = (props) => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { GooSaleContractData } from './useSaleInfo';
|
|
3
|
+
export interface RefundContractData {
|
|
4
|
+
address: string;
|
|
5
|
+
chainId: number;
|
|
6
|
+
type: 'goo' | 'sgoo';
|
|
7
|
+
stageKey: string;
|
|
8
|
+
stageNumber: number;
|
|
9
|
+
depositAmount: string;
|
|
10
|
+
depositAmountBTC: number;
|
|
11
|
+
hasRefunded: boolean;
|
|
12
|
+
principalToken: GooSaleContractData['principalToken'];
|
|
13
|
+
}
|
|
14
|
+
export interface RefundData {
|
|
15
|
+
contracts: RefundContractData[];
|
|
16
|
+
totalDepositBTC: number;
|
|
17
|
+
}
|
|
18
|
+
export default function useRefundData(): UseQueryResult<RefundData>;
|
|
@@ -31,6 +31,8 @@ export interface SaleInfo {
|
|
|
31
31
|
currentStage: StageInfo | null;
|
|
32
32
|
nextStage: StageInfo | null;
|
|
33
33
|
isInBreakPeriod: boolean;
|
|
34
|
+
isRefundPeriod: boolean;
|
|
35
|
+
refundStage: StageInfo | null;
|
|
34
36
|
totalHardCap: number;
|
|
35
37
|
totalBilled: number;
|
|
36
38
|
overallProgress: number;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Goo Money Bond SDK",
|
|
4
4
|
"author": "Goo Money",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.0.
|
|
6
|
+
"version": "3.0.160",
|
|
7
7
|
"proxy": "https://realtime-api-pr-99.herokuapp.com",
|
|
8
8
|
"module": "dist/main.js",
|
|
9
9
|
"type": "module",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
"@types/react": "^18.3.3",
|
|
56
56
|
"@types/react-dom": "^18.3.0",
|
|
57
57
|
"@vitejs/plugin-react": "^4.2.1",
|
|
58
|
-
"axios": "1.
|
|
58
|
+
"axios": "1.13.2",
|
|
59
59
|
"eslint": "^9.28.0",
|
|
60
60
|
"eslint-plugin-react": "^7.37.5",
|
|
61
61
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
62
|
-
"ethers": "5.
|
|
62
|
+
"ethers": "5.8.0",
|
|
63
63
|
"husky": "^9.0.11",
|
|
64
64
|
"lint-staged": "^16.1.0",
|
|
65
65
|
"prettier": "^3.3.3",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"dom-to-image": "^2.6.0",
|
|
81
81
|
"framer-motion": "^11.3.2",
|
|
82
82
|
"lightweight-charts": "4.1.5",
|
|
83
|
-
"lodash": "
|
|
83
|
+
"lodash": "4.17.23",
|
|
84
84
|
"numbro": "^2.5.0",
|
|
85
85
|
"primereact": "10.6.2",
|
|
86
86
|
"react-chartjs-2": "5.2.0",
|