stacks-archive / stacks-transactions-js

The JavaScript library for generating Stacks 2.0 transactions
19 stars 17 forks source link

Question: builder method names #76

Closed aulneau closed 4 years ago

aulneau commented 4 years ago

I see we have these methods:

Questions:

yknl commented 4 years ago

Why is makeSmartContractDeploy prefixed with Smart vs makeContractDeploy to be in line with makeContractCall?

Agree with removing "smart" from makeSmartContractDeploy

Why are we prefixing some things with STX? Would makeTokenTransfer make sense, and makeContractPostCondition?

The reason that those functions are prefixed with STX is because there could be other types of token transfer transactions.

reedrosenbluth commented 4 years ago

I actually think the current naming is in line with is published in SIP-005 https://github.com/blockstack/stacks-blockchain/blob/sip/sip-005/sip/sip-005-blocks-and-transactions.md#type-1-instantiating-a-smart-contract

The smart prefix is used for a deploy tx, but not for a contract-call tx:

The payload type ID can take any of the following values:

0x00: the payload that follows is a token-transfer payload
0x01: the payload that follows is a contract-call payload
0x02: the payload that follows is a smart-contract payload
0x03: the payload that follows is a poison-microblock payload
0x04: the payload that follows is a coinbase payload.
reedrosenbluth commented 4 years ago

Let's update the SIP to match the names Thomas suggested, and then we can make these changes in the tx-lib