Skip to content

Commit

Permalink
Merge pull request #16 from coincord/Modified/Coincord-docs
Browse files Browse the repository at this point in the history
More cleanups and updates
  • Loading branch information
Mozartted authored Jul 14, 2024
2 parents e9be762 + ce12254 commit eedbf4f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ These types outline the response of each of the sdk functions based on the types
type CoreSDK {
getApp: App

createAddress(token_set: TokenCollection!): Address
createAddress(network: Network!, token_set: TokenSet!): Address
createAddressCollection(uniqueId: String!): AddressSet
getFeeEstimate(network: Network! = ETHEREUM, recipient: String!, token: TokenCollection! = ETHEREUM, value: Float!): FeeEstimate
processTransaction(hash_ref: String!): Transaction
Expand Down
4 changes: 3 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type TokenCollectionType =
| "DAI"
| "USDC"
| "USDT";
export type TokenSet = "NATIVE" | "ERC20" | "TRC20" | "ERC721";
export type NetworkCollection =
| "BITCOIN"
| "LITECOIN"
Expand Down Expand Up @@ -65,10 +66,11 @@ export default class CoincordCoreWallet {
}
}

async createAddress(token: TokenCollectionType) {
async createAddress(network: NetworkCollection, token: TokenSet) {
let address;
try {
address = await graphqlClient.request(createAddress, {
network,
token_set: token,
});
// console.log(address)
Expand Down
9 changes: 7 additions & 2 deletions lib/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ export const transactions = gql``;

// mutations
export const createAddress = gql`
mutation CREATE_NEW_ADDRESS($token_set: TokenCollection!) {
_createAddress(token_set: $token_set) {
mutation CREATE_NEW_ADDRESS($network: Network!, $token_set: TokenSet!) {
_createAddress(network: $network, token_set: $token_set) {
id
address
created_at
Expand Down Expand Up @@ -152,6 +152,11 @@ export const createAddressCollection = gql`
address
created_at
}
MULTI_TRC {
id
address
created_at
}
}
}
`;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coincord/coincord-core-sdk-wallet",
"version": "0.1.8-alpha.3",
"version": "0.1.8-alpha.4",
"description": "A module for managing and manipulating operations with bitcoin, ethereum and litecoin wallets.",
"main": "dist/lib/index.js",
"publishConfig": {
Expand Down

0 comments on commit eedbf4f

Please sign in to comment.