Class: TorqueAdminClient
@torque-labs/torque-ts-sdk • Docs
@torque-labs/torque-ts-sdk / TorqueAdminClient
Class: TorqueAdminClient
The TorqueAdminClient class is used to manage admin actions in the Torque API.
Example
Constructors
new TorqueAdminClient()
Create a new instance of the TorqueAdminClient class with the provided API key.
Parameters
Parameter | Type | Description |
---|---|---|
| The options for the TorqueAdminClient. |
Returns
Defined in
Properties
Property | Type |
---|---|
| |
|
|
|
|
|
|
Methods
createCampaign()
Create a new campaign with the provided data.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The data for the campaign to create. |
| { | - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
| ( | { | - |
|
| - |
| { | - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
|
| - |
Returns
Promise
<SignatureField
>
A promise that resolves with the signature of the transaction.
Defined in
deleteAudience()
Delete an existing audience.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the audience to delete. |
Returns
Promise
<{ audienceId
: string
; }>
A promise that resolves to the deleted audience.
Name | Type |
---|---|
|
|
Throws
If the client is not initialized or if there was an error deleting the audience.
Defined in
endCampaign()
End a campaign using the provided campaign ID.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the campaign to end. |
|
| - |
Returns
Promise
<SignatureField
>
A promise that resolves to the signature of the transaction.
Throws
Throws an error if the client is not initialized or if there is an error ending the campaign.
Defined in
getActiveCampaigns()
Get a list of all currently active campaigns.
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
Returns
Promise
<{ campaigns
: ApiCampaign
[]; }>
A promise that resolves to an array of ApiCampaign objects.
Name | Type |
---|---|
|
Throws
If the client is not initialized or there was an error getting the list of campaigns.
Defined in
getAudience()
Get an audience by ID.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the audience to fetch. |
Returns
Promise
<ApiAudience
>
A promise that resolves to an array of Audiences.
Throws
If the client is not initialized or there was an error getting the audience.
Defined in
getAudiences()
Get a list of the user's saved audiences.
Returns
Promise
<{ audiences
: ApiAudience
[]; }>
A promise that resolves to an array of Audiences.
Name | Type |
---|---|
|
Throws
If the client is not initialized or there was an error getting the audiences.
Defined in
getCampaign()
Get the details of a specific campaign.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the campaign to retrieve. |
Returns
Promise
<ApiCampaign
>
A Promise that resolves to the campaign data.
Throws
Throws an error if a fetching a campaign failed.
Defined in
getCampaignAnalytics()
Get the analytics data for a specific campaign.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the campaign to retrieve the analytics for. |
Returns
Promise
<CampaignAnalytics
>
A Promise that resolves to the analytics data for the campaign.
Throws
Throws an error if a fetching a campaign failed.
Defined in
getCampaigns()
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Returns
Promise
<{ campaigns
: ApiCampaign
[]; }>
Name | Type |
---|---|
|
Defined in
getHistoricCampaigns()
Get a list of all historic campaigns.
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
|
|
|
|
Returns
Promise
<{ campaigns
: ApiCampaign
[]; }>
A promise that resolves to an array of ApiCampaign objects.
Name | Type |
---|---|
|
Throws
If the client is not initialized or there was an error getting the list of campaigns.
Defined in
getLeaderboard()
Get the leaderboard for a specific campaign.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the campaign to get the leaderboard for. |
Returns
Promise
<ApiCampaignLeaderboard
>
A Promise that resolves to the leaderboard data for the campaign.
Throws
Throws an error if the client is not initialized or if there is an error getting the leaderboard.
Defined in
initPublisher()
Initialize a publisher account for the current user.
Returns
Promise
<string
>
A promise that resolves to the signature of the transaction.
Throws
Throws an error if there was an error creating the publisher.
Defined in
logout()
Returns
Promise
<void
>
Defined in
payoutPublisher()
Process a publisher payout for the current user, if eligible.
Parameters
Parameter | Type |
---|---|
|
|
|
|
|
|
Returns
Promise
<string
>
A promise that resolves to the signature of the transaction.
Throws
Throws an error if there was an error paying out the publisher.
Defined in
raffleRewards()
Get the raffle rewards for a specific campaign.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the campaign to get the raffle rewards for. |
Returns
Promise
<ApiRaffleRewards
>
Throws
Throws an error if the client is not initialized or if there is an error getting the raffle rewards.
Defined in
saveAudience()
Save an audience to the user's account.
Parameters
Parameter | Type | Description |
---|---|---|
| The metadata of the audience. | |
| The configuration of the audience to save. |
Returns
Promise
<{ audienceId
: string
; }>
A promise that resolves to the id of the saved audience.
Name | Type |
---|---|
|
|
Throws
If the client is not initialized or there was an error saving the audience.
Defined in
updateAudience()
Update an existing audience with the provided configuration.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The ID of the audience to update. |
| The metadata of the audience. | |
| The configuration of the audience to update. |
Returns
Promise
<{ audienceId
: string
; }>
A promise that resolves to the updated audience.
Name | Type |
---|---|
|
|
Throws
If the client is not initialized or if there was an error updating the audience.
Defined in
getSafeTokenList()
Retrieves the list of safe tokens from the Jupiter ag.
Parameters
Parameter | Type | Description |
---|---|---|
|
| An optional filter to filter the tokens by text. |
|
| - |
Returns
Promise
<SafeToken
[]>
A promise that resolves to an array of SafeToken objects.
Throws
If the client is not initialized or there was an error fetching the safe token list.
Defined in
Last updated