@aeternity/aepp-sdk 12.1.0 → 12.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +13 -12
- package/dist/aepp-sdk.js.map +1 -1
- package/es/deprecated/index.d.ts +1 -1
- package/es/deprecated/index.mjs +4 -4
- package/es/deprecated/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/deprecated/index.ts +5 -3
package/es/deprecated/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare const createSalt: typeof salt;
|
|
|
35
35
|
* calculateMinFee('spendTx', { gasLimit, params })
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export declare function calculateMinFee(txType: Tag, { params, vsn, denomination }: CalculateMinFeeOptions): BigNumber;
|
|
39
39
|
interface CalculateMinFeeOptions {
|
|
40
40
|
params: TxParamsCommon;
|
|
41
41
|
vsn?: number;
|
package/es/deprecated/index.mjs
CHANGED
|
@@ -34,15 +34,15 @@ export const createSalt = salt;
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
export
|
|
37
|
+
export function calculateMinFee(txType, _ref) {
|
|
38
38
|
let {
|
|
39
39
|
params,
|
|
40
40
|
vsn,
|
|
41
41
|
denomination
|
|
42
42
|
} = _ref;
|
|
43
|
-
return calculateMinFeeInternal(txType, // @ts-expect-error anyway this planned to be removed
|
|
44
|
-
|
|
45
|
-
fee
|
|
43
|
+
return calculateMinFeeInternal(txType, fee => // @ts-expect-error anyway this planned to be removed
|
|
44
|
+
buildTx({ ...params,
|
|
45
|
+
_computingMinFee: fee
|
|
46
46
|
}, txType, {
|
|
47
47
|
vsn,
|
|
48
48
|
denomination
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["buildTx","calculateMinFee","calculateMinFeeInternal","mapObject","salt","Math","floor","random","Number","MAX_SAFE_INTEGER","createSalt","txType","params","vsn","denomination","fee","GAS_MAX","TX_TYPE","ID_TAG","account","name","commitment","oracle","contract","channel","PREFIX_ID_TAG","ak","nm","cm","ok","ct","ch","ID_TAG_PREFIX","key","value","POINTER_KEY_BY_PREFIX"],"sources":["../../src/deprecated/index.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport { calculateMinFee as calculateMinFeeInternal } from '../tx/builder/field-types/fee';\nimport { TxParamsCommon } from '../tx/builder/schema';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\nimport { mapObject } from '../utils/other';\nimport { Encoding } from '../utils/encoder';\n\nexport * from './methods';\n\n/**\n * @deprecated use NamePointer from apis/node instead\n * @hidden\n */\nexport interface Pointer {\n key: string;\n id: string;\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport function salt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport const createSalt = salt;\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param options - Options object\n * @param options.params - Tx params\n * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field\n * @hidden\n * @example\n * ```js\n * calculateMinFee('spendTx', { gasLimit, params })\n * ```\n */\nexport
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["buildTx","calculateMinFee","calculateMinFeeInternal","mapObject","salt","Math","floor","random","Number","MAX_SAFE_INTEGER","createSalt","txType","params","vsn","denomination","fee","_computingMinFee","GAS_MAX","TX_TYPE","ID_TAG","account","name","commitment","oracle","contract","channel","PREFIX_ID_TAG","ak","nm","cm","ok","ct","ch","ID_TAG_PREFIX","key","value","POINTER_KEY_BY_PREFIX"],"sources":["../../src/deprecated/index.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { buildTx } from '../tx/builder';\nimport { Tag } from '../tx/builder/constants';\nimport { calculateMinFee as calculateMinFeeInternal } from '../tx/builder/field-types/fee';\nimport { TxParamsCommon } from '../tx/builder/schema';\nimport { AE_AMOUNT_FORMATS } from '../utils/amount-formatter';\nimport { mapObject } from '../utils/other';\nimport { Encoding } from '../utils/encoder';\n\nexport * from './methods';\n\n/**\n * @deprecated use NamePointer from apis/node instead\n * @hidden\n */\nexport interface Pointer {\n key: string;\n id: string;\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport function salt(): number {\n return Math.floor(Math.random() * Math.floor(Number.MAX_SAFE_INTEGER));\n}\n\n/**\n * @deprecated use genSalt instead\n * @hidden\n */\nexport const createSalt = salt;\n\n/**\n * Calculate min fee\n * @category transaction builder\n * @param txType - Transaction type\n * @param options - Options object\n * @param options.params - Tx params\n * @deprecated use buildTx to generate transaction, unpack it and refer to `fee` field\n * @hidden\n * @example\n * ```js\n * calculateMinFee('spendTx', { gasLimit, params })\n * ```\n */\nexport function calculateMinFee(\n txType: Tag,\n { params, vsn, denomination }: CalculateMinFeeOptions,\n): BigNumber {\n return calculateMinFeeInternal(\n txType,\n (fee: BigNumber) => (\n // @ts-expect-error anyway this planned to be removed\n buildTx({ ...params, _computingMinFee: fee }, txType, { vsn, denomination })\n ),\n );\n}\n\ninterface CalculateMinFeeOptions {\n params: TxParamsCommon;\n vsn?: number;\n denomination?: AE_AMOUNT_FORMATS;\n}\n\n/**\n * @deprecated Maximum gas limit depends on transaction size, this value is outdated,\n * sdk check/provides gasLimit by itself while building a transaction\n * @hidden\n */\nexport const GAS_MAX = 1600000 - 21000;\n\n/**\n * @deprecated use `Tag`\n * @hidden\n */\nexport enum TX_TYPE {\n account = 10,\n signed = 11,\n spend = 12,\n oracleRegister = 22,\n oracleQuery = 23,\n oracleResponse = 24,\n oracleExtend = 25,\n nameClaim = 32,\n namePreClaim = 33,\n nameUpdate = 34,\n nameRevoke = 35,\n nameTransfer = 36,\n contract = 40,\n contractCallResult = 41,\n contractCreate = 42,\n contractCall = 43,\n channelCreate = 50,\n channelDeposit = 51,\n channelWithdraw = 52,\n channelCloseMutual = 53,\n channelCloseSolo = 54,\n channelSlash = 55,\n channelSettle = 56,\n channelOffChain = 57,\n channel = 58,\n channelSnapshotSolo = 59,\n proofOfInclusion = 60,\n stateTrees = 62,\n merklePatriciaTree = 63,\n merklePatriciaTreeValue = 64,\n sophiaByteCode = 70,\n gaAttach = 80,\n gaMeta = 81,\n payingFor = 82,\n channelForceProgress = 521,\n channelOffChainUpdateTransfer = 570,\n channelOffChainUpdateDeposit = 571,\n channelOffChainUpdateWithdrawal = 572,\n channelOffChainCreateContract = 573,\n channelOffChainCallContract = 574,\n channelReconnect = 575,\n contractsTree = 621,\n contractCallsTree = 622,\n channelsTree = 623,\n nameserviceTree = 624,\n oraclesTree = 625,\n accountsTree = 626,\n}\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG = {\n account: 1,\n name: 2,\n commitment: 3,\n oracle: 4,\n contract: 5,\n channel: 6,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const PREFIX_ID_TAG = {\n ak: ID_TAG.account,\n nm: ID_TAG.name,\n cm: ID_TAG.commitment,\n ok: ID_TAG.oracle,\n ct: ID_TAG.contract,\n ch: ID_TAG.channel,\n} as const;\n\n/**\n * @deprecated use `readId`, `writeId`\n * @hidden\n */\nexport const ID_TAG_PREFIX = mapObject(\n PREFIX_ID_TAG,\n ([key, value]: [Encoding, number]) => [value, key],\n);\n\n/**\n * @deprecated use `getDefaultPointerKey`\n * @hidden\n */\nexport enum POINTER_KEY_BY_PREFIX {\n ak = 'account_pubkey',\n ok = 'oracle_pubkey',\n ct = 'contract_pubkey',\n ch = 'channel',\n}\n"],"mappings":"SACSA,O;SAEAC,eAAe,IAAIC,uB;SAGnBC,S;;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;EAAAA,qB;EAAAA,qB;GAAAA,qB,KAAAA,qB"}
|
package/package.json
CHANGED
package/src/deprecated/index.ts
CHANGED
|
@@ -45,14 +45,16 @@ export const createSalt = salt;
|
|
|
45
45
|
* calculateMinFee('spendTx', { gasLimit, params })
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
export
|
|
48
|
+
export function calculateMinFee(
|
|
49
49
|
txType: Tag,
|
|
50
50
|
{ params, vsn, denomination }: CalculateMinFeeOptions,
|
|
51
51
|
): BigNumber {
|
|
52
52
|
return calculateMinFeeInternal(
|
|
53
53
|
txType,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
(fee: BigNumber) => (
|
|
55
|
+
// @ts-expect-error anyway this planned to be removed
|
|
56
|
+
buildTx({ ...params, _computingMinFee: fee }, txType, { vsn, denomination })
|
|
57
|
+
),
|
|
56
58
|
);
|
|
57
59
|
}
|
|
58
60
|
|