everything-dev 0.1.0 → 0.1.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.
- package/package.json +1 -1
- package/src/plugin.ts +9 -7
package/package.json
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -47,7 +47,10 @@ interface BosDeps {
|
|
|
47
47
|
nearPrivateKey?: string;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
const DEFAULT_GATEWAY = "everything.dev";
|
|
51
|
+
|
|
52
|
+
function getGatewayDomain(config: BosConfigType | null): string {
|
|
53
|
+
if (!config) return DEFAULT_GATEWAY;
|
|
51
54
|
const gateway = config.gateway as string | { production: string } | undefined;
|
|
52
55
|
if (typeof gateway === "string") {
|
|
53
56
|
return gateway.replace(/^https?:\/\//, "");
|
|
@@ -55,7 +58,7 @@ function getGatewayDomain(config: BosConfigType): string {
|
|
|
55
58
|
if (gateway && typeof gateway === "object" && "production" in gateway) {
|
|
56
59
|
return gateway.production.replace(/^https?:\/\//, "");
|
|
57
60
|
}
|
|
58
|
-
|
|
61
|
+
return DEFAULT_GATEWAY;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
function getAccountForNetwork(config: BosConfigType, network: "mainnet" | "testnet"): string {
|
|
@@ -512,7 +515,7 @@ export default createPlugin({
|
|
|
512
515
|
network,
|
|
513
516
|
privateKey,
|
|
514
517
|
gas: "300Tgas",
|
|
515
|
-
deposit: depositAmount === "0" ? "
|
|
518
|
+
deposit: depositAmount === "0" ? "1yoctoNEAR" : `${depositAmount}yoctoNEAR`,
|
|
516
519
|
});
|
|
517
520
|
|
|
518
521
|
return {
|
|
@@ -1284,11 +1287,10 @@ export default createPlugin({
|
|
|
1284
1287
|
sync: builder.sync.handler(async ({ input }) => {
|
|
1285
1288
|
const { configDir, bosConfig } = deps;
|
|
1286
1289
|
|
|
1287
|
-
const
|
|
1288
|
-
const DEFAULT_SYNC_GATEWAY = "everything.dev";
|
|
1290
|
+
const DEFAULT_ACCOUNT = "every.near";
|
|
1289
1291
|
|
|
1290
|
-
const account = input.account || bosConfig?.account ||
|
|
1291
|
-
const gateway = input.gateway ||
|
|
1292
|
+
const account = input.account || bosConfig?.account || DEFAULT_ACCOUNT;
|
|
1293
|
+
const gateway = input.gateway || getGatewayDomain(bosConfig);
|
|
1292
1294
|
const socialUrl = `https://near.social/mob.near/widget/State.Inspector?key=${account}/bos/gateways/${gateway}`;
|
|
1293
1295
|
|
|
1294
1296
|
if (!bosConfig) {
|