@idos-network/kwil-infra 3.0.0 → 4.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 +27 -0
- 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/facesign/index.d.mts +2 -2
- package/dist/facesign/index.mjs +1 -1
- package/dist/facesign-signer-CTPPUFxT.mjs +2 -0
- package/dist/facesign-signer-CTPPUFxT.mjs.map +1 -0
- package/dist/{facesign-signer-5I8juA7p.d.mts → facesign-signer-Dqh899om.d.mts} +3 -2
- package/dist/facesign-signer-Dqh899om.d.mts.map +1 -0
- package/dist/{index-Bqz6trCk.d.mts → index-Dwonqvwu.d.mts} +33 -20
- package/dist/index-Dwonqvwu.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/nep413-D_D-6Yf6.mjs +2 -0
- package/dist/nep413-D_D-6Yf6.mjs.map +1 -0
- package/dist/signature-verification/index.d.mts +1 -1
- package/dist/signature-verification/index.mjs +1 -1
- package/dist/signature-verification/index.mjs.map +1 -1
- package/dist/xrp/utils.d.mts +41 -41
- package/dist/xrp/utils.d.mts.map +1 -1
- package/package.json +3 -3
- package/src/actions/actions.test.ts +18 -2
- package/src/actions/actions.ts +76 -19
- package/src/facesign/facesign-signer.test.ts +58 -1
- package/src/facesign/facesign-signer.ts +8 -0
- package/src/facesign/index.ts +1 -1
- package/src/mm-token/create-mm-token-kwil-signer.test.ts +0 -16
- package/src/mm-token/create-mm-token-kwil-signer.ts +0 -5
- package/src/near/create-near-wallet-kwil-signer.test.ts +218 -0
- package/src/near/create-near-wallet-kwil-signer.ts +121 -28
- package/src/near/nep413.ts +47 -37
- package/src/near/signature-verification.test.ts +35 -0
- package/src/near/signature-verification.ts +15 -36
- package/dist/facesign-signer-5I8juA7p.d.mts.map +0 -1
- package/dist/facesign-signer-z5T312uQ.mjs +0 -2
- package/dist/facesign-signer-z5T312uQ.mjs.map +0 -1
- package/dist/index-Bqz6trCk.d.mts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @idos-network/kwil-infra
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 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).
|
|
8
|
+
|
|
9
|
+
`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.
|
|
10
|
+
|
|
11
|
+
`@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.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- e999de0: Sign credential broader signatures over the message the node returns, and reject adding an MM wallet.
|
|
16
|
+
- Updated dependencies [1668234]
|
|
17
|
+
- Updated dependencies [38a1991]
|
|
18
|
+
- @idos-network/utils@3.1.0
|
|
19
|
+
|
|
20
|
+
## 3.0.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- b1466c8: Delete a FaceSign key already stored in the browser before that key can be added to an idOS profile.
|
|
25
|
+
- 47c1b10: Only trust a my-near-wallet redirect when its signature matches the saved request, its account is the connected account, and its public key is a full-access key of that account.
|
|
26
|
+
- dc34ffe: Reject NEAR signatures whose NEP-413 recipient is not `idos.network`.
|
|
27
|
+
- Updated dependencies [78ad0a9]
|
|
28
|
+
- @idos-network/utils@3.0.1
|
|
29
|
+
|
|
3
30
|
## 3.0.0
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
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 DataType, $n as addWalletTypeSchema, $t as GetUserAsInserterOutputSchema, A as AddWalletMessageOutput, An as SetCallerPayerInput, Ar as removeWallet, At as GetCredentialOwnedOutput, B as CheckCallerPayerOutputSchema, Bn as UpsertWalletAsInserterInput, Br as upsertWalletAsInserter, Bt as GetCredentialsSharedByUserOutput, C as AddAttributeInputSchema, Cn as RequestBalanceWithdrawalInputSchema, Cr as getUserAsInserter, Ct as GetAccessGrantsOwnedOutputSchema, D as AddWalletInputSchema, Dn as RescindSharedCredentialInputSchema, Dr as hasProfile, Dt as GetAttributesOutputSchema, E as AddWalletInput, En as RescindSharedCredentialInput, Er as hasLockedAccessGrants, Et as GetAttributesOutput, F as CheckBalanceOutput, Fn as SharePreliminaryCredentialInputSchema, Fr as setCallerPayer, Ft as GetCredentialSharedOutputSchema, G as CredentialBroaderMessageInput, Gn as actionCostingGas, Gt as GetIssuerFeeOutputSchema, H as CreatePreliminaryCredentialInputSchema, Hn as WALLET_TYPES, Ht as GetIssuerFeeInput, I as CheckBalanceOutputSchema, In as UnsetCallerPayerInput, Ir as shareAttribute, It as GetCredentialsOutput, J as CredentialBroaderMessageOutputSchema, Jn as addAttribute, Jt as GetSiblingCredentialIdOutput, K as CredentialBroaderMessageInputSchema, Kn as actionCostingIdosToken, Kt as GetSiblingCredentialIdInput, L as CheckCallerPayerInput, Ln as UnsetCallerPayerInputSchema, Lr as sharePreliminaryCredential, Lt as GetCredentialsOutputSchema, M as AddWalletType, Mn as ShareAttributeInput, Mr as requestWithdrawal, Mt as GetCredentialSharedInput, N as CheckBalanceInput, Nn as ShareAttributeInputSchema, Nr as rescindSharedCredential, Nt as GetCredentialSharedInputSchema, O as AddWalletMessageInput, On as RevokeAccessGrantInput, Or as removeAttribute, Ot as GetCredentialOwnedInput, P as CheckBalanceInputSchema, Pn as SharePreliminaryCredentialInput, Pr as revokeAccessGrant, Pt as GetCredentialSharedOutput, Q as CredentialExistAsInserterOutputSchema, Qn as addWalletMessage, Qt as GetUserAsInserterOutput, R as CheckCallerPayerInputSchema, Rn as UpdateUserPubKeyAsInserterInput, Rr as unsetCallerPayer, Rt as GetCredentialsSharedByUserInput, S as AddAttributeInput, Sn as RequestBalanceWithdrawalInput, Sr as getUser, St as GetAccessGrantsOwnedOutput, T as AddUserAsInserterInputSchema, Tn as RequestWithdrawalInputSchema, Tr as getWallets, Tt as GetAllowanceOutputSchema, U as CreatePreliminaryCredentialsByDwgInput, Un as WalletType, Ut as GetIssuerFeeInputSchema, V as CreatePreliminaryCredentialInput, Vn as UpsertWalletAsInserterInputSchema, Vr as walletTypeSchema, Vt as GetCredentialsSharedByUserOutputSchema, W as CreatePreliminaryCredentialsByDwgInputSchema, Wn as actionCostingFee, Wt as GetIssuerFeeOutput, X as CredentialExistAsInserterInputSchema, Xn as addUserAsInserter, Xt as GetUserAsInserterInput, Y as CredentialExistAsInserterInput, Yn as addAttributeAsInserter, Yt as GetSiblingCredentialIdOutputSchema, Z as CredentialExistAsInserterOutput, Zn as addWallet, Zt as GetUserAsInserterInputSchema, _ as ActionCostingIdosTokenInput, _n as RemoveAttributeInputSchema, _r as getCredentialShared, _t as GetAccessGrantsGrantedCountOutputSchema, a as idOSCredential, an as GetWalletWithBalanceOutputSchema, ar as credentialExistAsInserter, at as EditAttributeInput, b as AddAttributeAsInserterInput, bn as RemoveWalletInput, br as getIssuerFee, bt as GetAccessGrantsGrantedOutput, c as idOSGrant, cn as HasLockedAccessGrantsInput, cr as editPublicNotesAsIssuer, ct as EditPublicNotesAsIssuerInputSchema, d as idOSWallet, dn as HasLockedAccessGrantsOutputSchema, dr as getAccessGrantsGranted, dt as GetAccessGrantsForCredentialInputSchema, en as GetUserOutput, er as checkBalance, et as DwgMessageInput, f as removeWallets, fn as HasProfileInput, fr as getAccessGrantsGrantedCount, ft as GetAccessGrantsForCredentialOutput, g as ActionCostingFeeInputSchema, gn as RemoveAttributeInput, gr as getCredentialOwned, gt as GetAccessGrantsGrantedCountOutput, h as ActionCostingFeeInput, hn as HasProfileOutputSchema, hr as getAttributes, ht as GetAccessGrantsGrantedCountInputSchema, i as getGrants, in as GetWalletWithBalanceOutput, ir as credentialBroaderMessage, it as ENCRYPTION_PASSWORD_STORES, j as AddWalletMessageOutputSchema, jn as SetCallerPayerInputSchema, jr as requestBalanceWithdrawal, jt as GetCredentialOwnedOutputSchema, k as AddWalletMessageInputSchema, kn as RevokeAccessGrantInputSchema, kr as removeCredential, kt as GetCredentialOwnedInputSchema, l as idOSUser, ln as HasLockedAccessGrantsInputSchema, lr as encryptionPasswordStoreSchema, lt as EncryptionPasswordStore, m as ADD_WALLET_TYPES, mn as HasProfileOutput, mr as getAllowance, mt as GetAccessGrantsGrantedCountInput, n as GET_GRANTS_DEFAULT_RECORDS_PER_PAGE, nn as GetWalletWithBalanceInput, nr as createPreliminaryCredential, nt as DwgMessageOutput, o as idOSCredentialListItem, on as GetWalletsOutput, or as dwgMessage, ot as EditAttributeInputSchema, p as toDelegatedWriteGrantBaseParams, pn as HasProfileInputSchema, pr as getAccessGrantsOwned, pt as GetAccessGrantsForCredentialOutputSchema, q as CredentialBroaderMessageOutput, qn as actionSchema, qt as GetSiblingCredentialIdInputSchema, r as addWallets, rn as GetWalletWithBalanceInputSchema, rr as createPreliminaryCredentialsByDwg, rt as DwgMessageOutputSchema, s as idOSDelegatedWriteGrant, sn as GetWalletsOutputSchema, sr as editAttribute, st as EditPublicNotesAsIssuerInput, t as DelegatedWriteGrantBaseParams, tn as GetUserOutputSchema, tr as checkCallerPayer, tt as DwgMessageInputSchema, u as idOSUserAttribute, un as HasLockedAccessGrantsOutput, ur as getAccessGrantsForCredential, ut as GetAccessGrantsForCredentialInput, v as ActionCostingIdosTokenInputSchema, vn as RemoveCredentialInput, vr as getCredentials, vt as GetAccessGrantsGrantedInput, w as AddUserAsInserterInput, wn as RequestWithdrawalInput, wr as getWalletWithBalance, wt as GetAllowanceOutput, x as AddAttributeAsInserterInputSchema, xn as RemoveWalletInputSchema, xr as getSiblingCredentialId, xt as GetAccessGrantsGrantedOutputSchema, y as ActionSchemaElement, yn as RemoveCredentialInputSchema, yr as getCredentialsSharedByUser, yt as GetAccessGrantsGrantedInputSchema, z as CheckCallerPayerOutput, zn as UpdateUserPubKeyAsInserterInputSchema, zr as updateUserPubKeyAsInserter, zt as GetCredentialsSharedByUserInputSchema } from "../index-Dwonqvwu.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, CreatePreliminaryCredentialInput, CreatePreliminaryCredentialInputSchema, 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, 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, addWalletTypeSchema, addWallets, checkBalance, checkCallerPayer, createPreliminaryCredentialsByDwg as createCredentialsByDwg, createPreliminaryCredentialsByDwg, createPreliminaryCredential, credentialBroaderMessage, 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 };
|
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,ee=[`EVM`,`NEAR`,`XRPL`,`Stellar`,`FaceSign`,`MM`],r=t.enum(ee),i=[`EVM`,`NEAR`,`XRPL`,`Stellar`,`FaceSign`],a=t.enum(i),o=[`user`,`mpc`,`mm`],s=t.enum(o),c=`ipfs://`,l=`ukyc://`,u=t.string().refine(e=>e.startsWith(c)||e.startsWith(l),`content_uri must start with ${c} or ${l}`),d=t.number().int().positive(),f=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}],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}],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}]},p=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s});async function ne(e,t){let n=p.parse(t);await e.execute({name:`add_user_as_inserter`,inputs:n,description:`Add a user to idOS`})}const m=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s});async function re(e,t){let n=m.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:s});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 h=t.object({id:t.uuid()}),oe=t.object({id:t.uuid(),recipient_encryption_public_key:t.string(),encryption_password_store:s,inserter:t.string()});async function se(e,t){let n=h.parse(t);return await e.call({name:`get_user_as_inserter`,inputs:n}).then(e=>e[0])}const g=t.object({id:t.uuid(),user_id:t.uuid(),address:t.string(),public_key:t.string().nullish(),wallet_type:r,not_before:f.nullish(),not_after:f.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=g.parse(t);await e.execute({name:`upsert_wallet_as_inserter`,inputs:n,description:`Add a wallet to idOS by inserter (profile creator)`})}const _=t.object({address:t.string(),wallet_type:a,user_id:t.uuid(),not_before:f,not_after:f}),le=t.object({message:t.string()});async function ue(e,t){let n=_.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 v=t.object({id:t.uuid(),address:t.string(),public_key:t.string().nullish(),wallet_type:a,not_before:f,not_after:f,signature:t.string()});async function y(e,t){let n=v.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:r,message:t.string().nullable(),signature:t.string(),inserter:t.string().nullable()});async function fe(e){return await e.call({name:`get_wallets`,inputs:{}})}const b=t.object({id:t.uuid()});async function x(e,t){let n=b.parse(t);await e.execute({name:`remove_wallet`,inputs:n,description:`Remove a wallet from idOS`})}const S=t.object({public_notes_signature:t.string(),content_uri:u,recipient_wallet:t.string()}),pe=t.object({message:t.string()});async function me(e,t){let n=S.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 C=t.object({request_id:t.uuid(),credential_id:t.uuid(),issuer_auth_public_key:t.string(),encryptor_public_key:t.string(),content_uri:u,content_size:d,content_hash:t.string(),public_notes:t.string(),public_notes_signature:t.string(),broader_signature:t.string()});async function he(e,t){let n=C.parse(t);await e.execute({name:`create_preliminary_credential`,inputs:n,description:`Create a new preliminary credential`})}const ge=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 _e(e){return await e.call({name:`get_credentials`,inputs:{}})}const w=t.object({user_id:t.uuid(),original_issuer_auth_public_key:t.string().nullish()}),ve=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 ye(e,t){let n=w.parse(t);return await e.call({name:`get_credentials_shared_by_user`,inputs:n})}const T=t.object({public_notes_id:t.string(),public_notes:t.string()});async function be(e,t){let n=T.parse(t);await e.execute({name:`edit_public_notes_as_issuer`,inputs:n,description:`Edit public notes in a credential as issuer`})}const E=t.object({id:t.uuid()});async function xe(e,t){let n=E.parse(t);await e.execute({name:`remove_credential`,inputs:n,description:`Remove a credential from your idOS profile`})}const D=t.object({credential_id:t.uuid()});async function Se(e,t){let n=D.parse(t);await e.execute({name:`rescind_shared_credential`,inputs:n,description:`Rescind a shared credential as a grantee`})}const O=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:u,content_size:d,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 k(e,t){let n=O.parse(t);await e.execute({name:`share_preliminary_credential`,inputs:n,description:`Share a credential with creating AG`})}const A=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:u,original_content_size:d,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:u,copy_content_size:d,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:f,dwg_not_before:f,dwg_not_after:f,dwg_signature:t.string()});async function j(e,t){let n=A.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 M=t.object({id:t.uuid()}),Ce=t.object({credential_exist:t.boolean()});async function we(e,t){let n=M.parse(t);return await e.call({name:`credential_exist_as_inserter`,inputs:n}).then(e=>e[0])}const N=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=N.parse(t);return await e.call({name:`get_credential_owned`,inputs:n})}const P=t.object({id:t.uuid()}),De=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 Oe(e,t){let n=P.parse(t);return await e.call({name:`get_credential_shared`,inputs:n})}const F=t.object({content_hash:t.string()}),ke=t.object({id:t.uuid()});async function Ae(e,t){let n=F.parse(t);return await e.call({name:`get_sibling_credential_id`,inputs:n}).then(e=>e[0])}const je=t.object({id:t.uuid(),user_id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Me(e,t){let n=je.parse(t);await e.execute({name:`add_attribute_as_inserter`,inputs:n,description:`Add a new attribute as inserter`})}const I=t.object({id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Ne(e,t){let n=I.parse(t);await e.execute({name:`add_attribute`,inputs:n,description:`Create a new attribute in your idOS profile`})}const Pe=t.object({id:t.uuid(),user_id:t.uuid(),attribute_key:t.string(),value:t.string(),original_id:t.uuid()});async function Fe(e){return await e.call({name:`get_attributes`,inputs:{}})}const L=t.object({id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Ie(e,t){let n=L.parse(t);await e.execute({name:`edit_attribute`,inputs:n,description:`Edit an existing attribute`})}const R=t.object({id:t.uuid()});async function Le(e,t){let n=R.parse(t);await e.execute({name:`remove_attribute`,inputs:n,description:`Remove an existing attribute`})}const z=t.object({id:t.uuid(),original_attribute_id:t.uuid(),attribute_key:t.string(),value:t.string()});async function Re(e,t){let n=z.parse(t);await e.execute({name:`share_attribute`,inputs:n,description:`Share an attribute`})}const B=t.object({owner_wallet_identifier:t.string(),grantee_wallet_identifier:t.string(),issuer_public_key:t.string(),id:t.uuid(),access_grant_timelock:f,not_usable_before:f,not_usable_after:f}),ze=t.object({message:t.string()});async function Be(e,t){let n=B.parse(t);return await e.call({name:`dwg_message`,inputs:n}).then(e=>e[0])}const V=t.object({id:t.uuid()});async function Ve(e,t){let n=V.parse(t);await e.execute({name:`revoke_access_grant`,inputs:n,description:`Revoke an Access Grant from idOS`})}const He=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 Ue(e){return await e.call({name:`get_access_grants_owned`,inputs:{}})}const H=t.object({user_id:t.uuid().nullish(),page:t.number(),size:t.number()}),We=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 U(e,t){let n=H.parse(t);return await e.call({name:`get_access_grants_granted`,inputs:n})}const W=t.object({user_id:t.uuid().nullish()}),Ge=t.object({count:t.number()});async function Ke(e,t){let n=W.parse(t);return await e.call({name:`get_access_grants_granted_count`,inputs:n}).then(e=>e[0])}const G=t.object({id:t.uuid()}),qe=t.object({has:t.boolean()});async function Je(e,t){let n=G.parse(t);return await e.call({name:`has_locked_access_grants`,inputs:n}).then(e=>e[0])}const K=t.object({credential_id:t.uuid()}),Ye=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 Xe(e,t){let n=K.parse(t);return await e.call({name:`get_access_grants_for_credential`,inputs:n})}const q=t.object({address:t.string()}),Ze=t.object({has_profile:t.boolean()});async function Qe(e,t){let n=q.parse(t);return await e.call({name:`has_profile`,inputs:n},void 0).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:`set_caller_payer`,inputs:n,description:`Set the caller as a payer for a specific EVM address`})}const Y=t.object({address:t.string()}),et=t.object({is_payer:t.boolean()});async function tt(e,t){let n=Y.parse(t);return await e.call({name:`check_caller_payer`,inputs:n}).then(e=>e[0])}const X=t.object({address:t.string()});async function nt(e,t){let n=X.parse(t);await e.execute({name:`unset_caller_payer`,inputs:n,description:`Remove the caller as a payer for a specific EVM address`})}const Z=t.object({address:t.string(),token:t.string()}),rt=t.object({balance:t.number()});async function it(e,t){let n=Z.parse(t);return await e.call({name:`check_balance`,inputs:n}).then(e=>e[0])}const Q=t.object({token:t.string(),minimum_balance:t.number()}),at=t.object({wallet_address:t.string()});async function ot(e,t){let n=Q.parse(t);return await e.call({name:`get_wallet_with_balance`,inputs:n}).then(e=>e[0])}const $=t.object({token:t.string()});async function st(e,t){let n=$.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 ct=t.object({gas_allowance:t.number()});async function lt(e){return await e.call({name:`get_allowance`,inputs:{}}).then(e=>e[0])}async function ut(e){await e.execute({name:`action_costing_gas`,inputs:{},description:`Get cost of action for 1.2 gas`})}const dt=t.object({amount:t.number()});async function ft(e,t){let n=dt.parse(t);await e.execute({name:`action_costing_idos_token`,inputs:n,description:`Action that captures IDOS tokens from the caller`})}const pt=t.object({credential_id:t.uuid()}),mt=t.object({issuer_fee:t.number()});async function ht(e,t){let n=pt.parse(t);return await e.call({name:`get_issuer_fee`,inputs:n}).then(e=>e[0])}const gt=t.object({credential_id:t.uuid()});async function _t(e,t){let n=gt.parse(t);await e.execute({name:`action_costing_fee`,inputs:n,description:`Capture fee from credentials`})}const vt=t.object({token:t.string(),evm_address_to:t.string()});async function yt(e,t){let n=vt.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 bt(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 xt(e,t){await Promise.all(t.map(t=>y(e,t)))}async function St(e,t){await Promise.all(t.map(t=>x(e,{id:t})))}const Ct=10;async function wt(e,t={page:1,size:10,user_id:null}){return U(e,{page:t.page??1,size:t.size??10,user_id:t.user_id??null})}export{i as ADD_WALLET_TYPES,gt as ActionCostingFeeInputSchema,dt as ActionCostingIdosTokenInputSchema,je as AddAttributeAsInserterInputSchema,I as AddAttributeInputSchema,p as AddUserAsInserterInputSchema,v as AddWalletInputSchema,_ as AddWalletMessageInputSchema,le as AddWalletMessageOutputSchema,Z as CheckBalanceInputSchema,rt as CheckBalanceOutputSchema,Y as CheckCallerPayerInputSchema,et as CheckCallerPayerOutputSchema,A as CreateCredentialsByDwgInputSchema,A as CreatePreliminaryCredentialsByDwgInputSchema,C as CreatePreliminaryCredentialInputSchema,S as CredentialBroaderMessageInputSchema,pe as CredentialBroaderMessageOutputSchema,M as CredentialExistAsInserterInputSchema,Ce as CredentialExistAsInserterOutputSchema,n as DataType,B as DwgMessageInputSchema,ze as DwgMessageOutputSchema,o as ENCRYPTION_PASSWORD_STORES,L as EditAttributeInputSchema,T as EditPublicNotesAsIssuerInputSchema,Ct as GET_GRANTS_DEFAULT_RECORDS_PER_PAGE,K as GetAccessGrantsForCredentialInputSchema,Ye as GetAccessGrantsForCredentialOutputSchema,W as GetAccessGrantsGrantedCountInputSchema,Ge as GetAccessGrantsGrantedCountOutputSchema,H as GetAccessGrantsGrantedInputSchema,We as GetAccessGrantsGrantedOutputSchema,He as GetAccessGrantsOwnedOutputSchema,ct as GetAllowanceOutputSchema,Pe as GetAttributesOutputSchema,N as GetCredentialOwnedInputSchema,Te as GetCredentialOwnedOutputSchema,P as GetCredentialSharedInputSchema,De as GetCredentialSharedOutputSchema,ge as GetCredentialsOutputSchema,w as GetCredentialsSharedByUserInputSchema,ve as GetCredentialsSharedByUserOutputSchema,pt as GetIssuerFeeInputSchema,mt as GetIssuerFeeOutputSchema,F as GetSiblingCredentialIdInputSchema,ke as GetSiblingCredentialIdOutputSchema,h as GetUserAsInserterInputSchema,oe as GetUserAsInserterOutputSchema,ie as GetUserOutputSchema,Q as GetWalletWithBalanceInputSchema,at as GetWalletWithBalanceOutputSchema,de as GetWalletsOutputSchema,G as HasLockedAccessGrantsInputSchema,qe as HasLockedAccessGrantsOutputSchema,q as HasProfileInputSchema,Ze as HasProfileOutputSchema,R as RemoveAttributeInputSchema,E as RemoveCredentialInputSchema,b as RemoveWalletInputSchema,vt as RequestBalanceWithdrawalInputSchema,$ as RequestWithdrawalInputSchema,D as RescindSharedCredentialInputSchema,V as RevokeAccessGrantInputSchema,J as SetCallerPayerInputSchema,z as ShareAttributeInputSchema,O as ShareCredentialInputSchema,O as SharePreliminaryCredentialInputSchema,X as UnsetCallerPayerInputSchema,m as UpdateUserPubKeyAsInserterInputSchema,g as UpsertWalletAsInserterInputSchema,ee as WALLET_TYPES,_t as actionCostingFee,ut as actionCostingGas,ft as actionCostingIdosToken,te as actionSchema,Ne as addAttribute,Me as addAttributeAsInserter,ne as addUserAsInserter,y as addWallet,ue as addWalletMessage,a as addWalletTypeSchema,xt as addWallets,it as checkBalance,tt as checkCallerPayer,j as createCredentialsByDwg,j as createPreliminaryCredentialsByDwg,he as createPreliminaryCredential,me as credentialBroaderMessage,we as credentialExistAsInserter,Be as dwgMessage,Ie as editAttribute,be as editPublicNotesAsIssuer,s as encryptionPasswordStoreSchema,Xe as getAccessGrantsForCredential,U as getAccessGrantsGranted,Ke as getAccessGrantsGrantedCount,Ue as getAccessGrantsOwned,lt as getAllowance,Fe as getAttributes,Ee as getCredentialOwned,Oe as getCredentialShared,_e as getCredentials,ye as getCredentialsSharedByUser,wt as getGrants,ht as getIssuerFee,Ae as getSiblingCredentialId,ae as getUser,se as getUserAsInserter,ot as getWalletWithBalance,fe as getWallets,Je as hasLockedAccessGrants,Qe as hasProfile,Le as removeAttribute,xe as removeCredential,x as removeWallet,St as removeWallets,yt as requestBalanceWithdrawal,st as requestWithdrawal,Se as rescindSharedCredential,Ve as revokeAccessGrant,$e as setCallerPayer,Re as shareAttribute,k as shareCredential,k as sharePreliminaryCredential,bt as toDelegatedWriteGrantBaseParams,nt as unsetCallerPayer,re as updateUserPubKeyAsInserter,ce as upsertWalletAsInserter,r as walletTypeSchema};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|