deso-protocol
Advanced tools
Comparing version 2.2.1 to 2.2.2
{ | ||
"name": "deso-protocol", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Client side typescript/javascript SDK for building web3 applications for the DeSo blockchain.", |
@@ -1,2 +0,2 @@ | ||
import { BuyOrSellCreatorCoinRequest, BuyOrSellCreatorCoinResponse, ConstructedTransactionResponse, RequestOptions, SendDeSoRequest, SendDeSoResponse, TransferCreatorCoinRequest, TransferCreatorCoinResponse, TxRequestWithOptionalFeesAndExtraData } from '../backend-types/index.js'; | ||
import { BuyOrSellCreatorCoinRequest, BuyOrSellCreatorCoinResponse, ConstructedTransactionResponse, SendDeSoRequest, SendDeSoResponse, TransferCreatorCoinRequest, TransferCreatorCoinResponse, TxRequestWithOptionalFeesAndExtraData } from '../backend-types/index.js'; | ||
import { PartialWithRequiredFields } from '../data/index.js'; | ||
@@ -13,3 +13,3 @@ import { ConstructedAndSubmittedTx, TxRequestOptions } from '../types.js'; | ||
export type BuyCreatorCoinRequestParams = TxRequestWithOptionalFeesAndExtraData<PartialWithRequiredFields<Omit<BuyOrSellCreatorCoinRequest, 'CreatorCoinToSellNanos' | 'OperationType'>, 'UpdaterPublicKeyBase58Check' | 'CreatorPublicKeyBase58Check' | 'DeSoToSellNanos'>>; | ||
export declare const buyCreatorCoin: (params: BuyCreatorCoinRequestParams, options?: RequestOptions) => Promise<ConstructedAndSubmittedTx<BuyOrSellCreatorCoinResponse | ConstructedTransactionResponse>>; | ||
export declare const buyCreatorCoin: (params: BuyCreatorCoinRequestParams, options?: TxRequestOptions) => Promise<ConstructedAndSubmittedTx<BuyOrSellCreatorCoinResponse | ConstructedTransactionResponse>>; | ||
/** | ||
@@ -19,3 +19,3 @@ * https://docs.deso.org/deso-backend/construct-transactions/financial-transactions-api#buy-or-sell-creator-coin | ||
export type SellCreatorCoinRequestParams = TxRequestWithOptionalFeesAndExtraData<PartialWithRequiredFields<Omit<BuyOrSellCreatorCoinRequest, 'DesoToSellNanos' | 'OperationType'>, 'UpdaterPublicKeyBase58Check' | 'CreatorPublicKeyBase58Check' | 'CreatorCoinToSellNanos'>>; | ||
export declare const sellCreatorCoin: (params: SellCreatorCoinRequestParams, options?: RequestOptions) => Promise<ConstructedAndSubmittedTx<BuyOrSellCreatorCoinResponse | ConstructedTransactionResponse>>; | ||
export declare const sellCreatorCoin: (params: SellCreatorCoinRequestParams, options?: TxRequestOptions) => Promise<ConstructedAndSubmittedTx<BuyOrSellCreatorCoinResponse | ConstructedTransactionResponse>>; | ||
/** | ||
@@ -26,2 +26,1 @@ * https://docs.deso.org/deso-backend/construct-transactions/financial-transactions-api#transfer-creator-coin | ||
export declare const transferCreatorCoin: (params: TransferCreatorCoinRequestParams, options?: TxRequestOptions) => Promise<ConstructedAndSubmittedTx<TransferCreatorCoinResponse>>; | ||
export declare const constructTransferCreatorCoinTransaction: (params: TransferCreatorCoinRequestParams) => Promise<ConstructedTransactionResponse>; |
@@ -1,2 +0,2 @@ | ||
import { TransactionMetadataBasicTransfer, TransactionMetadataCreatorCoinTransfer, TransactionOutput, bs58PublicKeyToCompressedBytes, identity, } from '../identity/index.js'; | ||
import { TransactionMetadataBasicTransfer, TransactionMetadataCreatorCoin, TransactionMetadataCreatorCoinTransfer, TransactionOutput, bs58PublicKeyToCompressedBytes, identity, } from '../identity/index.js'; | ||
import { constructBalanceModelTx, getTxWithFeeNanos, handleSignAndSubmit, isMaybeDeSoPublicKey, sumTransactionFees, } from '../internal.js'; | ||
@@ -64,4 +64,20 @@ import { guardTxPermission } from './utils.js'; | ||
}; | ||
export const buyCreatorCoin = (params, options) => { | ||
// TODO: Add tx permission check once local tx construction is implemented. | ||
export const buyCreatorCoin = async (params, options) => { | ||
const txWithFee = getTxWithFeeNanos(params.UpdaterPublicKeyBase58Check, buildBuyCreatorCoinMetadata(params), { | ||
ExtraData: params.ExtraData, | ||
MinFeeRateNanosPerKB: params.MinFeeRateNanosPerKB, | ||
TransactionFees: params.TransactionFees, | ||
}); | ||
if (options?.checkPermissions !== false) { | ||
await guardTxPermission({ | ||
GlobalDESOLimit: params.DeSoToSellNanos + | ||
txWithFee.feeNanos + | ||
sumTransactionFees(params.TransactionFees), | ||
CreatorCoinOperationLimitMap: { | ||
[params.CreatorPublicKeyBase58Check]: { | ||
buy: options?.txLimitCount ?? 1, | ||
}, | ||
}, | ||
}); | ||
} | ||
return handleSignAndSubmit('api/v0/buy-or-sell-creator-coin', { | ||
@@ -72,4 +88,18 @@ ...params, | ||
}; | ||
export const sellCreatorCoin = (params, options) => { | ||
// TODO: Add tx permission check once local tx construction is implemented. | ||
export const sellCreatorCoin = async (params, options) => { | ||
const txWithFee = getTxWithFeeNanos(params.UpdaterPublicKeyBase58Check, buildSellCreatorCoinMetadata(params), { | ||
ExtraData: params.ExtraData, | ||
MinFeeRateNanosPerKB: params.MinFeeRateNanosPerKB, | ||
TransactionFees: params.TransactionFees, | ||
}); | ||
if (options?.checkPermissions !== false) { | ||
await guardTxPermission({ | ||
GlobalDESOLimit: txWithFee.feeNanos + sumTransactionFees(params.TransactionFees), | ||
CreatorCoinOperationLimitMap: { | ||
[params.CreatorPublicKeyBase58Check]: { | ||
sell: options?.txLimitCount ?? 1, | ||
}, | ||
}, | ||
}); | ||
} | ||
return handleSignAndSubmit('api/v0/buy-or-sell-creator-coin', { | ||
@@ -108,3 +138,3 @@ ...params, | ||
}; | ||
export const constructTransferCreatorCoinTransaction = (params) => { | ||
const constructTransferCreatorCoinTransaction = (params) => { | ||
if (!isMaybeDeSoPublicKey(params.ReceiverUsernameOrPublicKeyBase58Check)) { | ||
@@ -119,2 +149,26 @@ return Promise.reject('must provide public key, not user name for local construction'); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmluYW5jaWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RyYW5zYWN0aW9ucy9maW5hbm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JDb2luTWV0YWRhdGEocGFyYW1zKSxcbiAgICB7XG4gICAgICBFeHRyYURhdGE6IHBhcmFtcy5FeHRyYURhdGEsXG4gICAgICBNaW5GZWVSYXRlTmFub3NQZXJLQjogcGFyYW1zLk1pbkZlZVJhdGVOYW5vc1BlcktCLFxuICAgICAgVHJhbnNhY3Rpb25GZWVzOiBwYXJhbXMuVHJhbnNhY3Rpb25GZWVzLFxuICAgIH1cbiAgKTtcbn07XG4iXX0= | ||
const buildBuyCreatorCoinMetadata = (params) => { | ||
// NOTE: This is not exactly accurate and gives an upper bound estimate for | ||
// minCreatorCoinExpectedNanos. It should not but used for actual tx | ||
// construction, but it is useful for estimating tx fees. | ||
const metadata = new TransactionMetadataCreatorCoin(); | ||
metadata.profilePublicKey = bs58PublicKeyToCompressedBytes(params.CreatorPublicKeyBase58Check); | ||
metadata.operationType = 0; | ||
metadata.desoToSellNanos = params.DeSoToSellNanos; | ||
metadata.minCreatorCoinExpectedNanos = | ||
params.MinCreatorCoinExpectedNanos ?? Number.MAX_SAFE_INTEGER; | ||
return metadata; | ||
}; | ||
const buildSellCreatorCoinMetadata = (params) => { | ||
// NOTE: This is not exactly accurate and gives an upper bound estimate for | ||
// minDeSoExpectedNanos. It should not but used for actual tx construction, | ||
// but it is useful for estimating tx fees. | ||
const metadata = new TransactionMetadataCreatorCoin(); | ||
metadata.profilePublicKey = bs58PublicKeyToCompressedBytes(params.CreatorPublicKeyBase58Check); | ||
metadata.operationType = 1; | ||
metadata.creatorCoinToSellNanos = params.CreatorCoinToSellNanos; | ||
metadata.minDeSoExpectedNanos = | ||
params.MinDeSoExpectedNanos ?? Number.MAX_SAFE_INTEGER; | ||
return metadata; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmluYW5jaWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RyYW5zYWN0aW9ucy9maW5hbmNpYWwud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zLiBJdCBzaG91bGQgbm90IGJ1dCB1c2VkIGZvciBhY3R1YWwgdHggY29uc3RydWN0aW9uLFxuICAvLyBidXQgaXQgaXMgdXNlZnVsIGZvciBlc3RpbWF0aW5nIHR4IGZlZXMuXG4gIGNvbnN0IG1ldGFkYXRhID0gbmV3IFRyYW5zYWN0aW9uTWV0YWRhdGFDcmVhdG9yQ29pbigpO1xuICBtZXRhZGF0YS5wcm9maWxlUHVibGljS2V5ID0gYnM1OFB1YmxpY0tleVRvQ29tcHJlc3NlZEJ5dGVzKFxuICAgIHBhcmFtcy5DcmVhdG9yUHVibGljS2V5QmFzZTU4Q2hlY2tcbiAgKTtcbiAgbWV0YWRhdGEub3BlcmF0aW9uVHlwZSA9IDE7XG4gIG1ldGFkYXRhLmNyZWF0b3JDb2luVG9TZWxsTmFub3MgPSBwYXJhbXMuQ3JlYXRvckNvaW5Ub1NlbGxOYW5vcztcbiAgbWV0YWRhdGEubWluRGVTb0V4cGVjdGVkTmFub3MgPVxuICAgIHBhcmFtcy5NaW5EZVNvRXhwZWN0ZWROYW5vcyA/PyBOdW1iZXIuTUFYX1NBRkVfSU5URUdFUjtcblxuICByZXR1cm4gbWV0YWRhdGE7XG59O1xuIl19 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1516938
14025