@idos-network/kwil-infra 1.2.0 → 2.2.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/CHANGELOG.md +98 -0
- package/README.md +46 -1
- package/dist/actions/index.d.mts +2 -2
- package/dist/actions/index.mjs +1 -1370
- package/dist/actions/index.mjs.map +1 -1
- package/dist/facesign/index.d.mts +1 -1
- package/dist/facesign/index.mjs +1 -2
- package/dist/{facesign-signer-ADd4EASX.d.mts → facesign-signer-5I8juA7p.d.mts} +2 -1
- package/dist/facesign-signer-5I8juA7p.d.mts.map +1 -0
- package/dist/facesign-signer-z5T312uQ.mjs +2 -0
- package/dist/facesign-signer-z5T312uQ.mjs.map +1 -0
- package/dist/{index-UFgWkjYP.d.mts → index-Bqz6trCk.d.mts} +273 -187
- package/dist/index-Bqz6trCk.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -415
- package/dist/index.mjs.map +1 -1
- package/dist/signature-verification/index.d.mts +3 -5
- package/dist/signature-verification/index.d.mts.map +1 -1
- package/dist/signature-verification/index.mjs +1 -139
- package/dist/signature-verification/index.mjs.map +1 -1
- package/dist/xrp/utils.d.mts +165 -57
- package/dist/xrp/utils.d.mts.map +1 -1
- package/dist/xrp/utils.mjs +1 -104
- package/dist/xrp/utils.mjs.map +1 -1
- package/dist/xrpl-credentials/index.d.mts +162 -153
- package/dist/xrpl-credentials/index.d.mts.map +1 -1
- package/dist/xrpl-credentials/index.mjs +1 -223
- package/dist/xrpl-credentials/index.mjs.map +1 -1
- package/package.json +17 -12
- package/src/actions/actions.test.ts +189 -0
- package/src/actions/actions.ts +368 -467
- package/src/actions/index.ts +38 -0
- package/src/create-kgw-authenticated-fetch.test.ts +377 -0
- package/src/create-kgw-authenticated-fetch.ts +321 -0
- package/src/create-kwil-client.ts +33 -10
- package/src/create-kwil-signer.test.ts +80 -0
- package/src/create-kwil-signer.ts +31 -5
- package/src/facesign/facesign-signer.test.ts +77 -0
- package/src/facesign/facesign-signer.ts +50 -2
- package/src/index.ts +2 -0
- package/src/mm-token/create-mm-token-kwil-signer.test.ts +148 -0
- package/src/mm-token/create-mm-token-kwil-signer.ts +166 -0
- package/src/near/create-near-wallet-kwil-signer.ts +1 -1
- package/src/signature-verification/index.test.ts +18 -0
- package/src/signature-verification/index.ts +7 -1
- package/src/wait-for-kwil-tx.test.ts +92 -0
- package/src/wait-for-kwil-tx.ts +111 -0
- package/tsdown.config.ts +1 -0
- package/vitest.config.ts +4 -0
- package/.turbo/turbo-build.log +0 -47
- package/.turbo/turbo-test.log +0 -126
- package/.turbo/turbo-typecheck.log +0 -5
- package/dist/facesign-signer-ADd4EASX.d.mts.map +0 -1
- package/dist/facesign-signer-BY9Nti9F.mjs +0 -244
- package/dist/facesign-signer-BY9Nti9F.mjs.map +0 -1
- package/dist/index-UFgWkjYP.d.mts.map +0 -1
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
import { n as FaceSignSignerProvider } from "./facesign-signer-
|
|
1
|
+
import { n as FaceSignSignerProvider } from "./facesign-signer-5I8juA7p.mjs";
|
|
2
2
|
import { KwilSigner, KwilSigner as KwilSigner$1, NodeKwil, Utils, WebKwil } from "@idos-network/kwil-js";
|
|
3
3
|
import * as z from "zod";
|
|
4
|
+
import { BlobGateway, BlobGatewayParams } from "@idos-network/utils/blob-gateway";
|
|
4
5
|
import nacl from "tweetnacl";
|
|
5
|
-
import { NearWalletBase } from "@hot-labs/near-connect";
|
|
6
6
|
import { Store } from "@idos-network/utils/store";
|
|
7
|
+
import { Wallet } from "@near-wallet-selector/core";
|
|
7
8
|
import { Keypair } from "@stellar/stellar-sdk";
|
|
8
|
-
import { JsonRpcSigner, Wallet } from "ethers";
|
|
9
|
+
import { JsonRpcSigner, Wallet as Wallet$1 } from "ethers";
|
|
9
10
|
import { KeyPair } from "near-api-js";
|
|
10
|
-
import { KeyPair as KeyPair$1 } from "ripple-keypairs/src/types
|
|
11
|
-
|
|
11
|
+
import { KeyPair as KeyPair$1 } from "ripple-keypairs/src/types";
|
|
12
|
+
//#region src/wait-for-kwil-tx.d.ts
|
|
13
|
+
declare class KwilTxFailedError extends Error {
|
|
14
|
+
readonly txHash: string;
|
|
15
|
+
readonly code: number;
|
|
16
|
+
readonly log: string;
|
|
17
|
+
readonly height: number;
|
|
18
|
+
readonly name = "KwilTxFailedError";
|
|
19
|
+
constructor(txHash: string, code: number, log: string, height: number);
|
|
20
|
+
}
|
|
21
|
+
declare class KwilTxPollTimeoutError extends Error {
|
|
22
|
+
readonly txHash: string;
|
|
23
|
+
readonly deadlineMs: number;
|
|
24
|
+
readonly name = "KwilTxPollTimeoutError";
|
|
25
|
+
constructor(txHash: string, deadlineMs: number, options?: {
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
12
30
|
//#region src/create-kwil-client.d.ts
|
|
13
31
|
type CreateKwilClientParams = {
|
|
14
32
|
chainId?: string;
|
|
@@ -19,42 +37,116 @@ type ActionName = keyof KwilActions;
|
|
|
19
37
|
type AllKwilCallAction = { [Name in ActionName]: {
|
|
20
38
|
name: Name;
|
|
21
39
|
inputs: Record<KwilActions[Name][number]["name"], any>;
|
|
22
|
-
} };
|
|
40
|
+
}; };
|
|
23
41
|
type KwilCallActionRequestParams = AllKwilCallAction[ActionName];
|
|
24
42
|
type AllKwilExecuteAction = { [Name in ActionName]: AllKwilCallAction[Name] & {
|
|
25
43
|
description: string;
|
|
26
|
-
} };
|
|
44
|
+
}; };
|
|
27
45
|
type KwilExecuteActionRequestParams = AllKwilExecuteAction[ActionName];
|
|
28
46
|
/**
|
|
29
|
-
* A client for interacting with kwil with type-safe abstractions for `call` and `execute`.
|
|
30
|
-
* Has utility methods for creating actions and setting a signer.
|
|
31
|
-
*/
|
|
47
|
+
* A client for interacting with kwil with type-safe abstractions for `call` and `execute`.
|
|
48
|
+
* Has utility methods for creating actions and setting a signer.
|
|
49
|
+
*/
|
|
32
50
|
declare class KwilActionClient {
|
|
33
51
|
#private;
|
|
34
52
|
signer?: KwilSigner;
|
|
35
53
|
readonly client: NodeKwil | WebKwil;
|
|
36
54
|
constructor(client: NodeKwil | WebKwil);
|
|
37
55
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
* Calls an action on the kwil nodes. This similar to `GET` like request.
|
|
57
|
+
*/
|
|
40
58
|
call<T = unknown>(params: KwilCallActionRequestParams, signer?: KwilSigner | undefined): Promise<T>;
|
|
41
59
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
* Executes an action on the kwil nodes. This similar to `POST` like request.
|
|
61
|
+
*
|
|
62
|
+
* When `synchronous` is true (default), the tx is broadcast without blocking the node,
|
|
63
|
+
* then confirmed by polling `txInfo` with exponential backoff.
|
|
64
|
+
*/
|
|
65
|
+
execute(params: KwilExecuteActionRequestParams, signer?: KwilSigner | undefined, synchronous?: boolean): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Polls the node until a broadcast transaction is mined, or throws
|
|
68
|
+
* `KwilTxFailedError` / `KwilTxPollTimeoutError`.
|
|
69
|
+
*
|
|
70
|
+
* Called through `this` rather than directly so that it is a seam an
|
|
71
|
+
* instrumentation can wrap — the wait dominates the latency of `execute`.
|
|
72
|
+
*/
|
|
73
|
+
waitForTx(txHash: string): Promise<void>;
|
|
45
74
|
setSigner(signer: KwilSigner | undefined): void;
|
|
46
75
|
}
|
|
47
76
|
/**
|
|
48
|
-
* Create a kwil client for node.js environment
|
|
49
|
-
*/
|
|
77
|
+
* Create a kwil client for node.js environment
|
|
78
|
+
*/
|
|
50
79
|
declare const createNodeKwilClient: (params: CreateKwilClientParams) => Promise<KwilActionClient>;
|
|
51
80
|
/**
|
|
52
|
-
* Create a kwil client for browser environment
|
|
53
|
-
*/
|
|
81
|
+
* Create a kwil client for browser environment
|
|
82
|
+
*/
|
|
54
83
|
declare const createWebKwilClient: (params: CreateKwilClientParams) => Promise<KwilActionClient>;
|
|
55
84
|
//#endregion
|
|
85
|
+
//#region src/mm-token/create-mm-token-kwil-signer.d.ts
|
|
86
|
+
/** Decoded UKYC capability envelope. KGW signature data is base64url(JSON of this). */
|
|
87
|
+
interface MmTokenEnvelope {
|
|
88
|
+
payload: MmTokenPayload | Record<string, unknown>;
|
|
89
|
+
signature: string;
|
|
90
|
+
}
|
|
91
|
+
interface MmTokenPayload {
|
|
92
|
+
signing_public_key: string;
|
|
93
|
+
storage_id?: string;
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* One MM/UKYC capability, valid both as a KGW `mm_token` signer and as the
|
|
98
|
+
* `Authorization: AccessToken …` credential for UKYC blob requests.
|
|
99
|
+
*/
|
|
100
|
+
type MmTokenAuth = KwilSigner & {
|
|
101
|
+
readonly mmTokenPayload: MmTokenPayload | Record<string, unknown>;
|
|
102
|
+
/** Exact encoded envelope KGW and UKYC storage verify. Non-enumerable, so it stays out of logs. */
|
|
103
|
+
readonly accessToken: string;
|
|
104
|
+
/**
|
|
105
|
+
* A capability signs its own envelope, never an arbitrary message. Declared so callers
|
|
106
|
+
* handling a `Wallet` union can keep asking wallets for a message signature.
|
|
107
|
+
*/
|
|
108
|
+
readonly signMessage?: undefined;
|
|
109
|
+
};
|
|
110
|
+
declare function isMmTokenAuth(value: unknown): value is MmTokenAuth;
|
|
111
|
+
/** `storage_id` from the capability token used to construct this signer. */
|
|
112
|
+
declare function mmTokenStorageId(signer: KwilSigner): string;
|
|
113
|
+
declare function mmTokenCredentialContentUri(signer: KwilSigner, credentialId: string): string;
|
|
114
|
+
/**
|
|
115
|
+
* Build the MM authentication object for one UKYC capability.
|
|
116
|
+
*
|
|
117
|
+
* Pass the MetaMask-issued capability token as a **base64url-encoded** envelope string
|
|
118
|
+
* (what KGW verifies). A decoded `{ payload, signature }` object is also accepted and
|
|
119
|
+
* will be re-encoded.
|
|
120
|
+
*
|
|
121
|
+
* `signMessage` always returns the UTF-8 bytes of that encoded string — KGW ignores the
|
|
122
|
+
* request message and only verifies the envelope.
|
|
123
|
+
*/
|
|
124
|
+
declare function createMmTokenAuth(encodedEnvelope: string | MmTokenEnvelope): MmTokenAuth;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/create-kgw-authenticated-fetch.d.ts
|
|
127
|
+
/** Return true when the response means KGW auth is missing/expired.
|
|
128
|
+
* May read the body only for `application/json` responses (those are probed via a clone). */
|
|
129
|
+
type KgwAuthFailurePredicate = (response: Response) => Promise<boolean> | boolean;
|
|
130
|
+
type CreateKgwAuthenticatedFetchParams = {
|
|
131
|
+
kwilClient: KwilActionClient;
|
|
132
|
+
signer: KwilSigner;
|
|
133
|
+
fetchFn?: typeof fetch;
|
|
134
|
+
isAuthFailure?: KgwAuthFailurePredicate;
|
|
135
|
+
};
|
|
136
|
+
type CreateKgwAuthenticatedBlobGatewayParams = CreateKgwAuthenticatedFetchParams & {
|
|
137
|
+
url: string;
|
|
138
|
+
maxFetchBytes?: BlobGatewayParams["maxFetchBytes"];
|
|
139
|
+
/**
|
|
140
|
+
* UKYC storage authority for blob requests. Defaults to `signer` when that signer
|
|
141
|
+
* is itself an MM authentication object, so the capability is never passed twice.
|
|
142
|
+
*/
|
|
143
|
+
mmAuth?: MmTokenAuth;
|
|
144
|
+
};
|
|
145
|
+
declare function createKgwAuthenticatedBlobGateway({ url, maxFetchBytes, mmAuth, ...fetchParams }: CreateKgwAuthenticatedBlobGatewayParams): BlobGateway;
|
|
146
|
+
declare function createKgwAuthenticatedFetch({ kwilClient, signer, fetchFn, isAuthFailure }: CreateKgwAuthenticatedFetchParams): typeof fetch;
|
|
147
|
+
//#endregion
|
|
56
148
|
//#region src/create-kwil-signer.d.ts
|
|
57
|
-
type Wallet$
|
|
149
|
+
type Wallet$2 = Wallet$1 | JsonRpcSigner | Wallet | CustomKwilSigner | MmTokenAuth | FaceSignSignerProvider;
|
|
58
150
|
interface CustomKwilSigner extends KwilSigner {
|
|
59
151
|
publicAddress: string;
|
|
60
152
|
signatureType: string;
|
|
@@ -62,29 +154,29 @@ interface CustomKwilSigner extends KwilSigner {
|
|
|
62
154
|
walletType: string;
|
|
63
155
|
signMessage: (message: Uint8Array | string) => Promise<Uint8Array>;
|
|
64
156
|
}
|
|
65
|
-
type KwilSignerType = KeyPair | Wallet | nacl.SignKeyPair | JsonRpcSigner | Keypair | KeyPair$1;
|
|
157
|
+
type KwilSignerType = KeyPair | Wallet$1 | nacl.SignKeyPair | JsonRpcSigner | Keypair | KeyPair$1 | MmTokenAuth;
|
|
66
158
|
type SignerAddress = string;
|
|
67
159
|
type SignerPublicKey = string | undefined;
|
|
68
160
|
/**
|
|
69
|
-
* Creates a `KwilSigner` and its associated `SignerAddress`.
|
|
70
|
-
*
|
|
71
|
-
* This function is explicitly marked as being for backend use only because it doesn't reset
|
|
72
|
-
* the KGW cookie when logging out and re-logging in with a different wallet.
|
|
73
|
-
*/
|
|
161
|
+
* Creates a `KwilSigner` and its associated `SignerAddress`.
|
|
162
|
+
*
|
|
163
|
+
* This function is explicitly marked as being for backend use only because it doesn't reset
|
|
164
|
+
* the KGW cookie when logging out and re-logging in with a different wallet.
|
|
165
|
+
*/
|
|
74
166
|
declare function createServerKwilSigner(signer: KwilSignerType): Promise<[KwilSigner, SignerAddress]>;
|
|
75
|
-
declare function createClientKwilSigner(store: Store, kwilClient: KwilActionClient, wallet: Wallet$
|
|
167
|
+
declare function createClientKwilSigner(store: Store, kwilClient: KwilActionClient, wallet: Wallet$2): Promise<[KwilSigner, SignerAddress, SignerPublicKey, WalletType]>;
|
|
76
168
|
//#endregion
|
|
77
169
|
//#region src/near/create-near-wallet-kwil-signer.d.ts
|
|
78
170
|
declare function implicitAddressFromPublicKey(publicKey: string): string;
|
|
79
171
|
declare function getNearFullAccessPublicKeys(namedAddress: string): Promise<string[] | undefined>;
|
|
80
|
-
declare function signNearMessage(wallet:
|
|
172
|
+
declare function signNearMessage(wallet: Wallet, message: string, recipient?: string): Promise<string>;
|
|
81
173
|
//#endregion
|
|
82
174
|
//#region src/actions/actions.d.ts
|
|
83
175
|
declare const DataType: typeof Utils.DataType;
|
|
84
|
-
declare const WALLET_TYPES: readonly ["EVM", "NEAR", "XRPL", "Stellar", "FaceSign"];
|
|
176
|
+
declare const WALLET_TYPES: readonly ["EVM", "NEAR", "XRPL", "Stellar", "FaceSign", "MM"];
|
|
85
177
|
type WalletType = (typeof WALLET_TYPES)[number];
|
|
86
178
|
declare const walletTypeSchema: z.ZodType<WalletType>;
|
|
87
|
-
declare const ENCRYPTION_PASSWORD_STORES: readonly ["user", "mpc"];
|
|
179
|
+
declare const ENCRYPTION_PASSWORD_STORES: readonly ["user", "mpc", "mm"];
|
|
88
180
|
type EncryptionPasswordStore = (typeof ENCRYPTION_PASSWORD_STORES)[number];
|
|
89
181
|
declare const encryptionPasswordStoreSchema: z.ZodType<EncryptionPasswordStore>;
|
|
90
182
|
type ActionSchemaElement = {
|
|
@@ -92,29 +184,6 @@ type ActionSchemaElement = {
|
|
|
92
184
|
type: typeof DataType.Uuid | typeof DataType.Text | typeof DataType.Int | typeof DataType.Boolean;
|
|
93
185
|
};
|
|
94
186
|
declare const actionSchema: Record<string, ActionSchemaElement[]>;
|
|
95
|
-
declare const AddInserterAsOwnerInputSchema: z.ZodObject<{
|
|
96
|
-
id: z.ZodUUID;
|
|
97
|
-
name: z.ZodString;
|
|
98
|
-
}>;
|
|
99
|
-
type AddInserterAsOwnerInput = z.infer<typeof AddInserterAsOwnerInputSchema>;
|
|
100
|
-
/** INSERTER AND DELEGATE ACTIONS */
|
|
101
|
-
declare function addInserterAsOwner(kwilClient: KwilActionClient, params: AddInserterAsOwnerInput): Promise<void>;
|
|
102
|
-
declare const DeleteInserterAsOwnerInputSchema: z.ZodObject<{
|
|
103
|
-
id: z.ZodUUID;
|
|
104
|
-
}>;
|
|
105
|
-
type DeleteInserterAsOwnerInput = z.infer<typeof DeleteInserterAsOwnerInputSchema>;
|
|
106
|
-
declare function deleteInserterAsOwner(kwilClient: KwilActionClient, params: DeleteInserterAsOwnerInput): Promise<void>;
|
|
107
|
-
declare const AddDelegateAsOwnerInputSchema: z.ZodObject<{
|
|
108
|
-
address: z.ZodString;
|
|
109
|
-
inserter_id: z.ZodUUID;
|
|
110
|
-
}>;
|
|
111
|
-
type AddDelegateAsOwnerInput = z.infer<typeof AddDelegateAsOwnerInputSchema>;
|
|
112
|
-
declare function addDelegateAsOwner(kwilClient: KwilActionClient, params: AddDelegateAsOwnerInput): Promise<void>;
|
|
113
|
-
declare const DeleteDelegateAsOwnerInputSchema: z.ZodObject<{
|
|
114
|
-
address: z.ZodString;
|
|
115
|
-
}>;
|
|
116
|
-
type DeleteDelegateAsOwnerInput = z.infer<typeof DeleteDelegateAsOwnerInputSchema>;
|
|
117
|
-
declare function deleteDelegateAsOwner(kwilClient: KwilActionClient, params: DeleteDelegateAsOwnerInput): Promise<void>;
|
|
118
187
|
declare const AddUserAsInserterInputSchema: z.ZodObject<{
|
|
119
188
|
id: z.ZodUUID;
|
|
120
189
|
recipient_encryption_public_key: z.ZodString;
|
|
@@ -153,20 +222,35 @@ declare const UpsertWalletAsInserterInputSchema: z.ZodObject<{
|
|
|
153
222
|
id: z.ZodUUID;
|
|
154
223
|
user_id: z.ZodUUID;
|
|
155
224
|
address: z.ZodString;
|
|
156
|
-
public_key: z.ZodNullable<z.ZodString
|
|
225
|
+
public_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
157
226
|
wallet_type: z.ZodType<WalletType>;
|
|
158
|
-
|
|
227
|
+
not_before: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
228
|
+
not_after: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
159
229
|
signature: z.ZodString;
|
|
160
230
|
}>;
|
|
161
231
|
type UpsertWalletAsInserterInput = z.infer<typeof UpsertWalletAsInserterInputSchema>;
|
|
162
232
|
/** WALLET ACTIONS */
|
|
163
233
|
declare function upsertWalletAsInserter(kwilClient: KwilActionClient, params: UpsertWalletAsInserterInput): Promise<void>;
|
|
234
|
+
declare const AddWalletMessageInputSchema: z.ZodObject<{
|
|
235
|
+
address: z.ZodString;
|
|
236
|
+
wallet_type: z.ZodType<WalletType>;
|
|
237
|
+
user_id: z.ZodUUID;
|
|
238
|
+
not_before: z.ZodISODateTime;
|
|
239
|
+
not_after: z.ZodISODateTime;
|
|
240
|
+
}>;
|
|
241
|
+
type AddWalletMessageInput = z.infer<typeof AddWalletMessageInputSchema>;
|
|
242
|
+
declare const AddWalletMessageOutputSchema: z.ZodObject<{
|
|
243
|
+
message: z.ZodString;
|
|
244
|
+
}>;
|
|
245
|
+
type AddWalletMessageOutput = z.infer<typeof AddWalletMessageOutputSchema>;
|
|
246
|
+
declare function addWalletMessage(kwilClient: KwilActionClient, params: AddWalletMessageInput): Promise<AddWalletMessageOutput>;
|
|
164
247
|
declare const AddWalletInputSchema: z.ZodObject<{
|
|
165
248
|
id: z.ZodUUID;
|
|
166
249
|
address: z.ZodString;
|
|
167
|
-
public_key: z.ZodNullable<z.ZodString
|
|
250
|
+
public_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
251
|
wallet_type: z.ZodType<WalletType>;
|
|
169
|
-
|
|
252
|
+
not_before: z.ZodISODateTime;
|
|
253
|
+
not_after: z.ZodISODateTime;
|
|
170
254
|
signature: z.ZodString;
|
|
171
255
|
}>;
|
|
172
256
|
type AddWalletInput = z.infer<typeof AddWalletInputSchema>;
|
|
@@ -188,46 +272,37 @@ declare const RemoveWalletInputSchema: z.ZodObject<{
|
|
|
188
272
|
}>;
|
|
189
273
|
type RemoveWalletInput = z.infer<typeof RemoveWalletInputSchema>;
|
|
190
274
|
declare function removeWallet(kwilClient: KwilActionClient, params: RemoveWalletInput): Promise<void>;
|
|
191
|
-
declare const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
issuer_auth_public_key: z.ZodString;
|
|
195
|
-
encryptor_public_key: z.ZodString;
|
|
196
|
-
content: z.ZodString;
|
|
197
|
-
public_notes: z.ZodString;
|
|
198
|
-
public_notes_signature: z.ZodString;
|
|
199
|
-
broader_signature: z.ZodString;
|
|
200
|
-
}>;
|
|
201
|
-
type UpsertCredentialAsInserterInput = z.infer<typeof UpsertCredentialAsInserterInputSchema>;
|
|
202
|
-
/**
|
|
203
|
-
* CREDENTIAL ACTIONS
|
|
204
|
-
* throw an error if not authorized
|
|
205
|
-
*/
|
|
206
|
-
declare function upsertCredentialAsInserter(kwilClient: KwilActionClient, params: UpsertCredentialAsInserterInput): Promise<void>;
|
|
207
|
-
declare const AddCredentialInputSchema: z.ZodObject<{
|
|
208
|
-
id: z.ZodUUID;
|
|
275
|
+
declare const CreatePreliminaryCredentialInputSchema: z.ZodObject<{
|
|
276
|
+
request_id: z.ZodUUID;
|
|
277
|
+
credential_id: z.ZodUUID;
|
|
209
278
|
issuer_auth_public_key: z.ZodString;
|
|
210
279
|
encryptor_public_key: z.ZodString;
|
|
211
|
-
|
|
280
|
+
content_uri: z.ZodString;
|
|
281
|
+
content_size: z.ZodNumber;
|
|
282
|
+
content_hash: z.ZodString;
|
|
212
283
|
public_notes: z.ZodString;
|
|
213
284
|
public_notes_signature: z.ZodString;
|
|
214
285
|
broader_signature: z.ZodString;
|
|
215
286
|
}>;
|
|
216
|
-
type
|
|
217
|
-
|
|
287
|
+
type CreatePreliminaryCredentialInput = z.infer<typeof CreatePreliminaryCredentialInputSchema>;
|
|
288
|
+
/** CREDENTIAL ACTIONS */
|
|
289
|
+
declare function createPreliminaryCredential(kwilClient: KwilActionClient, params: CreatePreliminaryCredentialInput): Promise<void>;
|
|
218
290
|
declare const GetCredentialsOutputSchema: z.ZodObject<{
|
|
219
291
|
id: z.ZodUUID;
|
|
220
292
|
user_id: z.ZodUUID;
|
|
221
293
|
public_notes: z.ZodString;
|
|
294
|
+
content_uri: z.ZodNullable<z.ZodString>;
|
|
295
|
+
content_size: z.ZodNullable<z.ZodNumber>;
|
|
222
296
|
issuer_auth_public_key: z.ZodString;
|
|
223
|
-
|
|
297
|
+
inserter_type: z.ZodNullable<z.ZodString>;
|
|
298
|
+
inserter_id: z.ZodNullable<z.ZodString>;
|
|
224
299
|
original_id: z.ZodNullable<z.ZodUUID>;
|
|
225
300
|
}>;
|
|
226
301
|
type GetCredentialsOutput = z.infer<typeof GetCredentialsOutputSchema>;
|
|
227
302
|
declare function getCredentials(kwilClient: KwilActionClient): Promise<GetCredentialsOutput[]>;
|
|
228
303
|
declare const GetCredentialsSharedByUserInputSchema: z.ZodObject<{
|
|
229
304
|
user_id: z.ZodUUID;
|
|
230
|
-
original_issuer_auth_public_key: z.ZodNullable<z.ZodString
|
|
305
|
+
original_issuer_auth_public_key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
306
|
}>;
|
|
232
307
|
type GetCredentialsSharedByUserInput = z.infer<typeof GetCredentialsSharedByUserInputSchema>;
|
|
233
308
|
declare const GetCredentialsSharedByUserOutputSchema: z.ZodObject<{
|
|
@@ -236,74 +311,74 @@ declare const GetCredentialsSharedByUserOutputSchema: z.ZodObject<{
|
|
|
236
311
|
public_notes: z.ZodString;
|
|
237
312
|
encryptor_public_key: z.ZodString;
|
|
238
313
|
issuer_auth_public_key: z.ZodString;
|
|
239
|
-
|
|
314
|
+
inserter_type: z.ZodNullable<z.ZodString>;
|
|
315
|
+
inserter_id: z.ZodNullable<z.ZodString>;
|
|
240
316
|
original_id: z.ZodNullable<z.ZodUUID>;
|
|
241
317
|
}>;
|
|
242
318
|
type GetCredentialsSharedByUserOutput = z.infer<typeof GetCredentialsSharedByUserOutputSchema>;
|
|
243
319
|
declare function getCredentialsSharedByUser(kwilClient: KwilActionClient, params: GetCredentialsSharedByUserInput): Promise<GetCredentialsSharedByUserOutput[]>;
|
|
244
|
-
declare const EditCredentialInputSchema: z.ZodObject<{
|
|
245
|
-
id: z.ZodUUID;
|
|
246
|
-
public_notes: z.ZodString;
|
|
247
|
-
public_notes_signature: z.ZodString;
|
|
248
|
-
broader_signature: z.ZodString;
|
|
249
|
-
content: z.ZodString;
|
|
250
|
-
encryptor_public_key: z.ZodString;
|
|
251
|
-
issuer_auth_public_key: z.ZodString;
|
|
252
|
-
}>;
|
|
253
|
-
type EditCredentialInput = z.infer<typeof EditCredentialInputSchema>;
|
|
254
|
-
/**
|
|
255
|
-
* we forbid to edit a copy
|
|
256
|
-
* only copies can have AGs, so data_id in AGs is id of a copy
|
|
257
|
-
* if $id is shared_credentials.copy_id - it is a copy
|
|
258
|
-
*/
|
|
259
|
-
declare function editCredential(kwilClient: KwilActionClient, params: EditCredentialInput): Promise<void>;
|
|
260
320
|
declare const EditPublicNotesAsIssuerInputSchema: z.ZodObject<{
|
|
261
321
|
public_notes_id: z.ZodString;
|
|
262
322
|
public_notes: z.ZodString;
|
|
263
323
|
}>;
|
|
264
324
|
type EditPublicNotesAsIssuerInput = z.infer<typeof EditPublicNotesAsIssuerInputSchema>;
|
|
265
325
|
/**
|
|
266
|
-
* Be aware that @caller here is ed25519 public key, hex encoded.
|
|
267
|
-
* All other @caller in the schema are either secp256k1 or nep413
|
|
268
|
-
* This action can't be called by kwil-cli (as kwil-cli uses secp256k1 only)
|
|
269
|
-
*/
|
|
326
|
+
* Be aware that @caller here is ed25519 public key, hex encoded.
|
|
327
|
+
* All other @caller in the schema are either secp256k1 or nep413
|
|
328
|
+
* This action can't be called by kwil-cli (as kwil-cli uses secp256k1 only)
|
|
329
|
+
*/
|
|
270
330
|
declare function editPublicNotesAsIssuer(kwilClient: KwilActionClient, params: EditPublicNotesAsIssuerInput): Promise<void>;
|
|
271
331
|
declare const RemoveCredentialInputSchema: z.ZodObject<{
|
|
272
332
|
id: z.ZodUUID;
|
|
273
333
|
}>;
|
|
274
334
|
type RemoveCredentialInput = z.infer<typeof RemoveCredentialInputSchema>;
|
|
335
|
+
/**
|
|
336
|
+
* Already requested: succeed so the client can retry the blob DELETE.
|
|
337
|
+
* A second insert is impossible (credential_id is the primary key).
|
|
338
|
+
* Legacy inline credentials (no blob): delete immediately.
|
|
339
|
+
* Blob-backed: record intent; credential stays live until gateway finalizes.
|
|
340
|
+
*/
|
|
275
341
|
declare function removeCredential(kwilClient: KwilActionClient, params: RemoveCredentialInput): Promise<void>;
|
|
276
342
|
declare const RescindSharedCredentialInputSchema: z.ZodObject<{
|
|
277
343
|
credential_id: z.ZodUUID;
|
|
278
344
|
}>;
|
|
279
345
|
type RescindSharedCredentialInput = z.infer<typeof RescindSharedCredentialInputSchema>;
|
|
346
|
+
/**
|
|
347
|
+
* Already requested: succeed so the client can retry the blob DELETE.
|
|
348
|
+
* Legacy inline credentials (no blob): delete immediately.
|
|
349
|
+
*/
|
|
280
350
|
declare function rescindSharedCredential(kwilClient: KwilActionClient, params: RescindSharedCredentialInput): Promise<void>;
|
|
281
|
-
declare const
|
|
282
|
-
|
|
283
|
-
|
|
351
|
+
declare const SharePreliminaryCredentialInputSchema: z.ZodObject<{
|
|
352
|
+
request_id: z.ZodUUID;
|
|
353
|
+
copy_id: z.ZodUUID;
|
|
354
|
+
original_id: z.ZodUUID;
|
|
284
355
|
public_notes: z.ZodString;
|
|
285
356
|
public_notes_signature: z.ZodString;
|
|
286
357
|
broader_signature: z.ZodString;
|
|
287
|
-
|
|
358
|
+
content_uri: z.ZodString;
|
|
359
|
+
content_size: z.ZodNumber;
|
|
288
360
|
content_hash: z.ZodString;
|
|
289
361
|
encryptor_public_key: z.ZodString;
|
|
290
362
|
issuer_auth_public_key: z.ZodString;
|
|
291
363
|
grantee_wallet_identifier: z.ZodString;
|
|
292
364
|
locked_until: z.ZodNumber;
|
|
293
365
|
}>;
|
|
294
|
-
type
|
|
295
|
-
declare function
|
|
296
|
-
declare const
|
|
366
|
+
type SharePreliminaryCredentialInput = z.infer<typeof SharePreliminaryCredentialInputSchema>;
|
|
367
|
+
declare function sharePreliminaryCredential(kwilClient: KwilActionClient, params: SharePreliminaryCredentialInput): Promise<void>;
|
|
368
|
+
declare const CreatePreliminaryCredentialsByDwgInputSchema: z.ZodObject<{
|
|
369
|
+
request_id: z.ZodUUID;
|
|
297
370
|
issuer_auth_public_key: z.ZodString;
|
|
298
371
|
original_encryptor_public_key: z.ZodString;
|
|
299
|
-
|
|
300
|
-
|
|
372
|
+
original_id: z.ZodUUID;
|
|
373
|
+
original_content_uri: z.ZodString;
|
|
374
|
+
original_content_size: z.ZodNumber;
|
|
301
375
|
original_public_notes: z.ZodString;
|
|
302
376
|
original_public_notes_signature: z.ZodString;
|
|
303
377
|
original_broader_signature: z.ZodString;
|
|
304
378
|
copy_encryptor_public_key: z.ZodString;
|
|
305
|
-
|
|
306
|
-
|
|
379
|
+
copy_id: z.ZodUUID;
|
|
380
|
+
copy_content_uri: z.ZodString;
|
|
381
|
+
copy_content_size: z.ZodNumber;
|
|
307
382
|
copy_public_notes_signature: z.ZodString;
|
|
308
383
|
copy_broader_signature: z.ZodString;
|
|
309
384
|
content_hash: z.ZodString;
|
|
@@ -311,27 +386,34 @@ declare const CreateCredentialsByDwgInputSchema: z.ZodObject<{
|
|
|
311
386
|
dwg_grantee: z.ZodString;
|
|
312
387
|
dwg_issuer_public_key: z.ZodString;
|
|
313
388
|
dwg_id: z.ZodUUID;
|
|
314
|
-
dwg_access_grant_timelock: z.
|
|
315
|
-
dwg_not_before: z.
|
|
316
|
-
dwg_not_after: z.
|
|
389
|
+
dwg_access_grant_timelock: z.ZodISODateTime;
|
|
390
|
+
dwg_not_before: z.ZodISODateTime;
|
|
391
|
+
dwg_not_after: z.ZodISODateTime;
|
|
317
392
|
dwg_signature: z.ZodString;
|
|
318
393
|
}>;
|
|
319
|
-
type
|
|
394
|
+
type CreatePreliminaryCredentialsByDwgInput = z.infer<typeof CreatePreliminaryCredentialsByDwgInputSchema>;
|
|
320
395
|
/**
|
|
321
|
-
* Delegated write credential actions
|
|
322
|
-
* For access grant
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
|
|
334
|
-
|
|
396
|
+
* Delegated write credential actions
|
|
397
|
+
* For access grant
|
|
398
|
+
* We will use the same ids for preliminary credentials as for credentials, so we need to check if they already exist
|
|
399
|
+
* We capture gas upfront to prevent the real credential from being created if the gas is not enough
|
|
400
|
+
* The gas can be refunded fully or partially
|
|
401
|
+
* Temporary: an issuer is not an inserter/caller. A user grants a DWG to an issuer_key;
|
|
402
|
+
* the issuer must issue the credential and sign the proof with that same issuer_key.
|
|
403
|
+
* Today we approximate "same issuer" via delegates sharing an inserter_id.
|
|
404
|
+
* TODO: once the SDK distinguishes issuer_key from delegate_key, replace with:
|
|
405
|
+
* if $issuer_auth_public_key != $dwg_issuer_public_key {
|
|
406
|
+
* error('credentials issuer must be an issuer of delegated write grant');
|
|
407
|
+
* }
|
|
408
|
+
* Get the wallet type and public key for XRPL/NEAR wallets from database
|
|
409
|
+
* Will fail if not in the RFC3339 format
|
|
410
|
+
* Check the format and precedence
|
|
411
|
+
* Check if current block timestamp in time range allowed by write grant.
|
|
412
|
+
* @block_timestamp is a timestamp of previous block, which is can be a few seconds earlier
|
|
413
|
+
* (max is 6 seconds in current network consensus settings) then a time on a requester's machine.
|
|
414
|
+
* Also, if requester's machine has wrong time, it can be an issue.
|
|
415
|
+
*/
|
|
416
|
+
declare function createPreliminaryCredentialsByDwg(kwilClient: KwilActionClient, params: CreatePreliminaryCredentialsByDwgInput): Promise<void>;
|
|
335
417
|
declare const CredentialExistAsInserterInputSchema: z.ZodObject<{
|
|
336
418
|
id: z.ZodUUID;
|
|
337
419
|
}>;
|
|
@@ -349,10 +431,13 @@ declare const GetCredentialOwnedOutputSchema: z.ZodObject<{
|
|
|
349
431
|
id: z.ZodUUID;
|
|
350
432
|
user_id: z.ZodUUID;
|
|
351
433
|
public_notes: z.ZodString;
|
|
352
|
-
content: z.ZodString
|
|
434
|
+
content: z.ZodNullable<z.ZodString>;
|
|
435
|
+
content_uri: z.ZodNullable<z.ZodString>;
|
|
436
|
+
content_size: z.ZodNullable<z.ZodNumber>;
|
|
353
437
|
encryptor_public_key: z.ZodString;
|
|
354
438
|
issuer_auth_public_key: z.ZodString;
|
|
355
|
-
|
|
439
|
+
inserter_type: z.ZodNullable<z.ZodString>;
|
|
440
|
+
inserter_id: z.ZodNullable<z.ZodString>;
|
|
356
441
|
}>;
|
|
357
442
|
type GetCredentialOwnedOutput = z.infer<typeof GetCredentialOwnedOutputSchema>;
|
|
358
443
|
declare function getCredentialOwned(kwilClient: KwilActionClient, params: GetCredentialOwnedInput): Promise<GetCredentialOwnedOutput[]>;
|
|
@@ -364,10 +449,13 @@ declare const GetCredentialSharedOutputSchema: z.ZodObject<{
|
|
|
364
449
|
id: z.ZodUUID;
|
|
365
450
|
user_id: z.ZodUUID;
|
|
366
451
|
public_notes: z.ZodString;
|
|
367
|
-
content: z.ZodString
|
|
452
|
+
content: z.ZodNullable<z.ZodString>;
|
|
453
|
+
content_uri: z.ZodNullable<z.ZodString>;
|
|
454
|
+
content_size: z.ZodNullable<z.ZodNumber>;
|
|
368
455
|
encryptor_public_key: z.ZodString;
|
|
369
456
|
issuer_auth_public_key: z.ZodString;
|
|
370
|
-
|
|
457
|
+
inserter_type: z.ZodNullable<z.ZodString>;
|
|
458
|
+
inserter_id: z.ZodNullable<z.ZodString>;
|
|
371
459
|
}>;
|
|
372
460
|
type GetCredentialSharedOutput = z.infer<typeof GetCredentialSharedOutputSchema>;
|
|
373
461
|
/** As a credential copy doesn't contain PUBLIC notes, we return respective original credential PUBLIC notes */
|
|
@@ -431,9 +519,9 @@ declare const DwgMessageInputSchema: z.ZodObject<{
|
|
|
431
519
|
grantee_wallet_identifier: z.ZodString;
|
|
432
520
|
issuer_public_key: z.ZodString;
|
|
433
521
|
id: z.ZodUUID;
|
|
434
|
-
access_grant_timelock: z.
|
|
435
|
-
not_usable_before: z.
|
|
436
|
-
not_usable_after: z.
|
|
522
|
+
access_grant_timelock: z.ZodISODateTime;
|
|
523
|
+
not_usable_before: z.ZodISODateTime;
|
|
524
|
+
not_usable_after: z.ZodISODateTime;
|
|
437
525
|
}>;
|
|
438
526
|
type DwgMessageInput = z.infer<typeof DwgMessageInputSchema>;
|
|
439
527
|
declare const DwgMessageOutputSchema: z.ZodObject<{
|
|
@@ -441,13 +529,13 @@ declare const DwgMessageOutputSchema: z.ZodObject<{
|
|
|
441
529
|
}>;
|
|
442
530
|
type DwgMessageOutput = z.infer<typeof DwgMessageOutputSchema>;
|
|
443
531
|
/**
|
|
444
|
-
* WRITE GRANTS ACTIONS
|
|
445
|
-
* Must be in yyyy-mm-ddThh:mm:ssZ format
|
|
446
|
-
* Must be in yyyy-mm-ddThh:mm:ssZ format
|
|
447
|
-
* Must be in yyyy-mm-ddThh:mm:ssZ format
|
|
448
|
-
* Will fail if not in the yyyy-mm-ddThh:mm:ssZ format, and not comply to RFC3339
|
|
449
|
-
* Check the format and precedence
|
|
450
|
-
*/
|
|
532
|
+
* WRITE GRANTS ACTIONS
|
|
533
|
+
* Must be in yyyy-mm-ddThh:mm:ssZ format
|
|
534
|
+
* Must be in yyyy-mm-ddThh:mm:ssZ format
|
|
535
|
+
* Must be in yyyy-mm-ddThh:mm:ssZ format
|
|
536
|
+
* Will fail if not in the yyyy-mm-ddThh:mm:ssZ format, and not comply to RFC3339
|
|
537
|
+
* Check the format and precedence
|
|
538
|
+
*/
|
|
451
539
|
declare function dwgMessage(kwilClient: KwilActionClient, params: DwgMessageInput): Promise<DwgMessageOutput>;
|
|
452
540
|
declare const RevokeAccessGrantInputSchema: z.ZodObject<{
|
|
453
541
|
id: z.ZodUUID;
|
|
@@ -468,7 +556,7 @@ declare const GetAccessGrantsOwnedOutputSchema: z.ZodObject<{
|
|
|
468
556
|
type GetAccessGrantsOwnedOutput = z.infer<typeof GetAccessGrantsOwnedOutputSchema>;
|
|
469
557
|
declare function getAccessGrantsOwned(kwilClient: KwilActionClient): Promise<GetAccessGrantsOwnedOutput[]>;
|
|
470
558
|
declare const GetAccessGrantsGrantedInputSchema: z.ZodObject<{
|
|
471
|
-
user_id: z.ZodNullable<z.ZodUUID
|
|
559
|
+
user_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
472
560
|
page: z.ZodNumber;
|
|
473
561
|
size: z.ZodNumber;
|
|
474
562
|
}>;
|
|
@@ -485,13 +573,13 @@ declare const GetAccessGrantsGrantedOutputSchema: z.ZodObject<{
|
|
|
485
573
|
}>;
|
|
486
574
|
type GetAccessGrantsGrantedOutput = z.infer<typeof GetAccessGrantsGrantedOutputSchema>;
|
|
487
575
|
/**
|
|
488
|
-
* As arguments can be undefined (user can not send them at all), we have to have default values: page=1, size=20
|
|
489
|
-
* Page number starts from 1, as UI usually shows to user in pagination element
|
|
490
|
-
* Ordering is consistent because we use height as first ordering parameter
|
|
491
|
-
*/
|
|
576
|
+
* As arguments can be undefined (user can not send them at all), we have to have default values: page=1, size=20
|
|
577
|
+
* Page number starts from 1, as UI usually shows to user in pagination element
|
|
578
|
+
* Ordering is consistent because we use height as first ordering parameter
|
|
579
|
+
*/
|
|
492
580
|
declare function getAccessGrantsGranted(kwilClient: KwilActionClient, params: GetAccessGrantsGrantedInput): Promise<GetAccessGrantsGrantedOutput[]>;
|
|
493
581
|
declare const GetAccessGrantsGrantedCountInputSchema: z.ZodObject<{
|
|
494
|
-
user_id: z.ZodNullable<z.ZodUUID
|
|
582
|
+
user_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
495
583
|
}>;
|
|
496
584
|
type GetAccessGrantsGrantedCountInput = z.infer<typeof GetAccessGrantsGrantedCountInputSchema>;
|
|
497
585
|
declare const GetAccessGrantsGrantedCountOutputSchema: z.ZodObject<{
|
|
@@ -508,33 +596,6 @@ declare const HasLockedAccessGrantsOutputSchema: z.ZodObject<{
|
|
|
508
596
|
}>;
|
|
509
597
|
type HasLockedAccessGrantsOutput = z.infer<typeof HasLockedAccessGrantsOutputSchema>;
|
|
510
598
|
declare function hasLockedAccessGrants(kwilClient: KwilActionClient, params: HasLockedAccessGrantsInput): Promise<HasLockedAccessGrantsOutput>;
|
|
511
|
-
declare const DagMessageInputSchema: z.ZodObject<{
|
|
512
|
-
dag_owner_wallet_identifier: z.ZodString;
|
|
513
|
-
dag_grantee_wallet_identifier: z.ZodString;
|
|
514
|
-
dag_data_id: z.ZodUUID;
|
|
515
|
-
dag_locked_until: z.ZodNumber;
|
|
516
|
-
dag_content_hash: z.ZodString;
|
|
517
|
-
}>;
|
|
518
|
-
type DagMessageInput = z.infer<typeof DagMessageInputSchema>;
|
|
519
|
-
declare const DagMessageOutputSchema: z.ZodObject<{
|
|
520
|
-
message: z.ZodString;
|
|
521
|
-
}>;
|
|
522
|
-
type DagMessageOutput = z.infer<typeof DagMessageOutputSchema>;
|
|
523
|
-
declare function dagMessage(kwilClient: KwilActionClient, params: DagMessageInput): Promise<DagMessageOutput>;
|
|
524
|
-
declare const CreateAgByDagForCopyInputSchema: z.ZodObject<{
|
|
525
|
-
dag_owner_wallet_identifier: z.ZodString;
|
|
526
|
-
dag_grantee_wallet_identifier: z.ZodString;
|
|
527
|
-
dag_data_id: z.ZodUUID;
|
|
528
|
-
dag_locked_until: z.ZodNumber;
|
|
529
|
-
dag_content_hash: z.ZodString;
|
|
530
|
-
dag_signature: z.ZodString;
|
|
531
|
-
}>;
|
|
532
|
-
type CreateAgByDagForCopyInput = z.infer<typeof CreateAgByDagForCopyInputSchema>;
|
|
533
|
-
/**
|
|
534
|
-
* Get the wallet type and public key for XRPL/NEAR wallets from database
|
|
535
|
-
* This works for EVM-compatible signatures only
|
|
536
|
-
*/
|
|
537
|
-
declare function createAgByDagForCopy(kwilClient: KwilActionClient, params: CreateAgByDagForCopyInput): Promise<void>;
|
|
538
599
|
declare const GetAccessGrantsForCredentialInputSchema: z.ZodObject<{
|
|
539
600
|
credential_id: z.ZodUUID;
|
|
540
601
|
}>;
|
|
@@ -560,10 +621,29 @@ declare const HasProfileOutputSchema: z.ZodObject<{
|
|
|
560
621
|
}>;
|
|
561
622
|
type HasProfileOutput = z.infer<typeof HasProfileOutputSchema>;
|
|
562
623
|
/**
|
|
563
|
-
* OTHER ACTIONS
|
|
564
|
-
* Should we improve it to work with near wallets too?
|
|
565
|
-
*/
|
|
624
|
+
* OTHER ACTIONS
|
|
625
|
+
* Should we improve it to work with near wallets too?
|
|
626
|
+
*/
|
|
566
627
|
declare function hasProfile(kwilClient: KwilActionClient, params: HasProfileInput): Promise<HasProfileOutput>;
|
|
628
|
+
declare const SetCallerPayerInputSchema: z.ZodObject<{
|
|
629
|
+
address: z.ZodString;
|
|
630
|
+
}>;
|
|
631
|
+
type SetCallerPayerInput = z.infer<typeof SetCallerPayerInputSchema>;
|
|
632
|
+
declare function setCallerPayer(kwilClient: KwilActionClient, params: SetCallerPayerInput): Promise<void>;
|
|
633
|
+
declare const CheckCallerPayerInputSchema: z.ZodObject<{
|
|
634
|
+
address: z.ZodString;
|
|
635
|
+
}>;
|
|
636
|
+
type CheckCallerPayerInput = z.infer<typeof CheckCallerPayerInputSchema>;
|
|
637
|
+
declare const CheckCallerPayerOutputSchema: z.ZodObject<{
|
|
638
|
+
is_payer: z.ZodBoolean;
|
|
639
|
+
}>;
|
|
640
|
+
type CheckCallerPayerOutput = z.infer<typeof CheckCallerPayerOutputSchema>;
|
|
641
|
+
declare function checkCallerPayer(kwilClient: KwilActionClient, params: CheckCallerPayerInput): Promise<CheckCallerPayerOutput>;
|
|
642
|
+
declare const UnsetCallerPayerInputSchema: z.ZodObject<{
|
|
643
|
+
address: z.ZodString;
|
|
644
|
+
}>;
|
|
645
|
+
type UnsetCallerPayerInput = z.infer<typeof UnsetCallerPayerInputSchema>;
|
|
646
|
+
declare function unsetCallerPayer(kwilClient: KwilActionClient, params: UnsetCallerPayerInput): Promise<void>;
|
|
567
647
|
declare const CheckBalanceInputSchema: z.ZodObject<{
|
|
568
648
|
address: z.ZodString;
|
|
569
649
|
token: z.ZodString;
|
|
@@ -573,20 +653,16 @@ declare const CheckBalanceOutputSchema: z.ZodObject<{
|
|
|
573
653
|
balance: z.ZodNumber;
|
|
574
654
|
}>;
|
|
575
655
|
type CheckBalanceOutput = z.infer<typeof CheckBalanceOutputSchema>;
|
|
576
|
-
/** GAS AND FEES */
|
|
577
656
|
declare function checkBalance(kwilClient: KwilActionClient, params: CheckBalanceInput): Promise<CheckBalanceOutput>;
|
|
578
657
|
declare const GetWalletWithBalanceInputSchema: z.ZodObject<{
|
|
579
658
|
token: z.ZodString;
|
|
659
|
+
minimum_balance: z.ZodNumber;
|
|
580
660
|
}>;
|
|
581
661
|
type GetWalletWithBalanceInput = z.infer<typeof GetWalletWithBalanceInputSchema>;
|
|
582
662
|
declare const GetWalletWithBalanceOutputSchema: z.ZodObject<{
|
|
583
663
|
wallet_address: z.ZodString;
|
|
584
664
|
}>;
|
|
585
665
|
type GetWalletWithBalanceOutput = z.infer<typeof GetWalletWithBalanceOutputSchema>;
|
|
586
|
-
/**
|
|
587
|
-
* even if the @caller is not EVM address, there is no harm to try to get the balance, it will return nothing
|
|
588
|
-
* because bridge.balance can only have records with EVM addresses (it is filled from EVM-compatible contract events)
|
|
589
|
-
*/
|
|
590
666
|
declare function getWalletWithBalance(kwilClient: KwilActionClient, params: GetWalletWithBalanceInput): Promise<GetWalletWithBalanceOutput>;
|
|
591
667
|
declare const RequestWithdrawalInputSchema: z.ZodObject<{
|
|
592
668
|
token: z.ZodString;
|
|
@@ -635,10 +711,20 @@ type idOSCredentialListItem = GetCredentialsOutput;
|
|
|
635
711
|
type idOSUserAttribute = GetAttributesOutput;
|
|
636
712
|
type idOSWallet = UpsertWalletAsInserterInput;
|
|
637
713
|
type idOSDelegatedWriteGrant = DwgMessageInput;
|
|
714
|
+
type DelegatedWriteGrantBaseParams = {
|
|
715
|
+
id: string;
|
|
716
|
+
ownerWalletIdentifier: string;
|
|
717
|
+
consumerWalletIdentifier: string;
|
|
718
|
+
issuerPublicKey: string;
|
|
719
|
+
accessGrantTimelock: string;
|
|
720
|
+
notUsableBefore: string;
|
|
721
|
+
notUsableAfter: string;
|
|
722
|
+
};
|
|
723
|
+
declare function toDelegatedWriteGrantBaseParams(params: idOSDelegatedWriteGrant): DelegatedWriteGrantBaseParams;
|
|
638
724
|
declare function addWallets(kwilClient: KwilActionClient, wallets: AddWalletInput[]): Promise<void>;
|
|
639
725
|
declare function removeWallets(kwilClient: KwilActionClient, ids: string[]): Promise<void>;
|
|
640
726
|
declare const GET_GRANTS_DEFAULT_RECORDS_PER_PAGE = 10;
|
|
641
727
|
declare function getGrants(kwilClient: KwilActionClient, params?: Partial<GetAccessGrantsGrantedInput>): Promise<idOSGrant[]>;
|
|
642
728
|
//#endregion
|
|
643
|
-
export {
|
|
644
|
-
//# sourceMappingURL=index-
|
|
729
|
+
export { EditAttributeInput as $, editAttribute as $n, createMmTokenAuth as $r, GetWalletWithBalanceOutputSchema as $t, AddWalletMessageOutputSchema as A, UnsetCallerPayerInput as An, unsetCallerPayer as Ar, GetCredentialsOutput as At, CreatePreliminaryCredentialInputSchema as B, actionCostingIdosToken as Bn, SignerAddress as Br, GetSiblingCredentialIdInput as Bt, AddUserAsInserterInput as C, RevokeAccessGrantInputSchema as Cn, requestBalanceWithdrawal as Cr, GetCredentialOwnedInputSchema as Ct, AddWalletMessageInput as D, ShareAttributeInputSchema as Dn, setCallerPayer as Dr, GetCredentialSharedInputSchema as Dt, AddWalletInputSchema as E, ShareAttributeInput as En, revokeAccessGrant as Er, GetCredentialSharedInput as Et, CheckCallerPayerInput as F, UpsertWalletAsInserterInputSchema as Fn, implicitAddressFromPublicKey as Fr, GetCredentialsSharedByUserOutputSchema as Ft, CredentialExistAsInserterOutput as G, addWallet as Gn, CreateKgwAuthenticatedBlobGatewayParams as Gr, GetUserAsInserterInputSchema as Gt, CreatePreliminaryCredentialsByDwgInputSchema as H, addAttribute as Hn, Wallet$2 as Hr, GetSiblingCredentialIdOutput as Ht, CheckCallerPayerInputSchema as I, WALLET_TYPES as In, signNearMessage as Ir, GetIssuerFeeInput as It, DwgMessageInput as J, checkCallerPayer as Jn, createKgwAuthenticatedBlobGateway as Jr, GetUserOutput as Jt, CredentialExistAsInserterOutputSchema as K, addWalletMessage as Kn, CreateKgwAuthenticatedFetchParams as Kr, GetUserAsInserterOutput as Kt, CheckCallerPayerOutput as L, WalletType as Ln, CustomKwilSigner as Lr, GetIssuerFeeInputSchema as Lt, CheckBalanceInputSchema as M, UpdateUserPubKeyAsInserterInput as Mn, upsertWalletAsInserter as Mr, GetCredentialsSharedByUserInput as Mt, CheckBalanceOutput as N, UpdateUserPubKeyAsInserterInputSchema as Nn, walletTypeSchema as Nr, GetCredentialsSharedByUserInputSchema as Nt, AddWalletMessageInputSchema as O, SharePreliminaryCredentialInput as On, shareAttribute as Or, GetCredentialSharedOutput as Ot, CheckBalanceOutputSchema as P, UpsertWalletAsInserterInput as Pn, getNearFullAccessPublicKeys as Pr, GetCredentialsSharedByUserOutput as Pt, ENCRYPTION_PASSWORD_STORES as Q, dwgMessage as Qn, MmTokenPayload as Qr, GetWalletWithBalanceOutput as Qt, CheckCallerPayerOutputSchema as R, actionCostingFee as Rn, KwilSigner$1 as Rr, GetIssuerFeeOutput as Rt, AddAttributeInputSchema as S, RevokeAccessGrantInput as Sn, removeWallet as Sr, GetCredentialOwnedInput as St, AddWalletInput as T, SetCallerPayerInputSchema as Tn, rescindSharedCredential as Tr, GetCredentialOwnedOutputSchema as Tt, CredentialExistAsInserterInput as U, addAttributeAsInserter as Un, createClientKwilSigner as Ur, GetSiblingCredentialIdOutputSchema as Ut, CreatePreliminaryCredentialsByDwgInput as V, actionSchema as Vn, SignerPublicKey as Vr, GetSiblingCredentialIdInputSchema as Vt, CredentialExistAsInserterInputSchema as W, addUserAsInserter as Wn, createServerKwilSigner as Wr, GetUserAsInserterInput as Wt, DwgMessageOutput as X, createPreliminaryCredentialsByDwg as Xn, MmTokenAuth as Xr, GetWalletWithBalanceInput as Xt, DwgMessageInputSchema as Y, createPreliminaryCredential as Yn, createKgwAuthenticatedFetch as Yr, GetUserOutputSchema as Yt, DwgMessageOutputSchema as Z, credentialExistAsInserter as Zn, MmTokenEnvelope as Zr, GetWalletWithBalanceInputSchema as Zt, ActionCostingIdosTokenInputSchema as _, RequestBalanceWithdrawalInputSchema as _n, getWallets as _r, GetAccessGrantsOwnedOutputSchema as _t, idOSCredential as a, createWebKwilClient as ai, HasLockedAccessGrantsOutputSchema as an, getAccessGrantsOwned as ar, GetAccessGrantsForCredentialInputSchema as at, AddAttributeAsInserterInputSchema as b, RescindSharedCredentialInput as bn, removeAttribute as br, GetAttributesOutput as bt, idOSGrant as c, HasProfileOutput as cn, getCredentialOwned as cr, GetAccessGrantsGrantedCountInput as ct, idOSWallet as d, RemoveAttributeInputSchema as dn, getCredentialsSharedByUser as dr, GetAccessGrantsGrantedCountOutputSchema as dt, isMmTokenAuth as ei, GetWalletsOutput as en, editPublicNotesAsIssuer as er, EditAttributeInputSchema as et, removeWallets as f, RemoveCredentialInput as fn, getIssuerFee as fr, GetAccessGrantsGrantedInput as ft, ActionCostingIdosTokenInput as g, RequestBalanceWithdrawalInput as gn, getWalletWithBalance as gr, GetAccessGrantsOwnedOutput as gt, ActionCostingFeeInputSchema as h, RemoveWalletInputSchema as hn, getUserAsInserter as hr, GetAccessGrantsGrantedOutputSchema as ht, getGrants as i, createNodeKwilClient as ii, HasLockedAccessGrantsOutput as in, getAccessGrantsGrantedCount as ir, GetAccessGrantsForCredentialInput as it, CheckBalanceInput as j, UnsetCallerPayerInputSchema as jn, updateUserPubKeyAsInserter as jr, GetCredentialsOutputSchema as jt, AddWalletMessageOutput as k, SharePreliminaryCredentialInputSchema as kn, sharePreliminaryCredential as kr, GetCredentialSharedOutputSchema as kt, idOSUser as l, HasProfileOutputSchema as ln, getCredentialShared as lr, GetAccessGrantsGrantedCountInputSchema as lt, ActionCostingFeeInput as m, RemoveWalletInput as mn, getUser as mr, GetAccessGrantsGrantedOutput as mt, GET_GRANTS_DEFAULT_RECORDS_PER_PAGE as n, mmTokenStorageId as ni, HasLockedAccessGrantsInput as nn, getAccessGrantsForCredential as nr, EditPublicNotesAsIssuerInputSchema as nt, idOSCredentialListItem as o, KwilTxFailedError as oi, HasProfileInput as on, getAllowance as or, GetAccessGrantsForCredentialOutput as ot, toDelegatedWriteGrantBaseParams as p, RemoveCredentialInputSchema as pn, getSiblingCredentialId as pr, GetAccessGrantsGrantedInputSchema as pt, DataType as q, checkBalance as qn, KgwAuthFailurePredicate as qr, GetUserAsInserterOutputSchema as qt, addWallets as r, KwilActionClient as ri, HasLockedAccessGrantsInputSchema as rn, getAccessGrantsGranted as rr, EncryptionPasswordStore as rt, idOSDelegatedWriteGrant as s, KwilTxPollTimeoutError as si, HasProfileInputSchema as sn, getAttributes as sr, GetAccessGrantsForCredentialOutputSchema as st, DelegatedWriteGrantBaseParams as t, mmTokenCredentialContentUri as ti, GetWalletsOutputSchema as tn, encryptionPasswordStoreSchema as tr, EditPublicNotesAsIssuerInput as tt, idOSUserAttribute as u, RemoveAttributeInput as un, getCredentials as ur, GetAccessGrantsGrantedCountOutput as ut, ActionSchemaElement as v, RequestWithdrawalInput as vn, hasLockedAccessGrants as vr, GetAllowanceOutput as vt, AddUserAsInserterInputSchema as w, SetCallerPayerInput as wn, requestWithdrawal as wr, GetCredentialOwnedOutput as wt, AddAttributeInput as x, RescindSharedCredentialInputSchema as xn, removeCredential as xr, GetAttributesOutputSchema as xt, AddAttributeAsInserterInput as y, RequestWithdrawalInputSchema as yn, hasProfile as yr, GetAllowanceOutputSchema as yt, CreatePreliminaryCredentialInput as z, actionCostingGas as zn, KwilSignerType as zr, GetIssuerFeeOutputSchema as zt };
|
|
730
|
+
//# sourceMappingURL=index-Bqz6trCk.d.mts.map
|