@permaweb/libs 0.0.1-beta
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/bundle.esm.js +1 -0
- package/dist/common/ao.d.ts +24 -0
- package/dist/common/ao.js +326 -0
- package/dist/common/ao.js.map +1 -0
- package/dist/common/arweave.d.ts +7 -0
- package/dist/common/arweave.js +62 -0
- package/dist/common/arweave.js.map +1 -0
- package/dist/common/gql.d.ts +3 -0
- package/dist/common/gql.js +176 -0
- package/dist/common/gql.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.js +4 -0
- package/dist/common/index.js.map +1 -0
- package/dist/helpers/config.d.ts +67 -0
- package/dist/helpers/config.js +68 -0
- package/dist/helpers/config.js.map +1 -0
- package/dist/helpers/endpoints.d.ts +3 -0
- package/dist/helpers/endpoints.js +17 -0
- package/dist/helpers/endpoints.js.map +1 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.js +5 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/types.d.ts +184 -0
- package/dist/helpers/types.js +2 -0
- package/dist/helpers/types.js.map +1 -0
- package/dist/helpers/utils.d.ts +37 -0
- package/dist/helpers/utils.js +245 -0
- package/dist/helpers/utils.js.map +1 -0
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.js +153 -0
- package/dist/index.cjs.js.map +7 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +41 -0
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +7 -0
- package/dist/services/assets.d.ts +5 -0
- package/dist/services/assets.js +277 -0
- package/dist/services/assets.js.map +1 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.js +4 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/profiles.d.ts +5 -0
- package/dist/services/profiles.js +146 -0
- package/dist/services/profiles.js.map +1 -0
- package/dist/services/zones.d.ts +10 -0
- package/dist/services/zones.js +78 -0
- package/dist/services/zones.js.map +1 -0
- package/dist/types/common/ao.d.ts +25 -0
- package/dist/types/common/arweave.d.ts +8 -0
- package/dist/types/common/gql.d.ts +3 -0
- package/dist/types/common/index.d.ts +3 -0
- package/dist/types/helpers/config.d.ts +82 -0
- package/dist/types/helpers/endpoints.d.ts +3 -0
- package/dist/types/helpers/index.d.ts +4 -0
- package/dist/types/helpers/types.d.ts +230 -0
- package/dist/types/helpers/utils.d.ts +38 -0
- package/dist/types/index.d.ts +63 -0
- package/dist/types/services/assets.d.ts +7 -0
- package/dist/types/services/collections.d.ts +18 -0
- package/dist/types/services/comments.d.ts +27 -0
- package/dist/types/services/index.d.ts +5 -0
- package/dist/types/services/profiles.d.ts +5 -0
- package/dist/types/services/zones.d.ts +10 -0
- package/package.json +65 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/services/assets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE9G,MAAM,UAAgB,iBAAiB,CAAC,IAAyB,EAAE,MAAW,EAAE,QAAgC;;;QAC/G,MAAM,eAAe,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,eAAe;YAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;QAEtD,MAAM,IAAI,GAAG,MAAA,MAAA,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,0CAAE,SAAS,CAAC,IAAI,CAAC,I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QAAQ;QAAE,OAAO,sCAAsC,CAAC;IACnH,IAAI,YAAY,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ;QAAE,OAAO,0CAA0C,CAAC;IACnH,IAAI,WAAW,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ;QAAE,OAAO,kCAAkC,CAAC;IACzG,IAAI,QAAQ,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAAE,OAAO,kCAAkC,CAAC;IACzH,IAAI,cAAc,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,sCAAsC,CAAC;IACpH,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC;QAAE,OAAO,kCAAkC,CAAC;IAC/I,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,+BAA+B,CAAC;IAE1F,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ProfileArgsType, ProfileType } from 'helpers/types';
|
|
2
|
+
export declare function createProfile(args: ProfileArgsType, wallet: any, callback?: (status: any) => void): Promise<string | null>;
|
|
3
|
+
export declare function updateProfile(args: ProfileArgsType, profileId: string, wallet: any, callback?: (status: any) => void): Promise<string | null>;
|
|
4
|
+
export declare function getProfileById(profileId: string): Promise<ProfileType | null>;
|
|
5
|
+
export declare function getProfileByWalletAddress(walletAddress: string): Promise<ProfileType & any | null>;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { resolveTransaction } from '../common/arweave';
|
|
11
|
+
import { getGQLData } from '../common/gql';
|
|
12
|
+
import { GATEWAYS, TAGS } from '../helpers/config';
|
|
13
|
+
import { getBootTag, mapFromProcessCase } from '../helpers/utils';
|
|
14
|
+
|
|
15
|
+
import { createZone, getZone, updateZone } from './zones';
|
|
16
|
+
// TODO: Bootloader registry
|
|
17
|
+
export function createProfile(args, wallet, callback) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
var _a;
|
|
20
|
+
let profileId = null;
|
|
21
|
+
const tags = [
|
|
22
|
+
{ name: TAGS.keys.dataProtocol, value: 'Zone' },
|
|
23
|
+
{ name: TAGS.keys.zoneType, value: 'User' }
|
|
24
|
+
];
|
|
25
|
+
const addImageTag = (imageKey) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const key = imageKey.toLowerCase();
|
|
27
|
+
if (args[key]) {
|
|
28
|
+
try {
|
|
29
|
+
const resolvedImage = yield resolveTransaction(args[key]);
|
|
30
|
+
tags.push(getBootTag(imageKey, resolvedImage));
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
if (callback)
|
|
34
|
+
callback(`Failed to resolve ${imageKey}: ${e.message}`);
|
|
35
|
+
else
|
|
36
|
+
console.error(e);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
tags.push(getBootTag('Username', args.username));
|
|
41
|
+
tags.push(getBootTag('DisplayName', args.displayName));
|
|
42
|
+
tags.push(getBootTag('Description', args.description));
|
|
43
|
+
yield Promise.all([addImageTag('Thumbnail'), addImageTag('Banner')]);
|
|
44
|
+
try {
|
|
45
|
+
profileId = yield createZone({ tags: tags }, wallet, callback);
|
|
46
|
+
// if (profileId) {
|
|
47
|
+
// globalLog(`Profile ID: ${profileId}`);
|
|
48
|
+
// await waitForProcess(profileId);
|
|
49
|
+
// const registerId = await aoSend({
|
|
50
|
+
// processId: profileId,
|
|
51
|
+
// wallet: wallet,
|
|
52
|
+
// action: 'Register-Whitelisted-Subscriber',
|
|
53
|
+
// tags: [
|
|
54
|
+
// { name: 'Topics', value: JSON.stringify(['Zone-Update']) },
|
|
55
|
+
// { name: 'Subscriber-Process-Id', value: 'Wl7pTf-UEp6SIIu3S5MsTX074Sg8MhCx40NuG_YEhmk' },
|
|
56
|
+
// ]
|
|
57
|
+
// });
|
|
58
|
+
// console.log(`Register ID: ${registerId}`);
|
|
59
|
+
// }
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
throw new Error((_a = e.message) !== null && _a !== void 0 ? _a : 'Error creating profile');
|
|
63
|
+
}
|
|
64
|
+
return profileId;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
export function updateProfile(args, profileId, wallet, callback) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
var _a;
|
|
70
|
+
if (profileId) {
|
|
71
|
+
let data = {
|
|
72
|
+
Username: args.username,
|
|
73
|
+
DisplayName: args.displayName,
|
|
74
|
+
Description: args.description
|
|
75
|
+
};
|
|
76
|
+
if (args.thumbnail) {
|
|
77
|
+
try {
|
|
78
|
+
data.Thumbnail = yield resolveTransaction(args.thumbnail);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
if (callback)
|
|
82
|
+
callback(`Failed to resolve thumbnail: ${e.message}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (args.banner) {
|
|
86
|
+
try {
|
|
87
|
+
data.Banner = yield resolveTransaction(args.banner);
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
if (callback)
|
|
91
|
+
callback(`Failed to resolve banner: ${e.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
return yield updateZone(data, profileId, wallet);
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
throw new Error((_a = e.message) !== null && _a !== void 0 ? _a : 'Error creating profile');
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw new Error('No profile provided');
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
export function getProfileById(profileId) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
var _a, _b, _c;
|
|
109
|
+
try {
|
|
110
|
+
const zone = yield getZone(profileId);
|
|
111
|
+
return Object.assign(Object.assign({ id: profileId }, mapFromProcessCase((_a = zone.Store) !== null && _a !== void 0 ? _a : {})), { assets: mapFromProcessCase((_b = zone.Assets) !== null && _b !== void 0 ? _b : []) });
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
throw new Error((_c = e.message) !== null && _c !== void 0 ? _c : 'Error fetching profile');
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
export function getProfileByWalletAddress(walletAddress) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
try {
|
|
122
|
+
const gqlResponse = yield getGQLData({
|
|
123
|
+
gateway: GATEWAYS.arweave,
|
|
124
|
+
tags: [
|
|
125
|
+
{ name: TAGS.keys.dataProtocol, values: ['Zone'] },
|
|
126
|
+
{ name: TAGS.keys.zoneType, values: ['User'] },
|
|
127
|
+
],
|
|
128
|
+
owners: [walletAddress]
|
|
129
|
+
});
|
|
130
|
+
if (((_a = gqlResponse === null || gqlResponse === void 0 ? void 0 : gqlResponse.data) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
131
|
+
gqlResponse.data.sort((a, b) => {
|
|
132
|
+
var _a, _b, _c, _d;
|
|
133
|
+
const timestampA = (_b = (_a = a.node.block) === null || _a === void 0 ? void 0 : _a.timestamp) !== null && _b !== void 0 ? _b : 0;
|
|
134
|
+
const timestampB = (_d = (_c = b.node.block) === null || _c === void 0 ? void 0 : _c.timestamp) !== null && _d !== void 0 ? _d : 0;
|
|
135
|
+
return timestampB - timestampA;
|
|
136
|
+
});
|
|
137
|
+
return yield getProfileById(gqlResponse.data[0].node.id);
|
|
138
|
+
}
|
|
139
|
+
return { id: null };
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
throw new Error((_b = e.message) !== null && _b !== void 0 ? _b : 'Error fetching profile');
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/services/profiles.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,C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I,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE;iBAC9C;gBACD,MAAM,EAAE,CAAC,aAAa,CAAC;aACvB,CAAC,CAAC;YAEH,IAAI,CAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,0CAAE,MAAM,IAAG,CAAC,EAAE,CAAC;gBACnC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAsB,EAAE,CAAsB,EAAE,EAAE;;oBACxE,MAAM,UAAU,GAAG,MAAA,MAAA,CAAC,CAAC,IAAI,CAAC,KAAK,0CAAE,SAAS,mCAAI,CAAC,CAAC;oBAChD,MAAM,UAAU,GAAG,MAAA,MAAA,CAAC,CAAC,IAAI,CAAC,KAAK,0CAAE,SAAS,mCAAI,CAAC,CAAC;oBAChD,OAAO,UAAU,GAAG,UAAU,CAAC;gBAChC,CAAC,CAAC,CAAC;gBAEH,OAAO,MAAM,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1D,CAAC;YAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QACrB,CAAC;QACD,OAAO,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,MAAA,CAAC,CAAC,OAAO,mCAAI,wBAAwB,CAAC,CAAC;QACxD,CAAC;IACF,CAAC;CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TagType } from 'helpers/types';
|
|
2
|
+
export declare function createZone(args: {
|
|
3
|
+
tags?: TagType[];
|
|
4
|
+
}, wallet: any, callback?: (status: any) => void): Promise<string | null>;
|
|
5
|
+
export declare function updateZone(args: object, zoneId: string, wallet: any): Promise<string | null>;
|
|
6
|
+
export declare function addToZone(args: {
|
|
7
|
+
path: string;
|
|
8
|
+
data: object;
|
|
9
|
+
}, zoneId: string, wallet: any): Promise<string | null>;
|
|
10
|
+
export declare function getZone(zoneId: string): Promise<any | null>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { aoCreateProcess, aoDryRun, aoSend } from '../common/ao';
|
|
11
|
+
import { AO, TAGS } from '../helpers/config';
|
|
12
|
+
export function createZone(args, wallet, callback) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
const tags = [{ name: TAGS.keys.bootloaderInit, value: AO.src.zone }];
|
|
17
|
+
if (args.tags && args.tags.length)
|
|
18
|
+
args.tags.forEach((tag) => tags.push(tag));
|
|
19
|
+
const zoneId = yield aoCreateProcess({
|
|
20
|
+
wallet: wallet,
|
|
21
|
+
spawnTags: tags
|
|
22
|
+
}, callback ? (status) => callback(status) : undefined);
|
|
23
|
+
return zoneId;
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
throw new Error((_a = e.message) !== null && _a !== void 0 ? _a : 'Error creating zone');
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export function updateZone(args, zoneId, wallet) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
try {
|
|
33
|
+
const mappedData = Object.entries(args).map(([key, value]) => ({ key, value }));
|
|
34
|
+
const zoneUpdateId = yield aoSend({
|
|
35
|
+
processId: zoneId,
|
|
36
|
+
wallet: wallet,
|
|
37
|
+
action: 'Zone-Update',
|
|
38
|
+
data: mappedData
|
|
39
|
+
});
|
|
40
|
+
return zoneUpdateId;
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
throw new Error(e);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export function addToZone(args, zoneId, wallet) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
try {
|
|
50
|
+
const zoneUpdateId = yield aoSend({
|
|
51
|
+
processId: zoneId,
|
|
52
|
+
wallet: wallet,
|
|
53
|
+
action: 'Zone-Append',
|
|
54
|
+
tags: [{ name: 'Path', value: args.path }],
|
|
55
|
+
data: args.data
|
|
56
|
+
});
|
|
57
|
+
return zoneUpdateId;
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
throw new Error(e);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export function getZone(zoneId) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
try {
|
|
67
|
+
const processState = yield aoDryRun({
|
|
68
|
+
processId: zoneId,
|
|
69
|
+
action: 'Info',
|
|
70
|
+
});
|
|
71
|
+
return processState;
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
throw new Error(e);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=zones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zones.js","sourceRoot":"","sources":["../../src/services/zones.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG1C,MAAM,UAAgB,UAAU,CAAC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ACrB,CAAC;QACD,OAAO,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;CAAA;AAED,MAAM,UAAgB,SAAS,CAAC,IAAoC,EAAE,MAAc,EAAE,MAAW;;QAChG,IAAI,CAAC;YACJ,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC;gBACjC,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE,MAAM;gBACd,MAAM,EAAE,aAAa;gBACrB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;gBAC1C,IAAI,EAAE,IAAI,CAAC,IAAI;aACf,CAAC,CAAC;YAEH,OAAO,YAAY,CAAC;QACrB,CAAC;QACD,OAAO,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;CAAA;AAED,MAAM,UAAgB,OAAO,CAAC,MAAc;;QAC3C,IAAI,CAAC;YACJ,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC;gBACnC,SAAS,EAAE,MAAM;gBACjB,MAAM,EAAE,MAAM;aACd,CAAC,CAAC;YAEH,OAAO,YAAY,CAAC;QACrB,CAAC;QACD,OAAO,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DependencyType, MessageDryRunType, MessageResultType, MessageSendType, ProcessCreateType, ProcessSpawnType, TagType } from 'helpers/types';
|
|
2
|
+
export declare function aoSpawn(deps: DependencyType, args: ProcessSpawnType): Promise<string>;
|
|
3
|
+
export declare function aoSendWith(deps: DependencyType): (args: MessageSendType) => Promise<string>;
|
|
4
|
+
export declare function aoSend(deps: DependencyType, args: MessageSendType): Promise<string>;
|
|
5
|
+
export declare function aoDryRunWith(deps: DependencyType): (args: MessageSendType) => Promise<any>;
|
|
6
|
+
export declare function aoDryRun(deps: DependencyType, args: MessageDryRunType): Promise<any>;
|
|
7
|
+
export declare function aoMessageResult(deps: DependencyType, args: MessageResultType): Promise<any>;
|
|
8
|
+
export declare function aoMessageResults(deps: DependencyType, args: {
|
|
9
|
+
processId: string;
|
|
10
|
+
action: string;
|
|
11
|
+
tags: TagType[] | null;
|
|
12
|
+
data: any;
|
|
13
|
+
responses?: string[];
|
|
14
|
+
handler?: string;
|
|
15
|
+
}): Promise<any>;
|
|
16
|
+
export declare function handleProcessEval(deps: DependencyType, args: {
|
|
17
|
+
processId: string;
|
|
18
|
+
evalTxId: string | null;
|
|
19
|
+
evalSrc: string | null;
|
|
20
|
+
evalTags?: TagType[];
|
|
21
|
+
}): Promise<string | null>;
|
|
22
|
+
export declare function aoCreateProcessWith(deps: DependencyType): (args: ProcessCreateType, statusCB?: (status: any) => void) => Promise<string>;
|
|
23
|
+
export declare function aoCreateProcess(deps: DependencyType, args: ProcessCreateType, statusCB?: (status: any) => void): Promise<string>;
|
|
24
|
+
export declare function waitForProcess(processId: string, _setStatus?: (status: any) => void): Promise<string>;
|
|
25
|
+
export declare function fetchProcessSrc(txId: string): Promise<string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DependencyType, TagType } from 'helpers/types';
|
|
2
|
+
export declare function resolveTransactionWith(deps: DependencyType): (data: any) => Promise<any>;
|
|
3
|
+
export declare function resolveTransaction(deps: DependencyType, data: any): Promise<any>;
|
|
4
|
+
export declare function createTransaction(deps: DependencyType, args: {
|
|
5
|
+
data: any;
|
|
6
|
+
tags?: TagType[];
|
|
7
|
+
uploadMethod?: 'default' | 'turbo';
|
|
8
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BatchAGQLResponseType, BatchGQLArgsType, DefaultGQLResponseType, GQLArgsType } from 'helpers/types';
|
|
2
|
+
export declare function getGQLData(args: GQLArgsType): Promise<DefaultGQLResponseType>;
|
|
3
|
+
export declare function getBatchGQLData(args: BatchGQLArgsType): Promise<BatchAGQLResponseType>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export declare const AO: {
|
|
2
|
+
module: string;
|
|
3
|
+
scheduler: string;
|
|
4
|
+
mu: string;
|
|
5
|
+
src: {
|
|
6
|
+
asset: string;
|
|
7
|
+
zone: string;
|
|
8
|
+
collection: string;
|
|
9
|
+
};
|
|
10
|
+
collectionsRegistry: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const CONTENT_TYPES: {
|
|
13
|
+
[key: string]: {
|
|
14
|
+
type: string;
|
|
15
|
+
serialize: (data: any) => any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const GATEWAYS: {
|
|
19
|
+
arweave: string;
|
|
20
|
+
goldsky: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const LICENSES: {
|
|
23
|
+
udl: {
|
|
24
|
+
label: string;
|
|
25
|
+
address: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const TAGS: {
|
|
29
|
+
keys: {
|
|
30
|
+
access: string;
|
|
31
|
+
ans110: {
|
|
32
|
+
title: string;
|
|
33
|
+
description: string;
|
|
34
|
+
topic: string;
|
|
35
|
+
type: string;
|
|
36
|
+
implements: string;
|
|
37
|
+
license: string;
|
|
38
|
+
};
|
|
39
|
+
assetType: string;
|
|
40
|
+
banner: string;
|
|
41
|
+
bootloader: string;
|
|
42
|
+
bootloaderInit: string;
|
|
43
|
+
collectionId: string;
|
|
44
|
+
collectionName: string;
|
|
45
|
+
commericalUse: string;
|
|
46
|
+
contentType: string;
|
|
47
|
+
creator: string;
|
|
48
|
+
currency: string;
|
|
49
|
+
dataModelTraining: string;
|
|
50
|
+
dataProtocol: string;
|
|
51
|
+
dateCreated: string;
|
|
52
|
+
derivations: string;
|
|
53
|
+
description: string;
|
|
54
|
+
displayName: string;
|
|
55
|
+
handle: string;
|
|
56
|
+
implements: string;
|
|
57
|
+
initialOwner: string;
|
|
58
|
+
license: string;
|
|
59
|
+
name: string;
|
|
60
|
+
paymentAddress: string;
|
|
61
|
+
paymentMode: string;
|
|
62
|
+
profileCreator: string;
|
|
63
|
+
profileIndex: string;
|
|
64
|
+
protocolName: string;
|
|
65
|
+
renderWith: string;
|
|
66
|
+
thumbnail: string;
|
|
67
|
+
title: string;
|
|
68
|
+
topic: string;
|
|
69
|
+
type: string;
|
|
70
|
+
zoneType: string;
|
|
71
|
+
};
|
|
72
|
+
values: {
|
|
73
|
+
document: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const UPLOAD: {
|
|
77
|
+
node1: string;
|
|
78
|
+
node2: string;
|
|
79
|
+
batchSize: number;
|
|
80
|
+
chunkSize: number;
|
|
81
|
+
dispatchUploadSize: number;
|
|
82
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
export type DependencyType = {
|
|
2
|
+
ao: any;
|
|
3
|
+
signer?: any;
|
|
4
|
+
arweave?: any;
|
|
5
|
+
};
|
|
6
|
+
export type ProcessSpawnType = {
|
|
7
|
+
module: string;
|
|
8
|
+
scheduler: string;
|
|
9
|
+
data: any;
|
|
10
|
+
tags: TagType[];
|
|
11
|
+
wallet: any;
|
|
12
|
+
};
|
|
13
|
+
export type ProcessCreateType = {
|
|
14
|
+
module?: string;
|
|
15
|
+
scheduler?: string;
|
|
16
|
+
spawnData?: any;
|
|
17
|
+
spawnTags?: TagType[];
|
|
18
|
+
evalTags?: TagType[];
|
|
19
|
+
evalTxId?: string;
|
|
20
|
+
evalSrc?: string;
|
|
21
|
+
};
|
|
22
|
+
export type MessageSendType = {
|
|
23
|
+
processId: string;
|
|
24
|
+
action: string;
|
|
25
|
+
tags?: TagType[] | null;
|
|
26
|
+
data?: any;
|
|
27
|
+
useRawData?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type MessageResultType = {
|
|
30
|
+
messageId: string;
|
|
31
|
+
processId: string;
|
|
32
|
+
action: string;
|
|
33
|
+
};
|
|
34
|
+
export type MessageDryRunType = {
|
|
35
|
+
processId: string;
|
|
36
|
+
action: string;
|
|
37
|
+
tags?: TagType[] | null;
|
|
38
|
+
data?: string | object;
|
|
39
|
+
};
|
|
40
|
+
export type ZoneType = {
|
|
41
|
+
store: any;
|
|
42
|
+
assets: ZoneAssetType[];
|
|
43
|
+
};
|
|
44
|
+
export type ZoneAssetType = {
|
|
45
|
+
id: string;
|
|
46
|
+
balance: string;
|
|
47
|
+
dateCreated: number;
|
|
48
|
+
lastUpdate: number;
|
|
49
|
+
};
|
|
50
|
+
export type ProfileArgsType = {
|
|
51
|
+
username: string;
|
|
52
|
+
displayName: string;
|
|
53
|
+
description: string;
|
|
54
|
+
thumbnail?: any;
|
|
55
|
+
banner?: any;
|
|
56
|
+
};
|
|
57
|
+
export type ProfileType = {
|
|
58
|
+
id: string;
|
|
59
|
+
walletAddress: string;
|
|
60
|
+
username: string;
|
|
61
|
+
displayName: string;
|
|
62
|
+
description: string;
|
|
63
|
+
thumbnail?: any;
|
|
64
|
+
banner?: any;
|
|
65
|
+
assets: {
|
|
66
|
+
id: string;
|
|
67
|
+
quantity: string;
|
|
68
|
+
}[];
|
|
69
|
+
} & any;
|
|
70
|
+
export type AssetCreateArgsType = {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
type: string;
|
|
74
|
+
topics: string[];
|
|
75
|
+
contentType: string;
|
|
76
|
+
data: any;
|
|
77
|
+
creator: string;
|
|
78
|
+
collectionId?: string;
|
|
79
|
+
renderWith?: string;
|
|
80
|
+
thumbnail?: string;
|
|
81
|
+
supply?: number;
|
|
82
|
+
denomination?: number;
|
|
83
|
+
transferable?: boolean;
|
|
84
|
+
tags?: TagType[];
|
|
85
|
+
src?: string;
|
|
86
|
+
};
|
|
87
|
+
export type AssetHeaderType = {
|
|
88
|
+
id: string;
|
|
89
|
+
owner: string | null;
|
|
90
|
+
creator: string | null;
|
|
91
|
+
name: string | null;
|
|
92
|
+
description: string | null;
|
|
93
|
+
type: string | null;
|
|
94
|
+
topics: string[] | null;
|
|
95
|
+
implementation: string | null;
|
|
96
|
+
contentType: string | null;
|
|
97
|
+
renderWith: string | null;
|
|
98
|
+
thumbnail: string | null;
|
|
99
|
+
udl: UDLicenseType | null;
|
|
100
|
+
collectionId: string | null;
|
|
101
|
+
dateCreated: number | null;
|
|
102
|
+
blockHeight: number | null;
|
|
103
|
+
tags?: TagType[];
|
|
104
|
+
};
|
|
105
|
+
export type AssetStateType = {
|
|
106
|
+
ticker: string | null;
|
|
107
|
+
denomination: string | null;
|
|
108
|
+
balances: {
|
|
109
|
+
[key: string]: string;
|
|
110
|
+
} | null;
|
|
111
|
+
transferable: boolean | null;
|
|
112
|
+
};
|
|
113
|
+
export type AoAssetType = {
|
|
114
|
+
ticker: string;
|
|
115
|
+
denomination: string;
|
|
116
|
+
balances: {
|
|
117
|
+
[key: string]: string;
|
|
118
|
+
};
|
|
119
|
+
transferable: boolean;
|
|
120
|
+
name: string;
|
|
121
|
+
creator: string;
|
|
122
|
+
assetMetadata: {
|
|
123
|
+
[key: string]: any;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export type AssetDetailType = AssetHeaderType & AssetStateType;
|
|
127
|
+
export type CommentHeaderType = AssetHeaderType & {
|
|
128
|
+
content: string;
|
|
129
|
+
dataSource: string;
|
|
130
|
+
rootSource: string;
|
|
131
|
+
};
|
|
132
|
+
export type CommentStateType = AssetStateType;
|
|
133
|
+
export type CommentDetailType = CommentHeaderType & CommentStateType;
|
|
134
|
+
export type CommentCreateArgType = {
|
|
135
|
+
content: string;
|
|
136
|
+
creator: string;
|
|
137
|
+
parentId: string;
|
|
138
|
+
rootId?: string;
|
|
139
|
+
tags?: TagType[];
|
|
140
|
+
};
|
|
141
|
+
export type CollectionManifestType = {
|
|
142
|
+
type: string;
|
|
143
|
+
items: string[];
|
|
144
|
+
};
|
|
145
|
+
export type CollectionType = {
|
|
146
|
+
id: string;
|
|
147
|
+
title: string;
|
|
148
|
+
description: string | null;
|
|
149
|
+
creator: string;
|
|
150
|
+
dateCreated: string;
|
|
151
|
+
banner: string | null;
|
|
152
|
+
thumbnail: string | null;
|
|
153
|
+
};
|
|
154
|
+
export type CollectionDetailType = CollectionType & {
|
|
155
|
+
assetIds: string[];
|
|
156
|
+
};
|
|
157
|
+
export type UDLicenseType = {
|
|
158
|
+
access: UDLicenseValueType | null;
|
|
159
|
+
derivations: UDLicenseValueType | null;
|
|
160
|
+
commercialUse: UDLicenseValueType | null;
|
|
161
|
+
dataModelTraining: UDLicenseValueType | null;
|
|
162
|
+
paymentMode: string | null;
|
|
163
|
+
paymentAddress: string | null;
|
|
164
|
+
currency: string | null;
|
|
165
|
+
};
|
|
166
|
+
export type UDLicenseValueType = {
|
|
167
|
+
value: string | null;
|
|
168
|
+
icon?: string;
|
|
169
|
+
endText?: string;
|
|
170
|
+
};
|
|
171
|
+
export type BaseGQLArgsType = {
|
|
172
|
+
ids?: string[] | null;
|
|
173
|
+
tags?: TagFilterType[] | null;
|
|
174
|
+
owners?: string[] | null;
|
|
175
|
+
cursor?: string | null;
|
|
176
|
+
paginator?: number;
|
|
177
|
+
minBlock?: number;
|
|
178
|
+
maxBlock?: number;
|
|
179
|
+
};
|
|
180
|
+
export type GQLArgsType = {
|
|
181
|
+
gateway: string;
|
|
182
|
+
} & BaseGQLArgsType;
|
|
183
|
+
export type QueryBodyGQLArgsType = BaseGQLArgsType & {
|
|
184
|
+
gateway?: string;
|
|
185
|
+
queryKey?: string;
|
|
186
|
+
};
|
|
187
|
+
export type BatchGQLArgsType = {
|
|
188
|
+
gateway: string;
|
|
189
|
+
entries: {
|
|
190
|
+
[queryKey: string]: BaseGQLArgsType;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export type GQLNodeResponseType = {
|
|
194
|
+
cursor: string | null;
|
|
195
|
+
node: {
|
|
196
|
+
id: string;
|
|
197
|
+
tags: TagType[];
|
|
198
|
+
data: {
|
|
199
|
+
size: string;
|
|
200
|
+
type: string;
|
|
201
|
+
};
|
|
202
|
+
owner: {
|
|
203
|
+
address: string;
|
|
204
|
+
};
|
|
205
|
+
block: {
|
|
206
|
+
height: number;
|
|
207
|
+
timestamp: number;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
export type GQLResponseType = {
|
|
212
|
+
count: number;
|
|
213
|
+
nextCursor: string | null;
|
|
214
|
+
previousCursor: string | null;
|
|
215
|
+
};
|
|
216
|
+
export type DefaultGQLResponseType = {
|
|
217
|
+
data: GQLNodeResponseType[];
|
|
218
|
+
} & GQLResponseType;
|
|
219
|
+
export type BatchAGQLResponseType = {
|
|
220
|
+
[queryKey: string]: DefaultGQLResponseType;
|
|
221
|
+
};
|
|
222
|
+
export type TagType = {
|
|
223
|
+
name: string;
|
|
224
|
+
value: string;
|
|
225
|
+
};
|
|
226
|
+
export type TagFilterType = {
|
|
227
|
+
name: string;
|
|
228
|
+
values: string[];
|
|
229
|
+
match?: string;
|
|
230
|
+
};
|