Skip to main content

Transactions Scope

Source: src/sdk/transactions.ts

Use sdk.transactions for transaction retrieval, withdrawals, frozen-state actions, portfolio execution, and portfolio message signing.

Methods

findAll(filters?: TransactionFilters, pagination?: TransactionPaginationParams): Promise<Transaction[]>

Endpoint

GET /api/v1/core/transactions

How it works

Fetches transactions and forwards supported filter and pagination fields when they are provided.

Arguments

ArgumentTypeRequiredNotes
filters.statusTransactionStatusNoForwarded as status.
filters.customerIdstringNoForwarded as customerId.
filters.accountTypeAccountTypeNoForwarded as accountType.
pagination.pagenumberNoForwarded as page.
pagination.pageSizenumberNoForwarded as pageSize.

Returns

Promise<Transaction[]>

Behavior Notes

  • The SDK can send status, customerId, accountType, page, and pageSize.
  • It returns the response body directly as Transaction[].

Request Examples

const filteredTransactions = await sdk.transactions.findAll({
status: TransactionStatus.PENDING,
accountType: AccountType.PORTFOLIO,
});

const paginatedTransactions = await sdk.transactions.findAll(undefined, {
page: 1,
pageSize: 10,
});

const filteredPaginatedTransactions = await sdk.transactions.findAll(
{
status: TransactionStatus.PENDING,
customerId: 'customer-1',
accountType: AccountType.PORTFOLIO,
},
{
page: 1,
pageSize: 10,
},
);

Response Example

[
{
id: 'tx-1',
assetId: 'asset-1',
type: 'deposit',
amount: '100.00',
status: 'PENDING',
network: 'ethereum',
participantId: 'participant-1',
reference: 'ref-1',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:00:00Z',
executedAt: null,
phases: [],
},
]

getById(id: string): Promise<Transaction>

Endpoint

GET /api/v1/core/transactions/:id

How it works

Fetches one transaction by identifier.

Arguments

ArgumentTypeRequiredNotes
idstringYesTransaction identifier.

Returns

Promise<Transaction>

Request Example

const tx = await sdk.transactions.getById('tx-id');

Response Example

{
id: 'tx-id',
assetId: 'asset-1',
type: 'withdrawal',
amount: '50.00',
status: 'PENDING',
network: 'ethereum',
participantId: 'participant-1',
reference: 'withdrawal-001',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:00:00Z',
executedAt: null,
phases: [],
}

createWithdrawal(dto: CreateWithdrawalDto): Promise<Transaction>

Endpoint

POST /api/v1/core/transactions/withdrawal

How it works

Creates a withdrawal transaction using the current withdrawal DTO.

Arguments

ArgumentTypeRequiredNotes
dto.accountIdstringYesSource account ID.
dto.amountstringYesWithdrawal amount.
dto.assetCodestringYesAsset code.
dto.networkstringYesNetwork name string.
dto.participantIdstringYesParticipant identifier.
dto.destinationAddressstringYesDestination address.
dto.referencestringNoOptional reference string.

Returns

Promise<Transaction>

Request Example

const tx = await sdk.transactions.createWithdrawal({
accountId: 'account-id',
amount: '50.00',
assetCode: 'USDC',
network: 'ethereum',
participantId: 'participant-id',
destinationAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
reference: 'withdrawal-001',
});

Response Example

{
id: 'tx-2',
assetId: 'asset-usdc',
type: 'withdrawal',
amount: '50.00',
status: 'PENDING',
network: 'ethereum',
participantId: 'participant-id',
reference: 'withdrawal-001',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:00:00Z',
executedAt: null,
phases: [],
}

rejectFrozenDeposit(id: string, reason?: string): Promise<Transaction>

Endpoint

POST /api/v1/core/transactions/:id/reject-frozen-deposit

How it works

Calls the deposit-specific frozen rejection endpoint currently implemented in the SDK.

Arguments

ArgumentTypeRequiredNotes
idstringYesTransaction identifier.
reasonstringNoOptional rejection reason.

Returns

Promise<Transaction>

Behavior Notes

  • This method reflects the current SDK path exactly, even if the public API docs now document a newer generic frozen-rejection route.

Request Example

const rejected = await sdk.transactions.rejectFrozenDeposit(
'tx-id',
'manual review failed',
);

Response Example

{
id: 'tx-id',
assetId: 'asset-1',
type: 'deposit',
amount: '100.00',
status: 'REJECTED',
network: 'ethereum',
participantId: 'participant-1',
reference: 'deposit-review',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:10:00Z',
executedAt: null,
phases: [],
}

approveFrozenDeposit(id: string): Promise<Transaction>

Endpoint

POST /api/v1/core/transactions/:id/approve-frozen-deposit

How it works

Calls the deposit-specific frozen approval endpoint currently implemented in the SDK.

Arguments

ArgumentTypeRequiredNotes
idstringYesTransaction identifier.

Returns

Promise<Transaction>

Behavior Notes

  • This method documents the current SDK path, not the newer generic public route.

Request Example

const approved = await sdk.transactions.approveFrozenDeposit('tx-id');

Response Example

{
id: 'tx-id',
assetId: 'asset-1',
type: 'deposit',
amount: '100.00',
status: 'APPROVED',
network: 'ethereum',
participantId: 'participant-1',
reference: 'deposit-review',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:10:00Z',
executedAt: null,
phases: [],
}

rejectFrozenWithdrawal(id: string, reason?: string): Promise<Transaction>

Endpoint

POST /api/v1/core/transactions/:id/reject-frozen-withdrawal

How it works

Calls the withdrawal-specific frozen rejection endpoint currently implemented in the SDK.

Arguments

ArgumentTypeRequiredNotes
idstringYesTransaction identifier.
reasonstringNoOptional rejection reason.

Returns

Promise<Transaction>

Behavior Notes

  • This method documents the current SDK path, even if it differs from the newer public route naming.

Request Example

const rejected = await sdk.transactions.rejectFrozenWithdrawal(
'tx-id',
'risk policy',
);

Response Example

{
id: 'tx-id',
assetId: 'asset-1',
type: 'withdrawal',
amount: '50.00',
status: 'REJECTED',
network: 'ethereum',
participantId: 'participant-1',
reference: 'withdrawal-review',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:10:00Z',
executedAt: null,
phases: [],
}

approveFrozenWithdrawal(id: string): Promise<Transaction>

Endpoint

POST /api/v1/core/transactions/:id/approve-frozen-withdrawal

How it works

Calls the withdrawal-specific frozen approval endpoint currently implemented in the SDK.

Arguments

ArgumentTypeRequiredNotes
idstringYesTransaction identifier.

Returns

Promise<Transaction>

Request Example

const approved = await sdk.transactions.approveFrozenWithdrawal('tx-id');

Response Example

{
id: 'tx-id',
assetId: 'asset-1',
type: 'withdrawal',
amount: '50.00',
status: 'APPROVED',
network: 'ethereum',
participantId: 'participant-1',
reference: 'withdrawal-review',
transactionData: {},
createdAt: '2025-09-24T00:00:00Z',
updatedAt: '2025-09-24T00:10:00Z',
executedAt: null,
phases: [],
}

executePortfolioTransaction(dto: CreatePortfolioExecutionDto): Promise<PortfolioExecutionResponse>

Endpoint

POST /api/v1/core/transactions/portfolio/execute

How it works

Executes a portfolio web3 transaction using the current SDK execution DTO.

Arguments

ArgumentTypeRequiredNotes
dto.accountIdstringYesPortfolio account identifier.
dto.chainIdnumberYesChain ID used by the backend to resolve the target network.
dto.transactionDataRecord<string, unknown>YesRaw transaction payload forwarded as-is.

Returns

Promise<PortfolioExecutionResponse>

Request Example

const result = await sdk.transactions.executePortfolioTransaction({
accountId: 'portfolio-account-id',
chainId: 1,
transactionData: {
to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
data: '0x',
value: '0x0',
},
});

Response Example

{
transactionId: 'portfolio-tx-id',
txHash: '0x7d8c1f9b2f3e4a5c6d7e8f901234567890abcdef1234567890abcdef12345678',
}

signPortfolioMessage(dto: CreatePortfolioSignMessageDto): Promise<PortfolioSignMessageResponse>

Endpoint

POST /api/v1/core/transactions/portfolio/sign-message

How it works

Signs a portfolio message using the current signing DTO and returns the signature payload.

Arguments

ArgumentTypeRequiredNotes
dto.accountIdstringYesPortfolio account identifier.
dto.chainIdnumberYesChain ID used to resolve the wallet network.
dto.signModeWeb3SignModeYesSigning mode enum.
dto.messagestringNoPlain message payload.
dto.messageEncodingWeb3SignMessageEncodingNoMessage encoding.
dto.domainRecord<string, unknown>NoEIP-712 domain object.
dto.typesRecord<string, unknown>NoEIP-712 types object.
dto.typedDataMessageRecord<string, unknown>NoEIP-712 message object.

Returns

Promise<PortfolioSignMessageResponse>

Behavior Notes

  • Which fields are required in practice depends on the signMode chosen.
  • The SDK forwards the DTO as-is without local validation.

Request Example

import {
Web3SignMessageEncoding,
Web3SignMode,
} from '@ledgerlink/link-sdk';

const result = await sdk.transactions.signPortfolioMessage({
accountId: 'portfolio-account-id',
chainId: 1,
signMode: Web3SignMode.PERSONAL_SIGN,
message: 'Login challenge: 123456',
messageEncoding: Web3SignMessageEncoding.UTF8,
});

Response Example

{
signature: '0x4f3c...',
r: '0x1111',
s: '0x2222',
v: 27,
messageHash: '0xabc123',
message: 'Login challenge: 123456',
walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
network: 'ethereum',
signMode: 'personal_sign',
status: 'completed',
completedAt: '2026-04-02T09:00:00.000Z',
}