@triadxyz/triad-protocol 2.5.6-beta → 2.5.7-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -10
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/utils/helpers.d.ts +2 -1
- package/dist/utils/helpers.js +13 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -61,16 +61,7 @@ export default class TriadProtocolClient {
|
|
|
61
61
|
* @param wallet - The wallet address of the customer
|
|
62
62
|
*
|
|
63
63
|
*/
|
|
64
|
-
getCustomerByWallet(wallet: PublicKey): Promise<import("
|
|
65
|
-
bump: number;
|
|
66
|
-
id: number;
|
|
67
|
-
authority: PublicKey;
|
|
68
|
-
name: string;
|
|
69
|
-
feeRecipient: PublicKey;
|
|
70
|
-
feeBps: number;
|
|
71
|
-
isVerified: boolean;
|
|
72
|
-
padding: number[];
|
|
73
|
-
}>>;
|
|
64
|
+
getCustomerByWallet(wallet: PublicKey): Promise<import("./types").Customer>;
|
|
74
65
|
/**
|
|
75
66
|
* Get Refer By Wallet Address
|
|
76
67
|
* @param wallet - The wallet address of the refer
|
package/dist/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -238,3 +238,12 @@ export type Refer = {
|
|
|
238
238
|
feeBps: number;
|
|
239
239
|
feeClaimed: number;
|
|
240
240
|
};
|
|
241
|
+
export type Customer = {
|
|
242
|
+
id: number;
|
|
243
|
+
authority: string;
|
|
244
|
+
name: string;
|
|
245
|
+
feeRecipient: string;
|
|
246
|
+
feeBps: number;
|
|
247
|
+
isVerified: boolean;
|
|
248
|
+
address: string;
|
|
249
|
+
};
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { IdlAccounts } from '@coral-xyz/anchor';
|
|
3
3
|
import { Stake, StakeVault, Unstake } from './../types/stake';
|
|
4
|
-
import { Market, Order, OrderDirection, OrderSide, OrderStatus, OrderType, UserTrade, Pool, BookOrder, Refer } from '../types';
|
|
4
|
+
import { Market, Order, OrderDirection, OrderSide, OrderStatus, OrderType, UserTrade, Pool, BookOrder, Refer, Customer } from '../types';
|
|
5
5
|
import { TriadProtocol } from '../types/triad_protocol';
|
|
6
6
|
export declare const encodeString: (value: string, alloc?: number) => number[];
|
|
7
7
|
export declare const decodeString: (bytes: number[]) => string;
|
|
@@ -46,3 +46,4 @@ export declare const getOrderStatus: (status: {
|
|
|
46
46
|
waiting: {};
|
|
47
47
|
}) => OrderStatus;
|
|
48
48
|
export declare const formatRefer: (account: IdlAccounts<TriadProtocol>['refer']) => Refer;
|
|
49
|
+
export declare const formatCustomer: (account: IdlAccounts<TriadProtocol>['customer'], publicKey: PublicKey) => Customer;
|
package/dist/utils/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatRefer = exports.getOrderStatus = exports.getOrderSide = exports.getOrderType = exports.getOrderSideFromNumber = exports.getOrderDirectionFromNumber = exports.getOrderDirection = exports.getTokenProgram = exports.calculateStakeRewards = exports.formatBookOrder = exports.formatOrder = exports.formatUserTrade = exports.formatMarket = exports.formatPool = exports.formatUnstake = exports.formatStake = exports.formatStakeVault = exports.decodeString = exports.encodeString = void 0;
|
|
3
|
+
exports.formatCustomer = exports.formatRefer = exports.getOrderStatus = exports.getOrderSide = exports.getOrderType = exports.getOrderSideFromNumber = exports.getOrderDirectionFromNumber = exports.getOrderDirection = exports.getTokenProgram = exports.calculateStakeRewards = exports.formatBookOrder = exports.formatOrder = exports.formatUserTrade = exports.formatMarket = exports.formatPool = exports.formatUnstake = exports.formatStake = exports.formatStakeVault = exports.decodeString = exports.encodeString = void 0;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
5
|
const spl_token_1 = require("@solana/spl-token");
|
|
6
6
|
const types_1 = require("../types");
|
|
@@ -235,3 +235,15 @@ const formatRefer = (account) => {
|
|
|
235
235
|
};
|
|
236
236
|
};
|
|
237
237
|
exports.formatRefer = formatRefer;
|
|
238
|
+
const formatCustomer = (account, publicKey) => {
|
|
239
|
+
return {
|
|
240
|
+
id: account.id,
|
|
241
|
+
authority: publicKey.toString(),
|
|
242
|
+
name: account.name,
|
|
243
|
+
feeRecipient: account.feeRecipient.toString(),
|
|
244
|
+
feeBps: account.feeBps,
|
|
245
|
+
isVerified: account.isVerified,
|
|
246
|
+
address: publicKey.toString()
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
exports.formatCustomer = formatCustomer;
|