|
1 | 1 | import { Signer } from '../types/crypto'; |
2 | 2 | import { PublicKey, Transaction, TransactionSignature } from '@solana/web3.js'; |
3 | 3 | import { Cryptid, CryptidOptions, DEFAULT_CRYPTID_OPTIONS } from './cryptid'; |
4 | | -import { addKey as addKeyTransaction } from '../lib/solana/transactions/did/addKey'; |
5 | | -import { removeKey as removeKeyTransaction } from '../lib/solana/transactions/did/removeKey'; |
6 | | -import { addService as addServiceTransaction } from '../lib/solana/transactions/did/addService'; |
7 | | -import { removeService as removeServiceTransaction } from '../lib/solana/transactions/did/removeService'; |
8 | | -import { addController as addControllerTransaction } from '../lib/solana/transactions/did/addController'; |
9 | | -import { removeController as removeControllerTransaction } from '../lib/solana/transactions/did/removeController'; |
10 | | -import { DIDDocument, ServiceEndpoint } from 'did-resolver'; |
| 4 | +// import { addKey as addKeyTransaction } from '../lib/solana/transactions/did/addKey'; |
| 5 | +import { DIDDocument } from 'did-resolver'; |
11 | 6 | import { DidSolIdentifier, DidSolService } from '@identity.com/sol-did-client'; |
12 | 7 | import { didToDefaultDOASigner } from '../lib/util'; |
13 | 8 | import { CRYPTID_PROGRAM_ID } from '../lib/constants'; |
@@ -96,97 +91,22 @@ export abstract class AbstractCryptid implements Cryptid { |
96 | 91 | } |
97 | 92 | } |
98 | 93 |
|
99 | | - async addKey( |
100 | | - publicKey: PublicKey, |
101 | | - alias: string |
102 | | - ): Promise<TransactionSignature> { |
103 | | - const signer = await this.getSignerForInternalTransaction(); |
104 | | - const authority = await this.signer.publicKey; |
105 | | - const transaction = await addKeyTransaction( |
106 | | - this.options.connection, |
107 | | - this.did, |
108 | | - signer, |
109 | | - publicKey, |
110 | | - alias, |
111 | | - authority |
112 | | - ); |
113 | | - return this.send(transaction); |
114 | | - } |
115 | | - |
116 | | - async removeKey(alias: string): Promise<TransactionSignature> { |
117 | | - const signer = await this.getSignerForInternalTransaction(); |
118 | | - const authority = await this.signer.publicKey; |
119 | | - |
120 | | - const transaction = await removeKeyTransaction( |
121 | | - this.options.connection, |
122 | | - this.did, |
123 | | - signer, |
124 | | - alias, |
125 | | - authority |
126 | | - ); |
127 | | - |
128 | | - return this.send(transaction); |
129 | | - } |
130 | | - |
131 | | - async addService(service: ServiceEndpoint): Promise<TransactionSignature> { |
132 | | - const signer = await this.getSignerForInternalTransaction(); |
133 | | - const authority = await this.signer.publicKey; |
134 | | - |
135 | | - const transaction = await addServiceTransaction( |
136 | | - this.options.connection, |
137 | | - this.did, |
138 | | - signer, |
139 | | - service, |
140 | | - authority |
141 | | - ); |
142 | | - |
143 | | - return this.send(transaction); |
144 | | - } |
145 | | - |
146 | | - async removeService(alias: string): Promise<TransactionSignature> { |
147 | | - const signer = await this.getSignerForInternalTransaction(); |
148 | | - const authority = await this.signer.publicKey; |
149 | | - |
150 | | - const transaction = await removeServiceTransaction( |
151 | | - this.options.connection, |
152 | | - this.did, |
153 | | - signer, |
154 | | - alias, |
155 | | - authority |
156 | | - ); |
157 | | - |
158 | | - return this.send(transaction); |
159 | | - } |
160 | | - |
161 | | - async addController(controller: string): Promise<TransactionSignature> { |
162 | | - const signer = await this.getSignerForInternalTransaction(); |
163 | | - const authority = await this.signer.publicKey; |
164 | | - |
165 | | - const transaction = await addControllerTransaction( |
166 | | - this.options.connection, |
167 | | - this.did, |
168 | | - signer, |
169 | | - controller, |
170 | | - authority |
171 | | - ); |
172 | | - |
173 | | - return this.send(transaction); |
174 | | - } |
175 | | - |
176 | | - async removeController(controller: string): Promise<TransactionSignature> { |
177 | | - const signer = await this.getSignerForInternalTransaction(); |
178 | | - const authority = await this.signer.publicKey; |
179 | | - |
180 | | - const transaction = await removeControllerTransaction( |
181 | | - this.options.connection, |
182 | | - this.did, |
183 | | - signer, |
184 | | - controller, |
185 | | - authority |
186 | | - ); |
187 | | - |
188 | | - return this.send(transaction); |
189 | | - } |
| 94 | +// async addKey( |
| 95 | +// publicKey: PublicKey, |
| 96 | +// alias: string |
| 97 | +// ): Promise<TransactionSignature> { |
| 98 | +// const signer = await this.getSignerForInternalTransaction(); |
| 99 | +// const authority = await this.signer.publicKey; |
| 100 | +// const transaction = await addKeyTransaction( |
| 101 | +// this.options.connection, |
| 102 | +// this.did, |
| 103 | +// signer, |
| 104 | +// publicKey, |
| 105 | +// alias, |
| 106 | +// authority |
| 107 | +// ); |
| 108 | +// return this.send(transaction); |
| 109 | +// } |
190 | 110 |
|
191 | 111 | // Base case for collecting all additional keys that must be provided when signing |
192 | 112 | // a transaction with controller chains. Each controller layer adds an additional key here |
|
0 commit comments