@@ -127,6 +127,45 @@ apiInfo =
127127 let unsignedTxObjectName = " UnsignedTx"
128128 signedTxObjectName = " SignedTx"
129129 grpcConnectionName = " GrpcConnection"
130+ walletObjectName = " Wallet"
131+
132+ walletObj =
133+ VirtualObjectInfo
134+ { virtualObjectName = walletObjectName
135+ , virtualObjectDoc = " Represents a wallet."
136+ , virtualObjectMethods =
137+ [ MethodInfo
138+ { methodName = " getAddressBech32"
139+ , methodDoc = " Get the Bech32 representation of the address. (Can be shared for receiving funds.)"
140+ , methodParams = []
141+ , methodReturnType = OtherType " string"
142+ , methodReturnDoc = " The Bech32 representation of the address."
143+ }
144+ , MethodInfo
145+ { methodName = " getBech32ForVerificationKey"
146+ , methodDoc =
147+ " Get the Bech32 representation of the verification key of the wallet. (Can be shared for verification.)"
148+ , methodParams = []
149+ , methodReturnType = OtherType " string"
150+ , methodReturnDoc = " The Bech32 representation of the verification key."
151+ }
152+ , MethodInfo
153+ { methodName = " getBech32ForSigningKey"
154+ , methodDoc =
155+ " Get the Bech32 representation of the signing key of the wallet. (Must be kept secret.)"
156+ , methodParams = []
157+ , methodReturnType = OtherType " string"
158+ , methodReturnDoc = " The Bech32 representation of the signing key."
159+ }
160+ , MethodInfo
161+ { methodName = " getBase16ForVerificationKeyHash"
162+ , methodDoc = " Get the base16 representation of the hash of the verification key of the wallet."
163+ , methodParams = []
164+ , methodReturnType = OtherType " string"
165+ , methodReturnDoc = " The base16 representation of the verification key hash."
166+ }
167+ ]
168+ }
130169
131170 unsignedTxObj =
132171 VirtualObjectInfo
@@ -242,9 +281,40 @@ apiInfo =
242281 , methodReturnType = NewObject grpcConnectionName
243282 , methodReturnDoc = " A promise that resolves to a new `GrpcConnection`."
244283 }
284+ , MethodInfo
285+ { methodName = " generatePaymentWallet"
286+ , methodDoc = " Generate a simple payment wallet for mainnet."
287+ , methodParams = []
288+ , methodReturnType = NewObject walletObjectName
289+ , methodReturnDoc = " A promise that resolves to a new `Wallet` object."
290+ }
291+ , MethodInfo
292+ { methodName = " restorePaymentWalletFromSigningKeyBech32"
293+ , methodDoc = " Restore a mainnet payment wallet from a Bech32 encoded signing key."
294+ , methodParams = [ParamInfo " signingKeyBech32" " string" " The Bech32 encoded signing key." ]
295+ , methodReturnType = NewObject walletObjectName
296+ , methodReturnDoc = " A promise that resolves to a new `Wallet` object."
297+ }
298+ , MethodInfo
299+ { methodName = " generateTestnetPaymentWallet"
300+ , methodDoc = " Generate a simple payment wallet for testnet, given the testnet's network magic."
301+ , methodParams = [ParamInfo " networkMagic" " number" " The network magic for the testnet." ]
302+ , methodReturnType = NewObject walletObjectName
303+ , methodReturnDoc = " A promise that resolves to a new `Wallet` object."
304+ }
305+ , MethodInfo
306+ { methodName = " restoreTestnetPaymentWalletFromSigningKeyBech32"
307+ , methodDoc = " Restore a testnet payment wallet from a Bech32 encoded signing key."
308+ , methodParams =
309+ [ ParamInfo " networkMagic" " number" " The network magic for the testnet."
310+ , ParamInfo " signingKeyBech32" " string" " The Bech32 encoded signing key."
311+ ]
312+ , methodReturnType = NewObject walletObjectName
313+ , methodReturnDoc = " A promise that resolves to a new `Wallet` object."
314+ }
245315 ]
246316 }
247- , virtualObjects = [unsignedTxObj, signedTxObj, grpcConnection]
317+ , virtualObjects = [unsignedTxObj, signedTxObj, grpcConnection, walletObj ]
248318 , initialiseFunctionDoc = " Initialises the Cardano API."
249319 , initialiseFunctionReturnDoc = " A promise that resolves to the main `CardanoAPI` object."
250320 }
0 commit comments