@novasamatech/host-api 0.5.0-8 → 0.5.0
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/README.md +103 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/helpers.d.ts +33 -0
- package/dist/helpers.js +46 -0
- package/dist/hostApi.d.ts +31 -0
- package/dist/hostApi.js +345 -0
- package/dist/index.d.ts +18 -6
- package/dist/index.js +14 -5
- package/dist/protocol/commonCodecs.d.ts +42 -0
- package/dist/protocol/commonCodecs.js +64 -0
- package/dist/protocol/commonCodecs.spec.d.ts +1 -0
- package/dist/protocol/commonCodecs.spec.js +72 -0
- package/dist/protocol/impl.d.ts +93 -0
- package/dist/protocol/impl.js +97 -0
- package/dist/protocol/messageCodec.d.ts +1245 -0
- package/dist/protocol/messageCodec.js +24 -0
- package/dist/protocol/types.d.ts +1 -0
- package/dist/protocol/types.js +1 -0
- package/dist/protocol/v1/accounts.d.ts +265 -0
- package/dist/protocol/v1/accounts.js +51 -0
- package/dist/protocol/v1/chat.d.ts +341 -0
- package/dist/protocol/v1/chat.js +71 -0
- package/dist/protocol/v1/createTransaction.d.ts +238 -0
- package/dist/protocol/v1/createTransaction.js +58 -0
- package/dist/protocol/v1/feature.d.ts +15 -0
- package/dist/protocol/v1/feature.js +7 -0
- package/dist/protocol/v1/handshake.d.ts +85 -0
- package/dist/protocol/v1/handshake.js +12 -0
- package/dist/protocol/v1/jsonRpc.d.ts +10 -0
- package/dist/protocol/v1/jsonRpc.js +6 -0
- package/dist/protocol/v1/permission.d.ts +90 -0
- package/dist/protocol/v1/permission.js +18 -0
- package/dist/protocol/v1/sign.d.ts +152 -0
- package/dist/protocol/v1/sign.js +43 -0
- package/dist/protocol/v1/statementStore.d.ts +175 -0
- package/dist/protocol/v1/statementStore.js +47 -0
- package/dist/protocol/v1/storage.d.ts +87 -0
- package/dist/protocol/v1/storage.js +16 -0
- package/dist/provider.d.ts +8 -0
- package/dist/provider.js +1 -0
- package/dist/transport.d.ts +3 -0
- package/dist/transport.js +248 -0
- package/dist/types.d.ts +15 -15
- package/package.json +3 -5
- package/dist/commonEncoders.d.ts +0 -9
- package/dist/commonEncoders.js +0 -14
- package/dist/createTransport.d.ts +0 -6
- package/dist/createTransport.js +0 -183
- package/dist/createTransportEncoder.d.ts +0 -7
- package/dist/createTransportEncoder.js +0 -5
- package/dist/interactions/accounts.d.ts +0 -12
- package/dist/interactions/accounts.js +0 -39
- package/dist/interactions/features.d.ts +0 -13
- package/dist/interactions/features.js +0 -13
- package/dist/interactions/handshake.d.ts +0 -2
- package/dist/interactions/handshake.js +0 -3
- package/dist/interactions/papiProvider.d.ts +0 -8
- package/dist/interactions/papiProvider.js +0 -9
- package/dist/interactions/sign.d.ts +0 -101
- package/dist/interactions/sign.js +0 -169
- package/dist/messageEncoder.d.ts +0 -217
- package/dist/messageEncoder.js +0 -37
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Struct, _void, str } from 'scale-ts';
|
|
2
|
+
import { Enum } from './commonCodecs.js';
|
|
3
|
+
import { hostApiProtocol } from './impl.js';
|
|
4
|
+
const createPayload = (hostApi) => {
|
|
5
|
+
const fields = {};
|
|
6
|
+
for (const [method, payload] of Object.entries(hostApi)) {
|
|
7
|
+
if (payload.type === 'request') {
|
|
8
|
+
fields[`${method}_request`] = payload.request;
|
|
9
|
+
fields[`${method}_response`] = payload.response;
|
|
10
|
+
}
|
|
11
|
+
if (payload.type === 'subscription') {
|
|
12
|
+
fields[`${method}_start`] = payload.start;
|
|
13
|
+
fields[`${method}_stop`] = _void;
|
|
14
|
+
fields[`${method}_interrupt`] = _void;
|
|
15
|
+
fields[`${method}_receive`] = payload.receive;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Enum(fields);
|
|
19
|
+
};
|
|
20
|
+
export const MessagePayload = createPayload(hostApiProtocol);
|
|
21
|
+
export const Message = Struct({
|
|
22
|
+
requestId: str,
|
|
23
|
+
payload: MessagePayload,
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type HexString = `0x${string}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
export declare const AccountId: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
|
|
2
|
+
export declare const PublicKey: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
|
|
3
|
+
export declare const DotNsIdentifier: import("scale-ts").Codec<string>;
|
|
4
|
+
export declare const DerivationIndex: import("scale-ts").Codec<number>;
|
|
5
|
+
export declare const ProductAccountId: import("scale-ts").Codec<[string, number]>;
|
|
6
|
+
export declare const RingVrfProof: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
|
|
7
|
+
export declare const RingVrgAlias: import("scale-ts").Codec<Uint8Array<ArrayBufferLike>>;
|
|
8
|
+
export declare const Account: import("scale-ts").Codec<{
|
|
9
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
10
|
+
name: string | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ContextualAlias: import("scale-ts").Codec<{
|
|
13
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
14
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const RingLocationHint: import("scale-ts").Codec<{
|
|
17
|
+
palletInstance: number | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const RingLocation: import("scale-ts").Codec<{
|
|
20
|
+
genesisHash: `0x${string}`;
|
|
21
|
+
ringRootHash: `0x${string}`;
|
|
22
|
+
hints: {
|
|
23
|
+
palletInstance: number | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const RequestCredentialsErr: [import("scale-ts").Encoder<(Error & {
|
|
27
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
28
|
+
className: string;
|
|
29
|
+
payload: undefined;
|
|
30
|
+
}) | (Error & {
|
|
31
|
+
name: "RequestCredentialsErr::Rejected";
|
|
32
|
+
className: string;
|
|
33
|
+
payload: undefined;
|
|
34
|
+
}) | (Error & {
|
|
35
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
36
|
+
className: string;
|
|
37
|
+
payload: undefined;
|
|
38
|
+
}) | (Error & {
|
|
39
|
+
name: "RequestCredentialsErr::Unknown";
|
|
40
|
+
className: string;
|
|
41
|
+
payload: {
|
|
42
|
+
reason: string;
|
|
43
|
+
};
|
|
44
|
+
})>, import("scale-ts").Decoder<(Error & {
|
|
45
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
46
|
+
className: string;
|
|
47
|
+
payload: undefined;
|
|
48
|
+
}) | (Error & {
|
|
49
|
+
name: "RequestCredentialsErr::Rejected";
|
|
50
|
+
className: string;
|
|
51
|
+
payload: undefined;
|
|
52
|
+
}) | (Error & {
|
|
53
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
54
|
+
className: string;
|
|
55
|
+
payload: undefined;
|
|
56
|
+
}) | (Error & {
|
|
57
|
+
name: "RequestCredentialsErr::Unknown";
|
|
58
|
+
className: string;
|
|
59
|
+
payload: {
|
|
60
|
+
reason: string;
|
|
61
|
+
};
|
|
62
|
+
})>] & {
|
|
63
|
+
enc: import("scale-ts").Encoder<(Error & {
|
|
64
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
65
|
+
className: string;
|
|
66
|
+
payload: undefined;
|
|
67
|
+
}) | (Error & {
|
|
68
|
+
name: "RequestCredentialsErr::Rejected";
|
|
69
|
+
className: string;
|
|
70
|
+
payload: undefined;
|
|
71
|
+
}) | (Error & {
|
|
72
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
73
|
+
className: string;
|
|
74
|
+
payload: undefined;
|
|
75
|
+
}) | (Error & {
|
|
76
|
+
name: "RequestCredentialsErr::Unknown";
|
|
77
|
+
className: string;
|
|
78
|
+
payload: {
|
|
79
|
+
reason: string;
|
|
80
|
+
};
|
|
81
|
+
})>;
|
|
82
|
+
dec: import("scale-ts").Decoder<(Error & {
|
|
83
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
84
|
+
className: string;
|
|
85
|
+
payload: undefined;
|
|
86
|
+
}) | (Error & {
|
|
87
|
+
name: "RequestCredentialsErr::Rejected";
|
|
88
|
+
className: string;
|
|
89
|
+
payload: undefined;
|
|
90
|
+
}) | (Error & {
|
|
91
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
92
|
+
className: string;
|
|
93
|
+
payload: undefined;
|
|
94
|
+
}) | (Error & {
|
|
95
|
+
name: "RequestCredentialsErr::Unknown";
|
|
96
|
+
className: string;
|
|
97
|
+
payload: {
|
|
98
|
+
reason: string;
|
|
99
|
+
};
|
|
100
|
+
})>;
|
|
101
|
+
} & {
|
|
102
|
+
readonly NotConnected: import("../commonCodecs.js").ErrCodec<undefined, "RequestCredentialsErr::NotConnected">;
|
|
103
|
+
readonly Rejected: import("../commonCodecs.js").ErrCodec<undefined, "RequestCredentialsErr::Rejected">;
|
|
104
|
+
readonly DomainNotValid: import("../commonCodecs.js").ErrCodec<undefined, "RequestCredentialsErr::DomainNotValid">;
|
|
105
|
+
readonly Unknown: import("../commonCodecs.js").ErrCodec<{
|
|
106
|
+
reason: string;
|
|
107
|
+
}, "RequestCredentialsErr::Unknown">;
|
|
108
|
+
};
|
|
109
|
+
export declare const CreateProofErr: [import("scale-ts").Encoder<(Error & {
|
|
110
|
+
name: "CreateProofErr::Rejected";
|
|
111
|
+
className: string;
|
|
112
|
+
payload: undefined;
|
|
113
|
+
}) | (Error & {
|
|
114
|
+
name: "CreateProofErr::Unknown";
|
|
115
|
+
className: string;
|
|
116
|
+
payload: {
|
|
117
|
+
reason: string;
|
|
118
|
+
};
|
|
119
|
+
}) | (Error & {
|
|
120
|
+
name: "CreateProofErr::RingNotFound";
|
|
121
|
+
className: string;
|
|
122
|
+
payload: undefined;
|
|
123
|
+
})>, import("scale-ts").Decoder<(Error & {
|
|
124
|
+
name: "CreateProofErr::Rejected";
|
|
125
|
+
className: string;
|
|
126
|
+
payload: undefined;
|
|
127
|
+
}) | (Error & {
|
|
128
|
+
name: "CreateProofErr::Unknown";
|
|
129
|
+
className: string;
|
|
130
|
+
payload: {
|
|
131
|
+
reason: string;
|
|
132
|
+
};
|
|
133
|
+
}) | (Error & {
|
|
134
|
+
name: "CreateProofErr::RingNotFound";
|
|
135
|
+
className: string;
|
|
136
|
+
payload: undefined;
|
|
137
|
+
})>] & {
|
|
138
|
+
enc: import("scale-ts").Encoder<(Error & {
|
|
139
|
+
name: "CreateProofErr::Rejected";
|
|
140
|
+
className: string;
|
|
141
|
+
payload: undefined;
|
|
142
|
+
}) | (Error & {
|
|
143
|
+
name: "CreateProofErr::Unknown";
|
|
144
|
+
className: string;
|
|
145
|
+
payload: {
|
|
146
|
+
reason: string;
|
|
147
|
+
};
|
|
148
|
+
}) | (Error & {
|
|
149
|
+
name: "CreateProofErr::RingNotFound";
|
|
150
|
+
className: string;
|
|
151
|
+
payload: undefined;
|
|
152
|
+
})>;
|
|
153
|
+
dec: import("scale-ts").Decoder<(Error & {
|
|
154
|
+
name: "CreateProofErr::Rejected";
|
|
155
|
+
className: string;
|
|
156
|
+
payload: undefined;
|
|
157
|
+
}) | (Error & {
|
|
158
|
+
name: "CreateProofErr::Unknown";
|
|
159
|
+
className: string;
|
|
160
|
+
payload: {
|
|
161
|
+
reason: string;
|
|
162
|
+
};
|
|
163
|
+
}) | (Error & {
|
|
164
|
+
name: "CreateProofErr::RingNotFound";
|
|
165
|
+
className: string;
|
|
166
|
+
payload: undefined;
|
|
167
|
+
})>;
|
|
168
|
+
} & {
|
|
169
|
+
readonly RingNotFound: import("../commonCodecs.js").ErrCodec<undefined, "CreateProofErr::RingNotFound">;
|
|
170
|
+
readonly Rejected: import("../commonCodecs.js").ErrCodec<undefined, "CreateProofErr::Rejected">;
|
|
171
|
+
readonly Unknown: import("../commonCodecs.js").ErrCodec<{
|
|
172
|
+
reason: string;
|
|
173
|
+
}, "CreateProofErr::Unknown">;
|
|
174
|
+
};
|
|
175
|
+
export declare const AccountGetV1_request: import("scale-ts").Codec<[string, number]>;
|
|
176
|
+
export declare const AccountGetV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
177
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
178
|
+
name: string | undefined;
|
|
179
|
+
}, (Error & {
|
|
180
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
181
|
+
className: string;
|
|
182
|
+
payload: undefined;
|
|
183
|
+
}) | (Error & {
|
|
184
|
+
name: "RequestCredentialsErr::Rejected";
|
|
185
|
+
className: string;
|
|
186
|
+
payload: undefined;
|
|
187
|
+
}) | (Error & {
|
|
188
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
189
|
+
className: string;
|
|
190
|
+
payload: undefined;
|
|
191
|
+
}) | (Error & {
|
|
192
|
+
name: "RequestCredentialsErr::Unknown";
|
|
193
|
+
className: string;
|
|
194
|
+
payload: {
|
|
195
|
+
reason: string;
|
|
196
|
+
};
|
|
197
|
+
})>>;
|
|
198
|
+
export declare const AccountGetAliasV1_request: import("scale-ts").Codec<[string, number]>;
|
|
199
|
+
export declare const AccountGetAliasV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
200
|
+
context: Uint8Array<ArrayBufferLike>;
|
|
201
|
+
alias: Uint8Array<ArrayBufferLike>;
|
|
202
|
+
}, (Error & {
|
|
203
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
204
|
+
className: string;
|
|
205
|
+
payload: undefined;
|
|
206
|
+
}) | (Error & {
|
|
207
|
+
name: "RequestCredentialsErr::Rejected";
|
|
208
|
+
className: string;
|
|
209
|
+
payload: undefined;
|
|
210
|
+
}) | (Error & {
|
|
211
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
212
|
+
className: string;
|
|
213
|
+
payload: undefined;
|
|
214
|
+
}) | (Error & {
|
|
215
|
+
name: "RequestCredentialsErr::Unknown";
|
|
216
|
+
className: string;
|
|
217
|
+
payload: {
|
|
218
|
+
reason: string;
|
|
219
|
+
};
|
|
220
|
+
})>>;
|
|
221
|
+
export declare const AccountCreateProofV1_request: import("scale-ts").Codec<[[string, number], {
|
|
222
|
+
genesisHash: `0x${string}`;
|
|
223
|
+
ringRootHash: `0x${string}`;
|
|
224
|
+
hints: {
|
|
225
|
+
palletInstance: number | undefined;
|
|
226
|
+
} | undefined;
|
|
227
|
+
}, Uint8Array<ArrayBufferLike>]>;
|
|
228
|
+
export declare const AccountCreateProofV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, (Error & {
|
|
229
|
+
name: "CreateProofErr::Rejected";
|
|
230
|
+
className: string;
|
|
231
|
+
payload: undefined;
|
|
232
|
+
}) | (Error & {
|
|
233
|
+
name: "CreateProofErr::Unknown";
|
|
234
|
+
className: string;
|
|
235
|
+
payload: {
|
|
236
|
+
reason: string;
|
|
237
|
+
};
|
|
238
|
+
}) | (Error & {
|
|
239
|
+
name: "CreateProofErr::RingNotFound";
|
|
240
|
+
className: string;
|
|
241
|
+
payload: undefined;
|
|
242
|
+
})>>;
|
|
243
|
+
export declare const GetNonProductAccountsV1_request: import("scale-ts").Codec<undefined>;
|
|
244
|
+
export declare const GetNonProductAccountsV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
245
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
246
|
+
name: string | undefined;
|
|
247
|
+
}[], (Error & {
|
|
248
|
+
name: "RequestCredentialsErr::NotConnected";
|
|
249
|
+
className: string;
|
|
250
|
+
payload: undefined;
|
|
251
|
+
}) | (Error & {
|
|
252
|
+
name: "RequestCredentialsErr::Rejected";
|
|
253
|
+
className: string;
|
|
254
|
+
payload: undefined;
|
|
255
|
+
}) | (Error & {
|
|
256
|
+
name: "RequestCredentialsErr::DomainNotValid";
|
|
257
|
+
className: string;
|
|
258
|
+
payload: undefined;
|
|
259
|
+
}) | (Error & {
|
|
260
|
+
name: "RequestCredentialsErr::Unknown";
|
|
261
|
+
className: string;
|
|
262
|
+
payload: {
|
|
263
|
+
reason: string;
|
|
264
|
+
};
|
|
265
|
+
})>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Bytes, Option, Result, Struct, Tuple, Vector, _void, str, u32 } from 'scale-ts';
|
|
2
|
+
import { ErrEnum, GenericErr, GenesisHash, Hex } from '../commonCodecs.js';
|
|
3
|
+
// common types
|
|
4
|
+
export const AccountId = Bytes(32);
|
|
5
|
+
export const PublicKey = Bytes();
|
|
6
|
+
export const DotNsIdentifier = str;
|
|
7
|
+
export const DerivationIndex = u32;
|
|
8
|
+
export const ProductAccountId = Tuple(DotNsIdentifier, DerivationIndex);
|
|
9
|
+
export const RingVrfProof = Bytes();
|
|
10
|
+
export const RingVrgAlias = Bytes();
|
|
11
|
+
// structs
|
|
12
|
+
export const Account = Struct({
|
|
13
|
+
publicKey: PublicKey,
|
|
14
|
+
name: Option(str),
|
|
15
|
+
});
|
|
16
|
+
export const ContextualAlias = Struct({
|
|
17
|
+
context: Bytes(32),
|
|
18
|
+
alias: RingVrgAlias,
|
|
19
|
+
});
|
|
20
|
+
export const RingLocationHint = Struct({
|
|
21
|
+
palletInstance: Option(u32),
|
|
22
|
+
});
|
|
23
|
+
export const RingLocation = Struct({
|
|
24
|
+
genesisHash: GenesisHash,
|
|
25
|
+
ringRootHash: Hex(),
|
|
26
|
+
hints: Option(RingLocationHint),
|
|
27
|
+
});
|
|
28
|
+
// errors
|
|
29
|
+
export const RequestCredentialsErr = ErrEnum('RequestCredentialsErr', {
|
|
30
|
+
NotConnected: [_void, 'RequestCredentials: not connected'],
|
|
31
|
+
Rejected: [_void, 'RequestCredentials: rejected'],
|
|
32
|
+
DomainNotValid: [_void, 'RequestCredentials: domain not valid'],
|
|
33
|
+
Unknown: [GenericErr, 'RequestCredentials: unknown error'],
|
|
34
|
+
});
|
|
35
|
+
export const CreateProofErr = ErrEnum('CreateProofErr', {
|
|
36
|
+
RingNotFound: [_void, 'CreateProof: ring not found'],
|
|
37
|
+
Rejected: [_void, 'CreateProof: rejected'],
|
|
38
|
+
Unknown: [GenericErr, 'CreateProof: unknown error'],
|
|
39
|
+
});
|
|
40
|
+
// account_get
|
|
41
|
+
export const AccountGetV1_request = ProductAccountId;
|
|
42
|
+
export const AccountGetV1_response = Result(Account, RequestCredentialsErr);
|
|
43
|
+
// account_get_alias
|
|
44
|
+
export const AccountGetAliasV1_request = ProductAccountId;
|
|
45
|
+
export const AccountGetAliasV1_response = Result(ContextualAlias, RequestCredentialsErr);
|
|
46
|
+
// account_create_proof
|
|
47
|
+
export const AccountCreateProofV1_request = Tuple(ProductAccountId, RingLocation, Bytes());
|
|
48
|
+
export const AccountCreateProofV1_response = Result(RingVrfProof, CreateProofErr);
|
|
49
|
+
// get_non_product_accounts
|
|
50
|
+
export const GetNonProductAccountsV1_request = _void;
|
|
51
|
+
export const GetNonProductAccountsV1_response = Result(Vector(Account), RequestCredentialsErr);
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
export declare const ChatContactRegistrationErr: [import("scale-ts").Encoder<Error & {
|
|
2
|
+
name: "ChatContactRegistrationErr::Unknown";
|
|
3
|
+
className: string;
|
|
4
|
+
payload: {
|
|
5
|
+
reason: string;
|
|
6
|
+
};
|
|
7
|
+
}>, import("scale-ts").Decoder<Error & {
|
|
8
|
+
name: "ChatContactRegistrationErr::Unknown";
|
|
9
|
+
className: string;
|
|
10
|
+
payload: {
|
|
11
|
+
reason: string;
|
|
12
|
+
};
|
|
13
|
+
}>] & {
|
|
14
|
+
enc: import("scale-ts").Encoder<Error & {
|
|
15
|
+
name: "ChatContactRegistrationErr::Unknown";
|
|
16
|
+
className: string;
|
|
17
|
+
payload: {
|
|
18
|
+
reason: string;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
dec: import("scale-ts").Decoder<Error & {
|
|
22
|
+
name: "ChatContactRegistrationErr::Unknown";
|
|
23
|
+
className: string;
|
|
24
|
+
payload: {
|
|
25
|
+
reason: string;
|
|
26
|
+
};
|
|
27
|
+
}>;
|
|
28
|
+
} & {
|
|
29
|
+
readonly Unknown: import("../commonCodecs.js").ErrCodec<{
|
|
30
|
+
reason: string;
|
|
31
|
+
}, "ChatContactRegistrationErr::Unknown">;
|
|
32
|
+
};
|
|
33
|
+
export declare const ChatContactRegistrationStatus: import("scale-ts").Codec<"New" | "Exists">;
|
|
34
|
+
export declare const ChatContact: import("scale-ts").Codec<{
|
|
35
|
+
name: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const ChatCreateContactV1_request: import("scale-ts").Codec<{
|
|
39
|
+
name: string;
|
|
40
|
+
icon: string;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const ChatCreateContactV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<"New" | "Exists", Error & {
|
|
43
|
+
name: "ChatContactRegistrationErr::Unknown";
|
|
44
|
+
className: string;
|
|
45
|
+
payload: {
|
|
46
|
+
reason: string;
|
|
47
|
+
};
|
|
48
|
+
}>>;
|
|
49
|
+
export declare const ChatAction: import("scale-ts").Codec<{
|
|
50
|
+
actionId: string;
|
|
51
|
+
title: string;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const ChatActionLayout: import("scale-ts").Codec<"Column" | "Grid">;
|
|
54
|
+
export declare const ChatActions: import("scale-ts").Codec<{
|
|
55
|
+
text: string | undefined;
|
|
56
|
+
actions: {
|
|
57
|
+
actionId: string;
|
|
58
|
+
title: string;
|
|
59
|
+
}[];
|
|
60
|
+
layout: "Column" | "Grid";
|
|
61
|
+
}>;
|
|
62
|
+
export declare const ChatMedia: import("scale-ts").Codec<{
|
|
63
|
+
url: string;
|
|
64
|
+
}>;
|
|
65
|
+
export declare const ChatRichText: import("scale-ts").Codec<{
|
|
66
|
+
text: string | undefined;
|
|
67
|
+
media: {
|
|
68
|
+
url: string;
|
|
69
|
+
}[];
|
|
70
|
+
}>;
|
|
71
|
+
export declare const ChatFile: import("scale-ts").Codec<{
|
|
72
|
+
url: string;
|
|
73
|
+
fileName: string;
|
|
74
|
+
mimeType: string;
|
|
75
|
+
sizeBytes: bigint;
|
|
76
|
+
text: string | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
export declare const ChatReaction: import("scale-ts").Codec<{
|
|
79
|
+
messageId: string;
|
|
80
|
+
emoji: string;
|
|
81
|
+
}>;
|
|
82
|
+
export declare const ChatMessage: import("scale-ts").Codec<{
|
|
83
|
+
tag: "Text";
|
|
84
|
+
value: string;
|
|
85
|
+
} | {
|
|
86
|
+
tag: "RichText";
|
|
87
|
+
value: {
|
|
88
|
+
text: string | undefined;
|
|
89
|
+
media: {
|
|
90
|
+
url: string;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
} | {
|
|
94
|
+
tag: "Actions";
|
|
95
|
+
value: {
|
|
96
|
+
text: string | undefined;
|
|
97
|
+
actions: {
|
|
98
|
+
actionId: string;
|
|
99
|
+
title: string;
|
|
100
|
+
}[];
|
|
101
|
+
layout: "Column" | "Grid";
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
104
|
+
tag: "File";
|
|
105
|
+
value: {
|
|
106
|
+
url: string;
|
|
107
|
+
fileName: string;
|
|
108
|
+
mimeType: string;
|
|
109
|
+
sizeBytes: bigint;
|
|
110
|
+
text: string | undefined;
|
|
111
|
+
};
|
|
112
|
+
} | {
|
|
113
|
+
tag: "Reaction";
|
|
114
|
+
value: {
|
|
115
|
+
messageId: string;
|
|
116
|
+
emoji: string;
|
|
117
|
+
};
|
|
118
|
+
} | {
|
|
119
|
+
tag: "ReactionRemoved";
|
|
120
|
+
value: {
|
|
121
|
+
messageId: string;
|
|
122
|
+
emoji: string;
|
|
123
|
+
};
|
|
124
|
+
}>;
|
|
125
|
+
export declare const ChatMessagePostingErr: [import("scale-ts").Encoder<(Error & {
|
|
126
|
+
name: "ChatMessagePostingErr::Unknown";
|
|
127
|
+
className: string;
|
|
128
|
+
payload: {
|
|
129
|
+
reason: string;
|
|
130
|
+
};
|
|
131
|
+
}) | (Error & {
|
|
132
|
+
name: "ChatMessagePostingErr::MessageTooLarge";
|
|
133
|
+
className: string;
|
|
134
|
+
payload: undefined;
|
|
135
|
+
})>, import("scale-ts").Decoder<(Error & {
|
|
136
|
+
name: "ChatMessagePostingErr::Unknown";
|
|
137
|
+
className: string;
|
|
138
|
+
payload: {
|
|
139
|
+
reason: string;
|
|
140
|
+
};
|
|
141
|
+
}) | (Error & {
|
|
142
|
+
name: "ChatMessagePostingErr::MessageTooLarge";
|
|
143
|
+
className: string;
|
|
144
|
+
payload: undefined;
|
|
145
|
+
})>] & {
|
|
146
|
+
enc: import("scale-ts").Encoder<(Error & {
|
|
147
|
+
name: "ChatMessagePostingErr::Unknown";
|
|
148
|
+
className: string;
|
|
149
|
+
payload: {
|
|
150
|
+
reason: string;
|
|
151
|
+
};
|
|
152
|
+
}) | (Error & {
|
|
153
|
+
name: "ChatMessagePostingErr::MessageTooLarge";
|
|
154
|
+
className: string;
|
|
155
|
+
payload: undefined;
|
|
156
|
+
})>;
|
|
157
|
+
dec: import("scale-ts").Decoder<(Error & {
|
|
158
|
+
name: "ChatMessagePostingErr::Unknown";
|
|
159
|
+
className: string;
|
|
160
|
+
payload: {
|
|
161
|
+
reason: string;
|
|
162
|
+
};
|
|
163
|
+
}) | (Error & {
|
|
164
|
+
name: "ChatMessagePostingErr::MessageTooLarge";
|
|
165
|
+
className: string;
|
|
166
|
+
payload: undefined;
|
|
167
|
+
})>;
|
|
168
|
+
} & {
|
|
169
|
+
readonly MessageTooLarge: import("../commonCodecs.js").ErrCodec<undefined, "ChatMessagePostingErr::MessageTooLarge">;
|
|
170
|
+
readonly Unknown: import("../commonCodecs.js").ErrCodec<{
|
|
171
|
+
reason: string;
|
|
172
|
+
}, "ChatMessagePostingErr::Unknown">;
|
|
173
|
+
};
|
|
174
|
+
export declare const ChatPostMessageResult: import("scale-ts").Codec<{
|
|
175
|
+
messageId: string;
|
|
176
|
+
}>;
|
|
177
|
+
export declare const ChatPostMessageV1_request: import("scale-ts").Codec<{
|
|
178
|
+
tag: "Text";
|
|
179
|
+
value: string;
|
|
180
|
+
} | {
|
|
181
|
+
tag: "RichText";
|
|
182
|
+
value: {
|
|
183
|
+
text: string | undefined;
|
|
184
|
+
media: {
|
|
185
|
+
url: string;
|
|
186
|
+
}[];
|
|
187
|
+
};
|
|
188
|
+
} | {
|
|
189
|
+
tag: "Actions";
|
|
190
|
+
value: {
|
|
191
|
+
text: string | undefined;
|
|
192
|
+
actions: {
|
|
193
|
+
actionId: string;
|
|
194
|
+
title: string;
|
|
195
|
+
}[];
|
|
196
|
+
layout: "Column" | "Grid";
|
|
197
|
+
};
|
|
198
|
+
} | {
|
|
199
|
+
tag: "File";
|
|
200
|
+
value: {
|
|
201
|
+
url: string;
|
|
202
|
+
fileName: string;
|
|
203
|
+
mimeType: string;
|
|
204
|
+
sizeBytes: bigint;
|
|
205
|
+
text: string | undefined;
|
|
206
|
+
};
|
|
207
|
+
} | {
|
|
208
|
+
tag: "Reaction";
|
|
209
|
+
value: {
|
|
210
|
+
messageId: string;
|
|
211
|
+
emoji: string;
|
|
212
|
+
};
|
|
213
|
+
} | {
|
|
214
|
+
tag: "ReactionRemoved";
|
|
215
|
+
value: {
|
|
216
|
+
messageId: string;
|
|
217
|
+
emoji: string;
|
|
218
|
+
};
|
|
219
|
+
}>;
|
|
220
|
+
export declare const ChatPostMessageV1_response: import("scale-ts").Codec<import("scale-ts").ResultPayload<{
|
|
221
|
+
messageId: string;
|
|
222
|
+
}, (Error & {
|
|
223
|
+
name: "ChatMessagePostingErr::Unknown";
|
|
224
|
+
className: string;
|
|
225
|
+
payload: {
|
|
226
|
+
reason: string;
|
|
227
|
+
};
|
|
228
|
+
}) | (Error & {
|
|
229
|
+
name: "ChatMessagePostingErr::MessageTooLarge";
|
|
230
|
+
className: string;
|
|
231
|
+
payload: undefined;
|
|
232
|
+
})>>;
|
|
233
|
+
export declare const ActionTrigger: import("scale-ts").Codec<{
|
|
234
|
+
messageId: string;
|
|
235
|
+
actionId: string;
|
|
236
|
+
}>;
|
|
237
|
+
export declare const ReceivedChatAction: import("scale-ts").Codec<{
|
|
238
|
+
tag: "MessagePosted";
|
|
239
|
+
value: {
|
|
240
|
+
tag: "Text";
|
|
241
|
+
value: string;
|
|
242
|
+
} | {
|
|
243
|
+
tag: "RichText";
|
|
244
|
+
value: {
|
|
245
|
+
text: string | undefined;
|
|
246
|
+
media: {
|
|
247
|
+
url: string;
|
|
248
|
+
}[];
|
|
249
|
+
};
|
|
250
|
+
} | {
|
|
251
|
+
tag: "Actions";
|
|
252
|
+
value: {
|
|
253
|
+
text: string | undefined;
|
|
254
|
+
actions: {
|
|
255
|
+
actionId: string;
|
|
256
|
+
title: string;
|
|
257
|
+
}[];
|
|
258
|
+
layout: "Column" | "Grid";
|
|
259
|
+
};
|
|
260
|
+
} | {
|
|
261
|
+
tag: "File";
|
|
262
|
+
value: {
|
|
263
|
+
url: string;
|
|
264
|
+
fileName: string;
|
|
265
|
+
mimeType: string;
|
|
266
|
+
sizeBytes: bigint;
|
|
267
|
+
text: string | undefined;
|
|
268
|
+
};
|
|
269
|
+
} | {
|
|
270
|
+
tag: "Reaction";
|
|
271
|
+
value: {
|
|
272
|
+
messageId: string;
|
|
273
|
+
emoji: string;
|
|
274
|
+
};
|
|
275
|
+
} | {
|
|
276
|
+
tag: "ReactionRemoved";
|
|
277
|
+
value: {
|
|
278
|
+
messageId: string;
|
|
279
|
+
emoji: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
} | {
|
|
283
|
+
tag: "ActionTriggered";
|
|
284
|
+
value: {
|
|
285
|
+
messageId: string;
|
|
286
|
+
actionId: string;
|
|
287
|
+
};
|
|
288
|
+
}>;
|
|
289
|
+
export declare const ChatActionSubscribeV1_start: import("scale-ts").Codec<undefined>;
|
|
290
|
+
export declare const ChatActionSubscribeV1_receive: import("scale-ts").Codec<{
|
|
291
|
+
tag: "MessagePosted";
|
|
292
|
+
value: {
|
|
293
|
+
tag: "Text";
|
|
294
|
+
value: string;
|
|
295
|
+
} | {
|
|
296
|
+
tag: "RichText";
|
|
297
|
+
value: {
|
|
298
|
+
text: string | undefined;
|
|
299
|
+
media: {
|
|
300
|
+
url: string;
|
|
301
|
+
}[];
|
|
302
|
+
};
|
|
303
|
+
} | {
|
|
304
|
+
tag: "Actions";
|
|
305
|
+
value: {
|
|
306
|
+
text: string | undefined;
|
|
307
|
+
actions: {
|
|
308
|
+
actionId: string;
|
|
309
|
+
title: string;
|
|
310
|
+
}[];
|
|
311
|
+
layout: "Column" | "Grid";
|
|
312
|
+
};
|
|
313
|
+
} | {
|
|
314
|
+
tag: "File";
|
|
315
|
+
value: {
|
|
316
|
+
url: string;
|
|
317
|
+
fileName: string;
|
|
318
|
+
mimeType: string;
|
|
319
|
+
sizeBytes: bigint;
|
|
320
|
+
text: string | undefined;
|
|
321
|
+
};
|
|
322
|
+
} | {
|
|
323
|
+
tag: "Reaction";
|
|
324
|
+
value: {
|
|
325
|
+
messageId: string;
|
|
326
|
+
emoji: string;
|
|
327
|
+
};
|
|
328
|
+
} | {
|
|
329
|
+
tag: "ReactionRemoved";
|
|
330
|
+
value: {
|
|
331
|
+
messageId: string;
|
|
332
|
+
emoji: string;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
} | {
|
|
336
|
+
tag: "ActionTriggered";
|
|
337
|
+
value: {
|
|
338
|
+
messageId: string;
|
|
339
|
+
actionId: string;
|
|
340
|
+
};
|
|
341
|
+
}>;
|