Solana Api Save

API for Solana Tokens

Project README

Paidwork

Send & Receive secure Blockchain transactions on Solana with Worken

🚀 Over 20M+ Users using Worken!

GitHub Repository Stars Count Follow Us on X

Commitizen friendly License PRs Welcome

API providing access to make easy and secure Blockchain transactions with Worken. Read more about Worken Token.

Endpoints

  • CreateTransactionToAssociatedAccount [POST]
  • SimulateTransactionToAssociatedAccount [POST]
  • CreateTransactionWithBurnToAssociatedAccount [POST]
  • SimulateTransactionWithBurnToAssociatedAccount [POST]
  • Burn [POST]
  • SimulateBurn [POST]
  • CreateWallet [POST]
  • CreateWalletWordCount [POST]
  • CreateWalletWordList [POST]
  • CreateWalletFull [POST]

CreateTransactionToAssociatedAccount

[POST] /api/Transactions/CreateTransactionToAssociatedAccount

this endpoint send created transaction based on given body and send it to network for processing while returning Hash of such transaction

Body structure

public class CreateTransactionRequest
{
    public string fromAccountPublicKey { get; set; }

    public string fromAccountPrivateKey { get; set; }

    public string toAccountPublicKey { get; set; }

    public ulong lanPorts {  get; set; }
    
    public string Memo { get; set; } = string.Empty;
}

Result

string Transaction hash

SimulateTransactionToAssociatedAccount

[POST] /api/Transactions/CreateTransactionToAssociatedAccount

this endpoint simulate transaction without sending it to network while returning result of complited transaction. This endpoint execute transaction exacly same as CreateTransactionToAssociatedAccount so this endpoint can be use for testing implementation

Body structure

public class CreateTransactionRequest
{
    public string fromAccountPublicKey { get; set; }

    public string fromAccountPrivateKey { get; set; }

    public string toAccountPublicKey { get; set; }

    public ulong lanPorts {  get; set; }
    
    public string Memo { get; set; } = string.Empty;
}

Result

public class SimulationLogs
{
    public AccountInfo[] Accounts { get; set; }

    [JsonPropertyName("err")]
    public TransactionError Error { get; set; }

    public string[] Logs { get; set; }
}

CreateTransactionWithBurnToAssociatedAccount

[POST] /api/Transactions/CreateTransactionToAssociatedAccount

this endpoint send created transaction based on given body and send it to network for processing while returning Hash of such transaction

Body structure

public class CreateTransactionBurnRequest
{
    public string fromAccountPublicKey { get; set; }

    public string fromAccountPrivateKey { get; set; }

    public string toAccountPublicKey { get; set; }

    public ulong lanPorts {  get; set; }

    public ulong LamPortsBurn { get; set; }

    public string Memo { get; set; } = string.Empty;
}

Result

string Transaction hash

SimulateTransactionWithBurnToAssociatedAccount

[POST] /api/Transactions/SimulateTransactionWithBurnToAssociatedAccount

this endpoint simulate transaction without sending it to network while returning result of complited transaction. This endpoint execute transaction exacly same as CreateTransactionToAssociatedAccount so this endpoint can be use for testing implementation

Body structure

public class CreateTransactionRequest
{
    public string fromAccountPublicKey { get; set; }

    public string fromAccountPrivateKey { get; set; }

    public string toAccountPublicKey { get; set; }

    public ulong lanPorts {  get; set; }

    public ulong LamPortsBurn { get; set; }

    public string Memo { get; set; } = string.Empty;
}

Result

public class SimulationLogs
{
    public AccountInfo[] Accounts { get; set; }

    [JsonPropertyName("err")]
    public TransactionError Error { get; set; }

    public string[] Logs { get; set; }
}
```## Burn

#### **[POST]** /api/Transactions/Burn

this endpoint send created transaction with only burn instruction

#### Body structure
```c#
public class CreateBurnRequest
{
    public string FromAccountPublicKey { get; set; }

    public string FromAccountPrivateKey { get; set; }

    public ulong Amount { get; set; }

    public string Memo { get; set; } = string.Empty;
}

Result

string Transaction hash ## SimulateBurn

[POST] /api/Transactions/SimulateBurn

this endpoint send created transaction with only burn instruction but only simulate transaction without sending to network

Body structure

public class CreateBurnRequest
{
    public string FromAccountPublicKey { get; set; }

    public string FromAccountPrivateKey { get; set; }

    public ulong Amount { get; set; }

    public string Memo { get; set; } = string.Empty;
}

Result

public class SimulationLogs
{
    public AccountInfo[] Accounts { get; set; }

    [JsonPropertyName("err")]
    public TransactionError Error { get; set; }

    public string[] Logs { get; set; }
}

CreateWallet

[POST] /api/Wallet/CreateWallet

create base wallet with default values for wordCount and wordList as given WordCount.Twelve and WordList.English

Body structure

empty

Example result [JSON]

{
  "account": {
    "privateKey": {
      "key": "45oED964ffnj1Br6tDbwcLNdi8JaZqHciVdWeaJhLVwB4JWZ3SRWE7LtZn4Zh4ntqjrDD7ksyMaPRBuMEnfdhojz",
      "keyBytes": "mjAR0I/E+pNVwqxQ+Z3yGb1o0z5uELRb60DZikAQFDADskNwpOnFtC30jRx+Cyni+o3ALdANvDmJtJVU8cCuNQ=="
    },
    "publicKey": {
      "key": "FRt3vuU8aPPs74ZeH5CA6QD9WYutvVzzsySTYSTD1dn",
      "keyBytes": "A7JDcKTpxbQt9I0cfgsp4vqNwC3QDbw5ibSVVPHArjU="
    }
  },
  "mnemonic": {
    "isValidChecksum": true,
    "wordList": {
      "space": " ",
      "wordCount": 2048
    },
    "indices": [
      1224,
      1684,
      34,
      1881,
      1701,
      1350,
      453,
      1818,
      519,
      2037,
      1451,
      1540
    ],
    "words": [
      "october",
      "spoon",
      "affair",
      "twenty",
      "start",
      "potato",
      "december",
      "today",
      "domain",
      "wrong",
      "rely",
      "scene"
    ]
  }
}

CreateWalletWordCount

[POST] /api/Wallet/CreateWalletWordCount

create base wallet with default values for wordList as given WordList.English while wordCount must be provided

Body structure

int 

Possible values that represent number of words

12 15 18 21 24

Example result [JSON]

{
  "account": {
    "privateKey": {
      "key": "45oED964ffnj1Br6tDbwcLNdi8JaZqHciVdWeaJhLVwB4JWZ3SRWE7LtZn4Zh4ntqjrDD7ksyMaPRBuMEnfdhojz",
      "keyBytes": "mjAR0I/E+pNVwqxQ+Z3yGb1o0z5uELRb60DZikAQFDADskNwpOnFtC30jRx+Cyni+o3ALdANvDmJtJVU8cCuNQ=="
    },
    "publicKey": {
      "key": "FRt3vuU8aPPs74ZeH5CA6QD9WYutvVzzsySTYSTD1dn",
      "keyBytes": "A7JDcKTpxbQt9I0cfgsp4vqNwC3QDbw5ibSVVPHArjU="
    }
  },
  "mnemonic": {
    "isValidChecksum": true,
    "wordList": {
      "space": " ",
      "wordCount": 2048
    },
    "indices": [
      1224,
      1684,
      34,
      1881,
      1701,
      1350,
      453,
      1818,
      519,
      2037,
      1451,
      1540
    ],
    "words": [
      "october",
      "spoon",
      "affair",
      "twenty",
      "start",
      "potato",
      "december",
      "today",
      "domain",
      "wrong",
      "rely",
      "scene"
    ]
  }
}

CreateWalletWordList

[POST] /api/Wallet/CreateWalletWordList

create base wallet with default values for WordCount as given WordCount count while WordList must be provided

Body structure

string

Possible values that represents wordList

"English", "Japanese", "ChineseSimplified", "ChineseTraditional", "Spanish", "French", "PortugueseBrazil", "Czech"

Example result [JSON]

{
  "account": {
    "privateKey": {
      "key": "45oED964ffnj1Br6tDbwcLNdi8JaZqHciVdWeaJhLVwB4JWZ3SRWE7LtZn4Zh4ntqjrDD7ksyMaPRBuMEnfdhojz",
      "keyBytes": "mjAR0I/E+pNVwqxQ+Z3yGb1o0z5uELRb60DZikAQFDADskNwpOnFtC30jRx+Cyni+o3ALdANvDmJtJVU8cCuNQ=="
    },
    "publicKey": {
      "key": "FRt3vuU8aPPs74ZeH5CA6QD9WYutvVzzsySTYSTD1dn",
      "keyBytes": "A7JDcKTpxbQt9I0cfgsp4vqNwC3QDbw5ibSVVPHArjU="
    }
  },
  "mnemonic": {
    "isValidChecksum": true,
    "wordList": {
      "space": " ",
      "wordCount": 2048
    },
    "indices": [
      1224,
      1684,
      34,
      1881,
      1701,
      1350,
      453,
      1818,
      519,
      2037,
      1451,
      1540
    ],
    "words": [
      "october",
      "spoon",
      "affair",
      "twenty",
      "start",
      "potato",
      "december",
      "today",
      "domain",
      "wrong",
      "rely",
      "scene"
    ]
  }
}

CreateWalletFull

[POST] /api/Wallet/CreateWalletFull

this endpoint gives you full access to parameters of creating wallet such as WordCount and WordList so both must be provided for this endpoint

Body structure

public class WalletCreationRequest
{
    public string WordList { get; set; }

    public int WordCount { get; set; }
}

Possible values for WordCount that represent number of words

12 15 18 21 24

Possible values for WordList that represents wordList

"English", "Japanese", "ChineseSimplified", "ChineseTraditional", "Spanish", "French", "PortugueseBrazil", "Czech"

Example result [JSON]

{
  "account": {
    "privateKey": {
      "key": "45oED964ffnj1Br6tDbwcLNdi8JaZqHciVdWeaJhLVwB4JWZ3SRWE7LtZn4Zh4ntqjrDD7ksyMaPRBuMEnfdhojz",
      "keyBytes": "mjAR0I/E+pNVwqxQ+Z3yGb1o0z5uELRb60DZikAQFDADskNwpOnFtC30jRx+Cyni+o3ALdANvDmJtJVU8cCuNQ=="
    },
    "publicKey": {
      "key": "FRt3vuU8aPPs74ZeH5CA6QD9WYutvVzzsySTYSTD1dn",
      "keyBytes": "A7JDcKTpxbQt9I0cfgsp4vqNwC3QDbw5ibSVVPHArjU="
    }
  },
  "mnemonic": {
    "isValidChecksum": true,
    "wordList": {
      "space": " ",
      "wordCount": 2048
    },
    "indices": [
      1224,
      1684,
      34,
      1881,
      1701,
      1350,
      453,
      1818,
      519,
      2037,
      1451,
      1540
    ],
    "words": [
      "october",
      "spoon",
      "affair",
      "twenty",
      "start",
      "potato",
      "december",
      "today",
      "domain",
      "wrong",
      "rely",
      "scene"
    ]
  }
}
Open Source Agenda is not affiliated with "Solana Api" Project. README Source: paidworkco/solana-api

Open Source Agenda Badge

Open Source Agenda Rating