{
execFee,
@@ -206,7 +202,9 @@ or of another given address.
const result: unknown = await connection.getBalanceIn(
token: string,
- address: | ,
+ address: string | {
+ address,
+ },
)
@@ -216,7 +214,9 @@ either in this connection's gas token,
or in another given token.
const result: unknown = await connection.getBalanceOf(
- address: | ,
+ address: string | {
+ address,
+ },
token: string,
)
@@ -225,33 +225,31 @@ or in another given token.
Get info about a specific block.
If no height is passed, gets info about the latest block.
-const result: Block = await connection.getBlock(
- height: number,
-)
+const result: Block = await connection.getBlock(height: number)
## method [*connection.getCodeHashOfAddress*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get the code hash of a given address.
-const result: string = await connection.getCodeHashOfAddress(
- contract: | ,
-)
+const result: string = await connection.getCodeHashOfAddress(contract: string | {
+ address,
+})
## method [*connection.getCodeHashOfCodeId*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get the code hash of a given code id.
-const result: string = await connection.getCodeHashOfCodeId(
- contract: | ,
-)
+const result: string = await connection.getCodeHashOfCodeId(contract: string | {
+ codeId,
+})
## method [*connection.getCodeId*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get the code id of a given address.
-const result: string = await connection.getCodeId(
- contract: | ,
-)
+const result: string = await connection.getCodeId(contract: string | {
+ address,
+})
## method [*connection.getCodes*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
@@ -262,17 +260,15 @@ Get the code id of a given address.
## method [*connection.getContract*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get a client handle for a specific smart contract, authenticated as as this agent.
-const result: Contract = connection.getContract(
- options: | ,
-)
+const result: Contract = connection.getContract(options: string | {
+ address,
+})
## method [*connection.getContractsByCodeId*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get client handles for all contracts that match a code ID
-const result: Record<string, Contract> = await connection.getContractsByCodeId(
- id: string,
-)
+const result: Record<string, Contract> = await connection.getContractsByCodeId(id: string)
const result: Record<string, InstanceType> = await connection.getContractsByCodeId(
@@ -284,9 +280,7 @@ Get client handles for all contracts that match a code ID
## method [*connection.getContractsByCodeIds*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get client handles for all contracts that match multiple code IDs
-const result: Record<string, Record> = await connection.getContractsByCodeIds(
- ids: Iterable<string>,
-)
+const result: Record<string, Record> = await connection.getContractsByCodeIds(ids: Iterable<string>)
const result: Record<string, Record> = await connection.getContractsByCodeIds(
@@ -295,16 +289,14 @@ Get client handles for all contracts that match multiple code IDs
)
-const result: Record<string, Record> = await connection.getContractsByCodeIds(
- ids: Record<string, C>,
-)
+const result: Record<string, Record> = await connection.getContractsByCodeIds(ids: Record<string, C>)
## method [*connection.instantiate*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Instantiate a new program from a code id, label and init message.
connection.instantiate(
- contract: | ,
+ contract: string | Partial<UploadedCode>,
options: Partial<ContractInstance>,
)
@@ -313,7 +305,9 @@ connection.instantiate(
Query a contract.
const result: Q = await connection.query(
- contract: | ,
+ contract: string | {
+ address,
+ },
message: Message,
)
@@ -322,8 +316,10 @@ Query a contract.
Send native tokens to 1 recipient.
const result: unknown = await connection.send(
- recipient: | ,
- amounts: | ,
+ recipient: string | {
+ address,
+ },
+ amounts: ICoin | TokenAmount,
options: {
sendFee,
sendMemo,
@@ -335,7 +331,7 @@ Send native tokens to 1 recipient.
Upload a contract's code, generating a new code id/hash pair.
connection.upload(
- code: | | | ,
+ code: string | Uint8Array | URL | Partial<CompiledCode>,
options: {
reupload,
uploadFee,
@@ -348,9 +344,7 @@ connection.upload(
## method [*connection.gas*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Native token of chain.
-const result: TokenAmount = connection.gas(
- amount: | ,
-)
+const result: TokenAmount = connection.gas(amount: string | number)
# class *Block*
@@ -398,9 +392,7 @@ Subclass this to add custom query and transaction methods corresponding
to the contract's API.
-const contract = new Contract(
- properties: | ,
-)
+const contract = new Contract(properties: string | Partial<Contract>)
@@ -430,8 +422,6 @@ Execute a transaction on the specified instance as the specified Connection.
## method [*contract.query*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Execute a query on the specified instance as the specified Connection.
-const result: Q = await contract.query(
- message: Message,
-)
+const result: Q = await contract.query(message: Message)
diff --git a/packages/agent/core.md b/packages/agent/core.md
index a33827cce8..eb41107f7e 100644
--- a/packages/agent/core.md
+++ b/packages/agent/core.md
@@ -2,9 +2,7 @@
# class *Error*
-const error = new Error(
- message: string,
-)const error = new Error(
+const error = new Error(message: string)const error = new Error(
message: string,
options: ErrorOptions,
)
@@ -44,7 +42,7 @@ Define an error subclass.
error.define(
name: string,
- getMessage: | ,
+ getMessage: string | ???,
construct: ???,
)
diff --git a/packages/agent/deploy.md b/packages/agent/deploy.md
index f7903b4372..ade245af9c 100644
--- a/packages/agent/deploy.md
+++ b/packages/agent/deploy.md
@@ -47,12 +47,10 @@ Compile this contract.
If a valid binary is present and a rebuild is not requested,
this does not compile it again, but reuses the binary.
-contractCode.compile(
- {
- compiler,
- rebuild,
- },
-)
+contractCode.compile({
+ compiler,
+ rebuild,
+})
## method [*contractCode.upload*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
@@ -66,9 +64,18 @@ this does not upload it again, but reuses the code ID.
If a valid binary is not present, but valid source is present,
this compiles the source code first to obtain a binary.
-contractCode.upload(
- & & ,
-)
+contractCode.upload({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+})
# class *UploadedCode*
@@ -122,9 +129,7 @@ A contract that is part of a deploment.
- generates structured label
-const deploymentUnit = new DeploymentUnit(
- properties: & ,
-)
+const deploymentUnit = new DeploymentUnit(properties: Partial<ContractCode> & Partial<DeploymentUnit>)
@@ -171,12 +176,10 @@ Compile this contract.
If a valid binary is present and a rebuild is not requested,
this does not compile it again, but reuses the binary.
-deploymentUnit.compile(
- {
- compiler,
- rebuild,
- },
-)
+deploymentUnit.compile({
+ compiler,
+ rebuild,
+})
## method [*deploymentUnit.serialize*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
@@ -195,9 +198,18 @@ this does not upload it again, but reuses the code ID.
If a valid binary is not present, but valid source is present,
this compiles the source code first to obtain a binary.
-deploymentUnit.upload(
- & & ,
-)
+deploymentUnit.upload({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+})
# class *ContractTemplate*
@@ -206,9 +218,7 @@ A contract that is part of a deploment.
- generates structured label
-const contractTemplate = new ContractTemplate(
- properties: & ,
-)
+const contractTemplate = new ContractTemplate(properties: Partial<ContractCode> & Partial<DeploymentUnit>)
@@ -258,12 +268,10 @@ Compile this contract.
If a valid binary is present and a rebuild is not requested,
this does not compile it again, but reuses the binary.
-contractTemplate.compile(
- {
- compiler,
- rebuild,
- },
-)
+contractTemplate.compile({
+ compiler,
+ rebuild,
+})
## method [*contractTemplate.contract*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
@@ -278,9 +286,7 @@ Create a new instance of this contract.
## method [*contractTemplate.contracts*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
Create multiple instances of this contract.
-const result: Record<string, ContractInstance> = contractTemplate.contracts(
- instanceParameters: Record<string, Partial>,
-)
+const result: Record<string, ContractInstance> = contractTemplate.contracts(instanceParameters: Record<string, Partial>)
## method [*contractTemplate.serialize*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
@@ -299,9 +305,18 @@ this does not upload it again, but reuses the code ID.
If a valid binary is not present, but valid source is present,
this compiles the source code first to obtain a binary.
-contractTemplate.upload(
- & & ,
-)
+contractTemplate.upload({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+})
# class *ContractInstance*
@@ -310,9 +325,7 @@ A contract that is part of a deploment.
- generates structured label
-const contractInstance = new ContractInstance(
- properties: & & ,
-)
+const contractInstance = new ContractInstance(properties: Partial<ContractCode> & Partial<DeploymentUnit> & Partial<ContractInstance>)
@@ -389,27 +402,35 @@ Compile this contract.
If a valid binary is present and a rebuild is not requested,
this does not compile it again, but reuses the binary.
-contractInstance.compile(
- {
- compiler,
- rebuild,
- },
-)
+contractInstance.compile({
+ compiler,
+ rebuild,
+})
## method [*contractInstance.connect*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
Returns a client to this contract instance.
-const result: Contract = contractInstance.connect(
- agent: Connection,
-)
+const result: Contract = contractInstance.connect(agent: Connection)
## method [*contractInstance.deploy*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-contractInstance.deploy(
- & & & & ,
-)
+contractInstance.deploy({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+} & Partial<ContractInstance> & {
+ deployer,
+ redeploy,
+})
## method [*contractInstance.isValid*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
@@ -433,9 +454,18 @@ this does not upload it again, but reuses the code ID.
If a valid binary is not present, but valid source is present,
this compiles the source code first to obtain a binary.
-contractInstance.upload(
- & & ,
-)
+contractInstance.upload({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+})
# class *Deployment*
@@ -473,23 +503,30 @@ Returns an iterable of entries in the map.
## method [*deployment.addContract*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-const result: Deployment = deployment.addContract(
- ...args: [, ],
-)
+const result: Deployment = deployment.addContract(args: [string, {
+ language,
+} & Partial<RustSourceCode> | {
+ language,
+} & Partial<SourceCode> & Partial<CompiledCode> & Partial<UploadedCode> & Partial<ContractInstance>])
## method [*deployment.addContracts*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-const result: Deployment = deployment.addContracts(
- ...args: [, ],
-)
+const result: Deployment = deployment.addContracts(args: [string, {
+ language,
+} & Partial<RustSourceCode> | {
+ language,
+} & Partial<SourceCode> & Partial<CompiledCode> & Partial<UploadedCode>])
## method [*deployment.build*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-const result: Record<string, > = await deployment.build(
- & ,
-)
+const result: Record<string, > = await deployment.build({
+ compiler,
+ rebuild,
+} & {
+ units,
+})
## method [*deployment.clear*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
@@ -503,23 +540,40 @@ and instantiated as part of this deployment.
const result: ContractInstance = deployment.contract(
name: string,
- properties: & & & ,
+ properties: {
+ language,
+ } & Partial<RustSourceCode> | {
+ language,
+ } & Partial<SourceCode> & Partial<CompiledCode> & Partial<UploadedCode> & Partial<ContractInstance>,
)
## method [*deployment.delete*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
-const result: boolean = deployment.delete(
- key: string,
-)
+const result: boolean = deployment.delete(key: string)
## method [*deployment.deploy*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-const result: Record<string, > = await deployment.deploy(
- & & & & & ,
-)
+const result: Record<string, > = await deployment.deploy({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+} & Partial<ContractInstance> & {
+ deployer,
+ redeploy,
+} & {
+ deployStore,
+ units,
+})
## method [*deployment.entries*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
@@ -540,17 +594,13 @@ Executes a provided function once per each key/value pair in the Map, in inserti
## method [*deployment.get*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
-const result: DeploymentUnit = deployment.get(
- key: string,
-)
+const result: DeploymentUnit = deployment.get(key: string)
## method [*deployment.has*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
-const result: boolean = deployment.has(
- key: string,
-)
+const result: boolean = deployment.has(key: string)
## method [*deployment.keys*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
@@ -580,15 +630,31 @@ the same code.
const result: ContractTemplate = deployment.template(
name: string,
- properties: & & ,
+ properties: {
+ language,
+ } & Partial<RustSourceCode> | {
+ language,
+ } & Partial<SourceCode> & Partial<CompiledCode> & Partial<UploadedCode>,
)
## method [*deployment.upload*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-const result: Record<string, > = await deployment.upload(
- & & & ,
-)
+const result: Record<string, > = await deployment.upload({
+ compiler,
+ rebuild,
+} & {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+} & {
+ reupload,
+ uploader,
+} & {
+ units,
+ uploadStore,
+})
## method [*deployment.values*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
@@ -599,8 +665,6 @@ Returns an iterable of values in the map
## method [*deployment.fromSnapshot*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/deploy.ts)
-const result: Deployment = deployment.fromSnapshot(
- Partial<>,
-)
+const result: Deployment = deployment.fromSnapshot(Partial<>)
diff --git a/packages/agent/program.md b/packages/agent/program.md
index 34fa6f892b..dfb3dfc81b 100644
--- a/packages/agent/program.md
+++ b/packages/agent/program.md
@@ -153,9 +153,7 @@ new LocalCompiledCode(
An object representing a given compiled binary on the local filesystem.
-const localCompiledCode = new LocalCompiledCode(
- properties: Partial<CompiledCode>,
-)
+const localCompiledCode = new LocalCompiledCode(properties: Partial<CompiledCode>)
@@ -199,16 +197,12 @@ localCompiledCode.serialize()
## method [*localCompiledCode.toCodeHash*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/program.browser.ts)
-const result: string = localCompiledCode.toCodeHash(
- data: Uint8Array,
-)
+const result: string = localCompiledCode.toCodeHash(data: Uint8Array)
# class *Compiler*
-const compiler = new Compiler(
- properties: Partial<Logged>,
-)
+const compiler = new Compiler(properties: Partial<Logged>)
@@ -230,7 +224,7 @@ Compile a source.
variants using its `build.impl.mjs` script.
const result: CompiledCode = await compiler.build(
- source: | ,
+ source: string | Partial<SourceCode>,
...args: unknown,
)
@@ -240,9 +234,7 @@ Build multiple sources.
Default implementation of buildMany is sequential.
Compiler classes may override this to optimize.
-const result: CompiledCode[] = await compiler.buildMany(
- inputs: Partial<SourceCode>[],
-)
+const result: CompiledCode[] = await compiler.buildMany(inputs: Partial<SourceCode>[])
# class *SourceCode*
@@ -407,8 +399,6 @@ compiledCode.serialize()
## method [*compiledCode.toCodeHash*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/program.browser.ts)
-const result: string = compiledCode.toCodeHash(
- data: Uint8Array,
-)
+const result: string = compiledCode.toCodeHash(data: Uint8Array)
diff --git a/packages/agent/store.md b/packages/agent/store.md
index 7828d4a14e..5f6bb22157 100644
--- a/packages/agent/store.md
+++ b/packages/agent/store.md
@@ -36,9 +36,7 @@ Returns an iterable of entries in the map.
## method [*deployStore.delete*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
-const result: boolean = deployStore.delete(
- key: string,
-)
+const result: boolean = deployStore.delete(key: string)
## method [*deployStore.entries*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
@@ -58,17 +56,13 @@ Executes a provided function once per each key/value pair in the Map, in inserti
## method [*deployStore.get*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/store.ts)
-const result: Partial<> = deployStore.get(
- name: string,
-)
+const result: Partial<> = deployStore.get(name: string)
## method [*deployStore.has*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
-const result: boolean = deployStore.has(
- key: string,
-)
+const result: boolean = deployStore.has(key: string)
## method [*deployStore.keys*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
@@ -81,7 +75,7 @@ Returns an iterable of keys in the map
deployStore.set(
name: string,
- state: | ,
+ state: Partial<> | Partial<Deployment>,
)
@@ -121,9 +115,7 @@ Returns an iterable of entries in the map.
## method [*uploadStore.delete*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
-const result: boolean = uploadStore.delete(
- key: string,
-)
+const result: boolean = uploadStore.delete(key: string)
## method [*uploadStore.entries*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
@@ -143,17 +135,13 @@ Executes a provided function once per each key/value pair in the Map, in inserti
## method [*uploadStore.get*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/store.ts)
-const result: UploadedCode = uploadStore.get(
- codeHash: string,
-)
+const result: UploadedCode = uploadStore.get(codeHash: string)
## method [*uploadStore.has*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.collection.d.ts)
-const result: boolean = uploadStore.has(
- key: string,
-)
+const result: boolean = uploadStore.has(key: string)
## method [*uploadStore.keys*](https://github.com/hackbg/fadroma/tree/v2/node_modules/.pnpm/typescript@5.3.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts)
diff --git a/packages/agent/stub.md b/packages/agent/stub.md
index f57610c7f0..de44918460 100644
--- a/packages/agent/stub.md
+++ b/packages/agent/stub.md
@@ -10,9 +10,7 @@ You shouldn't have to instantiate this directly;
instead, it's returned from `connection.getBlock()`
-const stubBlock = new StubBlock(
- properties: Partial<Block>,
-)
+const stubBlock = new StubBlock(properties: Partial<Block>)
@@ -134,7 +132,7 @@ Construct a transaction batch.
Call a given program's transaction method.
const result: unknown = await stubConnection.execute(
- contract: | ,
+ contract: string | Partial<ContractInstance>,
message: Message,
options: {
execFee,
@@ -151,7 +149,9 @@ or of another given address.
const result: unknown = await stubConnection.getBalanceIn(
token: string,
- address: | ,
+ address: string | {
+ address,
+ },
)
@@ -161,7 +161,9 @@ either in this connection's gas token,
or in another given token.
const result: unknown = await stubConnection.getBalanceOf(
- address: | ,
+ address: string | {
+ address,
+ },
token: string,
)
@@ -170,33 +172,31 @@ or in another given token.
Get info about a specific block.
If no height is passed, gets info about the latest block.
-const result: Block = await stubConnection.getBlock(
- height: number,
-)
+const result: Block = await stubConnection.getBlock(height: number)
## method [*stubConnection.getCodeHashOfAddress*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get the code hash of a given address.
-const result: string = await stubConnection.getCodeHashOfAddress(
- contract: | ,
-)
+const result: string = await stubConnection.getCodeHashOfAddress(contract: string | {
+ address,
+})
## method [*stubConnection.getCodeHashOfCodeId*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get the code hash of a given code id.
-const result: string = await stubConnection.getCodeHashOfCodeId(
- contract: | ,
-)
+const result: string = await stubConnection.getCodeHashOfCodeId(contract: string | {
+ codeId,
+})
## method [*stubConnection.getCodeId*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get the code id of a given address.
-const result: string = await stubConnection.getCodeId(
- contract: | ,
-)
+const result: string = await stubConnection.getCodeId(contract: string | {
+ address,
+})
## method [*stubConnection.getCodes*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
@@ -207,17 +207,15 @@ Get the code id of a given address.
## method [*stubConnection.getContract*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get a client handle for a specific smart contract, authenticated as as this agent.
-const result: Contract = stubConnection.getContract(
- options: | ,
-)
+const result: Contract = stubConnection.getContract(options: string | {
+ address,
+})
## method [*stubConnection.getContractsByCodeId*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get client handles for all contracts that match a code ID
-const result: Record<string, Contract> = await stubConnection.getContractsByCodeId(
- id: string,
-)
+const result: Record<string, Contract> = await stubConnection.getContractsByCodeId(id: string)
const result: Record<string, InstanceType> = await stubConnection.getContractsByCodeId(
@@ -229,9 +227,7 @@ Get client handles for all contracts that match a code ID
## method [*stubConnection.getContractsByCodeIds*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Get client handles for all contracts that match multiple code IDs
-const result: Record<string, Record> = await stubConnection.getContractsByCodeIds(
- ids: Iterable<string>,
-)
+const result: Record<string, Record> = await stubConnection.getContractsByCodeIds(ids: Iterable<string>)
const result: Record<string, Record> = await stubConnection.getContractsByCodeIds(
@@ -240,16 +236,14 @@ Get client handles for all contracts that match multiple code IDs
)
-const result: Record<string, Record> = await stubConnection.getContractsByCodeIds(
- ids: Record<string, C>,
-)
+const result: Record<string, Record> = await stubConnection.getContractsByCodeIds(ids: Record<string, C>)
## method [*stubConnection.instantiate*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Instantiate a new program from a code id, label and init message.
stubConnection.instantiate(
- contract: | ,
+ contract: string | Partial<UploadedCode>,
options: Partial<ContractInstance>,
)
@@ -258,7 +252,9 @@ stubConnection.instantiate(
Query a contract.
const result: Q = await stubConnection.query(
- contract: | ,
+ contract: string | {
+ address,
+ },
message: Message,
)
@@ -267,8 +263,10 @@ Query a contract.
Send native tokens to 1 recipient.
const result: unknown = await stubConnection.send(
- recipient: | ,
- amounts: | ,
+ recipient: string | {
+ address,
+ },
+ amounts: ICoin | TokenAmount,
options: {
sendFee,
sendMemo,
@@ -280,7 +278,7 @@ Send native tokens to 1 recipient.
Upload a contract's code, generating a new code id/hash pair.
stubConnection.upload(
- code: | | | ,
+ code: string | Uint8Array | URL | Partial<CompiledCode>,
options: {
reupload,
uploadFee,
@@ -293,9 +291,7 @@ stubConnection.upload(
## method [*stubConnection.gas*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/chain.ts)
Native token of chain.
-const result: TokenAmount = stubConnection.gas(
- amount: | ,
-)
+const result: TokenAmount = stubConnection.gas(amount: string | number)
# class *StubBackend*
@@ -309,9 +305,7 @@ You shouldn't need to instantiate this class directly.
Instead, see `Connection`, `Devnet`, and their subclasses.
-const stubBackend = new StubBackend(
- properties: Partial<>,
-)
+const stubBackend = new StubBackend(properties: Partial<>)
@@ -351,37 +345,27 @@ Instead, see `Connection`, `Devnet`, and their subclasses.
## method [*stubBackend.connect*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
-const result: Connection = await stubBackend.connect(
- parameter: | ,
-)
+const result: Connection = await stubBackend.connect(parameter: string | Partial<>)
## method [*stubBackend.execute*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
-const result: unknown = await stubBackend.execute(
- ...args: unknown,
-)
+const result: unknown = await stubBackend.execute(args: unknown)
## method [*stubBackend.export*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
-const result: unknown = await stubBackend.export(
- ...args: unknown,
-)
+const result: unknown = await stubBackend.export(args: unknown)
## method [*stubBackend.getIdentity*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
-const result: Identity = await stubBackend.getIdentity(
- name: string,
-)
+const result: Identity = await stubBackend.getIdentity(name: string)
## method [*stubBackend.import*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
-const result: unknown = await stubBackend.import(
- ...args: unknown,
-)
+const result: unknown = await stubBackend.import(args: unknown)
## method [*stubBackend.instantiate*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
@@ -405,18 +389,14 @@ stubBackend.instantiate(
## method [*stubBackend.upload*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
-stubBackend.upload(
- codeData: Uint8Array,
-)
+stubBackend.upload(codeData: Uint8Array)
# class *StubBatch*
Builder object for batched transactions.
-const stubBatch = new StubBatch(
- properties: Partial<Batch>,
-)
+const stubBatch = new StubBatch(properties: Partial<Batch>)
@@ -433,17 +413,17 @@ Builder object for batched transactions.
## method [*stubBatch.execute*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
Add an execute message to the batch.
-const result: StubBatch = stubBatch.execute(
- ...args: [, , ],
-)
+const result: StubBatch = stubBatch.execute(args: [string | Partial<ContractInstance>, Message, {
+ execFee,
+ execMemo,
+ execSend,
+}])
## method [*stubBatch.instantiate*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
Add an instantiate message to the batch.
-const result: StubBatch = stubBatch.instantiate(
- ...args: [, ],
-)
+const result: StubBatch = stubBatch.instantiate(args: [string | Partial<UploadedCode>, Partial<ContractInstance>])
## method [*stubBatch.submit*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
@@ -455,18 +435,19 @@ Submit the batch.
## method [*stubBatch.upload*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/stub.ts)
Add an upload message to the batch.
-const result: StubBatch = stubBatch.upload(
- ...args: [, ],
-)
+const result: StubBatch = stubBatch.upload(args: [string | Uint8Array | URL | Partial<CompiledCode>, {
+ reupload,
+ uploadFee,
+ uploadMemo,
+ uploadStore,
+}])
# class *StubCompiler*
A compiler that does nothing. Used for testing.
-const stubCompiler = new StubCompiler(
- properties: Partial<Logged>,
-)
+const stubCompiler = new StubCompiler(properties: Partial<Logged>)
@@ -488,7 +469,7 @@ Compile a source.
variants using its `build.impl.mjs` script.
const result: CompiledCode = await stubCompiler.build(
- source: | ,
+ source: string | Partial<SourceCode>,
...args: any,
)
@@ -498,8 +479,6 @@ Build multiple sources.
Default implementation of buildMany is sequential.
Compiler classes may override this to optimize.
-const result: CompiledCode[] = await stubCompiler.buildMany(
- inputs: Partial<SourceCode>[],
-)
+const result: CompiledCode[] = await stubCompiler.buildMany(inputs: Partial<SourceCode>[])
\ No newline at end of file
diff --git a/packages/agent/token.md b/packages/agent/token.md
index f8d065028b..6b01a1d056 100644
--- a/packages/agent/token.md
+++ b/packages/agent/token.md
@@ -14,7 +14,7 @@ A constructable gas fee in native tokens.
const fee = new Fee(
- amount: | | ,
+ amount: string | number | bigint,
denom: string,
gas: string,
)
@@ -31,7 +31,7 @@ A constructable gas fee in native tokens.
## method [*fee.add*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
const result: void = fee.add(
- amount: | | ,
+ amount: string | number | bigint,
denom: string,
)
@@ -41,7 +41,7 @@ Represents some amount of native token.
const coin = new Coin(
- amount: | ,
+ amount: string | number,
denom: string,
)
@@ -86,9 +86,7 @@ An abstract fungible token.
## method [*fungible.amount*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
-const result: TokenAmount = fungible.amount(
- amount: | ,
-)
+const result: TokenAmount = fungible.amount(amount: string | number)
## abstract method [*fungible.isCustom*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
@@ -112,7 +110,7 @@ fungible.isNative()
## method [*fungible.addZeros*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
const result: string = fungible.addZeros(
- n: | ,
+ n: string | number,
z: number,
)
@@ -139,9 +137,7 @@ An abstract non-fungible token.
The chain's natively implemented token (such as SCRT on Secret Network).
-const native = new Native(
- denom: string,
-)
+const native = new Native(denom: string)
@@ -154,16 +150,12 @@ The chain's natively implemented token (such as SCRT on Secret Network).
## method [*native.amount*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
-const result: TokenAmount = native.amount(
- amount: | ,
-)
+const result: TokenAmount = native.amount(amount: string | number)
## method [*native.fee*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
-const result: IFee = native.fee(
- amount: | | ,
-)
+const result: IFee = native.fee(amount: string | number | bigint)
## method [*native.isCustom*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
@@ -187,7 +179,7 @@ The chain's natively implemented token (such as SCRT on Secret Network).
## method [*native.addZeros*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
const result: string = native.addZeros(
- n: | ,
+ n: string | number,
z: number,
)
@@ -215,9 +207,7 @@ A contract-based token.
## method [*custom.amount*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
-const result: TokenAmount = custom.amount(
- amount: | ,
-)
+const result: TokenAmount = custom.amount(amount: string | number)
## method [*custom.isCustom*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
@@ -241,7 +231,7 @@ A contract-based token.
## method [*custom.addZeros*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
const result: string = custom.addZeros(
- n: | ,
+ n: string | number,
z: number,
)
@@ -272,7 +262,7 @@ An amount of a fungible token.
const amount = new Amount(
- amount: | | ,
+ amount: string | number | bigint,
token: FungibleToken,
)
@@ -298,9 +288,7 @@ An amount of a fungible token.
## method [*amount.asFee*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
-const result: IFee = amount.asFee(
- gas: string,
-)
+const result: IFee = amount.asFee(gas: string)
## method [*amount.toString*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/token.ts)
@@ -313,8 +301,8 @@ A pair of token amounts.
const swap = new Swap(
- a: | ,
- b: | ,
+ a: NonFungibleToken | TokenAmount,
+ b: NonFungibleToken | TokenAmount,
)
diff --git a/packages/agent/tx.md b/packages/agent/tx.md
index 34a26e3ccb..0f2fad27fd 100644
--- a/packages/agent/tx.md
+++ b/packages/agent/tx.md
@@ -105,32 +105,24 @@ Builder object for batched transactions.
## method [*batch.execute*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/tx.ts)
Add an execute message to the batch.
-batch.execute(
- ...args: Parameters<>,
-)
+batch.execute(args: Parameters<>)
## method [*batch.instantiate*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/tx.ts)
Add an instantiate message to the batch.
-batch.instantiate(
- ...args: Parameters<>,
-)
+batch.instantiate(args: Parameters<>)
## method [*batch.submit*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/tx.ts)
Submit the batch.
-const result: unknown = await batch.submit(
- ...args: unknown,
-)
+const result: unknown = await batch.submit(args: unknown)
## method [*batch.upload*](https://github.com/hackbg/fadroma/tree/v2/packages/agent/tx.ts)
Add an upload message to the batch.
-batch.upload(
- ...args: Parameters<>,
-)
+batch.upload(args: Parameters<>)