Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/ts-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
tags:
- "**"
paths:
- "codegen/**"
- "sdk/**"
- "services/**"
- "scripts/**"
Expand Down Expand Up @@ -38,6 +39,7 @@ jobs:
with:
filters: |
relevant:
- "codegen/**"
- "sdk/**"
- "services/**"
- "scripts/**"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ configs/
.attestation-asset-policies/
.topup-bridge-state.json
artifacts/
!codegen/artifacts/
codegenCache.json

# Generated deploy artifacts
deployments/manifest.json
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ COPY tsconfig.base.json vitest.config.ts ./
COPY services/attestation/tsconfig.json services/attestation/
COPY services/topup/tsconfig.json services/topup/

# ── Codegen typed contract wrappers ──
COPY codegen/ codegen/

# ── Service & SDK source ──
COPY services/attestation/src/ services/attestation/src/
COPY services/topup/src/ services/topup/src/
Expand Down
9 changes: 9 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

134 changes: 134 additions & 0 deletions codegen/Counter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

/* Autogenerated file, do not edit! */

/* eslint-disable */
import { AztecAddress, CompleteAddress } from '@aztec/aztec.js/addresses';
import { type AbiType, type AztecAddressLike, type ContractArtifact, EventSelector, decodeFromAbi, type EthAddressLike, type FieldLike, type FunctionSelectorLike, loadContractArtifact, loadContractArtifactForPublic, type NoirCompiledContract, type OptionLike, type U128Like, type WrappedFieldLike } from '@aztec/aztec.js/abi';
import { Contract, ContractBase, ContractFunctionInteraction, type ContractMethod, type ContractStorageLayout, DeployMethod } from '@aztec/aztec.js/contracts';
import { EthAddress } from '@aztec/aztec.js/addresses';
import { Fr, Point } from '@aztec/aztec.js/fields';
import { type PublicKey, PublicKeys } from '@aztec/aztec.js/keys';
import type { Wallet } from '@aztec/aztec.js/wallet';
import CounterContractArtifactJson from './artifacts/mock_counter-Counter.json' with { type: 'json' };
export const CounterContractArtifact = loadContractArtifact(CounterContractArtifactJson as NoirCompiledContract);



/**
* Type-safe interface for contract Counter;
*/
export class CounterContract extends ContractBase {

protected constructor(
address: AztecAddress,
wallet: Wallet,
) {
super(address, CounterContractArtifact, wallet);
}



/**
* Creates a contract instance.
* @param address - The deployed contract's address.
* @param wallet - The wallet to use when interacting with the contract.
* @returns A new Contract instance.
*/
public static at(
address: AztecAddress,
wallet: Wallet,
): CounterContract {
return Contract.at(address, CounterContract.artifact, wallet) as CounterContract;
}


/**
* Creates a tx to deploy a new instance of this contract.
*/
public static deploy(wallet: Wallet, headstart: (bigint | number), owner: AztecAddressLike) {
return new DeployMethod<CounterContract>(PublicKeys.default(), wallet, CounterContractArtifact, (instance, wallet) => CounterContract.at(instance.address, wallet), Array.from(arguments).slice(1));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified public keys hash to derive the address.
*/
public static deployWithPublicKeys(publicKeys: PublicKeys, wallet: Wallet, headstart: (bigint | number), owner: AztecAddressLike) {
return new DeployMethod<CounterContract>(publicKeys, wallet, CounterContractArtifact, (instance, wallet) => CounterContract.at(instance.address, wallet), Array.from(arguments).slice(2));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified constructor method.
*/
public static deployWithOpts<M extends keyof CounterContract['methods']>(
opts: { publicKeys?: PublicKeys; method?: M; wallet: Wallet },
...args: Parameters<CounterContract['methods'][M]>
) {
return new DeployMethod<CounterContract>(
opts.publicKeys ?? PublicKeys.default(),
opts.wallet,
CounterContractArtifact,
(instance, wallet) => CounterContract.at(instance.address, wallet),
Array.from(arguments).slice(1),
opts.method ?? 'constructor',
);
}



/**
* Returns this contract's artifact.
*/
public static get artifact(): ContractArtifact {
return CounterContractArtifact;
}

/**
* Returns this contract's artifact with public bytecode.
*/
public static get artifactForPublic(): ContractArtifact {
return loadContractArtifactForPublic(CounterContractArtifactJson as NoirCompiledContract);
}


public static get storage(): ContractStorageLayout<'counters'> {
return {
counters: {
slot: new Fr(1n),
}
} as ContractStorageLayout<'counters'>;
}


/** Type-safe wrappers for the public methods exposed by the contract. */
public declare methods: {

/** __emit_public_init_nullifier() */
__emit_public_init_nullifier: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** _always_revert_public() */
_always_revert_public: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** always_revert() */
always_revert: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** get_counter(owner: struct) */
get_counter: ((owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** increment(owner: struct) */
increment: ((owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** initialize(headstart: integer, owner: struct) */
initialize: ((headstart: (bigint | number), owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** offchain_receive(messages: struct) */
offchain_receive: ((messages: { ciphertext: FieldLike[], recipient: AztecAddressLike, tx_hash: OptionLike<FieldLike>, anchor_block_timestamp: (bigint | number) }[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** public_dispatch(selector: field) */
public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** sync_state(scope: struct) */
sync_state: ((scope: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
};


}
125 changes: 125 additions & 0 deletions codegen/FPCMultiAsset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@

/* Autogenerated file, do not edit! */

/* eslint-disable */
import { AztecAddress, CompleteAddress } from '@aztec/aztec.js/addresses';
import { type AbiType, type AztecAddressLike, type ContractArtifact, EventSelector, decodeFromAbi, type EthAddressLike, type FieldLike, type FunctionSelectorLike, loadContractArtifact, loadContractArtifactForPublic, type NoirCompiledContract, type OptionLike, type U128Like, type WrappedFieldLike } from '@aztec/aztec.js/abi';
import { Contract, ContractBase, ContractFunctionInteraction, type ContractMethod, type ContractStorageLayout, DeployMethod } from '@aztec/aztec.js/contracts';
import { EthAddress } from '@aztec/aztec.js/addresses';
import { Fr, Point } from '@aztec/aztec.js/fields';
import { type PublicKey, PublicKeys } from '@aztec/aztec.js/keys';
import type { Wallet } from '@aztec/aztec.js/wallet';
import FPCMultiAssetContractArtifactJson from './artifacts/fpc-FPCMultiAsset.json' with { type: 'json' };
export const FPCMultiAssetContractArtifact = loadContractArtifact(FPCMultiAssetContractArtifactJson as NoirCompiledContract);



/**
* Type-safe interface for contract FPCMultiAsset;
*/
export class FPCMultiAssetContract extends ContractBase {

protected constructor(
address: AztecAddress,
wallet: Wallet,
) {
super(address, FPCMultiAssetContractArtifact, wallet);
}



/**
* Creates a contract instance.
* @param address - The deployed contract's address.
* @param wallet - The wallet to use when interacting with the contract.
* @returns A new Contract instance.
*/
public static at(
address: AztecAddress,
wallet: Wallet,
): FPCMultiAssetContract {
return Contract.at(address, FPCMultiAssetContract.artifact, wallet) as FPCMultiAssetContract;
}


/**
* Creates a tx to deploy a new instance of this contract.
*/
public static deploy(wallet: Wallet, operator: AztecAddressLike, operator_pubkey_x: FieldLike, operator_pubkey_y: FieldLike) {
return new DeployMethod<FPCMultiAssetContract>(PublicKeys.default(), wallet, FPCMultiAssetContractArtifact, (instance, wallet) => FPCMultiAssetContract.at(instance.address, wallet), Array.from(arguments).slice(1));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified public keys hash to derive the address.
*/
public static deployWithPublicKeys(publicKeys: PublicKeys, wallet: Wallet, operator: AztecAddressLike, operator_pubkey_x: FieldLike, operator_pubkey_y: FieldLike) {
return new DeployMethod<FPCMultiAssetContract>(publicKeys, wallet, FPCMultiAssetContractArtifact, (instance, wallet) => FPCMultiAssetContract.at(instance.address, wallet), Array.from(arguments).slice(2));
}

/**
* Creates a tx to deploy a new instance of this contract using the specified constructor method.
*/
public static deployWithOpts<M extends keyof FPCMultiAssetContract['methods']>(
opts: { publicKeys?: PublicKeys; method?: M; wallet: Wallet },
...args: Parameters<FPCMultiAssetContract['methods'][M]>
) {
return new DeployMethod<FPCMultiAssetContract>(
opts.publicKeys ?? PublicKeys.default(),
opts.wallet,
FPCMultiAssetContractArtifact,
(instance, wallet) => FPCMultiAssetContract.at(instance.address, wallet),
Array.from(arguments).slice(1),
opts.method ?? 'constructor',
);
}



/**
* Returns this contract's artifact.
*/
public static get artifact(): ContractArtifact {
return FPCMultiAssetContractArtifact;
}

/**
* Returns this contract's artifact with public bytecode.
*/
public static get artifactForPublic(): ContractArtifact {
return loadContractArtifactForPublic(FPCMultiAssetContractArtifactJson as NoirCompiledContract);
}


public static get storage(): ContractStorageLayout<'config'> {
return {
config: {
slot: new Fr(1n),
}
} as ContractStorageLayout<'config'>;
}


/** Type-safe wrappers for the public methods exposed by the contract. */
public declare methods: {

/** cold_start_entrypoint(user: struct, accepted_asset: struct, bridge: struct, claim_amount: integer, claim_secret: field, claim_secret_hash: field, message_leaf_index: field, fj_fee_amount: integer, aa_payment_amount: integer, valid_until: integer, quote_sig: array) */
cold_start_entrypoint: ((user: AztecAddressLike, accepted_asset: AztecAddressLike, bridge: AztecAddressLike, claim_amount: (bigint | number), claim_secret: FieldLike, claim_secret_hash: FieldLike, message_leaf_index: FieldLike, fj_fee_amount: (bigint | number), aa_payment_amount: (bigint | number), valid_until: (bigint | number), quote_sig: (bigint | number)[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** constructor(operator: struct, operator_pubkey_x: field, operator_pubkey_y: field) */
constructor: ((operator: AztecAddressLike, operator_pubkey_x: FieldLike, operator_pubkey_y: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** fee_entrypoint(accepted_asset: struct, authwit_nonce: field, fj_fee_amount: integer, aa_payment_amount: integer, valid_until: integer, quote_sig: array) */
fee_entrypoint: ((accepted_asset: AztecAddressLike, authwit_nonce: FieldLike, fj_fee_amount: (bigint | number), aa_payment_amount: (bigint | number), valid_until: (bigint | number), quote_sig: (bigint | number)[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** offchain_receive(messages: struct) */
offchain_receive: ((messages: { ciphertext: FieldLike[], recipient: AztecAddressLike, tx_hash: OptionLike<FieldLike>, anchor_block_timestamp: (bigint | number) }[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** public_dispatch(selector: field) */
public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

/** sync_state(scope: struct) */
sync_state: ((scope: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
};


}
Loading
Loading