@coasys/ad4m 0.12.0 → 0.12.1-dev
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/lib/index.cjs +253 -4
- package/lib/index.js +253 -4
- package/lib/src/agent/AgentClient.js +1 -0
- package/lib/src/runtime/RuntimeClient.d.ts +26 -0
- package/lib/src/runtime/RuntimeClient.js +126 -0
- package/lib/src/runtime/RuntimeResolver.d.ts +14 -1
- package/lib/src/runtime/RuntimeResolver.js +113 -4
- package/lib/src/schema.gql +13 -0
- package/lib/src/typeDefs.js +13 -0
- package/package.json +1 -1
- package/src/agent/AgentClient.ts +2 -0
- package/src/runtime/RuntimeClient.ts +140 -0
- package/src/runtime/RuntimeResolver.ts +77 -3
package/lib/index.js
CHANGED
|
@@ -9839,6 +9839,7 @@ class AgentClient {
|
|
|
9839
9839
|
email
|
|
9840
9840
|
remainingCredits
|
|
9841
9841
|
hotWalletAddress
|
|
9842
|
+
freeAccess
|
|
9842
9843
|
}
|
|
9843
9844
|
}`,
|
|
9844
9845
|
}));
|
|
@@ -10355,6 +10356,14 @@ class RuntimeClient {
|
|
|
10355
10356
|
}));
|
|
10356
10357
|
return runtimeInfo;
|
|
10357
10358
|
}
|
|
10359
|
+
async tlsDomain() {
|
|
10360
|
+
const { runtimeTlsDomain } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10361
|
+
query: gql `query runtimeTlsDomain {
|
|
10362
|
+
runtimeTlsDomain
|
|
10363
|
+
}`,
|
|
10364
|
+
}));
|
|
10365
|
+
return runtimeTlsDomain;
|
|
10366
|
+
}
|
|
10358
10367
|
async quit() {
|
|
10359
10368
|
const result = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10360
10369
|
mutation: gql `mutation runtimeQuit { runtimeQuit }`
|
|
@@ -10657,11 +10666,23 @@ class RuntimeClient {
|
|
|
10657
10666
|
did
|
|
10658
10667
|
lastSeen
|
|
10659
10668
|
perspectiveCount
|
|
10669
|
+
remainingCredits
|
|
10670
|
+
freeAccess
|
|
10671
|
+
hotWalletAddress
|
|
10660
10672
|
}
|
|
10661
10673
|
}`
|
|
10662
10674
|
}));
|
|
10663
10675
|
return runtimeListUsers;
|
|
10664
10676
|
}
|
|
10677
|
+
async userWalletAddress(email) {
|
|
10678
|
+
const { runtimeUserWalletAddress } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10679
|
+
query: gql `query runtimeUserWalletAddress($email: String!) {
|
|
10680
|
+
runtimeUserWalletAddress(email: $email)
|
|
10681
|
+
}`,
|
|
10682
|
+
variables: { email }
|
|
10683
|
+
}));
|
|
10684
|
+
return runtimeUserWalletAddress;
|
|
10685
|
+
}
|
|
10665
10686
|
async emailTestModeEnable() {
|
|
10666
10687
|
const { runtimeEmailTestModeEnable } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10667
10688
|
mutation: gql `mutation runtimeEmailTestModeEnable {
|
|
@@ -10704,6 +10725,112 @@ class RuntimeClient {
|
|
|
10704
10725
|
}));
|
|
10705
10726
|
return runtimeEmailTestSetExpiry;
|
|
10706
10727
|
}
|
|
10728
|
+
// ---- Unyt / mHOT methods ----
|
|
10729
|
+
async unytAgentKey() {
|
|
10730
|
+
const { runtimeUnytAgentKey } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10731
|
+
query: gql `query runtimeUnytAgentKey { runtimeUnytAgentKey }`,
|
|
10732
|
+
fetchPolicy: "network-only",
|
|
10733
|
+
}));
|
|
10734
|
+
return runtimeUnytAgentKey;
|
|
10735
|
+
}
|
|
10736
|
+
async unytHotAgentPubkey() {
|
|
10737
|
+
const { runtimeHotAgentPubkey } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10738
|
+
query: gql `query runtimeHotAgentPubkey { runtimeHotAgentPubkey }`,
|
|
10739
|
+
fetchPolicy: "network-only",
|
|
10740
|
+
}));
|
|
10741
|
+
return runtimeHotAgentPubkey;
|
|
10742
|
+
}
|
|
10743
|
+
async unytWalletBalance() {
|
|
10744
|
+
const { runtimeHotWalletBalance } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10745
|
+
query: gql `query runtimeHotWalletBalance { runtimeHotWalletBalance }`,
|
|
10746
|
+
fetchPolicy: "network-only",
|
|
10747
|
+
}));
|
|
10748
|
+
return runtimeHotWalletBalance;
|
|
10749
|
+
}
|
|
10750
|
+
async unytWalletHistory(page, perPage) {
|
|
10751
|
+
const { runtimeHotWalletHistory } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10752
|
+
query: gql `query runtimeHotWalletHistory($page: Int, $perPage: Int) {
|
|
10753
|
+
runtimeHotWalletHistory(page: $page, perPage: $perPage)
|
|
10754
|
+
}`,
|
|
10755
|
+
variables: { page, perPage },
|
|
10756
|
+
fetchPolicy: "network-only",
|
|
10757
|
+
}));
|
|
10758
|
+
return runtimeHotWalletHistory;
|
|
10759
|
+
}
|
|
10760
|
+
async unytVersionInfo() {
|
|
10761
|
+
const { runtimeUnytVersionInfo } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10762
|
+
query: gql `query runtimeUnytVersionInfo { runtimeUnytVersionInfo }`,
|
|
10763
|
+
fetchPolicy: "network-only",
|
|
10764
|
+
}));
|
|
10765
|
+
return runtimeUnytVersionInfo;
|
|
10766
|
+
}
|
|
10767
|
+
async unytSetMembraneProof(proof) {
|
|
10768
|
+
const { runtimeSetUnytMembraneProof } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10769
|
+
mutation: gql `mutation runtimeSetUnytMembraneProof($proof: String!) {
|
|
10770
|
+
runtimeSetUnytMembraneProof(proof: $proof) { success message }
|
|
10771
|
+
}`,
|
|
10772
|
+
variables: { proof },
|
|
10773
|
+
}));
|
|
10774
|
+
return runtimeSetUnytMembraneProof;
|
|
10775
|
+
}
|
|
10776
|
+
async unytReinstallDna() {
|
|
10777
|
+
const { runtimeReinstallUnytDna } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10778
|
+
mutation: gql `mutation runtimeReinstallUnytDna {
|
|
10779
|
+
runtimeReinstallUnytDna { success message }
|
|
10780
|
+
}`,
|
|
10781
|
+
}));
|
|
10782
|
+
return runtimeReinstallUnytDna;
|
|
10783
|
+
}
|
|
10784
|
+
async unytSendHot(recipient, amount) {
|
|
10785
|
+
const { runtimeSendHot } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10786
|
+
mutation: gql `mutation runtimeSendHot($recipient: String!, $amount: String!) {
|
|
10787
|
+
runtimeSendHot(recipient: $recipient, amount: $amount) { success message }
|
|
10788
|
+
}`,
|
|
10789
|
+
variables: { recipient, amount },
|
|
10790
|
+
}));
|
|
10791
|
+
return runtimeSendHot;
|
|
10792
|
+
}
|
|
10793
|
+
async setUserCredits(email, amount) {
|
|
10794
|
+
const { runtimeSetUserCredits } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10795
|
+
mutation: gql `mutation runtimeSetUserCredits($email: String!, $amount: Float!) {
|
|
10796
|
+
runtimeSetUserCredits(email: $email, amount: $amount)
|
|
10797
|
+
}`,
|
|
10798
|
+
variables: { email, amount },
|
|
10799
|
+
}));
|
|
10800
|
+
return runtimeSetUserCredits;
|
|
10801
|
+
}
|
|
10802
|
+
async setUserFreeAccess(email, enabled) {
|
|
10803
|
+
const { runtimeSetUserFreeAccess } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10804
|
+
mutation: gql `mutation runtimeSetUserFreeAccess($email: String!, $enabled: Boolean!) {
|
|
10805
|
+
runtimeSetUserFreeAccess(email: $email, enabled: $enabled)
|
|
10806
|
+
}`,
|
|
10807
|
+
variables: { email, enabled },
|
|
10808
|
+
}));
|
|
10809
|
+
return runtimeSetUserFreeAccess;
|
|
10810
|
+
}
|
|
10811
|
+
async setHostRates(ratesJson) {
|
|
10812
|
+
const { runtimeSetHostRates } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
10813
|
+
mutation: gql `mutation runtimeSetHostRates($ratesJson: String!) {
|
|
10814
|
+
runtimeSetHostRates(ratesJson: $ratesJson)
|
|
10815
|
+
}`,
|
|
10816
|
+
variables: { ratesJson },
|
|
10817
|
+
}));
|
|
10818
|
+
return runtimeSetHostRates;
|
|
10819
|
+
}
|
|
10820
|
+
async getHostRates() {
|
|
10821
|
+
const { runtimeHostRates } = unwrapApolloResult(await __classPrivateFieldGet$4(this, _RuntimeClient_apolloClient, "f").query({
|
|
10822
|
+
query: gql `query runtimeHostRates {
|
|
10823
|
+
runtimeHostRates
|
|
10824
|
+
}`,
|
|
10825
|
+
fetchPolicy: 'network-only',
|
|
10826
|
+
}));
|
|
10827
|
+
try {
|
|
10828
|
+
return JSON.parse(runtimeHostRates);
|
|
10829
|
+
}
|
|
10830
|
+
catch {
|
|
10831
|
+
return [];
|
|
10832
|
+
}
|
|
10833
|
+
}
|
|
10707
10834
|
addNotificationTriggeredCallback(cb) {
|
|
10708
10835
|
__classPrivateFieldGet$4(this, _RuntimeClient_notificationTriggeredCallbacks, "f").push(cb);
|
|
10709
10836
|
}
|
|
@@ -23138,6 +23265,7 @@ type ExpressionRendered {
|
|
|
23138
23265
|
|
|
23139
23266
|
type HostingUserInfo {
|
|
23140
23267
|
email: String!
|
|
23268
|
+
freeAccess: Boolean!
|
|
23141
23269
|
hotWalletAddress: String
|
|
23142
23270
|
remainingCredits: String!
|
|
23143
23271
|
}
|
|
@@ -23372,6 +23500,7 @@ type Mutation {
|
|
|
23372
23500
|
runtimeLoginUser(email: String!, password: String!): String!
|
|
23373
23501
|
runtimeOpenLink(url: String!): Boolean!
|
|
23374
23502
|
runtimeQuit: Boolean!
|
|
23503
|
+
runtimeReinstallUnytDna: PaymentRequestResult!
|
|
23375
23504
|
runtimeRemoveFriends(dids: [String!]!): [String!]!
|
|
23376
23505
|
runtimeRemoveKnownLinkLanguageTemplates(addresses: [String!]!): [String!]!
|
|
23377
23506
|
runtimeRemoveNotification(id: String!): Boolean!
|
|
@@ -23379,9 +23508,13 @@ type Mutation {
|
|
|
23379
23508
|
runtimeRequestLoginVerification(appInfo: AuthInfoInput, email: String!): VerificationRequestResult!
|
|
23380
23509
|
runtimeRequestPayment(amountHOT: String!): PaymentRequestResult!
|
|
23381
23510
|
runtimeRestartHolochain: Boolean!
|
|
23511
|
+
runtimeSendHot(amount: String!, recipient: String!): PaymentRequestResult!
|
|
23382
23512
|
runtimeSetHotWalletAddress(address: String!): Boolean!
|
|
23383
23513
|
runtimeSetMultiUserEnabled(enabled: Boolean!): Boolean!
|
|
23384
23514
|
runtimeSetStatus(status: PerspectiveInput!): Boolean!
|
|
23515
|
+
runtimeSetUnytMembraneProof(proof: String!): PaymentRequestResult!
|
|
23516
|
+
runtimeSetUserCredits(amount: Float!, email: String!): Boolean!
|
|
23517
|
+
runtimeSetUserFreeAccess(email: String!, enabled: Boolean!): Boolean!
|
|
23385
23518
|
runtimeTestEmail(to: String!): Boolean!
|
|
23386
23519
|
runtimeUpdateNotification(id: String!, notification: NotificationInput!): Boolean!
|
|
23387
23520
|
runtimeVerifyEmailCode(code: String!, email: String!, verificationType: String!): String!
|
|
@@ -23495,6 +23628,9 @@ type Query {
|
|
|
23495
23628
|
runtimeGetNetworkMetrics: String!
|
|
23496
23629
|
runtimeHcAgentInfos: String!
|
|
23497
23630
|
runtimeHostingUserInfo: HostingUserInfo!
|
|
23631
|
+
runtimeHotAgentPubkey: String!
|
|
23632
|
+
runtimeHotWalletBalance: String!
|
|
23633
|
+
runtimeHotWalletHistory(page: Float, perPage: Float): String!
|
|
23498
23634
|
runtimeInfo: RuntimeInfo!
|
|
23499
23635
|
runtimeKnownLinkLanguageTemplates: [String!]!
|
|
23500
23636
|
runtimeListUsers: [UserStatistics!]!
|
|
@@ -23502,6 +23638,7 @@ type Query {
|
|
|
23502
23638
|
runtimeMessageOutbox(filter: String): [SentMessage!]!
|
|
23503
23639
|
runtimeMultiUserEnabled: Boolean!
|
|
23504
23640
|
runtimeNotifications: [Notification!]!
|
|
23641
|
+
runtimeUnytVersionInfo: String!
|
|
23505
23642
|
runtimeVerifyStringSignedByDid(data: String!, did: String!, didSigningKeyId: String!, signedData: String!): Boolean!
|
|
23506
23643
|
}
|
|
23507
23644
|
|
|
@@ -23577,8 +23714,11 @@ type UserCreationResult {
|
|
|
23577
23714
|
type UserStatistics {
|
|
23578
23715
|
did: String!
|
|
23579
23716
|
email: String!
|
|
23717
|
+
freeAccess: Boolean!
|
|
23718
|
+
hotWalletAddress: String
|
|
23580
23719
|
lastSeen: String
|
|
23581
23720
|
perspectiveCount: Int!
|
|
23721
|
+
remainingCredits: String!
|
|
23582
23722
|
}
|
|
23583
23723
|
|
|
23584
23724
|
type VerificationRequestResult {
|
|
@@ -23873,6 +24013,18 @@ __decorate([
|
|
|
23873
24013
|
Field(),
|
|
23874
24014
|
__metadata("design:type", Number)
|
|
23875
24015
|
], UserStatistics.prototype, "perspectiveCount", void 0);
|
|
24016
|
+
__decorate([
|
|
24017
|
+
Field(),
|
|
24018
|
+
__metadata("design:type", String)
|
|
24019
|
+
], UserStatistics.prototype, "remainingCredits", void 0);
|
|
24020
|
+
__decorate([
|
|
24021
|
+
Field(),
|
|
24022
|
+
__metadata("design:type", Boolean)
|
|
24023
|
+
], UserStatistics.prototype, "freeAccess", void 0);
|
|
24024
|
+
__decorate([
|
|
24025
|
+
Field(),
|
|
24026
|
+
__metadata("design:type", String)
|
|
24027
|
+
], UserStatistics.prototype, "hotWalletAddress", void 0);
|
|
23876
24028
|
UserStatistics = __decorate([
|
|
23877
24029
|
ObjectType()
|
|
23878
24030
|
], UserStatistics);
|
|
@@ -23898,10 +24050,11 @@ VerificationRequestResult = __decorate([
|
|
|
23898
24050
|
ObjectType()
|
|
23899
24051
|
], VerificationRequestResult);
|
|
23900
24052
|
let HostingUserInfo = class HostingUserInfo {
|
|
23901
|
-
constructor(email, remainingCredits, hotWalletAddress) {
|
|
24053
|
+
constructor(email, remainingCredits, hotWalletAddress, freeAccess = false) {
|
|
23902
24054
|
this.email = email;
|
|
23903
24055
|
this.remainingCredits = remainingCredits;
|
|
23904
24056
|
this.hotWalletAddress = hotWalletAddress;
|
|
24057
|
+
this.freeAccess = freeAccess;
|
|
23905
24058
|
}
|
|
23906
24059
|
};
|
|
23907
24060
|
__decorate([
|
|
@@ -23916,9 +24069,13 @@ __decorate([
|
|
|
23916
24069
|
Field(),
|
|
23917
24070
|
__metadata("design:type", String)
|
|
23918
24071
|
], HostingUserInfo.prototype, "hotWalletAddress", void 0);
|
|
24072
|
+
__decorate([
|
|
24073
|
+
Field(),
|
|
24074
|
+
__metadata("design:type", Boolean)
|
|
24075
|
+
], HostingUserInfo.prototype, "freeAccess", void 0);
|
|
23919
24076
|
HostingUserInfo = __decorate([
|
|
23920
24077
|
ObjectType(),
|
|
23921
|
-
__metadata("design:paramtypes", [String, String, String])
|
|
24078
|
+
__metadata("design:paramtypes", [String, String, String, Boolean])
|
|
23922
24079
|
], HostingUserInfo);
|
|
23923
24080
|
let PaymentRequestResult = class PaymentRequestResult {
|
|
23924
24081
|
constructor(success, message) {
|
|
@@ -24098,7 +24255,9 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
24098
24255
|
email: "test@example.com",
|
|
24099
24256
|
did: "did:key:test123",
|
|
24100
24257
|
lastSeen: new Date().toISOString(),
|
|
24101
|
-
perspectiveCount: 5
|
|
24258
|
+
perspectiveCount: 5,
|
|
24259
|
+
remainingCredits: "0",
|
|
24260
|
+
freeAccess: false
|
|
24102
24261
|
}];
|
|
24103
24262
|
}
|
|
24104
24263
|
runtimeRequestLoginVerification(email, appInfo) {
|
|
@@ -24148,7 +24307,7 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
24148
24307
|
}
|
|
24149
24308
|
// Hosting mutations & queries
|
|
24150
24309
|
runtimeHostingUserInfo() {
|
|
24151
|
-
return new HostingUserInfo("test@example.com", "100000000", null);
|
|
24310
|
+
return new HostingUserInfo("test@example.com", "100000000", null, false);
|
|
24152
24311
|
}
|
|
24153
24312
|
runtimeSetHotWalletAddress(address) {
|
|
24154
24313
|
return true;
|
|
@@ -24156,6 +24315,33 @@ let RuntimeResolver = class RuntimeResolver {
|
|
|
24156
24315
|
runtimeRequestPayment(amountHOT) {
|
|
24157
24316
|
return new PaymentRequestResult(true, "Mock payment of " + amountHOT + " base units credited");
|
|
24158
24317
|
}
|
|
24318
|
+
runtimeSetUserCredits(email, amount) {
|
|
24319
|
+
return true;
|
|
24320
|
+
}
|
|
24321
|
+
runtimeSetUserFreeAccess(email, enabled) {
|
|
24322
|
+
return true;
|
|
24323
|
+
}
|
|
24324
|
+
runtimeReinstallUnytDna() {
|
|
24325
|
+
return new PaymentRequestResult(true, "");
|
|
24326
|
+
}
|
|
24327
|
+
runtimeSendHot(recipient, amount) {
|
|
24328
|
+
return new PaymentRequestResult(true, "");
|
|
24329
|
+
}
|
|
24330
|
+
runtimeSetUnytMembraneProof(proof) {
|
|
24331
|
+
return new PaymentRequestResult(true, "");
|
|
24332
|
+
}
|
|
24333
|
+
runtimeHotWalletBalance() {
|
|
24334
|
+
return "";
|
|
24335
|
+
}
|
|
24336
|
+
runtimeHotWalletHistory(page, perPage) {
|
|
24337
|
+
return "";
|
|
24338
|
+
}
|
|
24339
|
+
runtimeHotAgentPubkey() {
|
|
24340
|
+
return "";
|
|
24341
|
+
}
|
|
24342
|
+
runtimeUnytVersionInfo() {
|
|
24343
|
+
return "";
|
|
24344
|
+
}
|
|
24159
24345
|
};
|
|
24160
24346
|
__decorate([
|
|
24161
24347
|
Mutation(),
|
|
@@ -24503,6 +24689,69 @@ __decorate([
|
|
|
24503
24689
|
__metadata("design:paramtypes", [String]),
|
|
24504
24690
|
__metadata("design:returntype", PaymentRequestResult)
|
|
24505
24691
|
], RuntimeResolver.prototype, "runtimeRequestPayment", null);
|
|
24692
|
+
__decorate([
|
|
24693
|
+
Mutation(),
|
|
24694
|
+
__param(0, Arg()),
|
|
24695
|
+
__param(1, Arg()),
|
|
24696
|
+
__metadata("design:type", Function),
|
|
24697
|
+
__metadata("design:paramtypes", [String, Number]),
|
|
24698
|
+
__metadata("design:returntype", Boolean)
|
|
24699
|
+
], RuntimeResolver.prototype, "runtimeSetUserCredits", null);
|
|
24700
|
+
__decorate([
|
|
24701
|
+
Mutation(),
|
|
24702
|
+
__param(0, Arg()),
|
|
24703
|
+
__param(1, Arg()),
|
|
24704
|
+
__metadata("design:type", Function),
|
|
24705
|
+
__metadata("design:paramtypes", [String, Boolean]),
|
|
24706
|
+
__metadata("design:returntype", Boolean)
|
|
24707
|
+
], RuntimeResolver.prototype, "runtimeSetUserFreeAccess", null);
|
|
24708
|
+
__decorate([
|
|
24709
|
+
Mutation(),
|
|
24710
|
+
__metadata("design:type", Function),
|
|
24711
|
+
__metadata("design:paramtypes", []),
|
|
24712
|
+
__metadata("design:returntype", PaymentRequestResult)
|
|
24713
|
+
], RuntimeResolver.prototype, "runtimeReinstallUnytDna", null);
|
|
24714
|
+
__decorate([
|
|
24715
|
+
Mutation(),
|
|
24716
|
+
__param(0, Arg()),
|
|
24717
|
+
__param(1, Arg()),
|
|
24718
|
+
__metadata("design:type", Function),
|
|
24719
|
+
__metadata("design:paramtypes", [String, String]),
|
|
24720
|
+
__metadata("design:returntype", PaymentRequestResult)
|
|
24721
|
+
], RuntimeResolver.prototype, "runtimeSendHot", null);
|
|
24722
|
+
__decorate([
|
|
24723
|
+
Mutation(),
|
|
24724
|
+
__param(0, Arg()),
|
|
24725
|
+
__metadata("design:type", Function),
|
|
24726
|
+
__metadata("design:paramtypes", [String]),
|
|
24727
|
+
__metadata("design:returntype", PaymentRequestResult)
|
|
24728
|
+
], RuntimeResolver.prototype, "runtimeSetUnytMembraneProof", null);
|
|
24729
|
+
__decorate([
|
|
24730
|
+
Query(),
|
|
24731
|
+
__metadata("design:type", Function),
|
|
24732
|
+
__metadata("design:paramtypes", []),
|
|
24733
|
+
__metadata("design:returntype", String)
|
|
24734
|
+
], RuntimeResolver.prototype, "runtimeHotWalletBalance", null);
|
|
24735
|
+
__decorate([
|
|
24736
|
+
Query(),
|
|
24737
|
+
__param(0, Arg()),
|
|
24738
|
+
__param(1, Arg()),
|
|
24739
|
+
__metadata("design:type", Function),
|
|
24740
|
+
__metadata("design:paramtypes", [Number, Number]),
|
|
24741
|
+
__metadata("design:returntype", String)
|
|
24742
|
+
], RuntimeResolver.prototype, "runtimeHotWalletHistory", null);
|
|
24743
|
+
__decorate([
|
|
24744
|
+
Query(),
|
|
24745
|
+
__metadata("design:type", Function),
|
|
24746
|
+
__metadata("design:paramtypes", []),
|
|
24747
|
+
__metadata("design:returntype", String)
|
|
24748
|
+
], RuntimeResolver.prototype, "runtimeHotAgentPubkey", null);
|
|
24749
|
+
__decorate([
|
|
24750
|
+
Query(),
|
|
24751
|
+
__metadata("design:type", Function),
|
|
24752
|
+
__metadata("design:paramtypes", []),
|
|
24753
|
+
__metadata("design:returntype", String)
|
|
24754
|
+
], RuntimeResolver.prototype, "runtimeUnytVersionInfo", null);
|
|
24506
24755
|
RuntimeResolver = __decorate([
|
|
24507
24756
|
Resolver()
|
|
24508
24757
|
], RuntimeResolver);
|
|
@@ -9,6 +9,7 @@ export declare class RuntimeClient {
|
|
|
9
9
|
#private;
|
|
10
10
|
constructor(client: ApolloClient<any>, subscribe?: boolean);
|
|
11
11
|
info(): Promise<RuntimeInfo>;
|
|
12
|
+
tlsDomain(): Promise<string | null>;
|
|
12
13
|
quit(): Promise<Boolean>;
|
|
13
14
|
openLink(url: string): Promise<Boolean>;
|
|
14
15
|
addTrustedAgents(agents: string[]): Promise<string[]>;
|
|
@@ -42,11 +43,36 @@ export declare class RuntimeClient {
|
|
|
42
43
|
multiUserEnabled(): Promise<boolean>;
|
|
43
44
|
setMultiUserEnabled(enabled: boolean): Promise<boolean>;
|
|
44
45
|
listUsers(): Promise<UserStatistics[]>;
|
|
46
|
+
userWalletAddress(email: string): Promise<string | null>;
|
|
45
47
|
emailTestModeEnable(): Promise<boolean>;
|
|
46
48
|
emailTestModeDisable(): Promise<boolean>;
|
|
47
49
|
emailTestGetCode(email: string): Promise<string | null>;
|
|
48
50
|
emailTestClearCodes(): Promise<boolean>;
|
|
49
51
|
emailTestSetExpiry(email: string, verificationType: string, expiresAt: number): Promise<boolean>;
|
|
52
|
+
unytAgentKey(): Promise<string>;
|
|
53
|
+
unytHotAgentPubkey(): Promise<string>;
|
|
54
|
+
unytWalletBalance(): Promise<string>;
|
|
55
|
+
unytWalletHistory(page?: number, perPage?: number): Promise<string>;
|
|
56
|
+
unytVersionInfo(): Promise<string>;
|
|
57
|
+
unytSetMembraneProof(proof: string): Promise<{
|
|
58
|
+
success: boolean;
|
|
59
|
+
message: string;
|
|
60
|
+
}>;
|
|
61
|
+
unytReinstallDna(): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
message: string;
|
|
64
|
+
}>;
|
|
65
|
+
unytSendHot(recipient: string, amount: string): Promise<{
|
|
66
|
+
success: boolean;
|
|
67
|
+
message: string;
|
|
68
|
+
}>;
|
|
69
|
+
setUserCredits(email: string, amount: number): Promise<boolean>;
|
|
70
|
+
setUserFreeAccess(email: string, enabled: boolean): Promise<boolean>;
|
|
71
|
+
setHostRates(ratesJson: string): Promise<boolean>;
|
|
72
|
+
getHostRates(): Promise<{
|
|
73
|
+
description: string;
|
|
74
|
+
priceInHOT: number;
|
|
75
|
+
}[]>;
|
|
50
76
|
addNotificationTriggeredCallback(cb: NotificationTriggeredCallback): void;
|
|
51
77
|
subscribeNotificationTriggered(): void;
|
|
52
78
|
addMessageCallback(cb: MessageCallback): void;
|
|
@@ -74,6 +74,14 @@ export class RuntimeClient {
|
|
|
74
74
|
}));
|
|
75
75
|
return runtimeInfo;
|
|
76
76
|
}
|
|
77
|
+
async tlsDomain() {
|
|
78
|
+
const { runtimeTlsDomain } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
79
|
+
query: gql `query runtimeTlsDomain {
|
|
80
|
+
runtimeTlsDomain
|
|
81
|
+
}`,
|
|
82
|
+
}));
|
|
83
|
+
return runtimeTlsDomain;
|
|
84
|
+
}
|
|
77
85
|
async quit() {
|
|
78
86
|
const result = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
79
87
|
mutation: gql `mutation runtimeQuit { runtimeQuit }`
|
|
@@ -376,11 +384,23 @@ export class RuntimeClient {
|
|
|
376
384
|
did
|
|
377
385
|
lastSeen
|
|
378
386
|
perspectiveCount
|
|
387
|
+
remainingCredits
|
|
388
|
+
freeAccess
|
|
389
|
+
hotWalletAddress
|
|
379
390
|
}
|
|
380
391
|
}`
|
|
381
392
|
}));
|
|
382
393
|
return runtimeListUsers;
|
|
383
394
|
}
|
|
395
|
+
async userWalletAddress(email) {
|
|
396
|
+
const { runtimeUserWalletAddress } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
397
|
+
query: gql `query runtimeUserWalletAddress($email: String!) {
|
|
398
|
+
runtimeUserWalletAddress(email: $email)
|
|
399
|
+
}`,
|
|
400
|
+
variables: { email }
|
|
401
|
+
}));
|
|
402
|
+
return runtimeUserWalletAddress;
|
|
403
|
+
}
|
|
384
404
|
async emailTestModeEnable() {
|
|
385
405
|
const { runtimeEmailTestModeEnable } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
386
406
|
mutation: gql `mutation runtimeEmailTestModeEnable {
|
|
@@ -423,6 +443,112 @@ export class RuntimeClient {
|
|
|
423
443
|
}));
|
|
424
444
|
return runtimeEmailTestSetExpiry;
|
|
425
445
|
}
|
|
446
|
+
// ---- Unyt / mHOT methods ----
|
|
447
|
+
async unytAgentKey() {
|
|
448
|
+
const { runtimeUnytAgentKey } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
449
|
+
query: gql `query runtimeUnytAgentKey { runtimeUnytAgentKey }`,
|
|
450
|
+
fetchPolicy: "network-only",
|
|
451
|
+
}));
|
|
452
|
+
return runtimeUnytAgentKey;
|
|
453
|
+
}
|
|
454
|
+
async unytHotAgentPubkey() {
|
|
455
|
+
const { runtimeHotAgentPubkey } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
456
|
+
query: gql `query runtimeHotAgentPubkey { runtimeHotAgentPubkey }`,
|
|
457
|
+
fetchPolicy: "network-only",
|
|
458
|
+
}));
|
|
459
|
+
return runtimeHotAgentPubkey;
|
|
460
|
+
}
|
|
461
|
+
async unytWalletBalance() {
|
|
462
|
+
const { runtimeHotWalletBalance } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
463
|
+
query: gql `query runtimeHotWalletBalance { runtimeHotWalletBalance }`,
|
|
464
|
+
fetchPolicy: "network-only",
|
|
465
|
+
}));
|
|
466
|
+
return runtimeHotWalletBalance;
|
|
467
|
+
}
|
|
468
|
+
async unytWalletHistory(page, perPage) {
|
|
469
|
+
const { runtimeHotWalletHistory } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
470
|
+
query: gql `query runtimeHotWalletHistory($page: Int, $perPage: Int) {
|
|
471
|
+
runtimeHotWalletHistory(page: $page, perPage: $perPage)
|
|
472
|
+
}`,
|
|
473
|
+
variables: { page, perPage },
|
|
474
|
+
fetchPolicy: "network-only",
|
|
475
|
+
}));
|
|
476
|
+
return runtimeHotWalletHistory;
|
|
477
|
+
}
|
|
478
|
+
async unytVersionInfo() {
|
|
479
|
+
const { runtimeUnytVersionInfo } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
480
|
+
query: gql `query runtimeUnytVersionInfo { runtimeUnytVersionInfo }`,
|
|
481
|
+
fetchPolicy: "network-only",
|
|
482
|
+
}));
|
|
483
|
+
return runtimeUnytVersionInfo;
|
|
484
|
+
}
|
|
485
|
+
async unytSetMembraneProof(proof) {
|
|
486
|
+
const { runtimeSetUnytMembraneProof } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
487
|
+
mutation: gql `mutation runtimeSetUnytMembraneProof($proof: String!) {
|
|
488
|
+
runtimeSetUnytMembraneProof(proof: $proof) { success message }
|
|
489
|
+
}`,
|
|
490
|
+
variables: { proof },
|
|
491
|
+
}));
|
|
492
|
+
return runtimeSetUnytMembraneProof;
|
|
493
|
+
}
|
|
494
|
+
async unytReinstallDna() {
|
|
495
|
+
const { runtimeReinstallUnytDna } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
496
|
+
mutation: gql `mutation runtimeReinstallUnytDna {
|
|
497
|
+
runtimeReinstallUnytDna { success message }
|
|
498
|
+
}`,
|
|
499
|
+
}));
|
|
500
|
+
return runtimeReinstallUnytDna;
|
|
501
|
+
}
|
|
502
|
+
async unytSendHot(recipient, amount) {
|
|
503
|
+
const { runtimeSendHot } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
504
|
+
mutation: gql `mutation runtimeSendHot($recipient: String!, $amount: String!) {
|
|
505
|
+
runtimeSendHot(recipient: $recipient, amount: $amount) { success message }
|
|
506
|
+
}`,
|
|
507
|
+
variables: { recipient, amount },
|
|
508
|
+
}));
|
|
509
|
+
return runtimeSendHot;
|
|
510
|
+
}
|
|
511
|
+
async setUserCredits(email, amount) {
|
|
512
|
+
const { runtimeSetUserCredits } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
513
|
+
mutation: gql `mutation runtimeSetUserCredits($email: String!, $amount: Float!) {
|
|
514
|
+
runtimeSetUserCredits(email: $email, amount: $amount)
|
|
515
|
+
}`,
|
|
516
|
+
variables: { email, amount },
|
|
517
|
+
}));
|
|
518
|
+
return runtimeSetUserCredits;
|
|
519
|
+
}
|
|
520
|
+
async setUserFreeAccess(email, enabled) {
|
|
521
|
+
const { runtimeSetUserFreeAccess } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
522
|
+
mutation: gql `mutation runtimeSetUserFreeAccess($email: String!, $enabled: Boolean!) {
|
|
523
|
+
runtimeSetUserFreeAccess(email: $email, enabled: $enabled)
|
|
524
|
+
}`,
|
|
525
|
+
variables: { email, enabled },
|
|
526
|
+
}));
|
|
527
|
+
return runtimeSetUserFreeAccess;
|
|
528
|
+
}
|
|
529
|
+
async setHostRates(ratesJson) {
|
|
530
|
+
const { runtimeSetHostRates } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").mutate({
|
|
531
|
+
mutation: gql `mutation runtimeSetHostRates($ratesJson: String!) {
|
|
532
|
+
runtimeSetHostRates(ratesJson: $ratesJson)
|
|
533
|
+
}`,
|
|
534
|
+
variables: { ratesJson },
|
|
535
|
+
}));
|
|
536
|
+
return runtimeSetHostRates;
|
|
537
|
+
}
|
|
538
|
+
async getHostRates() {
|
|
539
|
+
const { runtimeHostRates } = unwrapApolloResult(await __classPrivateFieldGet(this, _RuntimeClient_apolloClient, "f").query({
|
|
540
|
+
query: gql `query runtimeHostRates {
|
|
541
|
+
runtimeHostRates
|
|
542
|
+
}`,
|
|
543
|
+
fetchPolicy: 'network-only',
|
|
544
|
+
}));
|
|
545
|
+
try {
|
|
546
|
+
return JSON.parse(runtimeHostRates);
|
|
547
|
+
}
|
|
548
|
+
catch {
|
|
549
|
+
return [];
|
|
550
|
+
}
|
|
551
|
+
}
|
|
426
552
|
addNotificationTriggeredCallback(cb) {
|
|
427
553
|
__classPrivateFieldGet(this, _RuntimeClient_notificationTriggeredCallbacks, "f").push(cb);
|
|
428
554
|
}
|
|
@@ -68,6 +68,9 @@ export declare class UserStatistics {
|
|
|
68
68
|
did: string;
|
|
69
69
|
lastSeen?: string;
|
|
70
70
|
perspectiveCount: number;
|
|
71
|
+
remainingCredits: string;
|
|
72
|
+
freeAccess: boolean;
|
|
73
|
+
hotWalletAddress?: string;
|
|
71
74
|
}
|
|
72
75
|
export declare class VerificationRequestResult {
|
|
73
76
|
success: boolean;
|
|
@@ -79,7 +82,8 @@ export declare class HostingUserInfo {
|
|
|
79
82
|
email: string;
|
|
80
83
|
remainingCredits: string;
|
|
81
84
|
hotWalletAddress?: string;
|
|
82
|
-
|
|
85
|
+
freeAccess: boolean;
|
|
86
|
+
constructor(email: string, remainingCredits: string, hotWalletAddress?: string, freeAccess?: boolean);
|
|
83
87
|
}
|
|
84
88
|
export declare class PaymentRequestResult {
|
|
85
89
|
success: boolean;
|
|
@@ -143,4 +147,13 @@ export default class RuntimeResolver {
|
|
|
143
147
|
runtimeHostingUserInfo(): HostingUserInfo;
|
|
144
148
|
runtimeSetHotWalletAddress(address: string): boolean;
|
|
145
149
|
runtimeRequestPayment(amountHOT: string): PaymentRequestResult;
|
|
150
|
+
runtimeSetUserCredits(email: string, amount: number): boolean;
|
|
151
|
+
runtimeSetUserFreeAccess(email: string, enabled: boolean): boolean;
|
|
152
|
+
runtimeReinstallUnytDna(): PaymentRequestResult;
|
|
153
|
+
runtimeSendHot(recipient: string, amount: string): PaymentRequestResult;
|
|
154
|
+
runtimeSetUnytMembraneProof(proof: string): PaymentRequestResult;
|
|
155
|
+
runtimeHotWalletBalance(): string;
|
|
156
|
+
runtimeHotWalletHistory(page?: number, perPage?: number): string;
|
|
157
|
+
runtimeHotAgentPubkey(): string;
|
|
158
|
+
runtimeUnytVersionInfo(): string;
|
|
146
159
|
}
|