deso-protocol
Advanced tools
Comparing version 2.6.7-beta.1 to 2.6.7-beta.2
{ | ||
"name": "deso-protocol", | ||
"version": "2.6.7-beta.1", | ||
"version": "2.6.7-beta.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Client side typescript/javascript SDK for building web3 applications for the DeSo blockchain.", |
@@ -1,4 +0,4 @@ | ||
import { ConstructedTransactionResponse, DAOCoinLimitOrderRequest, DAOCoinOrderResponse, DAOCoinLimitOrderWithCancelOrderIDRequest, DAOCoinRequest, DAOCoinResponse, RequestOptions, TransferDAOCoinRequest, TransferDAOCoinResponse, TxRequestWithOptionalFeesAndExtraData, DAOCoinMarketOrderRequest } from '../backend-types/index.js'; | ||
import { ConstructedTransactionResponse, DAOCoinLimitOrderRequest, DAOCoinLimitOrderWithCancelOrderIDRequest, DAOCoinMarketOrderRequest, DAOCoinOrderResponse, DAOCoinRequest, DAOCoinResponse, RequestOptions, TransferDAOCoinRequest, TransferDAOCoinResponse, TxRequestWithOptionalFeesAndExtraData } from '../backend-types/index.js'; | ||
import { PartialWithRequiredFields } from '../data/index.js'; | ||
import { ConstructedAndSubmittedTx } from '../types.js'; | ||
import { ConstructedAndSubmittedTx, TxRequestOptions } from '../types.js'; | ||
/** | ||
@@ -28,3 +28,3 @@ * https://docs.deso.org/deso-backend/construct-transactions/dao-transactions-api#create-deso-token-dao-coin | ||
*/ | ||
export declare const transferDeSoToken: (params: TxRequestWithOptionalFeesAndExtraData<TransferDAOCoinRequest>, options?: RequestOptions) => Promise<ConstructedAndSubmittedTx<TransferDAOCoinResponse>>; | ||
export declare const transferDeSoToken: (params: TxRequestWithOptionalFeesAndExtraData<TransferDAOCoinRequest>, options?: TxRequestOptions) => Promise<ConstructedAndSubmittedTx<TransferDAOCoinResponse>>; | ||
export declare const constructTransferDeSoToken: (params: TxRequestWithOptionalFeesAndExtraData<TransferDAOCoinRequest>) => Promise<ConstructedTransactionResponse>; | ||
@@ -31,0 +31,0 @@ /** |
import { hexToBytes } from '@noble/hashes/utils'; | ||
import { TransactionMetadataDAOCoin, TransactionMetadataTransferDAOCoin, bs58PublicKeyToCompressedBytes, } from '../identity/index.js'; | ||
import { constructBalanceModelTx, handleSignAndSubmit, isMaybeDeSoPublicKey, } from '../internal.js'; | ||
import { TransactionMetadataDAOCoin, TransactionMetadataTransferDAOCoin, bs58PublicKeyToCompressedBytes, identity, } from '../identity/index.js'; | ||
import { constructBalanceModelTx, getTxWithFeeNanos, handleSignAndSubmit, isMaybeDeSoPublicKey, sumTransactionFees, } from '../internal.js'; | ||
import { guardTxPermission } from './utils.js'; | ||
export const burnDeSoToken = (params, options) => { | ||
@@ -98,4 +99,2 @@ return handleSignAndSubmit('api/v0/dao-coin', { | ||
const metadata = new TransactionMetadataDAOCoin(); | ||
// TODO: I know we're passing hex strings representing uint256, but need | ||
// to figure out how they go to bytes. | ||
if (!isMaybeDeSoPublicKey(params.ProfilePublicKeyBase58CheckOrUsername)) { | ||
@@ -115,3 +114,34 @@ return Promise.reject('must provide profile public key, not username for local transaction construction'); | ||
*/ | ||
export const transferDeSoToken = (params, options) => { | ||
export const transferDeSoToken = async (params, options) => { | ||
if (options?.checkPermissions !== false) { | ||
const txWithFee = getTxWithFeeNanos(params.SenderPublicKeyBase58Check, new TransactionMetadataTransferDAOCoin(), { | ||
// TODO: I'm not sure exactly what outputs are needed here... for the time | ||
// being I'm just adding a static 1500 nanos to make sure the derived key | ||
// transaction can be submitted. | ||
// Outputs: ..., | ||
ExtraData: params.ExtraData, | ||
MinFeeRateNanosPerKB: params.MinFeeRateNanosPerKB, | ||
TransactionFees: params.TransactionFees, | ||
}); | ||
if (!isMaybeDeSoPublicKey(params.ProfilePublicKeyBase58CheckOrUsername)) { | ||
return Promise.reject('must provide profile public key, not username for ProfilePublicKeyBase58CheckOrUsername when checking dao coin transfer permissions'); | ||
} | ||
await guardTxPermission({ | ||
GlobalDESOLimit: | ||
// TODO: when I figure out how to properly calculate the fee for this transaction | ||
// we can remove this static 1500 buffer. | ||
txWithFee.feeNanos + sumTransactionFees(params.TransactionFees) + 1500, | ||
TransactionCountLimitMap: { | ||
DAO_COIN_TRANSFER: options?.txLimitCount ?? | ||
identity.transactionSpendingLimitOptions.TransactionCountLimitMap | ||
?.DAO_COIN_TRANSFER ?? | ||
1, | ||
}, | ||
DAOCoinOperationLimitMap: { | ||
[params.ProfilePublicKeyBase58CheckOrUsername]: { | ||
transfer: 1, | ||
}, | ||
}, | ||
}); | ||
} | ||
return handleSignAndSubmit('api/v0/transfer-dao-coin', params, { | ||
@@ -170,2 +200,2 @@ ...options, | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzby10b2tlbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHJhbnNhY3Rpb25zL2Rlc28tdG9rZW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQWdCakQsT0FBTyxFQUNMLDBCQUEwQixFQUMxQixrQ0FBa0MsRUFDbEMsOEJBQThCLEdBQy9CLE1BQU0sc0JBQXNCLENBQUM7QUFDOUIsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixtQkFBbUIsRUFDbkIsb0JBQW9CLEdBQ3JCLE1BQU0sZ0JBQWdCLENBQUM7QUFjeEIsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLENBQzNCLE1BQTJDLEVBQzNDLE9BQXdCLEVBQzZCLEVBQUU7SUFDdkQsT0FBTyxtQkFBbUIsQ0FDeEIsaUJBQWlCLEVBQ2pCO1FBQ0UsR0FBRyxNQUFNO1FBQ1QsYUFBYSxFQUFFLE1BQU07S0FDdEIsRUFDRCxFQUFFLEdBQUcsT0FBTyxFQUFFLG9CQUFvQixFQUFFLGlDQUFpQyxFQUFFLENBQ3hFLENBQUM7QUFDSixDQUFDLENBQ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va2VuLWRhby1jb2luLWxpbWl0LW9yZGVyXG4gKi9cbmV4cG9ydCBjb25zdCBjYW5jZWxEZVNvVG9rZW5MaW1pdE9yZGVyID0gKFxuICBwYXJhbXM6IFR4UmVxdWVzdFdpdGhPcHRpb25hbEZlZXNBbmRFeHRyYURhdGE8REFPQ29pbkxpbWl0T3JkZXJXaXRoQ2FuY2VsT3JkZXJJRFJlcXVlc3Q+LFxuICBvcHRpb25zPzogUmVxdWVzdE9wdGlvbnNcbik6IFByb21pc2U8Q29uc3RydWN0ZWRBbmRTdWJtaXR0ZWRUeDxEQU9Db2luT3JkZXJSZXNwb25zZT4+ID0+IHtcbiAgcmV0dXJuIGhhbmRsZVNpZ25BbmRTdWJtaXQoXG4gICAgJ2FwaS92MC9jYW5jZWwtZGFvLWNvaW4tbGltaXQtb3JkZXInLFxuICAgIHBhcmFtcyxcbiAgICBvcHRpb25zXG4gICk7XG59O1xuIl19 |
@@ -6,10 +6,4 @@ import { BuyOrSellCreatorCoinRequest, BuyOrSellCreatorCoinResponse, ConstructedTransactionResponse, SendDeSoRequest, SendDeSoResponse, TransferCreatorCoinRequest, TransferCreatorCoinResponse, TxRequestWithOptionalFeesAndExtraData } from '../backend-types/index.js'; | ||
* https://docs.deso.org/deso-backend/construct-transactions/financial-transactions-api#send-deso | ||
* | ||
* NOTE: In the case of a max send, the AmountNanos param will be a -1, which | ||
* is not useful for calculating the GlobalDESOLimit. In this case, the caller | ||
* should provide the optional spendingLimitAmountNanos to be used instead. | ||
*/ | ||
export declare const sendDeso: (params: TxRequestWithOptionalFeesAndExtraData<SendDeSoRequest>, options?: TxRequestOptions & { | ||
spendingLimitAmountNanos?: number; | ||
}) => Promise<ConstructedAndSubmittedTx<SendDeSoResponse | ConstructedTransactionResponse>>; | ||
export declare const sendDeso: (params: TxRequestWithOptionalFeesAndExtraData<SendDeSoRequest>, options?: TxRequestOptions) => Promise<ConstructedAndSubmittedTx<SendDeSoResponse | ConstructedTransactionResponse>>; | ||
export declare const constructSendDeSoTransaction: (params: TxRequestWithOptionalFeesAndExtraData<SendDeSoRequest>) => Promise<ConstructedTransactionResponse>; | ||
@@ -16,0 +10,0 @@ /** |
@@ -6,6 +6,2 @@ import { TransactionMetadataBasicTransfer, TransactionMetadataCreatorCoin, TransactionMetadataCreatorCoinTransfer, TransactionOutput, bs58PublicKeyToCompressedBytes, identity, } from '../identity/index.js'; | ||
* https://docs.deso.org/deso-backend/construct-transactions/financial-transactions-api#send-deso | ||
* | ||
* NOTE: In the case of a max send, the AmountNanos param will be a -1, which | ||
* is not useful for calculating the GlobalDESOLimit. In this case, the caller | ||
* should provide the optional spendingLimitAmountNanos to be used instead. | ||
*/ | ||
@@ -28,8 +24,5 @@ export const sendDeso = async (params, options) => { | ||
}); | ||
const amountNanos = typeof options?.spendingLimitAmountNanos === 'number' | ||
? options.spendingLimitAmountNanos | ||
: params.AmountNanos; | ||
if (options?.checkPermissions !== false) { | ||
await guardTxPermission({ | ||
GlobalDESOLimit: amountNanos + | ||
GlobalDESOLimit: params.AmountNanos + | ||
txWithFee.feeNanos + | ||
@@ -179,2 +172,2 @@ sumTransactionFees(params.TransactionFees), | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmluYW5jaWFsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RyYW5zYWN0aW9ucy9maW5hbmNpYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBV0EsT0FBTyxFQUNMLGdDQUFnQyxFQUNoQyw4QkFBOEIsRUFDOUIsc0NBQXNDLEVBQ3RDLGlCQUFpQixFQUNqQiw4QkFBOEIsRUFDOUIsUUFBUSxHQUNULE1BQU0sc0JBQXNCLENBQUM7QUFDOUIsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDakIsbUJBQW1CLEVBQ25CLG9CQUFvQixFQUNwQixrQkFBa0IsR0FDbk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Tk9URTogVGhpcyBpcyBub3QgZXhhY3RseSBhY2N1cmF0ZSBhbmQgZ2l2ZXMgYW4gdXBwZXIgYm91bmQgZXN0aW1hdGUgZm9yXG4gIC8vIG1pbkRlU29FeHBlY3RlZE5hbm9zLiBJdCBzaG91bGQgbm90IGJ1dCB1c2VkIGZvciBhY3R1YWwgdHggY29uc3RydWN0aW9uLFxuICAvLyBidXQgaXQgaXMgdXNlZnVsIGZvciBlc3RpbWF0aW5nIHR4IGZlZXMuXG4gIGNvbnN0IG1ldGFkYXRhID0gbmV3IFRyYW5zYWN0aW9uTWV0YWRhdGFDcmVhdG9yQ29pbigpO1xuICBtZXRhZGF0YS5wcm9maWxlUHVibGljS2V5ID0gYnM1OFB1YmxpY0tleVRvQ29tcHJlc3NlZEJ5dGVzKFxuICAgIHBhcmFtcy5DcmVhdG9yUHVibGljS2V5QmFzZTU4Q2hlY2tcbiAgKTtcbiAgbWV0YWRhdGEub3BlcmF0aW9uVHlwZSA9IDE7XG4gIG1ldGFkYXRhLmNyZWF0b3JDb2luVG9TZWxsTmFub3MgPSBwYXJhbXMuQ3JlYXRvckNvaW5Ub1NlbGxOYW5vcztcbiAgbWV0YWRhdGEubWluRGVTb0V4cGVjdGVkTmFub3MgPVxuICAgIHBhcmFtcy5NaW5EZVNvRXhwZWN0ZWROYW5vcyA/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
1533639
14148