Skip to content

Commit

Permalink
Renamed AlgokitComposer to AlgoKitComposer
Browse files Browse the repository at this point in the history
  • Loading branch information
robdmoore committed Aug 27, 2024
1 parent 8b21fd7 commit 003934e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/transaction/legacy-bridge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import algosdk from 'algosdk'
import { AlgorandClient, SendSingleTransactionResult } from '../types/algorand-client'
import AlgokitComposer, { CommonTransactionParams, ExecuteParams } from '../types/composer'
import AlgoKitComposer, { CommonTransactionParams, ExecuteParams } from '../types/composer'
import { SendTransactionFrom, SendTransactionParams, SendTransactionResult } from '../types/transaction'
import { getSenderTransactionSigner, getTransactionParams } from './transaction'
import Algodv2 = algosdk.Algodv2
Expand Down Expand Up @@ -40,11 +40,11 @@ export async function legacySendTransactionBridgeComposer<T extends CommonTransa
algod: Algodv2,
from: SendTransactionFrom,
params: T,
compose: (c: AlgokitComposer) => (params: T) => AlgokitComposer,
compose: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer,
sendParams?: SendTransactionParams,
suggestedParams?: algosdk.SuggestedParams,
): Promise<SendTransactionResult> {
const composer = new AlgokitComposer({
const composer = new AlgoKitComposer({
algod,
getSigner: (address) => getSenderTransactionSigner(from),

Check warning on line 49 in src/transaction/legacy-bridge.ts

View workflow job for this annotation

GitHub Actions / pull_request / node-ci

'address' is defined but never used. Allowed unused args must match /^_/u
getSuggestedParams: async () => await getTransactionParams(suggestedParams, algod),
Expand Down
4 changes: 2 additions & 2 deletions src/types/account-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AccountInformation, DISPENSER_ACCOUNT, MultisigAccount, SigningAccount,
import { SendSingleTransactionResult } from './algorand-client'
import { AlgoAmount } from './amount'
import { ClientManager } from './client-manager'
import AlgokitComposer, { CommonTransactionParams, ExecuteParams } from './composer'
import AlgoKitComposer, { CommonTransactionParams, ExecuteParams } from './composer'
import { TestNetDispenserApiClient } from './dispenser-client'
import { KmdAccountManager } from './kmd-account-manager'
import LogicSigAccount = algosdk.LogicSigAccount
Expand Down Expand Up @@ -58,7 +58,7 @@ export class AccountManager {
}

private _getComposer(getSuggestedParams?: () => Promise<algosdk.SuggestedParams>) {
return new AlgokitComposer({
return new AlgoKitComposer({
algod: this._clientManager.algod,
getSigner: this.getSigner.bind(this),
getSuggestedParams: getSuggestedParams ?? (() => this._clientManager.algod.getTransactionParams().do()),
Expand Down
8 changes: 4 additions & 4 deletions src/types/algorand-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './acc
import { AccountManager } from './account-manager'
import { AssetManager } from './asset-manager'
import { AlgoSdkClients, ClientManager } from './client-manager'
import AlgokitComposer, { AssetCreateParams, AssetOptOutParams, ExecuteParams, MethodCallParams } from './composer'
import AlgoKitComposer, { AssetCreateParams, AssetOptOutParams, ExecuteParams, MethodCallParams } from './composer'
import { AlgoConfig } from './network-client'
import { ConfirmedTransactionResult, SendAtomicTransactionComposerResults } from './transaction'
import Transaction = algosdk.Transaction
Expand Down Expand Up @@ -142,7 +142,7 @@ export class AlgorandClient {

/** Start a new `AlgokitComposer` transaction group */
public newGroup() {
return new AlgokitComposer({
return new AlgoKitComposer({
algod: this.client.algod,
getSigner: (addr: string) => this.account.getSigner(addr),
getSuggestedParams: () => this.getSuggestedParams(),
Expand All @@ -151,7 +151,7 @@ export class AlgorandClient {
}

private _send<T>(
c: (c: AlgokitComposer) => (params: T) => AlgokitComposer,
c: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer,
log?: {
preLog?: (params: T, transaction: Transaction) => string
postLog?: (params: T, result: SendSingleTransactionResult) => string
Expand Down Expand Up @@ -589,7 +589,7 @@ export class AlgorandClient {
}),
}

private _transaction<T>(c: (c: AlgokitComposer) => (params: T) => AlgokitComposer): (params: T) => Promise<Transaction> {
private _transaction<T>(c: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer): (params: T) => Promise<Transaction> {
return async (params: T) => {
const composer = this.newGroup()
const result = await c(composer).apply(composer, [params]).build()
Expand Down
4 changes: 2 additions & 2 deletions src/types/asset-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { chunkArray } from '../util'
import { AccountAssetInformation, TransactionSignerAccount } from './account'
import { AccountManager } from './account-manager'
import { ClientManager } from './client-manager'
import AlgokitComposer, { CommonTransactionParams, ExecuteParams, MAX_TRANSACTION_GROUP_SIZE } from './composer'
import AlgoKitComposer, { CommonTransactionParams, ExecuteParams, MAX_TRANSACTION_GROUP_SIZE } from './composer'
import AssetModel = algosdk.modelsv2.Asset

/** Individual result from performing a bulk opt-in or bulk opt-out for an account against a series of assets. */
Expand Down Expand Up @@ -155,7 +155,7 @@ export class AssetManager {
}

private _getComposer(getSuggestedParams?: () => Promise<algosdk.SuggestedParams>) {
return new AlgokitComposer({
return new AlgoKitComposer({
algod: this._clientManager.algod,
getSigner: this._accountManager.getSigner.bind(this._accountManager),
getSuggestedParams: getSuggestedParams ?? (() => this._clientManager.algod.getTransactionParams().do()),
Expand Down
24 changes: 12 additions & 12 deletions src/types/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export type AlgoKitComposerParams = {
}

/** AlgoKit Composer helps you compose and execute transactions as a transaction group. */
export default class AlgokitComposer {
export default class AlgoKitComposer {
/** The ATC used to compose the group */
private atc = new algosdk.AtomicTransactionComposer()

Expand Down Expand Up @@ -442,7 +442,7 @@ export default class AlgokitComposer {
* @param params The payment transaction parameters
* @returns The composer so you can chain method calls
*/
addPayment(params: PaymentParams): AlgokitComposer {
addPayment(params: PaymentParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'pay' })

return this
Expand All @@ -453,7 +453,7 @@ export default class AlgokitComposer {
* @param params The asset create transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetCreate(params: AssetCreateParams): AlgokitComposer {
addAssetCreate(params: AssetCreateParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetCreate' })

return this
Expand All @@ -464,7 +464,7 @@ export default class AlgokitComposer {
* @param params The asset config transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetConfig(params: AssetConfigParams): AlgokitComposer {
addAssetConfig(params: AssetConfigParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetConfig' })

return this
Expand All @@ -475,7 +475,7 @@ export default class AlgokitComposer {
* @param params The asset freeze transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetFreeze(params: AssetFreezeParams): AlgokitComposer {
addAssetFreeze(params: AssetFreezeParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetFreeze' })

return this
Expand All @@ -486,7 +486,7 @@ export default class AlgokitComposer {
* @param params The asset destroy transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetDestroy(params: AssetDestroyParams): AlgokitComposer {
addAssetDestroy(params: AssetDestroyParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetDestroy' })

return this
Expand All @@ -497,7 +497,7 @@ export default class AlgokitComposer {
* @param params The asset transfer transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetTransfer(params: AssetTransferParams): AlgokitComposer {
addAssetTransfer(params: AssetTransferParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetTransfer' })

return this
Expand All @@ -508,7 +508,7 @@ export default class AlgokitComposer {
* @param params The asset opt-in transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetOptIn(params: AssetOptInParams): AlgokitComposer {
addAssetOptIn(params: AssetOptInParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetOptIn' })

return this
Expand All @@ -519,7 +519,7 @@ export default class AlgokitComposer {
* @param params The asset opt-out transaction parameters
* @returns The composer so you can chain method calls
*/
addAssetOptOut(params: AssetOptOutParams): AlgokitComposer {
addAssetOptOut(params: AssetOptOutParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'assetOptOut' })

return this
Expand All @@ -532,7 +532,7 @@ export default class AlgokitComposer {
* @param params The application call transaction parameters
* @returns The composer so you can chain method calls
*/
addAppCall(params: AppCallParams): AlgokitComposer {
addAppCall(params: AppCallParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'appCall' })

return this
Expand All @@ -555,7 +555,7 @@ export default class AlgokitComposer {
* @param params The online key registration transaction parameters
* @returns The composer so you can chain method calls
*/
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): AlgokitComposer {
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): AlgoKitComposer {
this.txns.push({ ...params, type: 'keyReg' })

return this
Expand All @@ -566,7 +566,7 @@ export default class AlgokitComposer {
* @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
* @returns The composer so you can chain method calls
*/
addAtc(atc: algosdk.AtomicTransactionComposer): AlgokitComposer {
addAtc(atc: algosdk.AtomicTransactionComposer): AlgoKitComposer {
this.txns.push({ atc, type: 'atc' })
return this
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/kmd-account-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Config } from '../config'
import { SigningAccount, TransactionSignerAccount } from './account'
import { AlgoAmount } from './amount'
import { ClientManager } from './client-manager'
import AlgokitComposer from './composer'
import AlgoKitComposer from './composer'

/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance
* that makes it easier to get and manage accounts using KMD. */
Expand Down Expand Up @@ -161,7 +161,7 @@ export class KmdAccountManager {

// Fund the account from the dispenser
const dispenser = await this.getLocalNetDispenserAccount()
await new AlgokitComposer({
await new AlgoKitComposer({
algod: this._clientManager.algod,
getSigner: () => dispenser.signer,
getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),
Expand Down

0 comments on commit 003934e

Please sign in to comment.