Skip to content

Commit 55aa03d

Browse files
authored
refactor!: update sdk surface (#893)
* docs: update outdated docstrings * refactor!: drop export of signAndSubmitTx * docs: provide link to JSON Pointer RFC
1 parent 3c299bd commit 55aa03d

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

packages/credentials/src/holder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ function pointerToAttributeName(
5555
* @param credential A Verifiable Credential containing a proof.
5656
* @param proofOptions Options for creating the derived proof.
5757
* @param proofOptions.disclose Allows selecting which claims/attributes in the credential should be disclosed, hiding others.
58-
* @param proofOptions.disclose.only An array of credentialPath expressions selecting attributes to be disclosed.
58+
* @param proofOptions.disclose.only An array of {@link https://www.rfc-editor.org/info/rfc6901 JSON Pointer} expressions selecting attributes to be disclosed.
5959
* All other (non-mandatory) attributes that can be hidden will be hidden.
6060
* Takes precedence over `allBut`.
61-
* @param proofOptions.disclose.allBut An array of credentialPath expressions selecting attributes to be hidden.
61+
* @param proofOptions.disclose.allBut An array of {@link https://www.rfc-editor.org/info/rfc6901 JSON Pointer} expressions selecting attributes to be hidden.
6262
* This means that all other properties are being revealed.
6363
* Selecting mandatory properties will result in an error.
6464
* It is ignored if `only` is set.
@@ -121,7 +121,7 @@ export async function deriveProof(
121121
* @param credentials Array of one or more Verifiable Credentials to be included in the presentation.
122122
* @param holder Interfaces for interacting with the holder identity for the purpose of generating a presentation proof.
123123
* @param holder.did The Decentralized Identifier (DID) of the holder.
124-
* @param holder.didDocument The DID Document of the holder. If omitted, the holder DID will be resolved internally to retrieve the document.
124+
* @param holder.didDocument The DID Document of the holder.
125125
* @param holder.signers An array of signer interfaces, each allowing to request signatures made with a key associated with the holder DID Document.
126126
* The function will select the first signer that matches requirements around signature algorithm and relationship of the key to the DID as given by the DID Document.
127127
* @param presentationOptions Object holding optional arguments for scoping the presentation.

packages/credentials/src/issuer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import { SDKErrors } from '@kiltprotocol/utils'
1111
import { KiltAttestationProofV1, KiltCredentialV1 } from './V1/index.js'
1212
import type { UnsignedVc, VerifiableCredential } from './V1/types.js'
1313
import type { CTypeLoader } from './ctype/index.js'
14-
import type { IssuerOptions } from './interfaces.js'
14+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
15+
import type { IssuerOptions, SubmitOverride } from './interfaces.js'
1516

1617
export type { IssuerOptions }
1718

@@ -91,15 +92,14 @@ export async function createCredential({
9192
*
9293
* @param credential A credential document as returned by {@link createCredential}.
9394
* @param issuer Interfaces for interacting with the issuer identity for the purpose of generating a proof.
94-
* @param issuer.did The Decentralized Identifier (DID) of the issuer.
95-
* @param issuer.didDocument The DID Document of the issuer. If omitted, the issuer DID will be resolved internally to retrieve the document.
95+
* @param issuer.didDocument The DID Document of the issuer.
9696
* @param issuer.signers An array of signer interfaces, each allowing to request signatures made with a key associated with the issuer DID Document.
9797
* The function will select the first signer that matches requirements around signature algorithm and relationship of the key to the DID as given by the DID Document.
98-
* @param issuer.submitterAccount Some proof types require making transactions to effect state changes on the KILT blockchain.
98+
* @param issuer.submitter Some proof types require making transactions to effect state changes on the KILT blockchain.
9999
* The blockchain account whose address is specified here will be used to cover all transaction fees and deposits due for this operation.
100100
* As transactions to the blockchain need to be signed, `signers` is expected to contain a signer interface where the `id` matches this address.
101-
* @param issuer.authorizeTx Optional. Allows customizing the way state changes on the KILT blockchain are authorized with a signature made with one of the issuer's DID keys.
102-
* @param issuer.submitTx Optional. Allows customizing the way transactions are signed by the submitter account and submitted to the KILT blockchain.
101+
*
102+
* Alternatively, you can pass a {@link SubmitOverride} callback that takes care of Did-authorizing and submitting the transaction.
103103
* If you are using a service that helps you submit and pay for transactions, this is your point of integration to it.
104104
* @param proofOptions Options that control proof generation.
105105
* @param proofOptions.proofType The type of proof to be created.

packages/sdk-js/src/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,10 @@
1212
import { Holder, Issuer, Verifier } from '@kiltprotocol/credentials'
1313
import { ConfigService } from '@kiltprotocol/config'
1414
import { Signers } from '@kiltprotocol/utils'
15-
import {
16-
connect,
17-
disconnect,
18-
init,
19-
Blockchain,
20-
} from '@kiltprotocol/chain-helpers'
15+
import { connect, disconnect, init } from '@kiltprotocol/chain-helpers'
2116
import { resolver as DidResolver } from '@kiltprotocol/did'
2217
import * as DidHelpers from './DidHelpers/index.js'
2318

24-
const { signAndSubmitTx } = Blockchain // TODO: maybe we don't even need that if we have the identity class
2519
const { getSignersForKeypair, generateKeypair } = Signers
2620

2721
export {
@@ -34,7 +28,6 @@ export {
3428
Issuer,
3529
getSignersForKeypair,
3630
generateKeypair,
37-
signAndSubmitTx,
3831
ConfigService,
3932
DidHelpers,
4033
}

0 commit comments

Comments
 (0)