@idos-network/kwil-infra 3.0.1 → 5.0.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 +42 -0
- package/README.md +1 -46
- package/dist/actions/index.d.mts +2 -2
- package/dist/actions/index.mjs +1 -1
- package/dist/actions/index.mjs.map +1 -1
- package/dist/{index-Bk8YCFlx.d.mts → index-Dc_rffi1.d.mts} +149 -69
- package/dist/index-Dc_rffi1.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/signature-verification/index.d.mts +1 -1
- package/package.json +2 -2
- package/src/actions/actions.test.ts +23 -5
- package/src/actions/actions.ts +389 -42
- package/src/create-kgw-authenticated-fetch.test.ts +46 -26
- package/src/create-kgw-authenticated-fetch.ts +14 -18
- package/src/create-kwil-client.test.ts +40 -0
- package/src/create-kwil-client.ts +25 -0
- package/src/create-kwil-signer.test.ts +2 -67
- package/src/create-kwil-signer.ts +2 -27
- package/src/index.ts +0 -1
- package/dist/index-Bk8YCFlx.d.mts.map +0 -1
- package/src/mm-token/create-mm-token-kwil-signer.test.ts +0 -148
- package/src/mm-token/create-mm-token-kwil-signer.ts +0 -166
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @idos-network/kwil-infra
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 729c7d7: Remove the `mm_token` Kwil signer. KGW and kwild no longer accept MetaMask UKYC storage tokens as a login; MM users are now managed only by an MM operator (`idOSMmOperator` in the new `@idos-network/mm-operator` package).
|
|
8
|
+
|
|
9
|
+
- `@idos-network/kwil-infra`: removed `createMmTokenAuth`, `isMmTokenAuth`, `mmTokenStorageId` and the `MmTokenAuth`, `MmTokenEnvelope`, `MmTokenPayload` types; `Wallet` and `KwilSignerType` no longer include `MmTokenAuth`. `createKgwAuthenticatedBlobGateway` takes `accessToken?: string` (a UKYC storage token) instead of `mmAuth`. The KGW-authenticated fetch no longer re-logs in when blob-gateway rejects a storage token (`401 MM_TOKEN_INVALID` / `MM_TOKEN_EXPIRED`).
|
|
10
|
+
- Regenerated actions: new `getUserAsMmOperator`, `createUserAsMmOperator`, `getCredentialsAsMmOperator`, `createPreliminaryCredentialAsMmOperator`, `requestUserWipeAsMmOperator`, each taking the user's UKYC storage token as `storage_token`. `upsertWalletAsInserter` no longer accepts `wallet_type: "MM"` (`AddWalletType`), and `not_before` / `not_after` are required again.
|
|
11
|
+
- `@idos-network/client`: an `MmTokenAuth` is no longer a valid signer, and the client never creates `ukyc://` credentials. `removeCredential` rejects `ukyc://` credentials: they go only with a full data wipe.
|
|
12
|
+
- `@idos-network/consumer`: removed `mmAuth` from `idOSConsumer.init`. `rescindSharedCredential` rejects `ukyc://` credentials before calling Kwil.
|
|
13
|
+
- `@idos-network/issuer`: `CredentialByDelegatedWriteGrantBaseParams` no longer has `ukycStorageId`; delegated write grants can't write for MM users.
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 729c7d7: New package `@idos-network/mm-operator` with `idOSMmOperator`: the MM operator creates MetaMask users, reads and writes their `ukyc://` credentials through blob-gateway, and wipes them (`getUser`, `createUser`, `getCredentials`, `createCredential`, `getCredentialContent`, `requestUserWipe`, `wipeUser`). It signs Kwil calls with the operator's ed25519 key and reaches blob-gateway with a KGW session of the same key. Every method also takes the user's UKYC storage token, which kwild verifies in each MM operator action and blob-gateway on each blob request: `getUser(storageToken)`, `createUser({ id, recipientEncryptionPublicKey, walletId, storageToken })`, `getCredentials({ userId, storageToken })`, `requestUserWipe({ userId, deleteToken })`. A user's credentials all live in one UKYC storage (the first credential's); tokens for another storage are refused. Kwil token rejections surface as `idOSMmOperatorError` codes `STORAGE_TOKEN_INVALID`, `STORAGE_TOKEN_USER_MISMATCH` and `STORAGE_MISMATCH`. See the package README. `@idos-network/instrumentation` traces it as the `@idos-network/mm-operator` module.
|
|
18
|
+
|
|
19
|
+
`@idos-network/utils/blob-gateway`: `BlobGateway.deleteStorage()` (`DELETE /blob/v1/storage`, the MM user wipe), `decodeUkycStorageToken()`, `BLOB_GATEWAY_MM_ERROR_CODES` / `BlobGatewayMmErrorCode` (including `WIPE_STORAGE_MISMATCH`), `isBlobGatewayStorageTokenError()` and `isBlobGatewayUserWipeInProgressError()`. `requireAccessTokenForUkycContent` is deprecated.
|
|
20
|
+
|
|
21
|
+
The MM operator views (`getUser`, `getCredentials`, `getCredentialContent`) reject a bad token instead of returning no rows: Kwil reports a failing view action in the call response's `error` field, which `KwilActionClient.call` ignored. `KwilActionClient` has a new opt-in `throwOnCallError` property (default `false`, other callers are unchanged) that makes `call` throw `KwilCallError`; `idOSMmOperator` sets it. `@idos-network/utils/blob-gateway`: `decodeUkycStorageToken()` and `BlobGateway` accept a storage token with an `AccessToken ` / `Bearer ` prefix (new `normalizeUkycStorageToken()`) and send a single `AccessToken ` prefix.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [729c7d7]
|
|
26
|
+
- @idos-network/utils@3.2.0
|
|
27
|
+
|
|
28
|
+
## 4.0.0
|
|
29
|
+
|
|
30
|
+
### Major Changes
|
|
31
|
+
|
|
32
|
+
- 38a1991: Address new `ukyc://` blobs by the sha256 of the ciphertext, so the signed content URI pins the encrypted bytes. Reads of dev credentials whose blob id is still a UUID keep working (size check only).
|
|
33
|
+
|
|
34
|
+
`buildPreliminaryIDOSCredential` takes `ukycStorageId` instead of a finished `contentUri`. `createCredentialByDelegatedWriteGrant` drops `originalContentUri` and `copyContentUri`; pass one `ukycStorageId` (omit it to keep IPFS). `mmTokenCredentialContentUri` is removed; `mmTokenStorageId` remains.
|
|
35
|
+
|
|
36
|
+
`@idos-network/credentials` signing helpers now take a required `broaderMessageFor: (publicNotesSignature, contentUri) => Promise<string>` callback and are async: `buildSignedCredentialContentReference` and `buildEphemeralSignedCredentialContentReference` return `Promise<SignedCredentialContentReference>`, and `BuildPreliminaryIDOSCredentialArgs` requires `broaderMessageFor`. Fetch the message from the node with `credentialBroaderMessage` from `@idos-network/kwil-infra/actions` (`.then((row) => row.message)`) and `await` the result. `@idos-network/client` and `@idos-network/issuer` supply the callback themselves.
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- e999de0: Sign credential broader signatures over the message the node returns, and reject adding an MM wallet.
|
|
41
|
+
- Updated dependencies [1668234]
|
|
42
|
+
- Updated dependencies [38a1991]
|
|
43
|
+
- @idos-network/utils@3.1.0
|
|
44
|
+
|
|
3
45
|
## 3.0.1
|
|
4
46
|
|
|
5
47
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ infrastructure. It includes:
|
|
|
20
20
|
|
|
21
21
|
- Typed action helpers generated from the Kwil schema.
|
|
22
22
|
- Client helpers to `call` and `execute` actions.
|
|
23
|
-
- Signer helpers for EVM, NEAR, Stellar, XRPL,
|
|
23
|
+
- Signer helpers for EVM, NEAR, Stellar, XRPL, and custom signers.
|
|
24
24
|
- Signature verification utilities across supported wallet types.
|
|
25
25
|
- XRPL wallet helpers (Xumm, GemWallet).
|
|
26
26
|
|
|
@@ -47,51 +47,6 @@ const kwil = await createNodeKwilClient({
|
|
|
47
47
|
});
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
## Authenticate with an MM (MetaMask UKYC) token
|
|
51
|
-
|
|
52
|
-
KGW `mm_token` auth expects a **base64url-encoded** envelope string — not raw JSON.
|
|
53
|
-
Decoded shape:
|
|
54
|
-
|
|
55
|
-
```json
|
|
56
|
-
{
|
|
57
|
-
"payload": { "version": 1, "aud": "...", "signing_public_key": "...", "...": "..." },
|
|
58
|
-
"signature": "base64url(ed25519-signature-over-canonical-payload)"
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
import { createMmTokenAuth, createNodeKwilClient } from "@idos-network/kwil-infra";
|
|
64
|
-
import { getCredentials } from "@idos-network/kwil-infra/actions";
|
|
65
|
-
|
|
66
|
-
const kwil = await createNodeKwilClient({
|
|
67
|
-
nodeUrl: "https://kwil.your-node.example",
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// MetaMask / UKYC issues this as a single base64url string.
|
|
71
|
-
const encodedMmToken =
|
|
72
|
-
"eyJwYXlsb2FkIjp7InZlcnNpb24iOjEsImF1ZCI6Im1ldGFtYXNrOnVzZXItc3RvcmFnZTp1a3ljIiwiLi4uIjpudWxsfSwic2lnbmF0dXJlIjoiLi4uIn0";
|
|
73
|
-
|
|
74
|
-
const mmAuth = createMmTokenAuth(encodedMmToken);
|
|
75
|
-
kwil.setSigner(mmAuth);
|
|
76
|
-
|
|
77
|
-
await getCredentials(kwil);
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
`createMmTokenAuth` also accepts a decoded `{ payload, signature }` object and
|
|
81
|
-
re-encodes it. Prefer the encoded string from MetaMask so `signMessage` preserves the
|
|
82
|
-
exact bytes KGW will verify.
|
|
83
|
-
|
|
84
|
-
The returned object is one capability with two uses: it is a valid `KwilSigner` for KGW,
|
|
85
|
-
and it carries the encoded envelope as `accessToken` for UKYC blob requests. Pass it to
|
|
86
|
-
`client.withUserSigner()` or `idOSConsumer.init({ consumerSigner })` and the blob gateway
|
|
87
|
-
picks up that authorization automatically — never pass the raw token separately. A consumer
|
|
88
|
-
signing with a non-MM key can still read capability-authorized UKYC blobs by passing the
|
|
89
|
-
same object as `mmAuth`.
|
|
90
|
-
|
|
91
|
-
Note: `mm_token` callers cannot `add_wallet` / `remove_wallet` — MM wallets are inserted
|
|
92
|
-
by a trusted issuer (`wallet_type: "MM"`, with `address` and `public_key` both set to
|
|
93
|
-
`payload.signing_public_key`).
|
|
94
|
-
|
|
95
50
|
## Run actions
|
|
96
51
|
|
|
97
52
|
```ts
|
package/dist/actions/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { ActionCostingFeeInput, ActionCostingFeeInputSchema, ActionCostingIdosTokenInput, ActionCostingIdosTokenInputSchema, ActionSchemaElement, AddAttributeAsInserterInput, AddAttributeAsInserterInputSchema, AddAttributeInput, AddAttributeInputSchema, AddUserAsInserterInput, AddUserAsInserterInputSchema, AddWalletInput, AddWalletInputSchema, AddWalletMessageInput, AddWalletMessageInputSchema, AddWalletMessageOutput, AddWalletMessageOutputSchema, CheckBalanceInput, CheckBalanceInputSchema, CheckBalanceOutput, CheckBalanceOutputSchema, CheckCallerPayerInput, CheckCallerPayerInputSchema, CheckCallerPayerOutput, CheckCallerPayerOutputSchema, type CreatePreliminaryCredentialsByDwgInput as CreateCredentialsByDwgInput, CreatePreliminaryCredentialsByDwgInput, CreatePreliminaryCredentialsByDwgInputSchema as CreateCredentialsByDwgInputSchema, CreatePreliminaryCredentialsByDwgInputSchema, CreatePreliminaryCredentialInput, CreatePreliminaryCredentialInputSchema, CredentialExistAsInserterInput, CredentialExistAsInserterInputSchema, CredentialExistAsInserterOutput, CredentialExistAsInserterOutputSchema, DataType, DelegatedWriteGrantBaseParams, DwgMessageInput, DwgMessageInputSchema, DwgMessageOutput, DwgMessageOutputSchema, ENCRYPTION_PASSWORD_STORES, EditAttributeInput, EditAttributeInputSchema, EditPublicNotesAsIssuerInput, EditPublicNotesAsIssuerInputSchema, EncryptionPasswordStore, GET_GRANTS_DEFAULT_RECORDS_PER_PAGE, GetAccessGrantsForCredentialInput, GetAccessGrantsForCredentialInputSchema, GetAccessGrantsForCredentialOutput, GetAccessGrantsForCredentialOutputSchema, GetAccessGrantsGrantedCountInput, GetAccessGrantsGrantedCountInputSchema, GetAccessGrantsGrantedCountOutput, GetAccessGrantsGrantedCountOutputSchema, GetAccessGrantsGrantedInput, GetAccessGrantsGrantedInputSchema, GetAccessGrantsGrantedOutput, GetAccessGrantsGrantedOutputSchema, GetAccessGrantsOwnedOutput, GetAccessGrantsOwnedOutputSchema, GetAllowanceOutput, GetAllowanceOutputSchema, GetAttributesOutput, GetAttributesOutputSchema, GetCredentialOwnedInput, GetCredentialOwnedInputSchema, GetCredentialOwnedOutput, GetCredentialOwnedOutputSchema, GetCredentialSharedInput, GetCredentialSharedInputSchema, GetCredentialSharedOutput, GetCredentialSharedOutputSchema, GetCredentialsOutput, GetCredentialsOutputSchema, GetCredentialsSharedByUserInput, GetCredentialsSharedByUserInputSchema, GetCredentialsSharedByUserOutput, GetCredentialsSharedByUserOutputSchema, GetIssuerFeeInput, GetIssuerFeeInputSchema, GetIssuerFeeOutput, GetIssuerFeeOutputSchema, GetSiblingCredentialIdInput, GetSiblingCredentialIdInputSchema, GetSiblingCredentialIdOutput, GetSiblingCredentialIdOutputSchema, GetUserAsInserterInput, GetUserAsInserterInputSchema, GetUserAsInserterOutput, GetUserAsInserterOutputSchema, GetUserOutput, GetUserOutputSchema, GetWalletWithBalanceInput, GetWalletWithBalanceInputSchema, GetWalletWithBalanceOutput, GetWalletWithBalanceOutputSchema, GetWalletsOutput, GetWalletsOutputSchema, HasLockedAccessGrantsInput, HasLockedAccessGrantsInputSchema, HasLockedAccessGrantsOutput, HasLockedAccessGrantsOutputSchema, HasProfileInput, HasProfileInputSchema, HasProfileOutput, HasProfileOutputSchema, RemoveAttributeInput, RemoveAttributeInputSchema, RemoveCredentialInput, RemoveCredentialInputSchema, RemoveWalletInput, RemoveWalletInputSchema, RequestBalanceWithdrawalInput, RequestBalanceWithdrawalInputSchema, RequestWithdrawalInput, RequestWithdrawalInputSchema, RescindSharedCredentialInput, RescindSharedCredentialInputSchema, RevokeAccessGrantInput, RevokeAccessGrantInputSchema, SetCallerPayerInput, SetCallerPayerInputSchema, ShareAttributeInput, ShareAttributeInputSchema, type SharePreliminaryCredentialInput as ShareCredentialInput, SharePreliminaryCredentialInput, SharePreliminaryCredentialInputSchema as ShareCredentialInputSchema, SharePreliminaryCredentialInputSchema, UnsetCallerPayerInput, UnsetCallerPayerInputSchema, UpdateUserPubKeyAsInserterInput, UpdateUserPubKeyAsInserterInputSchema, UpsertWalletAsInserterInput, UpsertWalletAsInserterInputSchema, WALLET_TYPES, WalletType, actionCostingFee, actionCostingGas, actionCostingIdosToken, actionSchema, addAttribute, addAttributeAsInserter, addUserAsInserter, addWallet, addWalletMessage, addWallets, checkBalance, checkCallerPayer, createPreliminaryCredentialsByDwg as createCredentialsByDwg, createPreliminaryCredentialsByDwg, createPreliminaryCredential, credentialExistAsInserter, dwgMessage, editAttribute, editPublicNotesAsIssuer, encryptionPasswordStoreSchema, getAccessGrantsForCredential, getAccessGrantsGranted, getAccessGrantsGrantedCount, getAccessGrantsOwned, getAllowance, getAttributes, getCredentialOwned, getCredentialShared, getCredentials, getCredentialsSharedByUser, getGrants, getIssuerFee, getSiblingCredentialId, getUser, getUserAsInserter, getWalletWithBalance, getWallets, hasLockedAccessGrants, hasProfile, idOSCredential, idOSCredentialListItem, idOSDelegatedWriteGrant, idOSGrant, idOSUser, idOSUserAttribute, idOSWallet, removeAttribute, removeCredential, removeWallet, removeWallets, requestBalanceWithdrawal, requestWithdrawal, rescindSharedCredential, revokeAccessGrant, setCallerPayer, shareAttribute, sharePreliminaryCredential as shareCredential, sharePreliminaryCredential, toDelegatedWriteGrantBaseParams, unsetCallerPayer, updateUserPubKeyAsInserter, upsertWalletAsInserter, walletTypeSchema };
|
|
1
|
+
import { $ as CredentialExistAsInserterInput, $n as UpdateUserPubKeyAsInserterInputSchema, $r as revokeAccessGrant, $t as GetIssuerFeeOutputSchema, A as AddWalletMessageOutput, An as RemoveCredentialInput, Ar as getAllowance, At as GetAttributesOutput, B as CheckCallerPayerOutputSchema, Bn as RescindSharedCredentialInput, Br as getUserAsInserter, Bt as GetCredentialsAsMmOperatorInput, C as AddAttributeInputSchema, Cn as HasLockedAccessGrantsOutputSchema, Cr as editAttribute, Ct as GetAccessGrantsGrantedInputSchema, D as AddWalletInputSchema, Dn as HasProfileOutputSchema, Dr as getAccessGrantsGranted, Dt as GetAccessGrantsOwnedOutputSchema, E as AddWalletInput, En as HasProfileOutput, Er as getAccessGrantsForCredential, Et as GetAccessGrantsOwnedOutput, F as CheckBalanceOutput, Fn as RequestBalanceWithdrawalInputSchema, Fr as getCredentialsAsMmOperator, Ft as GetCredentialOwnedOutputSchema, G as CreatePreliminaryCredentialsByDwgInput, Gn as SetCallerPayerInputSchema, Gr as hasProfile, Gt as GetCredentialsOutputSchema, H as CreatePreliminaryCredentialAsMmOperatorInputSchema, Hn as RevokeAccessGrantInput, Hr as getWalletWithBalance, Ht as GetCredentialsAsMmOperatorOutput, I as CheckBalanceOutputSchema, In as RequestUserWipeAsMmOperatorInput, Ir as getCredentialsSharedByUser, It as GetCredentialSharedInput, J as CreateUserAsMmOperatorInputSchema, Jn as SharePreliminaryCredentialInput, Jr as removeWallet, Jt as GetCredentialsSharedByUserOutput, K as CreatePreliminaryCredentialsByDwgInputSchema, Kn as ShareAttributeInput, Kr as removeAttribute, Kt as GetCredentialsSharedByUserInput, L as CheckCallerPayerInput, Ln as RequestUserWipeAsMmOperatorInputSchema, Lr as getIssuerFee, Lt as GetCredentialSharedInputSchema, M as AddWalletType, Mn as RemoveWalletInput, Mr as getCredentialOwned, Mt as GetCredentialOwnedInput, N as CheckBalanceInput, Nn as RemoveWalletInputSchema, Nr as getCredentialShared, Nt as GetCredentialOwnedInputSchema, O as AddWalletMessageInput, On as RemoveAttributeInput, Or as getAccessGrantsGrantedCount, Ot as GetAllowanceOutput, P as CheckBalanceInputSchema, Pn as RequestBalanceWithdrawalInput, Pr as getCredentials, Pt as GetCredentialOwnedOutput, Q as CredentialBroaderMessageOutputSchema, Qn as UpdateUserPubKeyAsInserterInput, Qr as rescindSharedCredential, Qt as GetIssuerFeeOutput, R as CheckCallerPayerInputSchema, Rn as RequestWithdrawalInput, Rr as getSiblingCredentialId, Rt as GetCredentialSharedOutput, S as AddAttributeInput, Sn as HasLockedAccessGrantsOutput, Sr as dwgMessage, St as GetAccessGrantsGrantedInput, T as AddUserAsInserterInputSchema, Tn as HasProfileInputSchema, Tr as encryptionPasswordStoreSchema, Tt as GetAccessGrantsGrantedOutputSchema, U as CreatePreliminaryCredentialInput, Un as RevokeAccessGrantInputSchema, Ur as getWallets, Ut as GetCredentialsAsMmOperatorOutputSchema, V as CreatePreliminaryCredentialAsMmOperatorInput, Vn as RescindSharedCredentialInputSchema, Vr as getUserAsMmOperator, Vt as GetCredentialsAsMmOperatorInputSchema, W as CreatePreliminaryCredentialInputSchema, Wn as SetCallerPayerInput, Wr as hasLockedAccessGrants, Wt as GetCredentialsOutput, X as CredentialBroaderMessageInputSchema, Xn as UnsetCallerPayerInput, Xr as requestUserWipeAsMmOperator, Xt as GetIssuerFeeInput, Y as CredentialBroaderMessageInput, Yn as SharePreliminaryCredentialInputSchema, Yr as requestBalanceWithdrawal, Yt as GetCredentialsSharedByUserOutputSchema, Z as CredentialBroaderMessageOutput, Zn as UnsetCallerPayerInputSchema, Zr as requestWithdrawal, Zt as GetIssuerFeeInputSchema, _ as ActionCostingIdosTokenInput, _n as GetWalletWithBalanceOutputSchema, _r as createPreliminaryCredentialAsMmOperator, _t as GetAccessGrantsForCredentialOutputSchema, a as idOSCredential, ai as upsertWalletAsInserter, an as GetUserAsInserterInputSchema, ar as actionCostingGas, at as DwgMessageInputSchema, b as AddAttributeAsInserterInput, bn as HasLockedAccessGrantsInput, br as credentialBroaderMessage, bt as GetAccessGrantsGrantedCountOutput, c as idOSGrant, cn as GetUserAsMmOperatorInput, cr as addAttribute, ct as ENCRYPTION_PASSWORD_STORES, d as idOSWallet, dn as GetUserAsMmOperatorOutputSchema, dr as addWallet, dt as EditPublicNotesAsIssuerInput, ei as setCallerPayer, en as GetSiblingCredentialIdInput, er as UpsertWalletAsInserterInput, et as CredentialExistAsInserterInputSchema, f as removeWallets, fn as GetUserOutput, fr as addWalletMessage, ft as EditPublicNotesAsIssuerInputSchema, g as ActionCostingFeeInputSchema, gn as GetWalletWithBalanceOutput, gr as createPreliminaryCredential, gt as GetAccessGrantsForCredentialOutput, h as ActionCostingFeeInput, hn as GetWalletWithBalanceInputSchema, hr as checkCallerPayer, ht as GetAccessGrantsForCredentialInputSchema, i as getGrants, ii as updateUserPubKeyAsInserter, in as GetUserAsInserterInput, ir as actionCostingFee, it as DwgMessageInput, j as AddWalletMessageOutputSchema, jn as RemoveCredentialInputSchema, jr as getAttributes, jt as GetAttributesOutputSchema, k as AddWalletMessageInputSchema, kn as RemoveAttributeInputSchema, kr as getAccessGrantsOwned, kt as GetAllowanceOutputSchema, l as idOSUser, ln as GetUserAsMmOperatorInputSchema, lr as addAttributeAsInserter, lt as EditAttributeInput, m as ADD_WALLET_TYPES, mn as GetWalletWithBalanceInput, mr as checkBalance, mt as GetAccessGrantsForCredentialInput, n as GET_GRANTS_DEFAULT_RECORDS_PER_PAGE, ni as sharePreliminaryCredential, nn as GetSiblingCredentialIdOutput, nr as WALLET_TYPES, nt as CredentialExistAsInserterOutputSchema, o as idOSCredentialListItem, oi as walletTypeSchema, on as GetUserAsInserterOutput, or as actionCostingIdosToken, ot as DwgMessageOutput, p as toDelegatedWriteGrantBaseParams, pn as GetUserOutputSchema, pr as addWalletTypeSchema, pt as EncryptionPasswordStore, q as CreateUserAsMmOperatorInput, qn as ShareAttributeInputSchema, qr as removeCredential, qt as GetCredentialsSharedByUserInputSchema, r as addWallets, ri as unsetCallerPayer, rn as GetSiblingCredentialIdOutputSchema, rr as WalletType, rt as DataType, s as idOSDelegatedWriteGrant, sn as GetUserAsInserterOutputSchema, sr as actionSchema, st as DwgMessageOutputSchema, t as DelegatedWriteGrantBaseParams, ti as shareAttribute, tn as GetSiblingCredentialIdInputSchema, tr as UpsertWalletAsInserterInputSchema, tt as CredentialExistAsInserterOutput, u as idOSUserAttribute, un as GetUserAsMmOperatorOutput, ur as addUserAsInserter, ut as EditAttributeInputSchema, v as ActionCostingIdosTokenInputSchema, vn as GetWalletsOutput, vr as createPreliminaryCredentialsByDwg, vt as GetAccessGrantsGrantedCountInput, w as AddUserAsInserterInput, wn as HasProfileInput, wr as editPublicNotesAsIssuer, wt as GetAccessGrantsGrantedOutput, x as AddAttributeAsInserterInputSchema, xn as HasLockedAccessGrantsInputSchema, xr as credentialExistAsInserter, xt as GetAccessGrantsGrantedCountOutputSchema, y as ActionSchemaElement, yn as GetWalletsOutputSchema, yr as createUserAsMmOperator, yt as GetAccessGrantsGrantedCountInputSchema, z as CheckCallerPayerOutput, zn as RequestWithdrawalInputSchema, zr as getUser, zt as GetCredentialSharedOutputSchema } from "../index-Dc_rffi1.mjs";
|
|
2
|
+
export { ADD_WALLET_TYPES, ActionCostingFeeInput, ActionCostingFeeInputSchema, ActionCostingIdosTokenInput, ActionCostingIdosTokenInputSchema, ActionSchemaElement, AddAttributeAsInserterInput, AddAttributeAsInserterInputSchema, AddAttributeInput, AddAttributeInputSchema, AddUserAsInserterInput, AddUserAsInserterInputSchema, AddWalletInput, AddWalletInputSchema, AddWalletMessageInput, AddWalletMessageInputSchema, AddWalletMessageOutput, AddWalletMessageOutputSchema, AddWalletType, CheckBalanceInput, CheckBalanceInputSchema, CheckBalanceOutput, CheckBalanceOutputSchema, CheckCallerPayerInput, CheckCallerPayerInputSchema, CheckCallerPayerOutput, CheckCallerPayerOutputSchema, type CreatePreliminaryCredentialsByDwgInput as CreateCredentialsByDwgInput, CreatePreliminaryCredentialsByDwgInput, CreatePreliminaryCredentialsByDwgInputSchema as CreateCredentialsByDwgInputSchema, CreatePreliminaryCredentialsByDwgInputSchema, CreatePreliminaryCredentialAsMmOperatorInput, CreatePreliminaryCredentialAsMmOperatorInputSchema, CreatePreliminaryCredentialInput, CreatePreliminaryCredentialInputSchema, CreateUserAsMmOperatorInput, CreateUserAsMmOperatorInputSchema, CredentialBroaderMessageInput, CredentialBroaderMessageInputSchema, CredentialBroaderMessageOutput, CredentialBroaderMessageOutputSchema, CredentialExistAsInserterInput, CredentialExistAsInserterInputSchema, CredentialExistAsInserterOutput, CredentialExistAsInserterOutputSchema, DataType, DelegatedWriteGrantBaseParams, DwgMessageInput, DwgMessageInputSchema, DwgMessageOutput, DwgMessageOutputSchema, ENCRYPTION_PASSWORD_STORES, EditAttributeInput, EditAttributeInputSchema, EditPublicNotesAsIssuerInput, EditPublicNotesAsIssuerInputSchema, EncryptionPasswordStore, GET_GRANTS_DEFAULT_RECORDS_PER_PAGE, GetAccessGrantsForCredentialInput, GetAccessGrantsForCredentialInputSchema, GetAccessGrantsForCredentialOutput, GetAccessGrantsForCredentialOutputSchema, GetAccessGrantsGrantedCountInput, GetAccessGrantsGrantedCountInputSchema, GetAccessGrantsGrantedCountOutput, GetAccessGrantsGrantedCountOutputSchema, GetAccessGrantsGrantedInput, GetAccessGrantsGrantedInputSchema, GetAccessGrantsGrantedOutput, GetAccessGrantsGrantedOutputSchema, GetAccessGrantsOwnedOutput, GetAccessGrantsOwnedOutputSchema, GetAllowanceOutput, GetAllowanceOutputSchema, GetAttributesOutput, GetAttributesOutputSchema, GetCredentialOwnedInput, GetCredentialOwnedInputSchema, GetCredentialOwnedOutput, GetCredentialOwnedOutputSchema, GetCredentialSharedInput, GetCredentialSharedInputSchema, GetCredentialSharedOutput, GetCredentialSharedOutputSchema, GetCredentialsAsMmOperatorInput, GetCredentialsAsMmOperatorInputSchema, GetCredentialsAsMmOperatorOutput, GetCredentialsAsMmOperatorOutputSchema, GetCredentialsOutput, GetCredentialsOutputSchema, GetCredentialsSharedByUserInput, GetCredentialsSharedByUserInputSchema, GetCredentialsSharedByUserOutput, GetCredentialsSharedByUserOutputSchema, GetIssuerFeeInput, GetIssuerFeeInputSchema, GetIssuerFeeOutput, GetIssuerFeeOutputSchema, GetSiblingCredentialIdInput, GetSiblingCredentialIdInputSchema, GetSiblingCredentialIdOutput, GetSiblingCredentialIdOutputSchema, GetUserAsInserterInput, GetUserAsInserterInputSchema, GetUserAsInserterOutput, GetUserAsInserterOutputSchema, GetUserAsMmOperatorInput, GetUserAsMmOperatorInputSchema, GetUserAsMmOperatorOutput, GetUserAsMmOperatorOutputSchema, GetUserOutput, GetUserOutputSchema, GetWalletWithBalanceInput, GetWalletWithBalanceInputSchema, GetWalletWithBalanceOutput, GetWalletWithBalanceOutputSchema, GetWalletsOutput, GetWalletsOutputSchema, HasLockedAccessGrantsInput, HasLockedAccessGrantsInputSchema, HasLockedAccessGrantsOutput, HasLockedAccessGrantsOutputSchema, HasProfileInput, HasProfileInputSchema, HasProfileOutput, HasProfileOutputSchema, RemoveAttributeInput, RemoveAttributeInputSchema, RemoveCredentialInput, RemoveCredentialInputSchema, RemoveWalletInput, RemoveWalletInputSchema, RequestBalanceWithdrawalInput, RequestBalanceWithdrawalInputSchema, RequestUserWipeAsMmOperatorInput, RequestUserWipeAsMmOperatorInputSchema, RequestWithdrawalInput, RequestWithdrawalInputSchema, RescindSharedCredentialInput, RescindSharedCredentialInputSchema, RevokeAccessGrantInput, RevokeAccessGrantInputSchema, SetCallerPayerInput, SetCallerPayerInputSchema, ShareAttributeInput, ShareAttributeInputSchema, type SharePreliminaryCredentialInput as ShareCredentialInput, SharePreliminaryCredentialInput, SharePreliminaryCredentialInputSchema as ShareCredentialInputSchema, SharePreliminaryCredentialInputSchema, UnsetCallerPayerInput, UnsetCallerPayerInputSchema, UpdateUserPubKeyAsInserterInput, UpdateUserPubKeyAsInserterInputSchema, UpsertWalletAsInserterInput, UpsertWalletAsInserterInputSchema, WALLET_TYPES, WalletType, actionCostingFee, actionCostingGas, actionCostingIdosToken, actionSchema, addAttribute, addAttributeAsInserter, addUserAsInserter, addWallet, addWalletMessage, addWalletTypeSchema, addWallets, checkBalance, checkCallerPayer, createPreliminaryCredentialsByDwg as createCredentialsByDwg, createPreliminaryCredentialsByDwg, createPreliminaryCredential, createPreliminaryCredentialAsMmOperator, createUserAsMmOperator, credentialBroaderMessage, credentialExistAsInserter, dwgMessage, editAttribute, editPublicNotesAsIssuer, encryptionPasswordStoreSchema, getAccessGrantsForCredential, getAccessGrantsGranted, getAccessGrantsGrantedCount, getAccessGrantsOwned, getAllowance, getAttributes, getCredentialOwned, getCredentialShared, getCredentials, getCredentialsAsMmOperator, getCredentialsSharedByUser, getGrants, getIssuerFee, getSiblingCredentialId, getUser, getUserAsInserter, getUserAsMmOperator, getWalletWithBalance, getWallets, hasLockedAccessGrants, hasProfile, idOSCredential, idOSCredentialListItem, idOSDelegatedWriteGrant, idOSGrant, idOSUser, idOSUserAttribute, idOSWallet, removeAttribute, removeCredential, removeWallet, removeWallets, requestBalanceWithdrawal, requestUserWipeAsMmOperator, requestWithdrawal, rescindSharedCredential, revokeAccessGrant, setCallerPayer, shareAttribute, sharePreliminaryCredential as shareCredential, sharePreliminaryCredential, toDelegatedWriteGrantBaseParams, unsetCallerPayer, updateUserPubKeyAsInserter, upsertWalletAsInserter, walletTypeSchema };
|
package/dist/actions/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Utils as e}from"@idos-network/kwil-js";import*as t from"zod";const n=e.DataType,r=[`EVM`,`NEAR`,`XRPL`,`Stellar`,`FaceSign`,`MM`],i=t.enum(r),ee=[`user`,`mpc`,`mm`],a=t.enum(ee),o=`ipfs://`,s=`ukyc://`,c=t.string().refine(e=>e.startsWith(o)||e.startsWith(s),`content_uri must start with ${o} or ${s}`),l=t.number().int().positive(),u=t.iso.datetime({precision:0}),te={add_user_as_inserter:[{name:`id`,type:n.Uuid},{name:`recipient_encryption_public_key`,type:n.Text},{name:`encryption_password_store`,type:n.Text}],update_user_pub_key_as_inserter:[{name:`id`,type:n.Uuid},{name:`recipient_encryption_public_key`,type:n.Text},{name:`encryption_password_store`,type:n.Text}],get_user:[],get_user_as_inserter:[{name:`id`,type:n.Uuid}],upsert_wallet_as_inserter:[{name:`id`,type:n.Uuid},{name:`user_id`,type:n.Uuid},{name:`address`,type:n.Text},{name:`public_key`,type:n.Text},{name:`wallet_type`,type:n.Text},{name:`not_before`,type:n.Text},{name:`not_after`,type:n.Text},{name:`signature`,type:n.Text}],add_wallet_message:[{name:`address`,type:n.Text},{name:`wallet_type`,type:n.Text},{name:`user_id`,type:n.Uuid},{name:`not_before`,type:n.Text},{name:`not_after`,type:n.Text}],add_wallet:[{name:`id`,type:n.Uuid},{name:`address`,type:n.Text},{name:`public_key`,type:n.Text},{name:`wallet_type`,type:n.Text},{name:`not_before`,type:n.Text},{name:`not_after`,type:n.Text},{name:`signature`,type:n.Text}],get_wallets:[],remove_wallet:[{name:`id`,type:n.Uuid}],create_preliminary_credential:[{name:`request_id`,type:n.Uuid},{name:`credential_id`,type:n.Uuid},{name:`issuer_auth_public_key`,type:n.Text},{name:`encryptor_public_key`,type:n.Text},{name:`content_uri`,type:n.Text},{name:`content_size`,type:n.Int},{name:`content_hash`,type:n.Text},{name:`public_notes`,type:n.Text},{name:`public_notes_signature`,type:n.Text},{name:`broader_signature`,type:n.Text}],get_credentials:[],get_credentials_shared_by_user:[{name:`user_id`,type:n.Uuid},{name:`original_issuer_auth_public_key`,type:n.Text}],edit_public_notes_as_issuer:[{name:`public_notes_id`,type:n.Text},{name:`public_notes`,type:n.Text}],remove_credential:[{name:`id`,type:n.Uuid}],rescind_shared_credential:[{name:`credential_id`,type:n.Uuid}],share_preliminary_credential:[{name:`request_id`,type:n.Uuid},{name:`copy_id`,type:n.Uuid},{name:`original_id`,type:n.Uuid},{name:`public_notes`,type:n.Text},{name:`public_notes_signature`,type:n.Text},{name:`broader_signature`,type:n.Text},{name:`content_uri`,type:n.Text},{name:`content_size`,type:n.Int},{name:`content_hash`,type:n.Text},{name:`encryptor_public_key`,type:n.Text},{name:`issuer_auth_public_key`,type:n.Text},{name:`grantee_wallet_identifier`,type:n.Text},{name:`locked_until`,type:n.Int}],create_preliminary_credentials_by_dwg:[{name:`request_id`,type:n.Uuid},{name:`issuer_auth_public_key`,type:n.Text},{name:`original_encryptor_public_key`,type:n.Text},{name:`original_id`,type:n.Uuid},{name:`original_content_uri`,type:n.Text},{name:`original_content_size`,type:n.Int},{name:`original_public_notes`,type:n.Text},{name:`original_public_notes_signature`,type:n.Text},{name:`original_broader_signature`,type:n.Text},{name:`copy_encryptor_public_key`,type:n.Text},{name:`copy_id`,type:n.Uuid},{name:`copy_content_uri`,type:n.Text},{name:`copy_content_size`,type:n.Int},{name:`copy_public_notes_signature`,type:n.Text},{name:`copy_broader_signature`,type:n.Text},{name:`content_hash`,type:n.Text},{name:`dwg_owner`,type:n.Text},{name:`dwg_grantee`,type:n.Text},{name:`dwg_issuer_public_key`,type:n.Text},{name:`dwg_id`,type:n.Uuid},{name:`dwg_access_grant_timelock`,type:n.Text},{name:`dwg_not_before`,type:n.Text},{name:`dwg_not_after`,type:n.Text},{name:`dwg_signature`,type:n.Text}],credential_exist_as_inserter:[{name:`id`,type:n.Uuid}],get_credential_owned:[{name:`id`,type:n.Uuid}],get_credential_shared:[{name:`id`,type:n.Uuid}],get_sibling_credential_id:[{name:`content_hash`,type:n.Text}],add_attribute_as_inserter:[{name:`id`,type:n.Uuid},{name:`user_id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],add_attribute:[{name:`id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],get_attributes:[],edit_attribute:[{name:`id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],remove_attribute:[{name:`id`,type:n.Uuid}],share_attribute:[{name:`id`,type:n.Uuid},{name:`original_attribute_id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],dwg_message:[{name:`owner_wallet_identifier`,type:n.Text},{name:`grantee_wallet_identifier`,type:n.Text},{name:`issuer_public_key`,type:n.Text},{name:`id`,type:n.Uuid},{name:`access_grant_timelock`,type:n.Text},{name:`not_usable_before`,type:n.Text},{name:`not_usable_after`,type:n.Text}],revoke_access_grant:[{name:`id`,type:n.Uuid}],get_access_grants_owned:[],get_access_grants_granted:[{name:`user_id`,type:n.Uuid},{name:`page`,type:n.Int},{name:`size`,type:n.Int}],get_access_grants_granted_count:[{name:`user_id`,type:n.Uuid}],has_locked_access_grants:[{name:`id`,type:n.Uuid}],get_access_grants_for_credential:[{name:`credential_id`,type:n.Uuid}],has_profile:[{name:`address`,type:n.Text}],set_caller_payer:[{name:`address`,type:n.Text}],check_caller_payer:[{name:`address`,type:n.Text}],unset_caller_payer:[{name:`address`,type:n.Text}],check_balance:[{name:`address`,type:n.Text},{name:`token`,type:n.Text}],get_wallet_with_balance:[{name:`token`,type:n.Text},{name:`minimum_balance`,type:n.Int}],request_withdrawal:[{name:`token`,type:n.Text}],get_allowance:[],action_costing_gas:[],action_costing_idos_token:[{name:`amount`,type:n.Int}],get_issuer_fee:[{name:`credential_id`,type:n.Uuid}],action_costing_fee:[{name:`credential_id`,type:n.Uuid}],request_balance_withdrawal:[{name:`token`,type:n.Text},{name:`evm_address_to`,type:n.Text}]},d=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:a});async function ne(e,t){let n=d.parse(t);await e.execute({name:`add_user_as_inserter`,inputs:n,description:`Add a user to idOS`})}const f=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:a});async function re(e,t){let n=f.parse(t);await e.execute({name:`update_user_pub_key_as_inserter`,inputs:n,description:`Update user's encryption key and password store in idOS as inserter (profile creator)`})}const ie=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:a});async function ae(e){return await e.call({name:`get_user`,inputs:{}}).then(e=>{if(!e[0])throw Error(`get_user returned no rows`);return e[0]})}const p=t.object({id:t.uuid()}),oe=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:a,inserter:t.string()});async function se(e,t){let n=p.parse(t);return await e.call({name:`get_user_as_inserter`,inputs:n}).then(e=>e[0])}const m=t.object({id:t.uuid(),user_id:t.uuid(),address:t.string(),public_key:t.string().nullish(),wallet_type:i,not_before:u.nullish(),not_after:u.nullish(),signature:t.string()}).refine(e=>e.wallet_type===`MM`==(e.not_before==null),{path:[`not_before`],message:`not_before must be null when wallet_type is MM, and set otherwise`}).refine(e=>e.wallet_type===`MM`==(e.not_after==null),{path:[`not_after`],message:`not_after must be null when wallet_type is MM, and set otherwise`});async function ce(e,t){let n=m.parse(t);await e.execute({name:`upsert_wallet_as_inserter`,inputs:n,description:`Add a wallet to idOS by inserter (profile creator)`})}const h=t.object({address:t.string(),wallet_type:i,user_id:t.uuid(),not_before:u,not_after:u}),le=t.object({message:t.string()});async function ue(e,t){let n=h.parse(t);return await e.call({name:`add_wallet_message`,inputs:n}).then(e=>{if(!e[0])throw Error(`add_wallet_message returned no rows`);return e[0]})}const g=t.object({id:t.uuid(),address:t.string(),public_key:t.string().nullish(),wallet_type:i,not_before:u,not_after:u,signature:t.string()});async function _(e,t){let n=g.parse(t);await e.execute({name:`add_wallet`,inputs:n,description:`Add a wallet to idOS`})}const de=t.object({id:t.uuid(),user_id:t.uuid(),address:t.string(),public_key:t.string().nullable(),wallet_type:i,message:t.string(),signature:t.string(),inserter:t.string().nullable()});async function fe(e){return await e.call({name:`get_wallets`,inputs:{}})}const v=t.object({id:t.uuid()});async function y(e,t){let n=v.parse(t);await e.execute({name:`remove_wallet`,inputs:n,description:`Remove a wallet from idOS`})}const b=t.object({request_id:t.uuid(),credential_id:t.uuid(),issuer_auth_public_key:t.string(),encryptor_public_key:t.string(),content_uri:c,content_size:l,content_hash:t.string(),public_notes:t.string(),public_notes_signature:t.string(),broader_signature:t.string()});async function pe(e,t){let n=b.parse(t);await e.execute({name:`create_preliminary_credential`,inputs:n,description:`Create a new preliminary credential`})}const me=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content_uri:t.string().nullable(),content_size:t.number().nullable(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable(),original_id:t.uuid().nullable()});async function he(e){return await e.call({name:`get_credentials`,inputs:{}})}const x=t.object({user_id:t.uuid(),original_issuer_auth_public_key:t.string().nullish()}),ge=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable(),original_id:t.uuid().nullable()});async function _e(e,t){let n=x.parse(t);return await e.call({name:`get_credentials_shared_by_user`,inputs:n})}const S=t.object({public_notes_id:t.string(),public_notes:t.string()});async function ve(e,t){let n=S.parse(t);await e.execute({name:`edit_public_notes_as_issuer`,inputs:n,description:`Edit public notes in a credential as issuer`})}const C=t.object({id:t.uuid()});async function ye(e,t){let n=C.parse(t);await e.execute({name:`remove_credential`,inputs:n,description:`Remove a credential from your idOS profile`})}const w=t.object({credential_id:t.uuid()});async function be(e,t){let n=w.parse(t);await e.execute({name:`rescind_shared_credential`,inputs:n,description:`Rescind a shared credential as a grantee`})}const T=t.object({request_id:t.uuid(),copy_id:t.uuid(),original_id:t.uuid(),public_notes:t.string(),public_notes_signature:t.string(),broader_signature:t.string(),content_uri:c,content_size:l,content_hash:t.string(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),grantee_wallet_identifier:t.string(),locked_until:t.number()});async function E(e,t){let n=T.parse(t);await e.execute({name:`share_preliminary_credential`,inputs:n,description:`Share a credential with creating AG`})}const D=t.object({request_id:t.uuid(),issuer_auth_public_key:t.string(),original_encryptor_public_key:t.string(),original_id:t.uuid(),original_content_uri:c,original_content_size:l,original_public_notes:t.string(),original_public_notes_signature:t.string(),original_broader_signature:t.string(),copy_encryptor_public_key:t.string(),copy_id:t.uuid(),copy_content_uri:c,copy_content_size:l,copy_public_notes_signature:t.string(),copy_broader_signature:t.string(),content_hash:t.string(),dwg_owner:t.string(),dwg_grantee:t.string(),dwg_issuer_public_key:t.string(),dwg_id:t.uuid(),dwg_access_grant_timelock:u,dwg_not_before:u,dwg_not_after:u,dwg_signature:t.string()});async function O(e,t){let n=D.parse(t);await e.execute({name:`create_preliminary_credentials_by_dwg`,inputs:n,description:`Add original credential and copy credential with AG on behalf of a user (using delegated write grant given by the user)`})}const k=t.object({id:t.uuid()}),xe=t.object({credential_exist:t.boolean()});async function Se(e,t){let n=k.parse(t);return await e.call({name:`credential_exist_as_inserter`,inputs:n}).then(e=>e[0])}const A=t.object({id:t.uuid()}),Ce=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content:t.string().nullable(),content_uri:t.string().nullable(),content_size:t.number().nullable(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable()});async function we(e,t){let n=A.parse(t);return await e.call({name:`get_credential_owned`,inputs:n})}const j=t.object({id:t.uuid()}),Te=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content:t.string().nullable(),content_uri:t.string().nullable(),content_size:t.number().nullable(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable()});async function Ee(e,t){let n=j.parse(t);return await e.call({name:`get_credential_shared`,inputs:n})}const M=t.object({content_hash:t.string()}),De=t.object({id:t.uuid()});async function Oe(e,t){let n=M.parse(t);return await e.call({name:`get_sibling_credential_id`,inputs:n}).then(e=>e[0])}const N=t.object({id:t.uuid(),user_id:t.uuid(),attribute_key:t.string(),value:t.string()});async function ke(e,t){let n=N.parse(t);await e.execute({name:`add_attribute_as_inserter`,inputs:n,description:`Add a new attribute as inserter`})}const P=t.object({id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Ae(e,t){let n=P.parse(t);await e.execute({name:`add_attribute`,inputs:n,description:`Create a new attribute in your idOS profile`})}const je=t.object({id:t.uuid(),user_id:t.uuid(),attribute_key:t.string(),value:t.string(),original_id:t.uuid()});async function Me(e){return await e.call({name:`get_attributes`,inputs:{}})}const F=t.object({id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Ne(e,t){let n=F.parse(t);await e.execute({name:`edit_attribute`,inputs:n,description:`Edit an existing attribute`})}const I=t.object({id:t.uuid()});async function Pe(e,t){let n=I.parse(t);await e.execute({name:`remove_attribute`,inputs:n,description:`Remove an existing attribute`})}const L=t.object({id:t.uuid(),original_attribute_id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Fe(e,t){let n=L.parse(t);await e.execute({name:`share_attribute`,inputs:n,description:`Share an attribute`})}const R=t.object({owner_wallet_identifier:t.string(),grantee_wallet_identifier:t.string(),issuer_public_key:t.string(),id:t.uuid(),access_grant_timelock:u,not_usable_before:u,not_usable_after:u}),Ie=t.object({message:t.string()});async function Le(e,t){let n=R.parse(t);return await e.call({name:`dwg_message`,inputs:n}).then(e=>e[0])}const z=t.object({id:t.uuid()});async function Re(e,t){let n=z.parse(t);await e.execute({name:`revoke_access_grant`,inputs:n,description:`Revoke an Access Grant from idOS`})}const ze=t.object({id:t.uuid(),ag_owner_user_id:t.uuid(),ag_grantee_wallet_identifier:t.string(),data_id:t.uuid(),locked_until:t.number(),content_hash:t.string().nullable(),inserter_type:t.string(),inserter_id:t.string()});async function Be(e){return await e.call({name:`get_access_grants_owned`,inputs:{}})}const B=t.object({user_id:t.uuid().nullish(),page:t.number(),size:t.number()}),Ve=t.object({id:t.uuid(),ag_owner_user_id:t.uuid(),ag_grantee_wallet_identifier:t.string(),data_id:t.uuid(),locked_until:t.number(),content_hash:t.string().nullable(),inserter_type:t.string(),inserter_id:t.string()});async function V(e,t){let n=B.parse(t);return await e.call({name:`get_access_grants_granted`,inputs:n})}const H=t.object({user_id:t.uuid().nullish()}),He=t.object({count:t.number()});async function Ue(e,t){let n=H.parse(t);return await e.call({name:`get_access_grants_granted_count`,inputs:n}).then(e=>e[0])}const U=t.object({id:t.uuid()}),We=t.object({has:t.boolean()});async function Ge(e,t){let n=U.parse(t);return await e.call({name:`has_locked_access_grants`,inputs:n}).then(e=>e[0])}const W=t.object({credential_id:t.uuid()}),Ke=t.object({id:t.uuid(),ag_owner_user_id:t.uuid(),ag_grantee_wallet_identifier:t.string(),data_id:t.uuid(),locked_until:t.number(),content_hash:t.string().nullable(),inserter_type:t.string(),inserter_id:t.string()});async function qe(e,t){let n=W.parse(t);return await e.call({name:`get_access_grants_for_credential`,inputs:n})}const G=t.object({address:t.string()}),Je=t.object({has_profile:t.boolean()});async function Ye(e,t){let n=G.parse(t);return await e.call({name:`has_profile`,inputs:n},void 0).then(e=>e[0])}const K=t.object({address:t.string()});async function Xe(e,t){let n=K.parse(t);await e.execute({name:`set_caller_payer`,inputs:n,description:`Set the caller as a payer for a specific EVM address`})}const q=t.object({address:t.string()}),Ze=t.object({is_payer:t.boolean()});async function Qe(e,t){let n=q.parse(t);return await e.call({name:`check_caller_payer`,inputs:n}).then(e=>e[0])}const J=t.object({address:t.string()});async function $e(e,t){let n=J.parse(t);await e.execute({name:`unset_caller_payer`,inputs:n,description:`Remove the caller as a payer for a specific EVM address`})}const Y=t.object({address:t.string(),token:t.string()}),et=t.object({balance:t.number()});async function tt(e,t){let n=Y.parse(t);return await e.call({name:`check_balance`,inputs:n}).then(e=>e[0])}const X=t.object({token:t.string(),minimum_balance:t.number()}),nt=t.object({wallet_address:t.string()});async function rt(e,t){let n=X.parse(t);return await e.call({name:`get_wallet_with_balance`,inputs:n}).then(e=>e[0])}const Z=t.object({token:t.string()});async function it(e,t){let n=Z.parse(t);await e.execute({name:`request_withdrawal`,inputs:n,description:`Request a withdrawal of all tokens from idOS to user's EVM wallet`})}const at=t.object({gas_allowance:t.number()});async function ot(e){return await e.call({name:`get_allowance`,inputs:{}}).then(e=>e[0])}async function st(e){await e.execute({name:`action_costing_gas`,inputs:{},description:`Get cost of action for 1.2 gas`})}const Q=t.object({amount:t.number()});async function ct(e,t){let n=Q.parse(t);await e.execute({name:`action_costing_idos_token`,inputs:n,description:`Action that captures IDOS tokens from the caller`})}const lt=t.object({credential_id:t.uuid()}),ut=t.object({issuer_fee:t.number()});async function dt(e,t){let n=lt.parse(t);return await e.call({name:`get_issuer_fee`,inputs:n}).then(e=>e[0])}const ft=t.object({credential_id:t.uuid()});async function pt(e,t){let n=ft.parse(t);await e.execute({name:`action_costing_fee`,inputs:n,description:`Capture fee from credentials`})}const $=t.object({token:t.string(),evm_address_to:t.string()});async function mt(e,t){let n=$.parse(t);await e.execute({name:`request_balance_withdrawal`,inputs:n,description:`Request a withdrawal of all tokens from idOS to specified EVM address`})}function ht(e){return{id:e.id,ownerWalletIdentifier:e.owner_wallet_identifier,consumerWalletIdentifier:e.grantee_wallet_identifier,issuerPublicKey:e.issuer_public_key,accessGrantTimelock:e.access_grant_timelock,notUsableBefore:e.not_usable_before,notUsableAfter:e.not_usable_after}}async function gt(e,t){await Promise.all(t.map(t=>_(e,t)))}async function _t(e,t){await Promise.all(t.map(t=>y(e,{id:t})))}const vt=10;async function yt(e,t={page:1,size:10,user_id:null}){return V(e,{page:t.page??1,size:t.size??10,user_id:t.user_id??null})}export{ft as ActionCostingFeeInputSchema,Q as ActionCostingIdosTokenInputSchema,N as AddAttributeAsInserterInputSchema,P as AddAttributeInputSchema,d as AddUserAsInserterInputSchema,g as AddWalletInputSchema,h as AddWalletMessageInputSchema,le as AddWalletMessageOutputSchema,Y as CheckBalanceInputSchema,et as CheckBalanceOutputSchema,q as CheckCallerPayerInputSchema,Ze as CheckCallerPayerOutputSchema,D as CreateCredentialsByDwgInputSchema,D as CreatePreliminaryCredentialsByDwgInputSchema,b as CreatePreliminaryCredentialInputSchema,k as CredentialExistAsInserterInputSchema,xe as CredentialExistAsInserterOutputSchema,n as DataType,R as DwgMessageInputSchema,Ie as DwgMessageOutputSchema,ee as ENCRYPTION_PASSWORD_STORES,F as EditAttributeInputSchema,S as EditPublicNotesAsIssuerInputSchema,vt as GET_GRANTS_DEFAULT_RECORDS_PER_PAGE,W as GetAccessGrantsForCredentialInputSchema,Ke as GetAccessGrantsForCredentialOutputSchema,H as GetAccessGrantsGrantedCountInputSchema,He as GetAccessGrantsGrantedCountOutputSchema,B as GetAccessGrantsGrantedInputSchema,Ve as GetAccessGrantsGrantedOutputSchema,ze as GetAccessGrantsOwnedOutputSchema,at as GetAllowanceOutputSchema,je as GetAttributesOutputSchema,A as GetCredentialOwnedInputSchema,Ce as GetCredentialOwnedOutputSchema,j as GetCredentialSharedInputSchema,Te as GetCredentialSharedOutputSchema,me as GetCredentialsOutputSchema,x as GetCredentialsSharedByUserInputSchema,ge as GetCredentialsSharedByUserOutputSchema,lt as GetIssuerFeeInputSchema,ut as GetIssuerFeeOutputSchema,M as GetSiblingCredentialIdInputSchema,De as GetSiblingCredentialIdOutputSchema,p as GetUserAsInserterInputSchema,oe as GetUserAsInserterOutputSchema,ie as GetUserOutputSchema,X as GetWalletWithBalanceInputSchema,nt as GetWalletWithBalanceOutputSchema,de as GetWalletsOutputSchema,U as HasLockedAccessGrantsInputSchema,We as HasLockedAccessGrantsOutputSchema,G as HasProfileInputSchema,Je as HasProfileOutputSchema,I as RemoveAttributeInputSchema,C as RemoveCredentialInputSchema,v as RemoveWalletInputSchema,$ as RequestBalanceWithdrawalInputSchema,Z as RequestWithdrawalInputSchema,w as RescindSharedCredentialInputSchema,z as RevokeAccessGrantInputSchema,K as SetCallerPayerInputSchema,L as ShareAttributeInputSchema,T as ShareCredentialInputSchema,T as SharePreliminaryCredentialInputSchema,J as UnsetCallerPayerInputSchema,f as UpdateUserPubKeyAsInserterInputSchema,m as UpsertWalletAsInserterInputSchema,r as WALLET_TYPES,pt as actionCostingFee,st as actionCostingGas,ct as actionCostingIdosToken,te as actionSchema,Ae as addAttribute,ke as addAttributeAsInserter,ne as addUserAsInserter,_ as addWallet,ue as addWalletMessage,gt as addWallets,tt as checkBalance,Qe as checkCallerPayer,O as createCredentialsByDwg,O as createPreliminaryCredentialsByDwg,pe as createPreliminaryCredential,Se as credentialExistAsInserter,Le as dwgMessage,Ne as editAttribute,ve as editPublicNotesAsIssuer,a as encryptionPasswordStoreSchema,qe as getAccessGrantsForCredential,V as getAccessGrantsGranted,Ue as getAccessGrantsGrantedCount,Be as getAccessGrantsOwned,ot as getAllowance,Me as getAttributes,we as getCredentialOwned,Ee as getCredentialShared,he as getCredentials,_e as getCredentialsSharedByUser,yt as getGrants,dt as getIssuerFee,Oe as getSiblingCredentialId,ae as getUser,se as getUserAsInserter,rt as getWalletWithBalance,fe as getWallets,Ge as hasLockedAccessGrants,Ye as hasProfile,Pe as removeAttribute,ye as removeCredential,y as removeWallet,_t as removeWallets,mt as requestBalanceWithdrawal,it as requestWithdrawal,be as rescindSharedCredential,Re as revokeAccessGrant,Xe as setCallerPayer,Fe as shareAttribute,E as shareCredential,E as sharePreliminaryCredential,ht as toDelegatedWriteGrantBaseParams,$e as unsetCallerPayer,re as updateUserPubKeyAsInserter,ce as upsertWalletAsInserter,i as walletTypeSchema};
|
|
1
|
+
import{Utils as e}from"@idos-network/kwil-js";import*as t from"zod";const n=e.DataType,r=[`EVM`,`NEAR`,`XRPL`,`Stellar`,`FaceSign`,`MM`],i=t.enum(r),ee=[`EVM`,`NEAR`,`XRPL`,`Stellar`,`FaceSign`],a=t.enum(ee),o=[`user`,`mpc`,`mm`],s=t.enum(o),c=`ipfs://`,te=`ukyc://`,l=t.string().refine(e=>e.startsWith(c)||e.startsWith(te),`content_uri must start with ${c} or ${te}`),u=t.number().int().positive(),d=t.iso.datetime({precision:0}),ne={add_user_as_inserter:[{name:`id`,type:n.Uuid},{name:`recipient_encryption_public_key`,type:n.Text},{name:`encryption_password_store`,type:n.Text}],update_user_pub_key_as_inserter:[{name:`id`,type:n.Uuid},{name:`recipient_encryption_public_key`,type:n.Text},{name:`encryption_password_store`,type:n.Text}],get_user:[],get_user_as_inserter:[{name:`id`,type:n.Uuid}],upsert_wallet_as_inserter:[{name:`id`,type:n.Uuid},{name:`user_id`,type:n.Uuid},{name:`address`,type:n.Text},{name:`public_key`,type:n.Text},{name:`wallet_type`,type:n.Text},{name:`not_before`,type:n.Text},{name:`not_after`,type:n.Text},{name:`signature`,type:n.Text}],add_wallet_message:[{name:`address`,type:n.Text},{name:`wallet_type`,type:n.Text},{name:`user_id`,type:n.Uuid},{name:`not_before`,type:n.Text},{name:`not_after`,type:n.Text}],add_wallet:[{name:`id`,type:n.Uuid},{name:`address`,type:n.Text},{name:`public_key`,type:n.Text},{name:`wallet_type`,type:n.Text},{name:`not_before`,type:n.Text},{name:`not_after`,type:n.Text},{name:`signature`,type:n.Text}],get_wallets:[],remove_wallet:[{name:`id`,type:n.Uuid}],credential_broader_message:[{name:`public_notes_signature`,type:n.Text},{name:`content_uri`,type:n.Text},{name:`recipient_wallet`,type:n.Text}],create_preliminary_credential:[{name:`request_id`,type:n.Uuid},{name:`credential_id`,type:n.Uuid},{name:`issuer_auth_public_key`,type:n.Text},{name:`encryptor_public_key`,type:n.Text},{name:`content_uri`,type:n.Text},{name:`content_size`,type:n.Int},{name:`content_hash`,type:n.Text},{name:`public_notes`,type:n.Text},{name:`public_notes_signature`,type:n.Text},{name:`broader_signature`,type:n.Text}],get_credentials:[],get_credentials_shared_by_user:[{name:`user_id`,type:n.Uuid},{name:`original_issuer_auth_public_key`,type:n.Text}],edit_public_notes_as_issuer:[{name:`public_notes_id`,type:n.Text},{name:`public_notes`,type:n.Text}],remove_credential:[{name:`id`,type:n.Uuid}],rescind_shared_credential:[{name:`credential_id`,type:n.Uuid}],share_preliminary_credential:[{name:`request_id`,type:n.Uuid},{name:`copy_id`,type:n.Uuid},{name:`original_id`,type:n.Uuid},{name:`public_notes`,type:n.Text},{name:`public_notes_signature`,type:n.Text},{name:`broader_signature`,type:n.Text},{name:`content_uri`,type:n.Text},{name:`content_size`,type:n.Int},{name:`content_hash`,type:n.Text},{name:`encryptor_public_key`,type:n.Text},{name:`issuer_auth_public_key`,type:n.Text},{name:`grantee_wallet_identifier`,type:n.Text},{name:`locked_until`,type:n.Int}],create_preliminary_credentials_by_dwg:[{name:`request_id`,type:n.Uuid},{name:`issuer_auth_public_key`,type:n.Text},{name:`original_encryptor_public_key`,type:n.Text},{name:`original_id`,type:n.Uuid},{name:`original_content_uri`,type:n.Text},{name:`original_content_size`,type:n.Int},{name:`original_public_notes`,type:n.Text},{name:`original_public_notes_signature`,type:n.Text},{name:`original_broader_signature`,type:n.Text},{name:`copy_encryptor_public_key`,type:n.Text},{name:`copy_id`,type:n.Uuid},{name:`copy_content_uri`,type:n.Text},{name:`copy_content_size`,type:n.Int},{name:`copy_public_notes_signature`,type:n.Text},{name:`copy_broader_signature`,type:n.Text},{name:`content_hash`,type:n.Text},{name:`dwg_owner`,type:n.Text},{name:`dwg_grantee`,type:n.Text},{name:`dwg_issuer_public_key`,type:n.Text},{name:`dwg_id`,type:n.Uuid},{name:`dwg_access_grant_timelock`,type:n.Text},{name:`dwg_not_before`,type:n.Text},{name:`dwg_not_after`,type:n.Text},{name:`dwg_signature`,type:n.Text}],credential_exist_as_inserter:[{name:`id`,type:n.Uuid}],get_credential_owned:[{name:`id`,type:n.Uuid}],get_credential_shared:[{name:`id`,type:n.Uuid}],get_sibling_credential_id:[{name:`content_hash`,type:n.Text}],get_user_as_mm_operator:[{name:`storage_token`,type:n.Text}],create_user_as_mm_operator:[{name:`id`,type:n.Uuid},{name:`recipient_encryption_public_key`,type:n.Text},{name:`wallet_id`,type:n.Uuid},{name:`storage_token`,type:n.Text}],get_credentials_as_mm_operator:[{name:`user_id`,type:n.Uuid},{name:`storage_token`,type:n.Text}],create_preliminary_credential_as_mm_operator:[{name:`request_id`,type:n.Uuid},{name:`user_id`,type:n.Uuid},{name:`credential_id`,type:n.Uuid},{name:`issuer_auth_public_key`,type:n.Text},{name:`encryptor_public_key`,type:n.Text},{name:`content_uri`,type:n.Text},{name:`content_size`,type:n.Int},{name:`content_hash`,type:n.Text},{name:`public_notes`,type:n.Text},{name:`public_notes_signature`,type:n.Text},{name:`broader_signature`,type:n.Text},{name:`storage_token`,type:n.Text}],request_user_wipe_as_mm_operator:[{name:`user_id`,type:n.Uuid},{name:`storage_token`,type:n.Text}],add_attribute_as_inserter:[{name:`id`,type:n.Uuid},{name:`user_id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],add_attribute:[{name:`id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],get_attributes:[],edit_attribute:[{name:`id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],remove_attribute:[{name:`id`,type:n.Uuid}],share_attribute:[{name:`id`,type:n.Uuid},{name:`original_attribute_id`,type:n.Uuid},{name:`attribute_key`,type:n.Text},{name:`value`,type:n.Text}],dwg_message:[{name:`owner_wallet_identifier`,type:n.Text},{name:`grantee_wallet_identifier`,type:n.Text},{name:`issuer_public_key`,type:n.Text},{name:`id`,type:n.Uuid},{name:`access_grant_timelock`,type:n.Text},{name:`not_usable_before`,type:n.Text},{name:`not_usable_after`,type:n.Text}],revoke_access_grant:[{name:`id`,type:n.Uuid}],get_access_grants_owned:[],get_access_grants_granted:[{name:`user_id`,type:n.Uuid},{name:`page`,type:n.Int},{name:`size`,type:n.Int}],get_access_grants_granted_count:[{name:`user_id`,type:n.Uuid}],has_locked_access_grants:[{name:`id`,type:n.Uuid}],get_access_grants_for_credential:[{name:`credential_id`,type:n.Uuid}],has_profile:[{name:`address`,type:n.Text}],set_caller_payer:[{name:`address`,type:n.Text}],check_caller_payer:[{name:`address`,type:n.Text}],unset_caller_payer:[{name:`address`,type:n.Text}],check_balance:[{name:`address`,type:n.Text},{name:`token`,type:n.Text}],get_wallet_with_balance:[{name:`token`,type:n.Text},{name:`minimum_balance`,type:n.Int}],request_withdrawal:[{name:`token`,type:n.Text}],get_allowance:[],action_costing_gas:[],action_costing_idos_token:[{name:`amount`,type:n.Int}],get_issuer_fee:[{name:`credential_id`,type:n.Uuid}],action_costing_fee:[{name:`credential_id`,type:n.Uuid}],request_balance_withdrawal:[{name:`token`,type:n.Text},{name:`evm_address_to`,type:n.Text}]},f=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s});async function re(e,t){let n=f.parse(t);await e.execute({name:`add_user_as_inserter`,inputs:n,description:`Add a user to idOS`})}const p=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s});async function ie(e,t){let n=p.parse(t);await e.execute({name:`update_user_pub_key_as_inserter`,inputs:n,description:`Update user's encryption key and password store in idOS as inserter (profile creator)`})}const ae=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s});async function oe(e){return await e.call({name:`get_user`,inputs:{}}).then(e=>{if(!e[0])throw Error(`get_user returned no rows`);return e[0]})}const m=t.object({id:t.uuid()}),se=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s,inserter:t.string()});async function ce(e,t){let n=m.parse(t);return await e.call({name:`get_user_as_inserter`,inputs:n}).then(e=>e[0])}const h=t.object({id:t.uuid(),user_id:t.uuid(),address:t.string(),public_key:t.string().nullish(),wallet_type:a,not_before:d,not_after:d,signature:t.string()});async function le(e,t){let n=h.parse(t);await e.execute({name:`upsert_wallet_as_inserter`,inputs:n,description:`Add a wallet to idOS by inserter (profile creator)`})}const g=t.object({address:t.string(),wallet_type:a,user_id:t.uuid(),not_before:d,not_after:d}),ue=t.object({message:t.string()});async function de(e,t){let n=g.parse(t);return await e.call({name:`add_wallet_message`,inputs:n}).then(e=>{if(!e[0])throw Error(`add_wallet_message returned no rows`);return e[0]})}const _=t.object({id:t.uuid(),address:t.string(),public_key:t.string().nullish(),wallet_type:a,not_before:d,not_after:d,signature:t.string()});async function v(e,t){let n=_.parse(t);await e.execute({name:`add_wallet`,inputs:n,description:`Add a wallet to idOS`})}const fe=t.object({id:t.uuid(),user_id:t.uuid(),address:t.string(),public_key:t.string().nullable(),wallet_type:i,message:t.string().nullable(),signature:t.string(),inserter:t.string().nullable()});async function pe(e){return await e.call({name:`get_wallets`,inputs:{}})}const y=t.object({id:t.uuid()});async function b(e,t){let n=y.parse(t);await e.execute({name:`remove_wallet`,inputs:n,description:`Remove a wallet from idOS`})}const x=t.object({public_notes_signature:t.string(),content_uri:l,recipient_wallet:t.string()}),me=t.object({message:t.string()});async function he(e,t){let n=x.parse(t);return await e.call({name:`credential_broader_message`,inputs:n}).then(e=>{if(!e[0])throw Error(`credential_broader_message returned no rows`);return e[0]})}const S=t.object({request_id:t.uuid(),credential_id:t.uuid(),issuer_auth_public_key:t.string(),encryptor_public_key:t.string(),content_uri:l,content_size:u,content_hash:t.string(),public_notes:t.string(),public_notes_signature:t.string(),broader_signature:t.string()});async function ge(e,t){let n=S.parse(t);await e.execute({name:`create_preliminary_credential`,inputs:n,description:`Create a new preliminary credential`})}const _e=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content_uri:t.string().nullable(),content_size:t.number().nullable(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable(),original_id:t.uuid().nullable()});async function ve(e){return await e.call({name:`get_credentials`,inputs:{}})}const C=t.object({user_id:t.uuid(),original_issuer_auth_public_key:t.string().nullish()}),ye=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable(),original_id:t.uuid().nullable()});async function be(e,t){let n=C.parse(t);return await e.call({name:`get_credentials_shared_by_user`,inputs:n})}const w=t.object({public_notes_id:t.string(),public_notes:t.string()});async function xe(e,t){let n=w.parse(t);await e.execute({name:`edit_public_notes_as_issuer`,inputs:n,description:`Edit public notes in a credential as issuer`})}const T=t.object({id:t.uuid()});async function Se(e,t){let n=T.parse(t);await e.execute({name:`remove_credential`,inputs:n,description:`Remove a credential from your idOS profile`})}const E=t.object({credential_id:t.uuid()});async function Ce(e,t){let n=E.parse(t);await e.execute({name:`rescind_shared_credential`,inputs:n,description:`Rescind a shared credential as a grantee`})}const D=t.object({request_id:t.uuid(),copy_id:t.uuid(),original_id:t.uuid(),public_notes:t.string(),public_notes_signature:t.string(),broader_signature:t.string(),content_uri:l,content_size:u,content_hash:t.string(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),grantee_wallet_identifier:t.string(),locked_until:t.number()});async function O(e,t){let n=D.parse(t);await e.execute({name:`share_preliminary_credential`,inputs:n,description:`Share a credential with creating AG`})}const k=t.object({request_id:t.uuid(),issuer_auth_public_key:t.string(),original_encryptor_public_key:t.string(),original_id:t.uuid(),original_content_uri:l,original_content_size:u,original_public_notes:t.string(),original_public_notes_signature:t.string(),original_broader_signature:t.string(),copy_encryptor_public_key:t.string(),copy_id:t.uuid(),copy_content_uri:l,copy_content_size:u,copy_public_notes_signature:t.string(),copy_broader_signature:t.string(),content_hash:t.string(),dwg_owner:t.string(),dwg_grantee:t.string(),dwg_issuer_public_key:t.string(),dwg_id:t.uuid(),dwg_access_grant_timelock:d,dwg_not_before:d,dwg_not_after:d,dwg_signature:t.string()});async function A(e,t){let n=k.parse(t);await e.execute({name:`create_preliminary_credentials_by_dwg`,inputs:n,description:`Add original credential and copy credential with AG on behalf of a user (using delegated write grant given by the user)`})}const j=t.object({id:t.uuid()}),we=t.object({credential_exist:t.boolean()});async function Te(e,t){let n=j.parse(t);return await e.call({name:`credential_exist_as_inserter`,inputs:n}).then(e=>e[0])}const M=t.object({id:t.uuid()}),Ee=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content:t.string().nullable(),content_uri:t.string().nullable(),content_size:t.number().nullable(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable()});async function De(e,t){let n=M.parse(t);return await e.call({name:`get_credential_owned`,inputs:n})}const N=t.object({id:t.uuid()}),Oe=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content:t.string().nullable(),content_uri:t.string().nullable(),content_size:t.number().nullable(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string().nullable(),inserter_id:t.string().nullable()});async function ke(e,t){let n=N.parse(t);return await e.call({name:`get_credential_shared`,inputs:n})}const Ae=t.object({content_hash:t.string()}),je=t.object({id:t.uuid()});async function Me(e,t){let n=Ae.parse(t);return await e.call({name:`get_sibling_credential_id`,inputs:n}).then(e=>e[0])}const P=t.object({storage_token:t.string()}),Ne=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),frozen:t.boolean()});async function Pe(e,t){let n=P.parse(t);return await e.call({name:`get_user_as_mm_operator`,inputs:n})}const F=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),wallet_id:t.uuid(),storage_token:t.string()});async function Fe(e,t){let n=F.parse(t);await e.execute({name:`create_user_as_mm_operator`,inputs:n,description:`Create an MM user with its MM wallet as an MM operator`})}const I=t.object({user_id:t.uuid(),storage_token:t.string()}),Ie=t.object({id:t.uuid(),user_id:t.uuid(),public_notes:t.string(),content_uri:t.string(),content_size:t.number(),encryptor_public_key:t.string(),issuer_auth_public_key:t.string(),inserter_type:t.string(),inserter_id:t.string()});async function Le(e,t){let n=I.parse(t);return await e.call({name:`get_credentials_as_mm_operator`,inputs:n})}const L=t.object({request_id:t.uuid(),user_id:t.uuid(),credential_id:t.uuid(),issuer_auth_public_key:t.string(),encryptor_public_key:t.string(),content_uri:l,content_size:u,content_hash:t.string(),public_notes:t.string(),public_notes_signature:t.string(),broader_signature:t.string(),storage_token:t.string()});async function Re(e,t){let n=L.parse(t);await e.execute({name:`create_preliminary_credential_as_mm_operator`,inputs:n,description:`Create a preliminary ukyc:// credential for an MM user as its MM operator`})}const R=t.object({user_id:t.uuid(),storage_token:t.string()});async function ze(e,t){let n=R.parse(t);await e.execute({name:`request_user_wipe_as_mm_operator`,inputs:n,description:`Request a data wipe of an MM user as its MM operator`})}const z=t.object({id:t.uuid(),user_id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Be(e,t){let n=z.parse(t);await e.execute({name:`add_attribute_as_inserter`,inputs:n,description:`Add a new attribute as inserter`})}const B=t.object({id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Ve(e,t){let n=B.parse(t);await e.execute({name:`add_attribute`,inputs:n,description:`Create a new attribute in your idOS profile`})}const He=t.object({id:t.uuid(),user_id:t.uuid(),attribute_key:t.string(),value:t.string(),original_id:t.uuid()});async function Ue(e){return await e.call({name:`get_attributes`,inputs:{}})}const V=t.object({id:t.uuid(),attribute_key:t.string(),value:t.string()});async function We(e,t){let n=V.parse(t);await e.execute({name:`edit_attribute`,inputs:n,description:`Edit an existing attribute`})}const H=t.object({id:t.uuid()});async function Ge(e,t){let n=H.parse(t);await e.execute({name:`remove_attribute`,inputs:n,description:`Remove an existing attribute`})}const U=t.object({id:t.uuid(),original_attribute_id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Ke(e,t){let n=U.parse(t);await e.execute({name:`share_attribute`,inputs:n,description:`Share an attribute`})}const W=t.object({owner_wallet_identifier:t.string(),grantee_wallet_identifier:t.string(),issuer_public_key:t.string(),id:t.uuid(),access_grant_timelock:d,not_usable_before:d,not_usable_after:d}),qe=t.object({message:t.string()});async function Je(e,t){let n=W.parse(t);return await e.call({name:`dwg_message`,inputs:n}).then(e=>e[0])}const G=t.object({id:t.uuid()});async function Ye(e,t){let n=G.parse(t);await e.execute({name:`revoke_access_grant`,inputs:n,description:`Revoke an Access Grant from idOS`})}const Xe=t.object({id:t.uuid(),ag_owner_user_id:t.uuid(),ag_grantee_wallet_identifier:t.string(),data_id:t.uuid(),locked_until:t.number(),content_hash:t.string().nullable(),inserter_type:t.string(),inserter_id:t.string()});async function Ze(e){return await e.call({name:`get_access_grants_owned`,inputs:{}})}const K=t.object({user_id:t.uuid().nullish(),page:t.number(),size:t.number()}),Qe=t.object({id:t.uuid(),ag_owner_user_id:t.uuid(),ag_grantee_wallet_identifier:t.string(),data_id:t.uuid(),locked_until:t.number(),content_hash:t.string().nullable(),inserter_type:t.string(),inserter_id:t.string()});async function q(e,t){let n=K.parse(t);return await e.call({name:`get_access_grants_granted`,inputs:n})}const J=t.object({user_id:t.uuid().nullish()}),$e=t.object({count:t.number()});async function et(e,t){let n=J.parse(t);return await e.call({name:`get_access_grants_granted_count`,inputs:n}).then(e=>e[0])}const Y=t.object({id:t.uuid()}),tt=t.object({has:t.boolean()});async function nt(e,t){let n=Y.parse(t);return await e.call({name:`has_locked_access_grants`,inputs:n}).then(e=>e[0])}const X=t.object({credential_id:t.uuid()}),rt=t.object({id:t.uuid(),ag_owner_user_id:t.uuid(),ag_grantee_wallet_identifier:t.string(),data_id:t.uuid(),locked_until:t.number(),content_hash:t.string().nullable(),inserter_type:t.string(),inserter_id:t.string()});async function it(e,t){let n=X.parse(t);return await e.call({name:`get_access_grants_for_credential`,inputs:n})}const Z=t.object({address:t.string()}),at=t.object({has_profile:t.boolean()});async function ot(e,t){let n=Z.parse(t);return await e.call({name:`has_profile`,inputs:n},void 0).then(e=>e[0])}const Q=t.object({address:t.string()});async function st(e,t){let n=Q.parse(t);await e.execute({name:`set_caller_payer`,inputs:n,description:`Set the caller as a payer for a specific EVM address`})}const ct=t.object({address:t.string()}),lt=t.object({is_payer:t.boolean()});async function ut(e,t){let n=ct.parse(t);return await e.call({name:`check_caller_payer`,inputs:n}).then(e=>e[0])}const dt=t.object({address:t.string()});async function ft(e,t){let n=dt.parse(t);await e.execute({name:`unset_caller_payer`,inputs:n,description:`Remove the caller as a payer for a specific EVM address`})}const pt=t.object({address:t.string(),token:t.string()}),mt=t.object({balance:t.number()});async function ht(e,t){let n=pt.parse(t);return await e.call({name:`check_balance`,inputs:n}).then(e=>e[0])}const gt=t.object({token:t.string(),minimum_balance:t.number()}),_t=t.object({wallet_address:t.string()});async function vt(e,t){let n=gt.parse(t);return await e.call({name:`get_wallet_with_balance`,inputs:n}).then(e=>e[0])}const yt=t.object({token:t.string()});async function bt(e,t){let n=yt.parse(t);await e.execute({name:`request_withdrawal`,inputs:n,description:`Request a withdrawal of all tokens from idOS to user's EVM wallet`})}const xt=t.object({gas_allowance:t.number()});async function St(e){return await e.call({name:`get_allowance`,inputs:{}}).then(e=>e[0])}async function Ct(e){await e.execute({name:`action_costing_gas`,inputs:{},description:`Get cost of action for 1.2 gas`})}const $=t.object({amount:t.number()});async function wt(e,t){let n=$.parse(t);await e.execute({name:`action_costing_idos_token`,inputs:n,description:`Action that captures IDOS tokens from the caller`})}const Tt=t.object({credential_id:t.uuid()}),Et=t.object({issuer_fee:t.number()});async function Dt(e,t){let n=Tt.parse(t);return await e.call({name:`get_issuer_fee`,inputs:n}).then(e=>e[0])}const Ot=t.object({credential_id:t.uuid()});async function kt(e,t){let n=Ot.parse(t);await e.execute({name:`action_costing_fee`,inputs:n,description:`Capture fee from credentials`})}const At=t.object({token:t.string(),evm_address_to:t.string()});async function jt(e,t){let n=At.parse(t);await e.execute({name:`request_balance_withdrawal`,inputs:n,description:`Request a withdrawal of all tokens from idOS to specified EVM address`})}function Mt(e){return{id:e.id,ownerWalletIdentifier:e.owner_wallet_identifier,consumerWalletIdentifier:e.grantee_wallet_identifier,issuerPublicKey:e.issuer_public_key,accessGrantTimelock:e.access_grant_timelock,notUsableBefore:e.not_usable_before,notUsableAfter:e.not_usable_after}}async function Nt(e,t){await Promise.all(t.map(t=>v(e,t)))}async function Pt(e,t){await Promise.all(t.map(t=>b(e,{id:t})))}const Ft=10;async function It(e,t={page:1,size:10,user_id:null}){return q(e,{page:t.page??1,size:t.size??10,user_id:t.user_id??null})}export{ee as ADD_WALLET_TYPES,Ot as ActionCostingFeeInputSchema,$ as ActionCostingIdosTokenInputSchema,z as AddAttributeAsInserterInputSchema,B as AddAttributeInputSchema,f as AddUserAsInserterInputSchema,_ as AddWalletInputSchema,g as AddWalletMessageInputSchema,ue as AddWalletMessageOutputSchema,pt as CheckBalanceInputSchema,mt as CheckBalanceOutputSchema,ct as CheckCallerPayerInputSchema,lt as CheckCallerPayerOutputSchema,k as CreateCredentialsByDwgInputSchema,k as CreatePreliminaryCredentialsByDwgInputSchema,L as CreatePreliminaryCredentialAsMmOperatorInputSchema,S as CreatePreliminaryCredentialInputSchema,F as CreateUserAsMmOperatorInputSchema,x as CredentialBroaderMessageInputSchema,me as CredentialBroaderMessageOutputSchema,j as CredentialExistAsInserterInputSchema,we as CredentialExistAsInserterOutputSchema,n as DataType,W as DwgMessageInputSchema,qe as DwgMessageOutputSchema,o as ENCRYPTION_PASSWORD_STORES,V as EditAttributeInputSchema,w as EditPublicNotesAsIssuerInputSchema,Ft as GET_GRANTS_DEFAULT_RECORDS_PER_PAGE,X as GetAccessGrantsForCredentialInputSchema,rt as GetAccessGrantsForCredentialOutputSchema,J as GetAccessGrantsGrantedCountInputSchema,$e as GetAccessGrantsGrantedCountOutputSchema,K as GetAccessGrantsGrantedInputSchema,Qe as GetAccessGrantsGrantedOutputSchema,Xe as GetAccessGrantsOwnedOutputSchema,xt as GetAllowanceOutputSchema,He as GetAttributesOutputSchema,M as GetCredentialOwnedInputSchema,Ee as GetCredentialOwnedOutputSchema,N as GetCredentialSharedInputSchema,Oe as GetCredentialSharedOutputSchema,I as GetCredentialsAsMmOperatorInputSchema,Ie as GetCredentialsAsMmOperatorOutputSchema,_e as GetCredentialsOutputSchema,C as GetCredentialsSharedByUserInputSchema,ye as GetCredentialsSharedByUserOutputSchema,Tt as GetIssuerFeeInputSchema,Et as GetIssuerFeeOutputSchema,Ae as GetSiblingCredentialIdInputSchema,je as GetSiblingCredentialIdOutputSchema,m as GetUserAsInserterInputSchema,se as GetUserAsInserterOutputSchema,P as GetUserAsMmOperatorInputSchema,Ne as GetUserAsMmOperatorOutputSchema,ae as GetUserOutputSchema,gt as GetWalletWithBalanceInputSchema,_t as GetWalletWithBalanceOutputSchema,fe as GetWalletsOutputSchema,Y as HasLockedAccessGrantsInputSchema,tt as HasLockedAccessGrantsOutputSchema,Z as HasProfileInputSchema,at as HasProfileOutputSchema,H as RemoveAttributeInputSchema,T as RemoveCredentialInputSchema,y as RemoveWalletInputSchema,At as RequestBalanceWithdrawalInputSchema,R as RequestUserWipeAsMmOperatorInputSchema,yt as RequestWithdrawalInputSchema,E as RescindSharedCredentialInputSchema,G as RevokeAccessGrantInputSchema,Q as SetCallerPayerInputSchema,U as ShareAttributeInputSchema,D as ShareCredentialInputSchema,D as SharePreliminaryCredentialInputSchema,dt as UnsetCallerPayerInputSchema,p as UpdateUserPubKeyAsInserterInputSchema,h as UpsertWalletAsInserterInputSchema,r as WALLET_TYPES,kt as actionCostingFee,Ct as actionCostingGas,wt as actionCostingIdosToken,ne as actionSchema,Ve as addAttribute,Be as addAttributeAsInserter,re as addUserAsInserter,v as addWallet,de as addWalletMessage,a as addWalletTypeSchema,Nt as addWallets,ht as checkBalance,ut as checkCallerPayer,A as createCredentialsByDwg,A as createPreliminaryCredentialsByDwg,ge as createPreliminaryCredential,Re as createPreliminaryCredentialAsMmOperator,Fe as createUserAsMmOperator,he as credentialBroaderMessage,Te as credentialExistAsInserter,Je as dwgMessage,We as editAttribute,xe as editPublicNotesAsIssuer,s as encryptionPasswordStoreSchema,it as getAccessGrantsForCredential,q as getAccessGrantsGranted,et as getAccessGrantsGrantedCount,Ze as getAccessGrantsOwned,St as getAllowance,Ue as getAttributes,De as getCredentialOwned,ke as getCredentialShared,ve as getCredentials,Le as getCredentialsAsMmOperator,be as getCredentialsSharedByUser,It as getGrants,Dt as getIssuerFee,Me as getSiblingCredentialId,oe as getUser,ce as getUserAsInserter,Pe as getUserAsMmOperator,vt as getWalletWithBalance,pe as getWallets,nt as hasLockedAccessGrants,ot as hasProfile,Ge as removeAttribute,Se as removeCredential,b as removeWallet,Pt as removeWallets,jt as requestBalanceWithdrawal,ze as requestUserWipeAsMmOperator,bt as requestWithdrawal,Ce as rescindSharedCredential,Ye as revokeAccessGrant,st as setCallerPayer,Ke as shareAttribute,O as shareCredential,O as sharePreliminaryCredential,Mt as toDelegatedWriteGrantBaseParams,ft as unsetCallerPayer,ie as updateUserPubKeyAsInserter,le as upsertWalletAsInserter,i as walletTypeSchema};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|