Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: estimateTransaction #13

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ OPTIONS

DESCRIPTION
A utility to simplify deploying contracts related to the STX bulk transfer tool. It deploys
the contract on the address of the provided private key.
the contract on the address of the provided private key.

Valid choices are: send-many, send-many-memo, and memo-expected.
Valid choices are: send-many, send-many-memo, and memo-expected.

The memo-expected contract is an empty contract that is checked by the `send-many-memo-safe`
command. If a contract called 'memo-expected' is deployed on a principal, and no memo is passed,
the send-many will be aborted before it reaches the chain.
The memo-expected contract is an empty contract that is checked by the `send-many-memo-safe`
command. If a contract called 'memo-expected' is deployed on a principal, and no memo is passed,
the send-many will be aborted before it reaches the chain.

Example usage:
Example usage:

```
npx stx-bulk-transfer deploy-contract memo-expected -k my_private_key -n testnet -b
```
```
npx stx-bulk-transfer deploy-contract memo-expected -k my_private_key -n testnet -b
```
```

_See code: [dist/commands/deploy-contract.ts](https://github.com/blockstack/send-many-stx-cli/blob/v1.4.0/dist/commands/deploy-contract.ts)_
Expand Down Expand Up @@ -134,17 +134,17 @@ OPTIONS
DESCRIPTION
The bulk transfer is executed in a single transaction by invoking a `contract-call` on the "send-many" contract.

The default contracts can be found below:
The default contracts can be found below:

Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many?chain=testnet
Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many?chain=mainnet
Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many?chain=testnet
Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many?chain=mainnet

Example usage:
Example usage:

```
npx stx-bulk-transfer send-many STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100
```
npx stx-bulk-transfer send-many STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100
ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50 -k my_private_key -n testnet -b
```
```
```

_See code: [dist/commands/send-many.ts](https://github.com/blockstack/send-many-stx-cli/blob/v1.4.0/dist/commands/send-many.ts)_
Expand Down Expand Up @@ -199,17 +199,17 @@ OPTIONS
DESCRIPTION
The bulk transfer is executed in a single transaction by invoking a `contract-call` on the "send-many-memo" contract.

The default contracts can be found below:
The default contracts can be found below:

Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo?chain=testnet
Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo?chain=mainnet
Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo?chain=testnet
Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo?chain=mainnet

Example usage:
Example usage:

```
npx stx-bulk-transfer send-many-memo STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,hello
```
npx stx-bulk-transfer send-many-memo STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,hello
ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50,memo2 -k my_private_key -n testnet -b
```
```
```

_See code: [dist/commands/send-many-memo.ts](https://github.com/blockstack/send-many-stx-cli/blob/v1.4.0/dist/commands/send-many-memo.ts)_
Expand Down Expand Up @@ -264,22 +264,22 @@ OPTIONS
DESCRIPTION
The bulk transfer is executed in a single transaction by invoking a `contract-call` on the "send-many-memo" contract.

The 'safe' counterpart of send-many-memo checks for the existence of a `memo-expected` contract for each recipient.
If it exists, the transfer will be aborted if the corresponding memo is empty or missing. A utility command to
The 'safe' counterpart of send-many-memo checks for the existence of a `memo-expected` contract for each recipient.
If it exists, the transfer will be aborted if the corresponding memo is empty or missing. A utility command to
deploy
this contract is part of this tool: stx-bulk-transfer deploy-contract memo-expected.
this contract is part of this tool: stx-bulk-transfer deploy-contract memo-expected.

The default contracts can be found below:
The default contracts can be found below:

Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo?chain=testnet
Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo?chain=mainnet
Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo?chain=testnet
Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo?chain=mainnet

Example usage:
Example usage:

```
npx stx-bulk-transfer send-many-memo-safe STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,hello
```
npx stx-bulk-transfer send-many-memo-safe STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,hello
ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50,memo2 -k my_private_key -n testnet -b
```
```
```

_See code: [dist/commands/send-many-memo-safe.ts](https://github.com/blockstack/send-many-stx-cli/blob/v1.4.0/dist/commands/send-many-memo-safe.ts)_
Expand All @@ -302,10 +302,10 @@ OPTIONS

DESCRIPTION
Example usage:

```
npx stx-bulk-transfer validate-address SP000000000000000000002Q6VF78 -n mainnet
```
```
npx stx-bulk-transfer validate-address SP000000000000000000002Q6VF78 -n mainnet
```
```

_See code: [dist/commands/validate-address.ts](https://github.com/blockstack/send-many-stx-cli/blob/v1.4.0/dist/commands/validate-address.ts)_
Expand Down
1 change: 1 addition & 0 deletions oclif.manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"1.4.0","commands":{"deploy-contract":{"id":"deploy-contract","description":"Deploy `send-many`, `send-many-memo`, `memo-expected`.\n A utility to simplify deploying contracts related to the STX bulk transfer tool. It deploys\n the contract on the address of the provided private key.\n\n Valid choices are: send-many, send-many-memo, and memo-expected.\n\n The memo-expected contract is an empty contract that is checked by the `send-many-memo-safe`\n command. If a contract called 'memo-expected' is deployed on a principal, and no memo is passed,\n the send-many will be aborted before it reaches the chain.\n\n Example usage:\n\n ```\n npx stx-bulk-transfer deploy-contract memo-expected -k my_private_key -n testnet -b\n ```\n ","pluginName":"@stacks/send-many-stx-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"privateKey":{"name":"privateKey","type":"option","char":"k","description":"Your private key","required":true},"broadcast":{"name":"broadcast","type":"boolean","char":"b","description":"Whether to broadcast this transaction. Omitting this flag will not broadcast the transaction.","allowNo":false},"network":{"name":"network","type":"option","char":"n","description":"Which network to broadcast this to","options":["mocknet","testnet","mainnet"],"default":"testnet"},"nodeUrl":{"name":"nodeUrl","type":"option","char":"u","description":"A default node URL will be used based on the `network` option. Use this flag to manually override.","required":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"\nReduce logging from this command. If this flag is passed with the broadcast (-b) flag,\nonly the transaction ID will be logged. If the quiet flagged is passed without broadcast, \nonly the raw transaction hex will be logged.\n","allowNo":false},"nonce":{"name":"nonce","type":"option","description":"Optionally specify a nonce for this transaction"}},"args":[{"name":"contract","description":"The contract to deploy"}]},"send-many-memo-safe":{"id":"send-many-memo-safe","description":"Execute a bulk STX transfer, with memos attached, checking if the transfer is safe to send.\n The bulk transfer is executed in a single transaction by invoking a `contract-call` on the \"send-many-memo\" contract.\n\n The 'safe' counterpart of send-many-memo checks for the existence of a `memo-expected` contract for each recipient.\n If it exists, the transfer will be aborted if the corresponding memo is empty or missing. A utility command to deploy\n this contract is part of this tool: stx-bulk-transfer deploy-contract memo-expected.\n\n The default contracts can be found below:\n\n Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo?chain=testnet\n Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo?chain=mainnet\n\n Example usage:\n\n ```\n npx stx-bulk-transfer send-many-memo-safe STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,hello ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50,memo2 -k my_private_key -n testnet -b\n ```\n ","pluginName":"@stacks/send-many-stx-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"privateKey":{"name":"privateKey","type":"option","char":"k","description":"Your private key","required":true},"broadcast":{"name":"broadcast","type":"boolean","char":"b","description":"Whether to broadcast this transaction. Omitting this flag will not broadcast the transaction.","allowNo":false},"network":{"name":"network","type":"option","char":"n","description":"Which network to broadcast this to","options":["mocknet","testnet","mainnet"],"default":"testnet"},"nodeUrl":{"name":"nodeUrl","type":"option","char":"u","description":"A default node URL will be used based on the `network` option. Use this flag to manually override.","required":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"\nReduce logging from this command. If this flag is passed with the broadcast (-b) flag,\nonly the transaction ID will be logged. If the quiet flagged is passed without broadcast, \nonly the raw transaction hex will be logged.\n","allowNo":false},"jsonOutput":{"name":"jsonOutput","type":"boolean","char":"j","description":"Output data in JSON format","allowNo":false},"contractAddress":{"name":"contractAddress","type":"option","char":"c","description":"Manually specify the contract address for send-many-memo. If omitted, default contracts will be used."},"nonce":{"name":"nonce","type":"option","description":"Optionally specify a nonce for this transaction"},"feeMultiplier":{"name":"feeMultiplier","type":"option","char":"m","description":"\nOptionally specify a fee multiplier. If passed, the tx fee will be (estimated fee + (estimated fee * multiplier)).\nFor example, a fee multiplier of 15 for a tx with an estimated fee of 200 would result in a tx with the fee of 230.\n","required":false},"allowSingleStxTransfer":{"name":"allowSingleStxTransfer","type":"boolean","char":"a","description":"\nIf enabled and only a single recipient is specified, a STX-transfer transaction type will be used rather than a contract-call transaction. \nIf omitted, a contract-call will always be used, which can be less efficient.\n","required":false,"allowNo":false}},"args":[{"name":"recipients","description":"\nA set of recipients in the format of \"address,amount_ustx,memo\". Memo is optional.\nExample: STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,memo ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50\n "}]},"send-many-memo":{"id":"send-many-memo","description":"Execute a bulk STX transfer, with memos attached.\n The bulk transfer is executed in a single transaction by invoking a `contract-call` on the \"send-many-memo\" contract.\n\n The default contracts can be found below:\n\n Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many-memo?chain=testnet\n Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many-memo?chain=mainnet\n\n Example usage:\n\n ```\n npx stx-bulk-transfer send-many-memo STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,hello ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50,memo2 -k my_private_key -n testnet -b\n ```\n ","pluginName":"@stacks/send-many-stx-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"privateKey":{"name":"privateKey","type":"option","char":"k","description":"Your private key","required":true},"broadcast":{"name":"broadcast","type":"boolean","char":"b","description":"Whether to broadcast this transaction. Omitting this flag will not broadcast the transaction.","allowNo":false},"network":{"name":"network","type":"option","char":"n","description":"Which network to broadcast this to","options":["mocknet","testnet","mainnet"],"default":"testnet"},"nodeUrl":{"name":"nodeUrl","type":"option","char":"u","description":"A default node URL will be used based on the `network` option. Use this flag to manually override.","required":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"\nReduce logging from this command. If this flag is passed with the broadcast (-b) flag,\nonly the transaction ID will be logged. If the quiet flagged is passed without broadcast, \nonly the raw transaction hex will be logged.\n","allowNo":false},"jsonOutput":{"name":"jsonOutput","type":"boolean","char":"j","description":"Output data in JSON format","allowNo":false},"contractAddress":{"name":"contractAddress","type":"option","char":"c","description":"Manually specify the contract address for send-many-memo. If omitted, default contracts will be used."},"nonce":{"name":"nonce","type":"option","description":"Optionally specify a nonce for this transaction"},"feeMultiplier":{"name":"feeMultiplier","type":"option","char":"m","description":"\nOptionally specify a fee multiplier. If passed, the tx fee will be (estimated fee + (estimated fee * multiplier)).\nFor example, a fee multiplier of 15 for a tx with an estimated fee of 200 would result in a tx with the fee of 230.\n","required":false},"allowSingleStxTransfer":{"name":"allowSingleStxTransfer","type":"boolean","char":"a","description":"\nIf enabled and only a single recipient is specified, a STX-transfer transaction type will be used rather than a contract-call transaction. \nIf omitted, a contract-call will always be used, which can be less efficient.\n","required":false,"allowNo":false}},"args":[{"name":"recipients","description":"\nA set of recipients in the format of \"address,amount_ustx,memo\". Memo is optional.\nExample: STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100,memo ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50\n "}]},"send-many":{"id":"send-many","description":"Execute a bulk STX transfer.\n The bulk transfer is executed in a single transaction by invoking a `contract-call` on the \"send-many\" contract.\n\n The default contracts can be found below:\n\n Testnet: https://explorer.stacks.co/txid/ST3F1X4QGV2SM8XD96X45M6RTQXKA1PZJZZCQAB4B.send-many?chain=testnet\n Mainnet: https://explorer.stacks.co/txid/SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.send-many?chain=mainnet\n\n Example usage:\n\n ```\n npx stx-bulk-transfer send-many STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100 ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50 -k my_private_key -n testnet -b\n ```\n ","pluginName":"@stacks/send-many-stx-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"privateKey":{"name":"privateKey","type":"option","char":"k","description":"Your private key","required":true},"broadcast":{"name":"broadcast","type":"boolean","char":"b","description":"Whether to broadcast this transaction. Omitting this flag will not broadcast the transaction.","allowNo":false},"network":{"name":"network","type":"option","char":"n","description":"Which network to broadcast this to","options":["mocknet","testnet","mainnet"],"default":"testnet"},"nodeUrl":{"name":"nodeUrl","type":"option","char":"u","description":"A default node URL will be used based on the `network` option. Use this flag to manually override.","required":false},"quiet":{"name":"quiet","type":"boolean","char":"q","description":"\nReduce logging from this command. If this flag is passed with the broadcast (-b) flag,\nonly the transaction ID will be logged. If the quiet flagged is passed without broadcast, \nonly the raw transaction hex will be logged.\n","allowNo":false},"contractAddress":{"name":"contractAddress","type":"option","char":"c","description":"Manually specify the contract address for send-many. If omitted, default contracts will be used."},"nonce":{"name":"nonce","type":"option","description":"Optionally specify a nonce for this transaction"},"feeMultiplier":{"name":"feeMultiplier","type":"option","char":"m","description":"\nOptionally specify a fee multiplier. If passed, the tx fee will be (estimated fee + (estimated fee * multiplier)).\nFor example, a fee multiplier of 15 for a tx with an estimated fee of 200 would result in a tx with the fee of 230.\n","required":false},"allowSingleStxTransfer":{"name":"allowSingleStxTransfer","type":"boolean","char":"a","description":"\nIf enabled and only a single recipient is specified, a STX-transfer transaction type will be used rather than a contract-call transaction. \nIf omitted, a contract-call will always be used, which can be less efficient.\n","required":false,"allowNo":false}},"args":[{"name":"recipients","description":"\nA set of recipients in the format of \"address,amount_ustx\"\nExample: STADMRP577SC3MCNP7T3PRSTZBJ75FJ59JGABZTW,100 ST2WPFYAW85A0YK9ACJR8JGWPM19VWYF90J8P5ZTH,50\n "}]},"validate-address":{"id":"validate-address","description":"Validates whether the input is a valid STX address for the provided network.\n \n Example usage:\n \n ```\n npx stx-bulk-transfer validate-address SP000000000000000000002Q6VF78 -n mainnet\n ```\n ","pluginName":"@stacks/send-many-stx-cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"network":{"name":"network","type":"option","char":"n","description":"Which network to check for","options":["mocknet","testnet","mainnet"],"default":"mainnet"},"verbose":{"name":"verbose","type":"boolean","char":"v","description":"Print error information for invalid addresses","required":false,"allowNo":false}},"args":[{"name":"address","description":"The address to validate"}]}}}
Loading