Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/chain-adapters/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SHAPESHIFT_TRACKING_ID = 'shapeshift'
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -292,7 +293,7 @@ export abstract class CosmosSdkBaseAdapter<T extends CosmosSdkChainId> implement
accountNumber,
chainSpecific: { gas, fee },
msg,
memo = '',
memo,
} = tx

const bip44Params = this.getBIP44Params({ accountNumber })
Expand All @@ -301,7 +302,7 @@ export abstract class CosmosSdkBaseAdapter<T extends CosmosSdkChainId> 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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export class ChainAdapter extends CosmosSdkBaseAdapter<KnownChainIds.CosmosMainn
value,
wallet,
} = tx
tx.memo ??= ''

const from = await this.getAddress({ accountNumber, wallet })
const account = await this.getAccount(from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class ChainAdapter extends CosmosSdkBaseAdapter<KnownChainIds.OsmosisMain
value,
wallet,
} = tx
tx.memo ??= ''

const from = await this.getAddress({ accountNumber, wallet })
const account = await this.getAccount(from)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class ChainAdapter extends CosmosSdkBaseAdapter<KnownChainIds.ThorchainMa
value,
wallet,
} = tx
tx.memo ??= ''

const from = await this.getAddress({ accountNumber, wallet })
const account = await this.getAccount(from)
Expand Down