@demox-labs/aleo-wallet-adapter-leo
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -5,5 +5,3 @@ import { | ||
scopePollingDetectionStrategy, | ||
WalletAccountError, | ||
WalletConnectionError, | ||
WalletRequestViewKeyError, | ||
WalletDisconnectionError, | ||
@@ -32,5 +30,3 @@ WalletName, | ||
publicKey?: string; | ||
viewKey?: string; | ||
signMessage(message: Uint8Array): Promise<{ signature: Uint8Array }>; | ||
requestViewKey(): Promise<{ viewKey: string }>; | ||
decrypt(cipherText: string, tpk?: string, programId?: string, functionName?: string, index?: number): Promise<{ text: string }>, | ||
@@ -44,3 +40,5 @@ requestRecords(program: string): Promise<{ records: any[] }>, | ||
getExecution(transactionId: string): Promise<{ execution: string }>, | ||
connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork): Promise<void>; | ||
requestRecordPlaintexts(program: string): Promise<{ records: any[] }>, | ||
requestTransactionHistory(program: string): Promise<{ transactions: any[] }>, | ||
connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork, programs?: string[]): Promise<void>; | ||
disconnect(): Promise<void>; | ||
@@ -73,3 +71,2 @@ } | ||
private _decryptPermission: string; | ||
private _viewKey: string | null; | ||
private _readyState: WalletReadyState = | ||
@@ -86,3 +83,2 @@ typeof window === 'undefined' || typeof document === 'undefined' | ||
this._decryptPermission = DecryptPermission.NoDecrypt; | ||
this._viewKey = null; | ||
@@ -105,6 +101,2 @@ if (this._readyState !== WalletReadyState.Unsupported) { | ||
get viewKey() { | ||
return this._viewKey; | ||
} | ||
get decryptPermission() { | ||
@@ -136,3 +128,3 @@ return this._decryptPermission; | ||
case DecryptPermission.AutoDecrypt: | ||
case DecryptPermission.ViewKeyAccess: | ||
case DecryptPermission.OnChainHistory: | ||
{ | ||
@@ -268,4 +260,38 @@ try { | ||
async connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork): Promise<void> { | ||
async requestRecordPlaintexts(program: string): Promise<any[]> { | ||
try { | ||
const wallet = this._wallet; | ||
if (!wallet || !this.publicKey) throw new WalletNotConnectedError(); | ||
try { | ||
const result = await wallet.requestRecordPlaintexts(program); | ||
return result.records; | ||
} catch (error: any) { | ||
throw new WalletRecordsError(error?.message, error); | ||
} | ||
} catch (error: any) { | ||
this.emit('error', error); | ||
throw error; | ||
} | ||
} | ||
async requestTransactionHistory(program: string): Promise<any[]> { | ||
try { | ||
const wallet = this._wallet; | ||
if (!wallet || !this.publicKey) throw new WalletNotConnectedError(); | ||
try { | ||
const result = await wallet.requestTransactionHistory(program); | ||
return result.transactions; | ||
} catch (error: any) { | ||
throw new WalletRecordsError(error?.message, error); | ||
} | ||
} catch (error: any) { | ||
this.emit('error', error); | ||
throw error; | ||
} | ||
} | ||
async connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork, programs?: string[]): Promise<void> { | ||
try { | ||
if (this.connected || this.connecting) return; | ||
@@ -280,3 +306,3 @@ if (this._readyState !== WalletReadyState.Installed) throw new WalletNotReadyError(); | ||
try { | ||
await wallet.connect(decryptPermission, network); | ||
await wallet.connect(decryptPermission, network, programs); | ||
if (!wallet?.publicKey) { | ||
@@ -292,3 +318,2 @@ throw new WalletConnectionError(); | ||
this._decryptPermission = decryptPermission; | ||
this._viewKey = this._viewKey; | ||
@@ -338,19 +363,2 @@ this.emit('connect', this._publicKey); | ||
} | ||
async requestViewKey(): Promise<string> { | ||
try { | ||
const wallet = this._wallet; | ||
if (!wallet || !this.publicKey) throw new WalletNotConnectedError(); | ||
try { | ||
const viewKey = await wallet.requestViewKey(); | ||
return viewKey.viewKey; | ||
} catch (error: any) { | ||
throw new WalletRequestViewKeyError(error?.message, error); | ||
} | ||
} catch (error: any) { | ||
this.emit('error', error); | ||
throw error; | ||
} | ||
} | ||
} |
@@ -8,9 +8,5 @@ import { BaseMessageSignerWalletAdapter, EventEmitter, WalletName, WalletReadyState, DecryptPermission, WalletAdapterNetwork, AleoTransaction, AleoDeployment } from '@demox-labs/aleo-wallet-adapter-base'; | ||
publicKey?: string; | ||
viewKey?: string; | ||
signMessage(message: Uint8Array): Promise<{ | ||
signature: Uint8Array; | ||
}>; | ||
requestViewKey(): Promise<{ | ||
viewKey: string; | ||
}>; | ||
decrypt(cipherText: string, tpk?: string, programId?: string, functionName?: string, index?: number): Promise<{ | ||
@@ -40,3 +36,9 @@ text: string; | ||
}>; | ||
connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork): Promise<void>; | ||
requestRecordPlaintexts(program: string): Promise<{ | ||
records: any[]; | ||
}>; | ||
requestTransactionHistory(program: string): Promise<{ | ||
transactions: any[]; | ||
}>; | ||
connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork, programs?: string[]): Promise<void>; | ||
disconnect(): Promise<void>; | ||
@@ -61,7 +63,5 @@ } | ||
private _decryptPermission; | ||
private _viewKey; | ||
private _readyState; | ||
constructor({ appName }?: LeoWalletAdapterConfig); | ||
get publicKey(): string; | ||
get viewKey(): string; | ||
get decryptPermission(): string; | ||
@@ -79,6 +79,7 @@ get connecting(): boolean; | ||
getExecution(transactionId: string): Promise<string>; | ||
connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork): Promise<void>; | ||
requestRecordPlaintexts(program: string): Promise<any[]>; | ||
requestTransactionHistory(program: string): Promise<any[]>; | ||
connect(decryptPermission: DecryptPermission, network: WalletAdapterNetwork, programs?: string[]): Promise<void>; | ||
disconnect(): Promise<void>; | ||
signMessage(message: Uint8Array): Promise<Uint8Array>; | ||
requestViewKey(): Promise<string>; | ||
} |
@@ -1,2 +0,2 @@ | ||
import { BaseMessageSignerWalletAdapter, scopePollingDetectionStrategy, WalletConnectionError, WalletRequestViewKeyError, WalletDisconnectionError, WalletNotConnectedError, WalletNotReadyError, WalletReadyState, WalletSignTransactionError, WalletDecryptionNotAllowedError, WalletDecryptionError, WalletRecordsError, DecryptPermission, WalletTransactionError, } from '@demox-labs/aleo-wallet-adapter-base'; | ||
import { BaseMessageSignerWalletAdapter, scopePollingDetectionStrategy, WalletConnectionError, WalletDisconnectionError, WalletNotConnectedError, WalletNotReadyError, WalletReadyState, WalletSignTransactionError, WalletDecryptionNotAllowedError, WalletDecryptionError, WalletRecordsError, DecryptPermission, WalletTransactionError, } from '@demox-labs/aleo-wallet-adapter-base'; | ||
export const LeoWalletName = 'Leo Wallet'; | ||
@@ -12,3 +12,2 @@ export class LeoWalletAdapter extends BaseMessageSignerWalletAdapter { | ||
_decryptPermission; | ||
_viewKey; | ||
_readyState = typeof window === 'undefined' || typeof document === 'undefined' | ||
@@ -23,3 +22,2 @@ ? WalletReadyState.Unsupported | ||
this._decryptPermission = DecryptPermission.NoDecrypt; | ||
this._viewKey = null; | ||
if (this._readyState !== WalletReadyState.Unsupported) { | ||
@@ -39,5 +37,2 @@ scopePollingDetectionStrategy(() => { | ||
} | ||
get viewKey() { | ||
return this._viewKey; | ||
} | ||
get decryptPermission() { | ||
@@ -65,3 +60,3 @@ return this._decryptPermission; | ||
case DecryptPermission.AutoDecrypt: | ||
case DecryptPermission.ViewKeyAccess: | ||
case DecryptPermission.OnChainHistory: | ||
{ | ||
@@ -211,4 +206,40 @@ try { | ||
} | ||
async connect(decryptPermission, network) { | ||
async requestRecordPlaintexts(program) { | ||
try { | ||
const wallet = this._wallet; | ||
if (!wallet || !this.publicKey) | ||
throw new WalletNotConnectedError(); | ||
try { | ||
const result = await wallet.requestRecordPlaintexts(program); | ||
return result.records; | ||
} | ||
catch (error) { | ||
throw new WalletRecordsError(error?.message, error); | ||
} | ||
} | ||
catch (error) { | ||
this.emit('error', error); | ||
throw error; | ||
} | ||
} | ||
async requestTransactionHistory(program) { | ||
try { | ||
const wallet = this._wallet; | ||
if (!wallet || !this.publicKey) | ||
throw new WalletNotConnectedError(); | ||
try { | ||
const result = await wallet.requestTransactionHistory(program); | ||
return result.transactions; | ||
} | ||
catch (error) { | ||
throw new WalletRecordsError(error?.message, error); | ||
} | ||
} | ||
catch (error) { | ||
this.emit('error', error); | ||
throw error; | ||
} | ||
} | ||
async connect(decryptPermission, network, programs) { | ||
try { | ||
if (this.connected || this.connecting) | ||
@@ -222,3 +253,3 @@ return; | ||
try { | ||
await wallet.connect(decryptPermission, network); | ||
await wallet.connect(decryptPermission, network, programs); | ||
if (!wallet?.publicKey) { | ||
@@ -234,3 +265,2 @@ throw new WalletConnectionError(); | ||
this._decryptPermission = decryptPermission; | ||
this._viewKey = this._viewKey; | ||
this.emit('connect', this._publicKey); | ||
@@ -279,21 +309,3 @@ } | ||
} | ||
async requestViewKey() { | ||
try { | ||
const wallet = this._wallet; | ||
if (!wallet || !this.publicKey) | ||
throw new WalletNotConnectedError(); | ||
try { | ||
const viewKey = await wallet.requestViewKey(); | ||
return viewKey.viewKey; | ||
} | ||
catch (error) { | ||
throw new WalletRequestViewKeyError(error?.message, error); | ||
} | ||
} | ||
catch (error) { | ||
this.emit('error', error); | ||
throw error; | ||
} | ||
} | ||
} | ||
//# sourceMappingURL=adapter.js.map |
@@ -23,3 +23,2 @@ [@demox-labs/aleo-wallet-adapter-leo](../README.md) / [Exports](../modules.md) / LeoWalletAdapter | ||
- [\_readyState](LeoWalletAdapter.md#_readystate) | ||
- [\_viewKey](LeoWalletAdapter.md#_viewkey) | ||
- [\_wallet](LeoWalletAdapter.md#_wallet) | ||
@@ -39,3 +38,2 @@ - [icon](LeoWalletAdapter.md#icon) | ||
- [readyState](LeoWalletAdapter.md#readystate) | ||
- [viewKey](LeoWalletAdapter.md#viewkey) | ||
@@ -61,5 +59,6 @@ ### Methods | ||
- [requestExecution](LeoWalletAdapter.md#requestexecution) | ||
- [requestRecordPlaintexts](LeoWalletAdapter.md#requestrecordplaintexts) | ||
- [requestRecords](LeoWalletAdapter.md#requestrecords) | ||
- [requestTransaction](LeoWalletAdapter.md#requesttransaction) | ||
- [requestViewKey](LeoWalletAdapter.md#requestviewkey) | ||
- [requestTransactionHistory](LeoWalletAdapter.md#requesttransactionhistory) | ||
- [signMessage](LeoWalletAdapter.md#signmessage) | ||
@@ -86,3 +85,3 @@ - [transactionStatus](LeoWalletAdapter.md#transactionstatus) | ||
[adapter.ts:76](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L76) | ||
[adapter.ts:73](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L73) | ||
@@ -97,3 +96,3 @@ ## Properties | ||
[adapter.ts:66](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L66) | ||
[adapter.ts:64](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L64) | ||
@@ -108,3 +107,3 @@ ___ | ||
[adapter.ts:69](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L69) | ||
[adapter.ts:67](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L67) | ||
@@ -119,3 +118,3 @@ ___ | ||
[adapter.ts:68](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L68) | ||
[adapter.ts:66](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L66) | ||
@@ -130,16 +129,6 @@ ___ | ||
[adapter.ts:71](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L71) | ||
[adapter.ts:68](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L68) | ||
___ | ||
### \_viewKey | ||
• `Private` **\_viewKey**: `string` | ||
#### Defined in | ||
[adapter.ts:70](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L70) | ||
___ | ||
### \_wallet | ||
@@ -151,3 +140,3 @@ | ||
[adapter.ts:67](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L67) | ||
[adapter.ts:65](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L65) | ||
@@ -166,3 +155,3 @@ ___ | ||
[adapter.ts:62](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L62) | ||
[adapter.ts:60](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L60) | ||
@@ -181,3 +170,3 @@ ___ | ||
[adapter.ts:60](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L60) | ||
[adapter.ts:58](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L58) | ||
@@ -196,3 +185,3 @@ ___ | ||
[adapter.ts:64](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L64) | ||
[adapter.ts:62](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L62) | ||
@@ -211,3 +200,3 @@ ___ | ||
[adapter.ts:61](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L61) | ||
[adapter.ts:59](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L59) | ||
@@ -244,3 +233,3 @@ ___ | ||
node_modules/@demox-labs/aleo-wallet-adapter-base/dist/adapter.d.ts:65 | ||
node_modules/@demox-labs/aleo-wallet-adapter-base/dist/adapter.d.ts:63 | ||
@@ -263,3 +252,3 @@ ___ | ||
[adapter.ts:108](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L108) | ||
[adapter.ts:100](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L100) | ||
@@ -278,3 +267,3 @@ ___ | ||
[adapter.ts:104](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L104) | ||
[adapter.ts:96](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L96) | ||
@@ -297,3 +286,3 @@ ___ | ||
[adapter.ts:96](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L96) | ||
[adapter.ts:92](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L92) | ||
@@ -316,3 +305,3 @@ ___ | ||
[adapter.ts:112](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L112) | ||
[adapter.ts:104](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L104) | ||
@@ -337,22 +326,4 @@ • `set` **readyState**(`readyState`): `void` | ||
[adapter.ts:116](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L116) | ||
[adapter.ts:108](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L108) | ||
___ | ||
### viewKey | ||
• `get` **viewKey**(): `string` | ||
#### Returns | ||
`string` | ||
#### Overrides | ||
BaseMessageSignerWalletAdapter.viewKey | ||
#### Defined in | ||
[adapter.ts:100](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L100) | ||
## Methods | ||
@@ -394,3 +365,3 @@ | ||
▸ **connect**(`decryptPermission`, `network`): `Promise`<`void`\> | ||
▸ **connect**(`decryptPermission`, `network`, `programs?`): `Promise`<`void`\> | ||
@@ -403,2 +374,3 @@ #### Parameters | ||
| `network` | `Testnet` | | ||
| `programs?` | `string`[] | | ||
@@ -415,3 +387,3 @@ #### Returns | ||
[adapter.ts:261](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L261) | ||
[adapter.ts:287](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L287) | ||
@@ -444,3 +416,3 @@ ___ | ||
[adapter.ts:120](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L120) | ||
[adapter.ts:112](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L112) | ||
@@ -463,3 +435,3 @@ ___ | ||
[adapter.ts:294](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L294) | ||
[adapter.ts:319](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L319) | ||
@@ -542,3 +514,3 @@ ___ | ||
[adapter.ts:245](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L245) | ||
[adapter.ts:237](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L237) | ||
@@ -787,3 +759,3 @@ ___ | ||
[adapter.ts:197](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L197) | ||
[adapter.ts:189](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L189) | ||
@@ -812,3 +784,3 @@ ___ | ||
[adapter.ts:213](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L213) | ||
[adapter.ts:205](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L205) | ||
@@ -837,6 +809,30 @@ ___ | ||
[adapter.ts:181](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L181) | ||
[adapter.ts:173](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L173) | ||
___ | ||
### requestRecordPlaintexts | ||
▸ **requestRecordPlaintexts**(`program`): `Promise`<`any`[]\> | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `program` | `string` | | ||
#### Returns | ||
`Promise`<`any`[]\> | ||
#### Overrides | ||
BaseMessageSignerWalletAdapter.requestRecordPlaintexts | ||
#### Defined in | ||
[adapter.ts:253](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L253) | ||
___ | ||
### requestRecords | ||
@@ -862,3 +858,3 @@ | ||
[adapter.ts:148](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L148) | ||
[adapter.ts:140](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L140) | ||
@@ -887,21 +883,27 @@ ___ | ||
[adapter.ts:165](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L165) | ||
[adapter.ts:157](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L157) | ||
___ | ||
### requestViewKey | ||
### requestTransactionHistory | ||
▸ **requestViewKey**(): `Promise`<`string`\> | ||
▸ **requestTransactionHistory**(`program`): `Promise`<`any`[]\> | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `program` | `string` | | ||
#### Returns | ||
`Promise`<`string`\> | ||
`Promise`<`any`[]\> | ||
#### Overrides | ||
BaseMessageSignerWalletAdapter.requestViewKey | ||
BaseMessageSignerWalletAdapter.requestTransactionHistory | ||
#### Defined in | ||
[adapter.ts:329](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L329) | ||
[adapter.ts:270](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L270) | ||
@@ -930,3 +932,3 @@ ___ | ||
[adapter.ts:312](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L312) | ||
[adapter.ts:337](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L337) | ||
@@ -955,2 +957,2 @@ ___ | ||
[adapter.ts:229](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L229) | ||
[adapter.ts:221](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L221) |
@@ -16,3 +16,2 @@ [@demox-labs/aleo-wallet-adapter-leo](../README.md) / [Exports](../modules.md) / LeoWallet | ||
- [publicKey](LeoWallet.md#publickey) | ||
- [viewKey](LeoWallet.md#viewkey) | ||
@@ -38,5 +37,6 @@ ### Methods | ||
- [requestExecution](LeoWallet.md#requestexecution) | ||
- [requestRecordPlaintexts](LeoWallet.md#requestrecordplaintexts) | ||
- [requestRecords](LeoWallet.md#requestrecords) | ||
- [requestTransaction](LeoWallet.md#requesttransaction) | ||
- [requestViewKey](LeoWallet.md#requestviewkey) | ||
- [requestTransactionHistory](LeoWallet.md#requesttransactionhistory) | ||
- [signMessage](LeoWallet.md#signmessage) | ||
@@ -53,14 +53,4 @@ - [transactionStatus](LeoWallet.md#transactionstatus) | ||
[adapter.ts:30](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L30) | ||
[adapter.ts:28](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L28) | ||
___ | ||
### viewKey | ||
• `Optional` **viewKey**: `string` | ||
#### Defined in | ||
[adapter.ts:31](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L31) | ||
## Methods | ||
@@ -102,3 +92,3 @@ | ||
▸ **connect**(`decryptPermission`, `network`): `Promise`<`void`\> | ||
▸ **connect**(`decryptPermission`, `network`, `programs?`): `Promise`<`void`\> | ||
@@ -111,2 +101,3 @@ #### Parameters | ||
| `network` | `Testnet` | | ||
| `programs?` | `string`[] | | ||
@@ -119,3 +110,3 @@ #### Returns | ||
[adapter.ts:42](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L42) | ||
[adapter.ts:40](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L40) | ||
@@ -144,3 +135,3 @@ ___ | ||
[adapter.ts:34](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L34) | ||
[adapter.ts:30](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L30) | ||
@@ -159,3 +150,3 @@ ___ | ||
[adapter.ts:43](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L43) | ||
[adapter.ts:41](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L41) | ||
@@ -234,3 +225,3 @@ ___ | ||
[adapter.ts:41](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L41) | ||
[adapter.ts:37](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L37) | ||
@@ -475,3 +466,3 @@ ___ | ||
[adapter.ts:38](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L38) | ||
[adapter.ts:34](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L34) | ||
@@ -496,3 +487,3 @@ ___ | ||
[adapter.ts:39](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L39) | ||
[adapter.ts:35](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L35) | ||
@@ -517,6 +508,26 @@ ___ | ||
[adapter.ts:37](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L37) | ||
[adapter.ts:33](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L33) | ||
___ | ||
### requestRecordPlaintexts | ||
▸ **requestRecordPlaintexts**(`program`): `Promise`<{ `records`: `any`[] }\> | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `program` | `string` | | ||
#### Returns | ||
`Promise`<{ `records`: `any`[] }\> | ||
#### Defined in | ||
[adapter.ts:38](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L38) | ||
___ | ||
### requestRecords | ||
@@ -538,3 +549,3 @@ | ||
[adapter.ts:35](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L35) | ||
[adapter.ts:31](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L31) | ||
@@ -559,17 +570,23 @@ ___ | ||
[adapter.ts:36](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L36) | ||
[adapter.ts:32](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L32) | ||
___ | ||
### requestViewKey | ||
### requestTransactionHistory | ||
▸ **requestViewKey**(): `Promise`<{ `viewKey`: `string` }\> | ||
▸ **requestTransactionHistory**(`program`): `Promise`<{ `transactions`: `any`[] }\> | ||
#### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `program` | `string` | | ||
#### Returns | ||
`Promise`<{ `viewKey`: `string` }\> | ||
`Promise`<{ `transactions`: `any`[] }\> | ||
#### Defined in | ||
[adapter.ts:33](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L33) | ||
[adapter.ts:39](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L39) | ||
@@ -594,3 +611,3 @@ ___ | ||
[adapter.ts:32](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L32) | ||
[adapter.ts:29](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L29) | ||
@@ -615,2 +632,2 @@ ___ | ||
[adapter.ts:40](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L40) | ||
[adapter.ts:36](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L36) |
@@ -19,2 +19,2 @@ [@demox-labs/aleo-wallet-adapter-leo](../README.md) / [Exports](../modules.md) / LeoWalletAdapterConfig | ||
[adapter.ts:54](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L54) | ||
[adapter.ts:52](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L52) |
@@ -30,3 +30,3 @@ [@demox-labs/aleo-wallet-adapter-leo](../README.md) / [Exports](../modules.md) / LeoWalletEvents | ||
[adapter.ts:25](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L25) | ||
[adapter.ts:23](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L23) | ||
@@ -51,2 +51,2 @@ ___ | ||
[adapter.ts:26](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L26) | ||
[adapter.ts:24](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L24) |
@@ -30,2 +30,2 @@ [@demox-labs/aleo-wallet-adapter-leo](README.md) / Exports | ||
[adapter.ts:57](https://github.com/demox-labs/leo-wallet-adapter/blob/21dd6ca/packages/wallets/leo/adapter.ts#L57) | ||
[adapter.ts:55](https://github.com/demox-labs/leo-wallet-adapter/blob/dbce117/packages/wallets/leo/adapter.ts#L55) |
@@ -249,1 +249,59 @@ @demox-labs/aleo-wallet-adapter-leo / [Exports](modules.md) | ||
``` | ||
### 🗂️Requesting Record Plaintexts | ||
This requires the `OnChainHistory` permission | ||
```tsx | ||
import { WalletNotConnectedError } from "@demox-labs/aleo-wallet-adapter-base"; | ||
import { useWallet } from "@demox-labs/aleo-wallet-adapter-react"; | ||
import React, { FC, useCallback } from "react"; | ||
export const RequestRecordPlaintexts: FC = () => { | ||
const { publicKey, requestRecordPlaintexts } = useWallet(); | ||
const onClick = async () => { | ||
const program = "credits.aleo"; | ||
if (!publicKey) throw new WalletNotConnectedError(); | ||
if (requestRecordPlaintexts) { | ||
const records = await requestRecordPlaintexts(program); | ||
console.log("Records: " + records); | ||
} | ||
}; | ||
return ( | ||
<button onClick={onClick} disabled={!publicKey}> | ||
Request Records Plaintexts | ||
</button> | ||
); | ||
}; | ||
``` | ||
### 🗂️Requesting Transaction History | ||
This requires the `OnChainHistory` permission | ||
```tsx | ||
import { WalletNotConnectedError } from "@demox-labs/aleo-wallet-adapter-base"; | ||
import { useWallet } from "@demox-labs/aleo-wallet-adapter-react"; | ||
import React, { FC, useCallback } from "react"; | ||
export const RequestRecords: FC = () => { | ||
const { publicKey, requestTransactionHistory } = useWallet(); | ||
const onClick = async () => { | ||
const program = "credits.aleo"; | ||
if (!publicKey) throw new WalletNotConnectedError(); | ||
if (requestTransactionHistory) { | ||
const transactions = await requestTransactionHistory(program); | ||
console.log("Transactions: " + transactions); | ||
} | ||
}; | ||
return ( | ||
<button onClick={onClick} disabled={!publicKey}> | ||
Request Records Transaction History | ||
</button> | ||
); | ||
}; | ||
``` |
{ | ||
"name": "@demox-labs/aleo-wallet-adapter-leo", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "Aleo wallet adapter for the Leo Wallet.", | ||
@@ -12,3 +12,3 @@ "module": "dist/index.js", | ||
"dependencies": { | ||
"@demox-labs/aleo-wallet-adapter-base": "^0.0.17", | ||
"@demox-labs/aleo-wallet-adapter-base": "^0.0.18", | ||
"nanoid": "^4.0.0" | ||
@@ -15,0 +15,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169347
821
307
+ Added@demox-labs/aleo-wallet-adapter-base@0.0.18(transitive)
- Removed@demox-labs/aleo-wallet-adapter-base@0.0.17(transitive)