diff --git a/packages/agent/agent.browser.ts b/packages/agent/agent.browser.ts index a20b014f5f..da911cc9a3 100644 --- a/packages/agent/agent.browser.ts +++ b/packages/agent/agent.browser.ts @@ -28,9 +28,6 @@ export * as Stub from './stub' export * as Governance from './governance' export * as Staking from './staking' -export { Identity } from './identity' -export { Transaction, Batch } from './tx' - export type { Address } from './identity' export type { CodeHash } from './program.browser' export type { ChainId, Message, TxHash } from './chain' diff --git a/packages/agent/chain.md b/packages/agent/chain.md index c947e37883..9fd41d024c 100644 --- a/packages/agent/chain.md +++ b/packages/agent/chain.md @@ -34,14 +34,14 @@ const backend = new Backend( log
const result: Connection = await backend.connect( parameter: string | Partial<Identity>, )-## abstract method [*backend.getIdentity*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L107) +## abstract method [*backend.getIdentity*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L110)
backend.getIdentity( name: string, @@ -70,12 +70,12 @@ const block = new Block( height-## method [*deployment.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L310) +## method [*deployment.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L310)number. Monotonically incrementing ID of block. -## abstract method [*block.getTransactionsById*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L613) +## abstract method [*block.getTransactionsById*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L616)const result: Record<string, Transaction> = await block.getTransactionsById()-## abstract method [*block.getTransactionsInOrder*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L616) +## abstract method [*block.getTransactionsInOrder*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L619)const result: Transaction[] = await block.getTransactionsInOrder()@@ -155,45 +155,53 @@ this property contains the URL to which requests are sent. nextBlock-## method [*connection.batch*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L592) +## method [*connection.batch*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L595) Construct a transaction batch. const result: Batch<Connection> = connection.batch()-## method [*connection.execute*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L565) +## method [*connection.execute*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L568) Call a given program's transaction method.const result: unknown = await connection.execute( contract: string | Partial<ContractInstance>, message: Message, - options: ???, + options: { + execFee, + execMemo, + execSend, + }, )-## method [*connection.getBalanceIn*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L386) +## method [*connection.getBalanceIn*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L389) Get the balance in a given native token, of either this connection's identity's address, or of another given address.const result: unknown = await connection.getBalanceIn( token: string, - address: string | ???, + address: string | { + address, + }, )-## method [*connection.getBalanceOf*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L361) +## method [*connection.getBalanceOf*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L364) Get the balance in a native token of a given address, either in this connection's gas token, or in another given token.const result: unknown = await connection.getBalanceOf( - address: string | ???, + address: string | { + address, + }, token: string, )-## method [*connection.getBlock*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L219) +## method [*connection.getBlock*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L222) Get info about a specific block. If no height is passed, gets info about the latest block.@@ -202,44 +210,52 @@ If no height is passed, gets info about the latest block. )-## method [*connection.getCodeHashOfAddress*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L261) +## method [*connection.getCodeHashOfAddress*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L264) Get the code hash of a given address.const result: string = await connection.getCodeHashOfAddress( - contract: string | ???, + contract: string | { + address, + }, )-## method [*connection.getCodeHashOfCodeId*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L245) +## method [*connection.getCodeHashOfCodeId*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L248) Get the code hash of a given code id.const result: string = await connection.getCodeHashOfCodeId( - contract: string | ???, + contract: string | { + codeId, + }, )-## method [*connection.getCodeId*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L229) +## method [*connection.getCodeId*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L232) Get the code id of a given address.const result: string = await connection.getCodeId( - contract: string | ???, + contract: string | { + address, + }, )-## method [*connection.getCodes*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L291) +## method [*connection.getCodes*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L294)const result: Record<string, UploadedCode> = await connection.getCodes()-## method [*connection.getContract*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L277) +## method [*connection.getContract*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L280) Get a client handle for a specific smart contract, authenticated as as this agent.const result: Contract = connection.getContract( - options: string | ???, + options: string | { + address, + }, )-## method [*connection.getContractsByCodeId*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L300) +## method [*connection.getContractsByCodeId*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L303) Get client handles for all contracts that match a code IDconst result: Record<string, Contract> = await connection.getContractsByCodeId( @@ -253,7 +269,7 @@ Get client handles for all contracts that match a code ID )-## method [*connection.getContractsByCodeIds*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L322) +## method [*connection.getContractsByCodeIds*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L325) Get client handles for all contracts that match multiple code IDsconst result: Record<string, Record> = await connection.getContractsByCodeIds( @@ -272,7 +288,7 @@ Get client handles for all contracts that match multiple code IDs )-## method [*connection.instantiate*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L521) +## method [*connection.instantiate*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L524) Instantiate a new program from a code id, label and init message.connection.instantiate( @@ -281,35 +297,47 @@ connection.instantiate( )-## method [*connection.query*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L413) +## method [*connection.query*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L416) Query a contract.const result: Q = await connection.query( - contract: string | ???, + contract: string | { + address, + }, message: Message, )-## method [*connection.send*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L429) +## method [*connection.send*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L432) Send native tokens to 1 recipient.const result: unknown = await connection.send( - recipient: string | ???, + recipient: string | { + address, + }, amounts: ICoin | TokenAmount, - options: ???, + options: { + sendFee, + sendMemo, + }, )-## method [*connection.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L461) +## method [*connection.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L464) Upload a contract's code, generating a new code id/hash pair.connection.upload( code: string | Uint8Array | URL | Partial<CompiledCode>, - options: ???, + options: { + reupload, + uploadFee, + uploadMemo, + uploadStore, + }, )-## method [*connection.gas*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L119) +## method [*connection.gas*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L122) Native token of chain.const result: TokenAmount = connection.gas( @@ -338,16 +366,20 @@ const contract = new Contract( log-## method [*deployment.contract*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L352) +## method [*deployment.contract*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L352) Define a contract that will be automatically compiled, uploaded, and instantiated as part of this deployment.Console. -## method [*contract.execute*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L654) +## method [*contract.execute*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L657) Execute a transaction on the specified instance as the specified Connection.const result: unknown = await contract.execute( message: Message, - options: ???, + options: { + execFee, + execMemo, + execSend, + }, )-## method [*contract.query*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L641) +## method [*contract.query*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L644) Execute a query on the specified instance as the specified Connection.const result: Q = await contract.query( diff --git a/packages/agent/chain.ts b/packages/agent/chain.ts index 11cf65d4b0..b232a37609 100644 --- a/packages/agent/chain.ts +++ b/packages/agent/chain.ts @@ -25,6 +25,9 @@ import { CompiledCode } from './program.browser' * version which can also load code from disk (`LocalCompiledCode`). Ugh. */ export const _$_HACK_$_ = { CompiledCode } +export * from './identity' +export * from './tx' + /** A chain ID. */ export type ChainId = string diff --git a/packages/agent/deploy.md b/packages/agent/deploy.md index eee6125d0e..e78e58a225 100644 --- a/packages/agent/deploy.md +++ b/packages/agent/deploy.md @@ -322,19 +322,22 @@ const contractCode = new ContractCode( uploader-## method [*deployment.addContract*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L374) +## method [*deployment.addContract*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L374)undefined. -## method [*contractCode.compile*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L36) +## method [*contractCode.compile*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L36) Compile this contract, unless a valid binary is present and a rebuild is not requested.contractCode.compile( - __namedParameters: ???, + { + compiler, + rebuild, + }, )-## method [*contractCode.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L68) +## method [*contractCode.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L68) Upload this contract, unless a valid upload is present and a rebuild is not requested.contractCode.upload( - __namedParameters: , + , )@@ -417,15 +420,18 @@ const contractInstance = new ContractInstance( uploaderundefined. -## method [*contractInstance.compile*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L36) +## method [*contractInstance.compile*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L36) Compile this contract, unless a valid binary is present and a rebuild is not requested.contractInstance.compile( - __namedParameters: ???, + { + compiler, + rebuild, + }, )-## method [*contractInstance.connect*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L274) +## method [*contractInstance.connect*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L274) Returns a client to this contract instance.const result: Contract = contractInstance.connect( @@ -433,28 +439,28 @@ Returns a client to this contract instance. )-## method [*contractInstance.deploy*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L235) +## method [*contractInstance.deploy*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L235)contractInstance.deploy( - __namedParameters: , + , )-## method [*contractInstance.isValid*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L282) +## method [*contractInstance.isValid*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L282)contractInstance.isValid()-## method [*contractInstance.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L265) +## method [*contractInstance.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L265)contractInstance.serialize()-## method [*contractInstance.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L68) +## method [*contractInstance.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L68) Upload this contract, unless a valid upload is present and a rebuild is not requested.contractInstance.upload( - __namedParameters: , + , )@@ -510,15 +516,18 @@ const contractTemplate = new ContractTemplate( uploaderundefined. -## method [*contractTemplate.compile*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L36) +## method [*contractTemplate.compile*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L36) Compile this contract, unless a valid binary is present and a rebuild is not requested.contractTemplate.compile( - __namedParameters: ???, + { + compiler, + rebuild, + }, )-## method [*contractTemplate.contract*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L187) +## method [*contractTemplate.contract*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L187) Create a new instance of this contract.const result: ContractInstance = contractTemplate.contract( @@ -527,7 +536,7 @@ Create a new instance of this contract. )-## method [*contractTemplate.contracts*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L193) +## method [*contractTemplate.contracts*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L193) Create multiple instances of this contract.const result: Record<string, ContractInstance> = contractTemplate.contracts( @@ -535,16 +544,16 @@ Create multiple instances of this contract. )-## method [*contractTemplate.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L178) +## method [*contractTemplate.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L178)contractTemplate.serialize()-## method [*contractTemplate.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L68) +## method [*contractTemplate.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L68) Upload this contract, unless a valid upload is present and a rebuild is not requested.contractTemplate.upload( - __namedParameters: , + , )@@ -577,24 +586,24 @@ Returns an iterable of entries in the map. const result: IterableIterator<> = deployment.[iterator]()const result: Deployment = deployment.addContract( ...args: , )-## method [*deployment.addContracts*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L382) +## method [*deployment.addContracts*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L382)const result: Deployment = deployment.addContracts( ...args: , )-## method [*deployment.build*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L390) +## method [*deployment.build*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L390)const result: Record<string, > = await deployment.build( - __namedParameters: , + , )@@ -603,7 +612,7 @@ Returns an iterable of entries in the map. const result: void = deployment.clear()@@ -621,10 +630,10 @@ and instantiated as part of this deployment. )-## method [*deployment.deploy*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L444) +## method [*deployment.deploy*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L444)const result: Record<string, > = await deployment.deploy( - __namedParameters: , + , )@@ -665,12 +674,12 @@ Returns an iterable of keys in the map const result: IterableIterator<string> = deployment.keys()
deployment.serialize()-## method [*deployment.set*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L318) +## method [*deployment.set*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L318)
deployment.set( name: string, @@ -678,7 +687,7 @@ deployment.set( )-## method [*deployment.template*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L329) +## method [*deployment.template*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L329) Define a template, representing code that can be compiled and uploaded, but will not be automatically instantiated. This can then be used to define multiple instances of @@ -690,10 +699,10 @@ the same code. ) -## method [*deployment.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L427) +## method [*deployment.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L427)
const result: Record<string, > = await deployment.upload( - __namedParameters: , + , )@@ -703,10 +712,10 @@ Returns an iterable of values in the map const result: IterableIterator<DeploymentUnit> = deployment.values() -## method [*deployment.fromSnapshot*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L295) +## method [*deployment.fromSnapshot*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L295)
const result: Deployment = deployment.fromSnapshot( - __namedParameters: Partial<>, + Partial<>, )@@ -759,24 +768,27 @@ const deploymentUnit = new DeploymentUnit( uploader
deploymentUnit.compile( - __namedParameters: ???, + { + compiler, + rebuild, + }, )-## method [*deploymentUnit.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L178) +## method [*deploymentUnit.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L178)
deploymentUnit.serialize()-## method [*deploymentUnit.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/deploy.ts#L68) +## method [*deploymentUnit.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/deploy.ts#L68) Upload this contract, unless a valid upload is present and a rebuild is not requested.
deploymentUnit.upload( - __namedParameters: , + , )@@ -815,7 +827,7 @@ const uploadedCode = new UploadedCode( canInstantiateInfo
uploadedCode.serialize()diff --git a/packages/agent/docs.ts b/packages/agent/docs.ts index 5302cb38be..c105e5a306 100755 --- a/packages/agent/docs.ts +++ b/packages/agent/docs.ts @@ -6,7 +6,6 @@ documentModule({ data, target: 'core.md', sources: ['core.ts'], documentModule({ data, target: 'chain.md', sources: ['chain.ts'], }) documentModule({ data, target: 'deploy.md', sources: ['deploy.ts'], }) documentModule({ data, target: 'governance.md', sources: ['governance.ts'], }) -documentModule({ data, target: 'identity.md', sources: ['identity.ts'], }) documentModule({ data, target: 'program.md', sources: ['program.browser.ts', 'program.ts'], }) documentModule({ data, target: 'staking.md', sources: ['staking.ts'], }) documentModule({ data, target: 'store.md', sources: ['store.ts'], }) diff --git a/packages/agent/identity.md b/packages/agent/identity.md deleted file mode 100644 index 413b5d8592..0000000000 --- a/packages/agent/identity.md +++ /dev/null @@ -1,65 +0,0 @@ - -### Agent identity - -The **agent.address** property is the on-chain address that uniquely identifies the agent. - -The **agent.name** property is a user-friendly name for an agent. On devnet, the name is -also used to access the initial accounts that are created during devnet genesis. - - -## Authenticating an agent - -To transact on a given chain, you need to authorize an **Agent**. -This is done using the **chain.authenticate(...)** method, which synchonously -returns a new **Agent** instance for the given chain. - -Instantiating multiple agents allows the same program to interact with the chain -from multiple distinct identities. - -This method may be called with one of the following signatures: - -* **chain.authenticate(options)** -* **chain.authenticate(CustomAgentClass, options)** -* **chain.authenticate(CustomAgentClass)** - -The returned **Agent** starts out uninitialized. Awaiting the **agent.ready** property makes sure -the agent is initialized. Usually, agents are initialized the first time you call one of the -async methods described below. - -If you don't pass a mnemonic, a random mnemonic and address will be generated. - -Examples: - -```typescript -// TODO -``` - - - -# class *Identity* -A cryptographic identity. - -```typescript -const identity = new Identity( - properties: Partial<...>, -) -``` - -
-address | -string. Unique identifier. |
-log | -Console. |
-name | -string. Display name. |
-const result: unknown = identity.sign( - doc: any, -) -- diff --git a/packages/agent/program.md b/packages/agent/program.md index 0112b7467d..07c6573dd0 100644 --- a/packages/agent/program.md +++ b/packages/agent/program.md @@ -181,23 +181,23 @@ const compiledCode = new CompiledCode( canUploadInfo
compiledCode.computeHash()-## method [*compiledCode.fetch*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L226) +## method [*compiledCode.fetch*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L226)
const result: Uint8Array = await compiledCode.fetch()-## method [*compiledCode.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L194) +## method [*compiledCode.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L194)
compiledCode.serialize()-## method [*compiledCode.toCodeHash*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L274) +## method [*compiledCode.toCodeHash*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L274)
const result: string = compiledCode.toCodeHash( data: Uint8Array, @@ -224,7 +224,7 @@ binary and checksum are both present in wasm/ directory log-## method [*compiler.buildMany*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L27) +## method [*compiler.buildMany*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L27) Build multiple sources. Default implementation of buildMany is sequential. Compiler classes may override this to optimize. @@ -277,23 +277,23 @@ const localCompiledCode = new LocalCompiledCode( canUploadInfoConsole. -## abstract method [*compiler.build*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L21) +## abstract method [*compiler.build*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L21) Compile a source. `@hackbg/fadroma` implements dockerized and non-dockerized variants using its `build.impl.mjs` script. @@ -235,7 +235,7 @@ variants using its `build.impl.mjs` script. )
localCompiledCode.computeHash()-## method [*localCompiledCode.fetch*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L226) +## method [*localCompiledCode.fetch*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L226)
const result: Uint8Array = await localCompiledCode.fetch()-## method [*localCompiledCode.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L194) +## method [*localCompiledCode.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L194)
localCompiledCode.serialize()-## method [*localCompiledCode.toCodeHash*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L274) +## method [*localCompiledCode.toCodeHash*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L274)
const result: string = localCompiledCode.toCodeHash( data: Uint8Array, @@ -350,7 +350,7 @@ const rustSourceCode = new RustSourceCode( canFetchInfo-## method [*deployStore.get*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/store.ts#L17) +## method [*deployStore.get*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/store.ts#L17)-## method [*rustSourceCode.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L116) +## method [*rustSourceCode.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L116) rustSourceCode.serialize()@@ -393,7 +393,7 @@ const sourceCode = new SourceCode( canFetchInfo-## method [*sourceCode.serialize*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L61) +## method [*sourceCode.serialize*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L61) sourceCode.serialize()diff --git a/packages/agent/store.md b/packages/agent/store.md index 82386550be..1d308f4856 100644 --- a/packages/agent/store.md +++ b/packages/agent/store.md @@ -56,7 +56,7 @@ Executes a provided function once per each key/value pair in the Map, in inserti )
const result: Partial<> = deployStore.get( name: string, @@ -77,7 +77,7 @@ Returns an iterable of keys in the map const result: IterableIterator<string> = deployStore.keys()-## method [*deployStore.set*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/store.ts#L24) +## method [*deployStore.set*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/store.ts#L24)
deployStore.set( name: string, @@ -141,7 +141,7 @@ Executes a provided function once per each key/value pair in the Map, in inserti )-## method [*uploadStore.get*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/store.ts#L37) +## method [*uploadStore.get*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/store.ts#L37)
const result: UploadedCode = uploadStore.get( codeHash: string, @@ -162,7 +162,7 @@ Returns an iterable of keys in the map const result: IterableIterator<string> = uploadStore.keys()-## method [*uploadStore.set*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/store.ts#L41) +## method [*uploadStore.set*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/store.ts#L41)
uploadStore.set( codeHash: string, diff --git a/packages/agent/stub.md b/packages/agent/stub.md index ba2249a162..28666f0491 100644 --- a/packages/agent/stub.md +++ b/packages/agent/stub.md @@ -51,42 +51,42 @@ const stubBackend = new StubBackend( urlstring. -## method [*stubBackend.connect*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L190) +## method [*stubBackend.connect*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L190)const result: Connection = await stubBackend.connect( parameter: string | Partial<>, )-## method [*stubBackend.execute*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L258) +## method [*stubBackend.execute*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L258)const result: unknown = await stubBackend.execute( ...args: unknown, )-## method [*stubBackend.export*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L229) +## method [*stubBackend.export*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L229)const result: unknown = await stubBackend.export( ...args: unknown, )-## method [*stubBackend.getIdentity*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L208) +## method [*stubBackend.getIdentity*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L208)const result: Identity = await stubBackend.getIdentity( name: string, )-## method [*stubBackend.import*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L225) +## method [*stubBackend.import*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L225)const result: unknown = await stubBackend.import( ...args: unknown, )-## method [*stubBackend.instantiate*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L243) +## method [*stubBackend.instantiate*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L243)stubBackend.instantiate( creator: string, @@ -95,17 +95,17 @@ stubBackend.instantiate( )-## method [*stubBackend.pause*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L220) +## method [*stubBackend.pause*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L220)const result: StubBackend = await stubBackend.pause()-## method [*stubBackend.start*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L215) +## method [*stubBackend.start*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L215)const result: StubBackend = await stubBackend.start()-## method [*stubBackend.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L233) +## method [*stubBackend.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L233)stubBackend.upload( codeData: Uint8Array, @@ -132,7 +132,7 @@ const stubBatch = new StubBatch( messagesundefined. -## method [*stubBatch.execute*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L276) +## method [*stubBatch.execute*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L276) Add an execute message to the batch.const result: StubBatch = stubBatch.execute( @@ -140,7 +140,7 @@ Add an execute message to the batch. )-## method [*stubBatch.instantiate*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L271) +## method [*stubBatch.instantiate*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L271) Add an instantiate message to the batch.const result: StubBatch = stubBatch.instantiate( @@ -148,13 +148,13 @@ Add an instantiate message to the batch. )-## method [*stubBatch.submit*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L281) +## method [*stubBatch.submit*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L281) Submit the batch.const result: object = await stubBatch.submit()-## method [*stubBatch.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L266) +## method [*stubBatch.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L266) Add an upload message to the batch.const result: StubBatch = stubBatch.upload( @@ -184,12 +184,12 @@ const stubBlock = new StubBlock( height-## method [*stubCompiler.buildMany*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/program.browser.ts#L27) +## method [*stubCompiler.buildMany*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/program.browser.ts#L27) Build multiple sources. Default implementation of buildMany is sequential. Compiler classes may override this to optimize. @@ -315,45 +315,53 @@ this property contains the URL to which requests are sent. nextBlocknumber. Monotonically incrementing ID of block. -## method [*stubBlock.getTransactionsById*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L18) +## method [*stubBlock.getTransactionsById*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L18)const result: Record<string, Transaction> = await stubBlock.getTransactionsById()-## method [*stubBlock.getTransactionsInOrder*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L21) +## method [*stubBlock.getTransactionsInOrder*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L21)const result: Transaction[] = await stubBlock.getTransactionsInOrder()@@ -216,7 +216,7 @@ binary and checksum are both present in wasm/ directory logConsole. -## method [*stubCompiler.build*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L297) +## method [*stubCompiler.build*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L297) Compile a source. `@hackbg/fadroma` implements dockerized and non-dockerized variants using its `build.impl.mjs` script. @@ -227,7 +227,7 @@ variants using its `build.impl.mjs` script. )-## method [*stubConnection.batch*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/stub.ts#L36) +## method [*stubConnection.batch*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/stub.ts#L36) Construct a transaction batch. const result: Batch<StubConnection> = stubConnection.batch()-## method [*stubConnection.execute*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L565) +## method [*stubConnection.execute*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L568) Call a given program's transaction method.const result: unknown = await stubConnection.execute( contract: string | Partial<ContractInstance>, message: Message, - options: ???, + options: { + execFee, + execMemo, + execSend, + }, )-## method [*stubConnection.getBalanceIn*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L386) +## method [*stubConnection.getBalanceIn*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L389) Get the balance in a given native token, of either this connection's identity's address, or of another given address.const result: unknown = await stubConnection.getBalanceIn( token: string, - address: string | ???, + address: string | { + address, + }, )-## method [*stubConnection.getBalanceOf*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L361) +## method [*stubConnection.getBalanceOf*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L364) Get the balance in a native token of a given address, either in this connection's gas token, or in another given token.const result: unknown = await stubConnection.getBalanceOf( - address: string | ???, + address: string | { + address, + }, token: string, )-## method [*stubConnection.getBlock*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L219) +## method [*stubConnection.getBlock*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L222) Get info about a specific block. If no height is passed, gets info about the latest block.@@ -362,44 +370,52 @@ If no height is passed, gets info about the latest block. )-## method [*stubConnection.getCodeHashOfAddress*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L261) +## method [*stubConnection.getCodeHashOfAddress*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L264) Get the code hash of a given address.const result: string = await stubConnection.getCodeHashOfAddress( - contract: string | ???, + contract: string | { + address, + }, )-## method [*stubConnection.getCodeHashOfCodeId*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L245) +## method [*stubConnection.getCodeHashOfCodeId*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L248) Get the code hash of a given code id.const result: string = await stubConnection.getCodeHashOfCodeId( - contract: string | ???, + contract: string | { + codeId, + }, )-## method [*stubConnection.getCodeId*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L229) +## method [*stubConnection.getCodeId*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L232) Get the code id of a given address.const result: string = await stubConnection.getCodeId( - contract: string | ???, + contract: string | { + address, + }, )-## method [*stubConnection.getCodes*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L291) +## method [*stubConnection.getCodes*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L294)const result: Record<string, UploadedCode> = await stubConnection.getCodes()-## method [*stubConnection.getContract*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L277) +## method [*stubConnection.getContract*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L280) Get a client handle for a specific smart contract, authenticated as as this agent.const result: Contract = stubConnection.getContract( - options: string | ???, + options: string | { + address, + }, )-## method [*stubConnection.getContractsByCodeId*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L300) +## method [*stubConnection.getContractsByCodeId*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L303) Get client handles for all contracts that match a code IDconst result: Record<string, Contract> = await stubConnection.getContractsByCodeId( @@ -413,7 +429,7 @@ Get client handles for all contracts that match a code ID )-## method [*stubConnection.getContractsByCodeIds*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L322) +## method [*stubConnection.getContractsByCodeIds*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L325) Get client handles for all contracts that match multiple code IDsconst result: Record<string, Record> = await stubConnection.getContractsByCodeIds( @@ -432,7 +448,7 @@ Get client handles for all contracts that match multiple code IDs )-## method [*stubConnection.instantiate*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L521) +## method [*stubConnection.instantiate*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L524) Instantiate a new program from a code id, label and init message.stubConnection.instantiate( @@ -441,35 +457,47 @@ stubConnection.instantiate( )-## method [*stubConnection.query*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L413) +## method [*stubConnection.query*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L416) Query a contract.const result: Q = await stubConnection.query( - contract: string | ???, + contract: string | { + address, + }, message: Message, )-## method [*stubConnection.send*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L429) +## method [*stubConnection.send*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L432) Send native tokens to 1 recipient.const result: unknown = await stubConnection.send( - recipient: string | ???, + recipient: string | { + address, + }, amounts: ICoin | TokenAmount, - options: ???, + options: { + sendFee, + sendMemo, + }, )-## method [*stubConnection.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L461) +## method [*stubConnection.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L464) Upload a contract's code, generating a new code id/hash pair.stubConnection.upload( code: string | Uint8Array | URL | Partial<CompiledCode>, - options: ???, + options: { + reupload, + uploadFee, + uploadMemo, + uploadStore, + }, )-## method [*stubConnection.gas*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/chain.ts#L119) +## method [*stubConnection.gas*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/chain.ts#L122) Native token of chain.const result: TokenAmount = stubConnection.gas( diff --git a/packages/agent/token.md b/packages/agent/token.md index 77d6fd2c28..31afe99245 100644 --- a/packages/agent/token.md +++ b/packages/agent/token.md @@ -33,19 +33,19 @@ const amount = new Amount( denom-## method [*amount.asCoin*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L115) +## method [*amount.asCoin*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L115) const result: ICoin = amount.asCoin()-## method [*amount.asFee*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L122) +## method [*amount.asFee*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L122)const result: IFee = amount.asFee( gas: string, )-## method [*amount.toString*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L111) +## method [*amount.toString*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L111)const result: string = amount.toString()@@ -89,32 +89,32 @@ const custom = new Custom( id-## method [*custom.amount*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L84) +## method [*custom.amount*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L84) const result: TokenAmount = custom.amount( amount: string | number, )-## method [*custom.isCustom*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L151) +## method [*custom.isCustom*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L151)const result: boolean = custom.isCustom()-## method [*custom.isFungible*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L74) +## method [*custom.isFungible*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L74)const result: boolean = custom.isFungible()-## method [*custom.isNative*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L153) +## method [*custom.isNative*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L153)const result: boolean = custom.isNative()-## method [*custom.addZeros*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L80) +## method [*custom.addZeros*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L80)const result: string = custom.addZeros( n: string | number, @@ -141,7 +141,7 @@ const fee = new Fee( gasstring. -## method [*fee.add*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L32) +## method [*fee.add*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L32)const result: void = fee.add( amount: string | number | bigint, @@ -161,32 +161,32 @@ new Fungible() id-## method [*fungible.amount*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L84) +## method [*fungible.amount*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L84) const result: TokenAmount = fungible.amount( amount: string | number, )-## abstract method [*fungible.isCustom*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L78) +## abstract method [*fungible.isCustom*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L78) Whether this token is implemented by a smart contract.fungible.isCustom()-## method [*fungible.isFungible*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L74) +## method [*fungible.isFungible*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L74)const result: boolean = fungible.isFungible()-## abstract method [*fungible.isNative*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L76) +## abstract method [*fungible.isNative*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L76) Whether this token is natively supported by the chain.fungible.isNative()-## method [*fungible.addZeros*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L80) +## method [*fungible.addZeros*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L80)const result: string = fungible.addZeros( n: string | number, @@ -211,39 +211,39 @@ const native = new Native( id-## method [*native.amount*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L84) +## method [*native.amount*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L84) const result: TokenAmount = native.amount( amount: string | number, )-## method [*native.fee*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L140) +## method [*native.fee*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L140)const result: IFee = native.fee( amount: string | number | bigint, )-## method [*native.isCustom*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L136) +## method [*native.isCustom*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L136)const result: boolean = native.isCustom()-## method [*native.isFungible*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L74) +## method [*native.isFungible*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L74)const result: boolean = native.isFungible()-## method [*native.isNative*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L138) +## method [*native.isNative*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L138)const result: boolean = native.isNative()-## method [*native.addZeros*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L80) +## method [*native.addZeros*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L80)const result: string = native.addZeros( n: string | number, @@ -263,7 +263,7 @@ new NonFungible() id-## method [*nonFungible.isFungible*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L68) +## method [*nonFungible.isFungible*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L68) const result: boolean = nonFungible.isFungible() @@ -323,7 +323,7 @@ new Token() id-## abstract method [*token.isFungible*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/token.ts#L62) +## abstract method [*token.isFungible*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/token.ts#L62) Whether this token is fungible. token.isFungible() diff --git a/packages/agent/tx.md b/packages/agent/tx.md index 5292410fb5..10676d92d5 100644 --- a/packages/agent/tx.md +++ b/packages/agent/tx.md @@ -71,7 +71,7 @@ const batch = new Batch( logConsole. -## method [*batch.execute*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/tx.ts#L38) +## method [*batch.execute*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/tx.ts#L38) Add an execute message to the batch.batch.execute( @@ -79,7 +79,7 @@ batch.execute( )-## method [*batch.instantiate*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/tx.ts#L32) +## method [*batch.instantiate*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/tx.ts#L32) Add an instantiate message to the batch.batch.instantiate( @@ -87,7 +87,7 @@ batch.instantiate( )-## method [*batch.submit*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/tx.ts#L44) +## method [*batch.submit*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/tx.ts#L44) Submit the batch.const result: unknown = await batch.submit( @@ -95,7 +95,7 @@ Submit the batch. )-## method [*batch.upload*](https://github.com/hackbg/fadroma/blob/dcce4232c7f1613b8a8273ce114e07b545f3a959/packages/agent/tx.ts#L26) +## method [*batch.upload*](https://github.com/hackbg/fadroma/blob/0dad4acde5441c08749fd7b46d47288231605082/packages/agent/tx.ts#L26) Add an upload message to the batch.batch.upload(