diff --git a/packages/chain-adapters/src/constants.ts b/packages/chain-adapters/src/constants.ts new file mode 100644 index 000000000..5f58a6a4b --- /dev/null +++ b/packages/chain-adapters/src/constants.ts @@ -0,0 +1 @@ +export const SHAPESHIFT_TRACKING_ID = 'shapeshift' diff --git a/packages/chain-adapters/src/cosmossdk/CosmosSdkBaseAdapter.ts b/packages/chain-adapters/src/cosmossdk/CosmosSdkBaseAdapter.ts index 2cacf7af5..31409828e 100644 --- a/packages/chain-adapters/src/cosmossdk/CosmosSdkBaseAdapter.ts +++ b/packages/chain-adapters/src/cosmossdk/CosmosSdkBaseAdapter.ts @@ -4,6 +4,7 @@ import * as unchained from '@shapeshiftoss/unchained-client' import { bech32 } from 'bech32' import { ChainAdapter as IChainAdapter } from '../api' +import { SHAPESHIFT_TRACKING_ID } from '../constants' import { ErrorHandler } from '../error/ErrorHandler' import { Account, @@ -292,7 +293,7 @@ export abstract class CosmosSdkBaseAdapter implement accountNumber, chainSpecific: { gas, fee }, msg, - memo = '', + memo, } = tx const bip44Params = this.getBIP44Params({ accountNumber }) @@ -301,7 +302,7 @@ export abstract class CosmosSdkBaseAdapter implement fee: { amount: [{ amount: bnOrZero(fee).toString(), denom: this.denom }], gas }, msg: [msg], signatures: [], - memo, + memo: memo ?? SHAPESHIFT_TRACKING_ID, // Apply tracking ID to all transactions where no memo is provided. Pass '' in memo field when tracking ID should not be applied. } const txToSign = { diff --git a/packages/chain-adapters/src/cosmossdk/cosmos/CosmosChainAdapter.ts b/packages/chain-adapters/src/cosmossdk/cosmos/CosmosChainAdapter.ts index 73fc900b8..afc037894 100644 --- a/packages/chain-adapters/src/cosmossdk/cosmos/CosmosChainAdapter.ts +++ b/packages/chain-adapters/src/cosmossdk/cosmos/CosmosChainAdapter.ts @@ -98,6 +98,7 @@ export class ChainAdapter extends CosmosSdkBaseAdapter