Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Added cross-fetch as an explicit dependency to not rely on it coming from algosdk #106

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/code/classes/testing.TestLogger.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,6 @@ This helps ensure that the provided configuration items won't appear

https://jestjs.io/docs/snapshot-testing#2-tests-should-be-deterministic

**`Example`**

Jest Example
```typescript
const logger = new TestLogger()
...
expect(logger.getLogSnapshot()).toMatchSnapshot()
```

#### Parameters

| Name | Type | Description |
Expand All @@ -189,6 +180,15 @@ expect(logger.getLogSnapshot()).toMatchSnapshot()

The snapshotted logs.

**`Example`**

Jest Example
```typescript
const logger = new TestLogger()
...
expect(logger.getLogSnapshot()).toMatchSnapshot()
```

#### Defined in

[src/testing/test-logger.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L47)
Expand Down
8 changes: 4 additions & 4 deletions docs/code/classes/types_logic_error.LogicError.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ ___

Optional override for formatting stack traces

**`See`**

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

##### Parameters

| Name | Type |
Expand All @@ -168,6 +164,10 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces

`any`

**`See`**

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

#### Inherited from

Error.prepareStackTrace
Expand Down
8 changes: 4 additions & 4 deletions docs/code/interfaces/types_testing.AlgorandFixture.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Testing framework agnostic handler method to run before each test to prepare the
Retrieve the current context.
Useful with destructuring.

#### Returns

[`AlgorandTestAutomationContext`](types_testing.AlgorandTestAutomationContext.md)

**`Example`**

```typescript
Expand All @@ -53,10 +57,6 @@ test('My test', () => {
})
```

#### Returns

[`AlgorandTestAutomationContext`](types_testing.AlgorandTestAutomationContext.md)

#### Defined in

[src/types/testing.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/testing.ts#L63)
156 changes: 78 additions & 78 deletions docs/code/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,20 @@ ___

▸ **getAccount**(`account`, `algod`, `kmdClient?`): `Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\>

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `account` | `string` \| { `fundWith?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `name`: `string` } | The details of the account to get, either the name identifier (string) or an object with: * `name`: The name identifier of the account * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account |
| `algod` | `default` | An algod client |
| `kmdClient?` | `default` | An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables |

#### Returns

`Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\>

The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)

**`Deprecated`**

use getAccount(account: { config: AccountConfig; fundWith?: AlgoAmount }, algod: Algodv2, kmdClient?: Kmd) instead
Expand Down Expand Up @@ -480,20 +494,6 @@ const account = await getAccount('ACCOUNT', algod)

If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `account` | `string` \| { `fundWith?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `name`: `string` } | The details of the account to get, either the name identifier (string) or an object with: * `name`: The name identifier of the account * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account |
| `algod` | `default` | An algod client |
| `kmdClient?` | `default` | An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables |

#### Returns

`Promise`<`Account` \| [`SigningAccount`](../classes/types_account.SigningAccount.md)\>

The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)

#### Defined in

[src/account.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L92)
Expand All @@ -504,17 +504,6 @@ Returns an Algorand account with private key loaded by convention based on the g

Note: This function expects to run in a Node.js environment.

**`Example`**

Default

If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:
```typescript
const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)
```

If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser.

#### Parameters

| Name | Type | Description |
Expand All @@ -531,6 +520,17 @@ If that code runs against LocalNet then a wallet called `ACCOUNT` will automatic

The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)

**`Example`**

Default

If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:
```typescript
const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)
```

If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGOs from the default LocalNet dispenser.

#### Defined in

[src/account.ts:119](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L119)
Expand Down Expand Up @@ -587,14 +587,6 @@ ___

Returns the Account configuration from environment variables

**`Example`**

```ts
environment variables
{accountName}_MNEMONIC
{accountName}_SENDER
```

#### Parameters

| Name | Type | Description |
Expand All @@ -605,6 +597,14 @@ environment variables

[`AccountConfig`](../interfaces/types_account.AccountConfig.md)

**`Example`**

```ts
environment variables
{accountName}_MNEMONIC
{accountName}_SENDER
```

#### Defined in

[src/account.ts:239](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/account.ts#L239)
Expand All @@ -617,6 +617,16 @@ ___

Returns an algod SDK client that automatically retries on idempotent calls

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) |

#### Returns

`Algodv2`

**`Example`**

Default (load from environment variables)
Expand Down Expand Up @@ -652,16 +662,6 @@ Custom (e.g. default LocalNet, although we recommend loading this into a .env an
await algod.healthCheck().do()
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) |

#### Returns

`Algodv2`

#### Defined in

[src/network-client.ts:126](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/network-client.ts#L126)
Expand All @@ -674,6 +674,16 @@ ___

Returns an indexer SDK client that automatically retries on idempotent calls

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) |

#### Returns

`Indexer`

**`Example`**

Default (load from environment variables)
Expand Down Expand Up @@ -709,16 +719,6 @@ Custom (e.g. default LocalNet, although we recommend loading this into a .env an
await indexer.makeHealthCheck().do()
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) |

#### Returns

`Indexer`

#### Defined in

[src/network-client.ts:159](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/network-client.ts#L159)
Expand All @@ -733,6 +733,16 @@ Returns a KMD SDK client that automatically retries on idempotent calls

KMD client allows you to export private keys, which is useful to get the default account in a LocalNet network.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) |

#### Returns

`Kmd`

**`Example`**

Default (load from environment variables)
Expand All @@ -749,16 +759,6 @@ Custom (e.g. default LocalNet, although we recommend loading this into a .env an
const kmd = getAlgoKmdClient({server: 'http://localhost', port: '4002', token: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'})
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `config?` | [`AlgoClientConfig`](../interfaces/types_network_client.AlgoClientConfig.md) | The config if you want to override the default (getting config from process.env) |

#### Returns

`Kmd`

#### Defined in

[src/network-client.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/network-client.ts#L182)
Expand Down Expand Up @@ -1294,17 +1294,6 @@ ___

Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).

**`Example`**

Get default funded account in a LocalNet

```typescript
const defaultDispenserAccount = await getKmdWalletAccount(algod,
'unencrypted-default-wallet',
a => a.status !== 'Offline' && a.amount > 1_000_000_000
)
```

#### Parameters

| Name | Type | Description |
Expand All @@ -1319,6 +1308,17 @@ const defaultDispenserAccount = await getKmdWalletAccount(algod,

`Promise`<`Account` \| `undefined`\>

**`Example`**

Get default funded account in a LocalNet

```typescript
const defaultDispenserAccount = await getKmdWalletAccount(algod,
'unencrypted-default-wallet',
a => a.status !== 'Offline' && a.amount > 1_000_000_000
)
```

#### Defined in

[src/localnet.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/localnet.ts#L90)
Expand Down Expand Up @@ -2134,10 +2134,6 @@ ___
Wait until the transaction is confirmed or rejected, or until `timeout`
number of rounds have passed.

**`Throws`**

Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds

#### Parameters

| Name | Type | Description |
Expand All @@ -2152,6 +2148,10 @@ Throws an error if the transaction is not confirmed or rejected in the next `tim

Pending transaction information

**`Throws`**

Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds

#### Defined in

[src/transaction.ts:340](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L340)
Loading
Loading