@seedprotocol/sdk 0.1.112 → 0.1.114

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.
@@ -1,4 +1,4 @@
1
- export { g as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, f as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SCHEMA_BY_NAME, b as GET_SEEDS, c as GET_SEED_IDS, d as GET_STORAGE_TRANSACTION_ID, e as GET_VERSIONS, I as Item, h as itemMachineAll, i as itemMachineSingle } from './index-OiUariqS.js';
1
+ export { g as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, f as GET_PROPERTIES, G as GET_SCHEMAS, a as GET_SCHEMA_BY_NAME, b as GET_SEEDS, c as GET_SEED_IDS, d as GET_STORAGE_TRANSACTION_ID, e as GET_VERSIONS, I as Item, h as itemMachineAll, i as itemMachineSingle } from './index-DO0GcmVW.js';
2
2
  import './constants-CEnkzyny.js';
3
3
  import '@ethereum-attestation-service/eas-sdk';
4
4
  import 'thirdweb';
@@ -29,4 +29,4 @@ import 'rxjs';
29
29
  import 'drizzle-orm/sqlite-proxy';
30
30
  import '@zenfs/dom';
31
31
  import 'arweave';
32
- //# sourceMappingURL=index-CwNnbNh8.js.map
32
+ //# sourceMappingURL=index-Bu8Tm6_l.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CwNnbNh8.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index-Bu8Tm6_l.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -598,7 +598,7 @@ const BROWSER_FS_TOP_DIR = 'app-files';
598
598
  const EAS_ENDPOINT = process.env.NEXT_PUBLIC_EAS_ENDPOINT ||
599
599
  process.env.EAS_ENDPOINT ||
600
600
  'https://optimism-sepolia.easscan.org/graphql';
601
- const ARWEAVE_HOST = process.env.NEXT_PUBLIC_ARWEAVE_HOST || 'permagate.io';
601
+ const ARWEAVE_HOST = process.env.NEXT_PUBLIC_ARWEAVE_HOST || 'arweave.net';
602
602
  const ARWEAVE_ENDPOINT = `https://${ARWEAVE_HOST}/graphql`;
603
603
 
604
604
  const queryClient = new QueryClient({
@@ -1980,7 +1980,7 @@ const syncDbWithEasHandler = throttle((_) => __awaiter(void 0, void 0, void 0, f
1980
1980
 
1981
1981
  const logger$n = debug('app:services:global:actors:initialize');
1982
1982
  const initialize$2 = fromCallback(({ sendBack, input: { event, context } }) => {
1983
- const { internalService, models, endpoints } = context;
1983
+ const { internalService, models, endpoints, arweaveDomain } = context;
1984
1984
  const { addresses } = event;
1985
1985
  let environment = 'browser';
1986
1986
  if (isNode()) {
@@ -2004,7 +2004,12 @@ const initialize$2 = fromCallback(({ sendBack, input: { event, context } }) => {
2004
2004
  resolve();
2005
2005
  }
2006
2006
  });
2007
- internalService.send({ type: 'init', endpoints, addresses });
2007
+ internalService.send({
2008
+ type: 'init',
2009
+ endpoints,
2010
+ addresses,
2011
+ arweaveDomain,
2012
+ });
2008
2013
  });
2009
2014
  });
2010
2015
  const _initAllItemsServices = () => __awaiter(void 0, void 0, void 0, function* () {
@@ -2090,7 +2095,7 @@ const addModelsToDb = fromCallback(({ sendBack, input: { context } }) => {
2090
2095
  if (!models$1) {
2091
2096
  return;
2092
2097
  }
2093
- const { models: SeedModels } = yield import('./seed.schema.config-CY5ZbFqn.js');
2098
+ const { models: SeedModels } = yield import('./seed.schema.config-BDBDPVuJ.js');
2094
2099
  const allModels = Object.assign(Object.assign({}, SeedModels), models$1);
2095
2100
  let hasModelsInDb = false;
2096
2101
  const schemaDefsByModelName = new Map();
@@ -3027,6 +3032,7 @@ setup({
3027
3032
  },
3028
3033
  });
3029
3034
 
3035
+ let domain = 'arweave.net';
3030
3036
  const getArweave = () => {
3031
3037
  if (typeof window === 'undefined' ||
3032
3038
  !Arweave ||
@@ -3053,15 +3059,18 @@ const getArweave = () => {
3053
3059
  // },)
3054
3060
  if (Object.keys(Arweave).includes('default')) {
3055
3061
  return Arweave.default.init({
3056
- host: 'permagate.io',
3062
+ host: domain,
3057
3063
  protocol: 'https',
3058
3064
  });
3059
3065
  }
3060
3066
  return Arweave.init({
3061
- host: 'permagate.io',
3067
+ host: domain,
3062
3068
  protocol: 'https',
3063
3069
  });
3064
3070
  };
3071
+ const setArweaveDomain = (newDomain) => {
3072
+ domain = newDomain;
3073
+ };
3065
3074
 
3066
3075
  const getMetadata = (props) => __awaiter(void 0, void 0, void 0, function* () {
3067
3076
  const appDb = getAppDb();
@@ -3423,7 +3432,7 @@ const saveConfig = fromCallback(({ sendBack, input: { context } }) => {
3423
3432
  error: 'Browser method called from non-browser context',
3424
3433
  });
3425
3434
  }
3426
- const { endpoints, addresses } = context;
3435
+ const { endpoints, addresses, arweaveDomain } = context;
3427
3436
  if (!endpoints) {
3428
3437
  throw new Error('saveConfig called with invalid endpoints');
3429
3438
  }
@@ -3465,6 +3474,19 @@ const saveConfig = fromCallback(({ sendBack, input: { context } }) => {
3465
3474
  },
3466
3475
  setWhere: sql `key = 'addresses'`,
3467
3476
  });
3477
+ yield appDb
3478
+ .insert(appState)
3479
+ .values({
3480
+ key: 'arweaveDomain',
3481
+ value: arweaveDomain || 'arweave.net',
3482
+ })
3483
+ .onConflictDoUpdate({
3484
+ target: appState.key,
3485
+ set: {
3486
+ value: arweaveDomain,
3487
+ },
3488
+ setWhere: sql `key = 'arweaveDomain'`,
3489
+ });
3468
3490
  logger$d('[sdk] [internal/actors] Should be done saving');
3469
3491
  }
3470
3492
  catch (error) {
@@ -6439,7 +6461,10 @@ const setupServiceHandlers = () => {
6439
6461
 
6440
6462
  const client = {
6441
6463
  init: ({ config, addresses }) => {
6442
- const { endpoints, models } = config;
6464
+ const { endpoints, models, arweaveDomain } = config;
6465
+ if (arweaveDomain) {
6466
+ setArweaveDomain(arweaveDomain);
6467
+ }
6443
6468
  for (const [key, value] of Object.entries(models)) {
6444
6469
  setModel(key, value);
6445
6470
  }
@@ -6453,8 +6478,14 @@ const client = {
6453
6478
  if (!areFsListenersReady()) {
6454
6479
  console.error('fs listeners not ready during init');
6455
6480
  }
6456
- globalService.send({ type: 'init', endpoints, models, addresses });
6457
- import('./seed.schema.config-CY5ZbFqn.js').then(({ models }) => {
6481
+ globalService.send({
6482
+ type: 'init',
6483
+ endpoints,
6484
+ models,
6485
+ addresses,
6486
+ arweaveDomain,
6487
+ });
6488
+ import('./seed.schema.config-BDBDPVuJ.js').then(({ models }) => {
6458
6489
  for (const [key, value] of Object.entries(models)) {
6459
6490
  setModel(key, value);
6460
6491
  }
@@ -7129,7 +7160,7 @@ const hydrateFromDb = fromCallback(({ sendBack, input: { context } }) => {
7129
7160
  if (propertyRecordSchema &&
7130
7161
  propertyRecordSchema.storageType &&
7131
7162
  propertyRecordSchema.storageType === 'ItemStorage') {
7132
- const { Item } = yield import('./index-CwNnbNh8.js');
7163
+ const { Item } = yield import('./index-Bu8Tm6_l.js');
7133
7164
  const item = yield Item.find({
7134
7165
  seedLocalId,
7135
7166
  modelName,
@@ -8071,4 +8102,4 @@ if (isNode()) {
8071
8102
  }
8072
8103
 
8073
8104
  export { GET_SCHEMAS as G, Item as I, Json as J, List as L, Model as M, Property as P, Relation as R, Text as T, GET_SCHEMA_BY_NAME as a, GET_SEEDS as b, GET_SEED_IDS as c, GET_STORAGE_TRANSACTION_ID as d, GET_VERSIONS as e, GET_PROPERTIES as f, GET_ALL_PROPERTIES_FOR_ALL_VERSIONS as g, itemMachineAll as h, itemMachineSingle as i, ImageSrc as j, ItemProperty as k, useItem as l, useItemProperties as m, useCreateItem as n, useItemProperty as o, useDeleteItem as p, useGlobalServiceStatus as q, useServices as r, getGlobalService as s, client as t, useItems as u, getCorrectId as v, withSeed as w };
8074
- //# sourceMappingURL=index-OiUariqS.js.map
8105
+ //# sourceMappingURL=index-DO0GcmVW.js.map