@cityofzion/bs-neo3 1.16.3 → 1.17.0
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/BSNeo3.d.ts +40 -30
- package/dist/BSNeo3.js +104 -54
- package/dist/constants/BSNeo3Constants.d.ts +12 -17
- package/dist/constants/BSNeo3Constants.js +221 -37
- package/dist/helpers/BSNeo3Helper.d.ts +5 -6
- package/dist/helpers/BSNeo3Helper.js +9 -8
- package/dist/helpers/BSNeo3NeonDappKitSingletonHelper.d.ts +6 -0
- package/dist/helpers/BSNeo3NeonDappKitSingletonHelper.js +26 -0
- package/dist/helpers/BSNeo3NeonJsSingletonHelper.d.ts +7 -0
- package/dist/helpers/BSNeo3NeonJsSingletonHelper.js +26 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/services/blockchain-data/DoraBDSNeo3.d.ts +13 -12
- package/dist/services/blockchain-data/DoraBDSNeo3.js +131 -141
- package/dist/services/blockchain-data/RpcBDSNeo3.d.ts +13 -19
- package/dist/services/blockchain-data/RpcBDSNeo3.js +28 -62
- package/dist/services/chaim-data/RpcCDSNeo3.d.ts +7 -0
- package/dist/services/chaim-data/RpcCDSNeo3.js +27 -0
- package/dist/services/exchange-data/FlamingoForthewinEDSNeo3.d.ts +6 -7
- package/dist/services/exchange-data/FlamingoForthewinEDSNeo3.js +4 -19
- package/dist/services/explorer/DoraESNeo3.d.ts +5 -5
- package/dist/services/explorer/DoraESNeo3.js +19 -22
- package/dist/services/ledger/NeonDappKitLedgerServiceNeo3.d.ts +10 -10
- package/dist/services/ledger/NeonDappKitLedgerServiceNeo3.js +28 -38
- package/dist/services/neo3neoXBridge/Neo3NeoXBridgeService.d.ts +10 -9
- package/dist/services/neo3neoXBridge/Neo3NeoXBridgeService.js +26 -25
- package/dist/services/nft-data/GhostMarketNDSNeo3.d.ts +7 -11
- package/dist/services/nft-data/GhostMarketNDSNeo3.js +41 -79
- package/dist/services/vote/DoraVoteServiceNeo3.d.ts +8 -29
- package/dist/services/vote/DoraVoteServiceNeo3.js +81 -21
- package/dist/services/wallet-connect/WalletConnectServiceNeo3.d.ts +45 -0
- package/dist/services/wallet-connect/WalletConnectServiceNeo3.js +163 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.js +18 -0
- package/package.json +25 -25
- package/dist/assets/tokens/mainnet.json +0 -194
- package/dist/assets/tokens/native.json +0 -14
- package/dist/builder/invocation/NeonDappKitInvocationBuilderNeo3.d.ts +0 -34
- package/dist/builder/invocation/NeonDappKitInvocationBuilderNeo3.js +0 -102
- package/dist/interfaces.d.ts +0 -41
- package/dist/interfaces.js +0 -2
- package/dist/services/nft-data/RpcNDSNeo3.d.ts +0 -9
- package/dist/services/nft-data/RpcNDSNeo3.js +0 -59
- package/dist/services/vote/RpcVoteServiceNeo3.d.ts +0 -10
- package/dist/services/vote/RpcVoteServiceNeo3.js +0 -88
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var _WalletConnectServiceNeo3_instances, _WalletConnectServiceNeo3_service, _WalletConnectServiceNeo3_getInvoker, _WalletConnectServiceNeo3_getSigner;
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.WalletConnectServiceNeo3 = void 0;
|
|
25
|
+
const BSNeo3Helper_1 = require("../../helpers/BSNeo3Helper");
|
|
26
|
+
const BSNeo3NeonDappKitSingletonHelper_1 = require("../../helpers/BSNeo3NeonDappKitSingletonHelper");
|
|
27
|
+
const BSNeo3NeonJsSingletonHelper_1 = require("../../helpers/BSNeo3NeonJsSingletonHelper");
|
|
28
|
+
class WalletConnectServiceNeo3 {
|
|
29
|
+
constructor(service) {
|
|
30
|
+
_WalletConnectServiceNeo3_instances.add(this);
|
|
31
|
+
this.namespace = 'neo3';
|
|
32
|
+
this.supportedMethods = [
|
|
33
|
+
'invokeFunction',
|
|
34
|
+
'testInvoke',
|
|
35
|
+
'signMessage',
|
|
36
|
+
'verifyMessage',
|
|
37
|
+
'getWalletInfo',
|
|
38
|
+
'traverseIterator',
|
|
39
|
+
'getNetworkVersion',
|
|
40
|
+
'encrypt',
|
|
41
|
+
'decrypt',
|
|
42
|
+
'decryptFromArray',
|
|
43
|
+
'calculateFee',
|
|
44
|
+
'signTransaction',
|
|
45
|
+
];
|
|
46
|
+
this.supportedEvents = [];
|
|
47
|
+
this.calculableMethods = ['invokeFunction', 'signTransaction'];
|
|
48
|
+
this.autoApproveMethods = [
|
|
49
|
+
'testInvoke',
|
|
50
|
+
'getWalletInfo',
|
|
51
|
+
'traverseIterator',
|
|
52
|
+
'getNetworkVersion',
|
|
53
|
+
'calculateFee',
|
|
54
|
+
];
|
|
55
|
+
_WalletConnectServiceNeo3_service.set(this, void 0);
|
|
56
|
+
__classPrivateFieldSet(this, _WalletConnectServiceNeo3_service, service, "f");
|
|
57
|
+
const networkId = BSNeo3Helper_1.BSNeo3Helper.isCustomNetwork(__classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").network)
|
|
58
|
+
? 'private'
|
|
59
|
+
: __classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").network.id.toString();
|
|
60
|
+
this.chain = `${this.namespace}:${networkId}`;
|
|
61
|
+
}
|
|
62
|
+
invokeFunction(args) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const invoker = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getInvoker).call(this, args);
|
|
65
|
+
return yield invoker.invokeFunction(args.params);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
testInvoke(args) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const invoker = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getInvoker).call(this, args);
|
|
71
|
+
return yield invoker.testInvoke(args.params);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
signMessage(args) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const signer = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getSigner).call(this, args);
|
|
77
|
+
return yield signer.signMessage(args.params);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
verifyMessage(args) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const signer = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getSigner).call(this, args);
|
|
83
|
+
return yield signer.verifyMessage(args.params);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
traverseIterator(args) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const invoker = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getInvoker).call(this, args);
|
|
89
|
+
return yield invoker.traverseIterator(args.params[0], args.params[1], args.params[2]);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
decrypt(args) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const signer = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getSigner).call(this, args);
|
|
95
|
+
return yield signer.decrypt(args.params[0]);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
encrypt(args) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const signer = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getSigner).call(this, args);
|
|
101
|
+
return yield signer.encrypt(args.params[0], args.params[1]);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
decryptFromArray(args) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const signer = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getSigner).call(this, args);
|
|
107
|
+
return yield signer.decryptFromArray(args.params[0]);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
getNetworkVersion() {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const { rpc } = BSNeo3NeonJsSingletonHelper_1.BSNeo3NeonJsSingletonHelper.getInstance();
|
|
113
|
+
const rpcClient = new rpc.RPCClient(__classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").network.url);
|
|
114
|
+
const response = yield rpcClient.getVersion();
|
|
115
|
+
return Object.assign({ rpcAddress: __classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").network.url }, response);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
calculateFee(args) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const invoker = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getInvoker).call(this, args);
|
|
121
|
+
return yield invoker.calculateFee(args.params);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
signTransaction(args) {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const invoker = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_instances, "m", _WalletConnectServiceNeo3_getInvoker).call(this, args);
|
|
127
|
+
return yield invoker.signTransaction(args.params);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
getWalletInfo(args) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
return {
|
|
133
|
+
isLedger: args.account.isHardware || false,
|
|
134
|
+
};
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
calculateRequestFee(args) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
const { total } = yield this.calculateFee(args);
|
|
140
|
+
return total.toString();
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.WalletConnectServiceNeo3 = WalletConnectServiceNeo3;
|
|
145
|
+
_WalletConnectServiceNeo3_service = new WeakMap(), _WalletConnectServiceNeo3_instances = new WeakSet(), _WalletConnectServiceNeo3_getInvoker = function _WalletConnectServiceNeo3_getInvoker(args) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const { neonJsAccount, signingCallback } = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").generateSigningCallback(args.account);
|
|
148
|
+
const { NeonInvoker } = BSNeo3NeonDappKitSingletonHelper_1.BSNeo3NeonDappKitSingletonHelper.getInstance();
|
|
149
|
+
const invoker = yield NeonInvoker.init({
|
|
150
|
+
rpcAddress: __classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").network.url,
|
|
151
|
+
account: neonJsAccount,
|
|
152
|
+
signingCallback,
|
|
153
|
+
});
|
|
154
|
+
return invoker;
|
|
155
|
+
});
|
|
156
|
+
}, _WalletConnectServiceNeo3_getSigner = function _WalletConnectServiceNeo3_getSigner(args) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
const { neonJsAccount } = yield __classPrivateFieldGet(this, _WalletConnectServiceNeo3_service, "f").generateSigningCallback(args.account);
|
|
159
|
+
const { NeonSigner } = BSNeo3NeonDappKitSingletonHelper_1.BSNeo3NeonDappKitSingletonHelper.getInstance();
|
|
160
|
+
const signer = new NeonSigner(neonJsAccount);
|
|
161
|
+
return signer;
|
|
162
|
+
});
|
|
163
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TBSAccount, IBlockchainService, IBSWithClaim, IBSWithEncryption, IBSWithExplorer, IBSWithFee, IBSWithLedger, IBSWithNameService, IBSWithNeo3NeoXBridge, IBSWithNft, TBSNetworkId, IBSWithWalletConnect } from '@cityofzion/blockchain-service';
|
|
2
|
+
import { wallet, api } from './helpers/BSNeo3NeonJsSingletonHelper';
|
|
3
|
+
export type TBSNeo3NetworkId = TBSNetworkId<'mainnet' | 'testnet'>;
|
|
4
|
+
export interface IBSNeo3<N extends string = string> extends IBlockchainService<N, TBSNeo3NetworkId>, IBSWithClaim<N>, IBSWithNameService, IBSWithFee<N>, IBSWithNft, IBSWithExplorer, IBSWithLedger<N>, IBSWithNeo3NeoXBridge<N>, IBSWithEncryption<N>, IBSWithWalletConnect {
|
|
5
|
+
generateSigningCallback(account: TBSAccount<N>): Promise<{
|
|
6
|
+
neonJsAccount: wallet.Account;
|
|
7
|
+
signingCallback: api.SigningFunction;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export type TVoteServiceCandidate = {
|
|
11
|
+
position: number;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
location: string;
|
|
15
|
+
email: string;
|
|
16
|
+
website: string;
|
|
17
|
+
hash: string;
|
|
18
|
+
pubKey: string;
|
|
19
|
+
votes: number;
|
|
20
|
+
logoUrl?: string;
|
|
21
|
+
type: 'consensus' | 'council';
|
|
22
|
+
};
|
|
23
|
+
export type TVoteServiceDetailsByAddressResponse = {
|
|
24
|
+
candidateName?: string;
|
|
25
|
+
candidatePubKey?: string;
|
|
26
|
+
neoBalance: number;
|
|
27
|
+
address: string;
|
|
28
|
+
};
|
|
29
|
+
export type TVoteServiceVoteParams<BSName extends string> = {
|
|
30
|
+
account: TBSAccount<BSName>;
|
|
31
|
+
candidatePubKey: string;
|
|
32
|
+
};
|
|
33
|
+
export type TDoraVoteServiceNeo3GetVoteCIMParams = {
|
|
34
|
+
address: string;
|
|
35
|
+
candidatePubKey: string;
|
|
36
|
+
};
|
|
37
|
+
export type TDoraVoteServiceNeo3GetCommitteeApiResponse = {
|
|
38
|
+
scripthash: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
location: string;
|
|
42
|
+
website: string;
|
|
43
|
+
email: string;
|
|
44
|
+
github: string;
|
|
45
|
+
telegram: string;
|
|
46
|
+
twitter: string;
|
|
47
|
+
logo: string;
|
|
48
|
+
votes: number;
|
|
49
|
+
pubkey: string;
|
|
50
|
+
};
|
|
51
|
+
export type TDoraVoteServiceNeo3GetVoteDetailsByAddressApiResponse = {
|
|
52
|
+
vote: string;
|
|
53
|
+
candidate: string;
|
|
54
|
+
candidatePubkey: string;
|
|
55
|
+
balance: number;
|
|
56
|
+
};
|
|
57
|
+
export interface IVoteService<BSName extends string> {
|
|
58
|
+
getCandidatesToVote(): Promise<TVoteServiceCandidate[]>;
|
|
59
|
+
getVoteDetailsByAddress(address: string): Promise<TVoteServiceDetailsByAddressResponse>;
|
|
60
|
+
vote(params: TVoteServiceVoteParams<BSName>): Promise<string>;
|
|
61
|
+
calculateVoteFee(params: TVoteServiceVoteParams<BSName>): Promise<string>;
|
|
62
|
+
}
|
|
63
|
+
export type TRpcVoteServiceNeo3GetVoteCIMParams = {
|
|
64
|
+
address: string;
|
|
65
|
+
candidatePubKey: string;
|
|
66
|
+
};
|
|
67
|
+
export type TNeo3NeoXBridgeServiceGetBridgeTxByNonceApiResponse = {
|
|
68
|
+
result: {
|
|
69
|
+
Vmstate: string;
|
|
70
|
+
txid: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export declare enum ENeonDappKitLedgerServiceNeo3Status {
|
|
74
|
+
OK = 36864
|
|
75
|
+
}
|
|
76
|
+
export declare enum ENeonDappKitLedgerServiceNeo3Command {
|
|
77
|
+
GET_APP_NAME = 0,
|
|
78
|
+
GET_PUBLIC_KEY = 4,
|
|
79
|
+
SIGN = 2
|
|
80
|
+
}
|
|
81
|
+
export declare enum ENeonDappKitLedgerServiceNeo3SecondParameter {
|
|
82
|
+
MORE_DATA = 128,
|
|
83
|
+
LAST_DATA = 0
|
|
84
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENeonDappKitLedgerServiceNeo3SecondParameter = exports.ENeonDappKitLedgerServiceNeo3Command = exports.ENeonDappKitLedgerServiceNeo3Status = void 0;
|
|
4
|
+
var ENeonDappKitLedgerServiceNeo3Status;
|
|
5
|
+
(function (ENeonDappKitLedgerServiceNeo3Status) {
|
|
6
|
+
ENeonDappKitLedgerServiceNeo3Status[ENeonDappKitLedgerServiceNeo3Status["OK"] = 36864] = "OK";
|
|
7
|
+
})(ENeonDappKitLedgerServiceNeo3Status || (exports.ENeonDappKitLedgerServiceNeo3Status = ENeonDappKitLedgerServiceNeo3Status = {}));
|
|
8
|
+
var ENeonDappKitLedgerServiceNeo3Command;
|
|
9
|
+
(function (ENeonDappKitLedgerServiceNeo3Command) {
|
|
10
|
+
ENeonDappKitLedgerServiceNeo3Command[ENeonDappKitLedgerServiceNeo3Command["GET_APP_NAME"] = 0] = "GET_APP_NAME";
|
|
11
|
+
ENeonDappKitLedgerServiceNeo3Command[ENeonDappKitLedgerServiceNeo3Command["GET_PUBLIC_KEY"] = 4] = "GET_PUBLIC_KEY";
|
|
12
|
+
ENeonDappKitLedgerServiceNeo3Command[ENeonDappKitLedgerServiceNeo3Command["SIGN"] = 2] = "SIGN";
|
|
13
|
+
})(ENeonDappKitLedgerServiceNeo3Command || (exports.ENeonDappKitLedgerServiceNeo3Command = ENeonDappKitLedgerServiceNeo3Command = {}));
|
|
14
|
+
var ENeonDappKitLedgerServiceNeo3SecondParameter;
|
|
15
|
+
(function (ENeonDappKitLedgerServiceNeo3SecondParameter) {
|
|
16
|
+
ENeonDappKitLedgerServiceNeo3SecondParameter[ENeonDappKitLedgerServiceNeo3SecondParameter["MORE_DATA"] = 128] = "MORE_DATA";
|
|
17
|
+
ENeonDappKitLedgerServiceNeo3SecondParameter[ENeonDappKitLedgerServiceNeo3SecondParameter["LAST_DATA"] = 0] = "LAST_DATA";
|
|
18
|
+
})(ENeonDappKitLedgerServiceNeo3SecondParameter || (exports.ENeonDappKitLedgerServiceNeo3SecondParameter = ENeonDappKitLedgerServiceNeo3SecondParameter = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -10,39 +10,39 @@
|
|
|
10
10
|
"/dist"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@cityofzion/dora-ts": "~0.5.1",
|
|
13
14
|
"@cityofzion/neon-js": "~5.7.0",
|
|
14
15
|
"@cityofzion/neon-core": "~5.7.0",
|
|
15
|
-
"@cityofzion/dora-ts": "0.5.1",
|
|
16
|
-
"axios": "1.8.2",
|
|
17
|
-
"query-string": "7.1.3",
|
|
18
|
-
"@ledgerhq/hw-transport": "~6.31.8",
|
|
19
16
|
"@cityofzion/neon-dappkit": "~0.6.0",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"lodash.clonedeep": "^4.5.0",
|
|
23
|
-
"date-fns": "~4.1.0",
|
|
24
|
-
"@cityofzion/bs-asteroid-sdk": "0.9.1",
|
|
25
|
-
"@cityofzion/blockchain-service": "1.21.2"
|
|
17
|
+
"axios": "~1.12.2",
|
|
18
|
+
"@cityofzion/blockchain-service": "1.22.0"
|
|
26
19
|
},
|
|
27
20
|
"devDependencies": {
|
|
28
21
|
"@cityofzion/neon-dappkit-types": "~0.5.0",
|
|
29
|
-
"@ledgerhq/hw-transport
|
|
30
|
-
"@
|
|
31
|
-
"@types/jest": "
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"jest": "29.
|
|
37
|
-
"ts-jest": "29.1.1",
|
|
22
|
+
"@ledgerhq/hw-transport": "~6.31.11",
|
|
23
|
+
"@ledgerhq/hw-transport-node-hid": "~6.29.12",
|
|
24
|
+
"@types/jest": "~30.0.0",
|
|
25
|
+
"date-fns": "~4.1.0",
|
|
26
|
+
"dotenv": "~17.2.2",
|
|
27
|
+
"eslint": "~9.36.0",
|
|
28
|
+
"jest": "~30.1.3",
|
|
29
|
+
"ts-jest": "~29.4.4",
|
|
38
30
|
"ts-node": "~10.9.2",
|
|
39
|
-
"typescript": "
|
|
40
|
-
|
|
31
|
+
"typescript": "~5.9.2"
|
|
32
|
+
},
|
|
33
|
+
"overrides": {
|
|
34
|
+
"@cityofzion/neon-js": "~5.7.0",
|
|
35
|
+
"@cityofzion/neon-core": "~5.7.0"
|
|
36
|
+
},
|
|
37
|
+
"resolutions": {
|
|
38
|
+
"@cityofzion/neon-js": "~5.7.0",
|
|
39
|
+
"@cityofzion/neon-core": "~5.7.0"
|
|
41
40
|
},
|
|
42
41
|
"scripts": {
|
|
43
|
-
"build": "tsc --project tsconfig.build.json",
|
|
44
|
-
"test": "jest --config jest.config.ts",
|
|
42
|
+
"build": "rm -rf ./dist && tsc --project tsconfig.build.json",
|
|
43
|
+
"test": "jest -i --config jest.config.ts",
|
|
45
44
|
"lint": "eslint .",
|
|
46
|
-
"format": "eslint --fix"
|
|
45
|
+
"format": "eslint --fix",
|
|
46
|
+
"package": "npm run build && npm pack"
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"symbol": "LRB",
|
|
4
|
-
"name": "LyrebirdToken",
|
|
5
|
-
"hash": "0x8c07b4c9f5bc170a3922eac4f5bb7ef17b0acc8b",
|
|
6
|
-
"decimals": 8
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"symbol": "USDL",
|
|
10
|
-
"name": "LyrebirdUSDToken",
|
|
11
|
-
"hash": "0xa8c51aa0c177187aeed3db88bdfa908ccbc9b1a5",
|
|
12
|
-
"decimals": 8
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"symbol": "FLM",
|
|
16
|
-
"name": "FLM",
|
|
17
|
-
"hash": "0xf0151f528127558851b39c2cd8aa47da7418ab28",
|
|
18
|
-
"decimals": 8
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"symbol": "CAKE",
|
|
22
|
-
"hash": "0x570c27653683788177f05740257d88fed76bf74b",
|
|
23
|
-
"decimals": 18,
|
|
24
|
-
"name": "CAKE"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"symbol": "fCAKE",
|
|
28
|
-
"name": "fCAKE",
|
|
29
|
-
"hash": "0xe65b462b90516012826f8a9c4c285d8c750e3a77",
|
|
30
|
-
"decimals": 18
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"symbol": "WING",
|
|
34
|
-
"name": "WING",
|
|
35
|
-
"hash": "0x948a60635d1f7921063d04be8f6cb35c741df566",
|
|
36
|
-
"decimals": 9
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"symbol": "pWING",
|
|
40
|
-
"hash": "0xeeccd60ed722111f8400434dac3ba42c14d8beb1",
|
|
41
|
-
"decimals": 9,
|
|
42
|
-
"name": "pWING"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"symbol": "WETH",
|
|
46
|
-
"hash": "0xd3a41b53888a733b549f5d4146e7a98d3285fa21",
|
|
47
|
-
"decimals": 18,
|
|
48
|
-
"name": "WETH"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"symbol": "fWETH",
|
|
52
|
-
"name": "fWETH",
|
|
53
|
-
"hash": "0xc14b601252aa5dfa6166cf35fe5ccd2e35f3fdf5",
|
|
54
|
-
"decimals": 18
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"symbol": "WBTC",
|
|
58
|
-
"hash": "0x4548a3bcb3c2b5ce42bf0559b1cf2f1ec97a51d0",
|
|
59
|
-
"decimals": 8,
|
|
60
|
-
"name": "WBTC"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"symbol": "fWBTC",
|
|
64
|
-
"name": "fWBTC",
|
|
65
|
-
"hash": "0xd6abe115ecb75e1fa0b42f5e85934ce8c1ae2893",
|
|
66
|
-
"decimals": 8
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"symbol": "SWTH",
|
|
70
|
-
"name": "SWTHToken",
|
|
71
|
-
"hash": "0x78e1330db47634afdb5ea455302ba2d12b8d549f",
|
|
72
|
-
"decimals": 8
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"symbol": "ONT",
|
|
76
|
-
"hash": "0x0a1328bffb804ad7bb342673da82a972cc7af86c",
|
|
77
|
-
"decimals": 9,
|
|
78
|
-
"name": "ONT"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"symbol": "pONT",
|
|
82
|
-
"name": "pONT",
|
|
83
|
-
"hash": "0x8122bc2212ec971690a044b37a6f52a9349b702b",
|
|
84
|
-
"decimals": 9
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"symbol": "USDT",
|
|
88
|
-
"name": "USDT",
|
|
89
|
-
"hash": "0x68b938cc42b6a2d54fb9040f5facf4290ebb8c5f",
|
|
90
|
-
"decimals": 6
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"symbol": "fUSDT",
|
|
94
|
-
"name": "fUSDT",
|
|
95
|
-
"hash": "0xcd48b160c1bbc9d74997b803b9a7ad50a4bef020",
|
|
96
|
-
"decimals": 6
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"symbol": "FLUND",
|
|
100
|
-
"name": "FLUND",
|
|
101
|
-
"hash": "0xa9603a59e21d29e37ac39cf1b5f5abf5006b22a3",
|
|
102
|
-
"decimals": 8
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"symbol": "GM",
|
|
106
|
-
"name": "GhostMarketToken",
|
|
107
|
-
"hash": "0x9b049f1283515eef1d3f6ac610e1595ed25ca3e9",
|
|
108
|
-
"decimals": 8
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"symbol": "TIPS",
|
|
112
|
-
"name": "TIPS",
|
|
113
|
-
"hash": "0x340720c7107ef5721e44ed2ea8e314cce5c130fa",
|
|
114
|
-
"decimals": 8
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"symbol": "CANDY",
|
|
118
|
-
"name": "NeoCandy",
|
|
119
|
-
"hash": "0x88da18a5bca86ec8206d9b4960a7d0c4355a432f",
|
|
120
|
-
"decimals": 9
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"symbol": "DOGER",
|
|
124
|
-
"name": "DogeRift",
|
|
125
|
-
"hash": "0x322b5a366ca724801a1aa01e669b5f3d7f8c7f6f",
|
|
126
|
-
"decimals": 8
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"symbol": "DOGEF",
|
|
130
|
-
"name": "DogeFood",
|
|
131
|
-
"hash": "0xa3291b66f70d4687fc0e41977d8acb0699f235ae",
|
|
132
|
-
"decimals": 8
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"symbol": "SOM",
|
|
136
|
-
"name": "Som",
|
|
137
|
-
"hash": "0x2d4c6cf0417209a7eb410160344e224e74f87195",
|
|
138
|
-
"decimals": 8
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"symbol": "LAMBO",
|
|
142
|
-
"name": "BoomerFund",
|
|
143
|
-
"hash": "0xafdd6abedf066ff8c5fbc868cc89f80eac467142",
|
|
144
|
-
"decimals": 8
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"symbol": "bNEO",
|
|
148
|
-
"hash": "0x48c40d4666f93408be1bef038b6722404d9a4c2a",
|
|
149
|
-
"decimals": 8,
|
|
150
|
-
"name": "BurgerNEO"
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"symbol": "BNB",
|
|
154
|
-
"hash": "0x00fb9575f220727f71a1537f75e83af9387628ff",
|
|
155
|
-
"decimals": 18,
|
|
156
|
-
"name": "BNB"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"symbol": "fBNB",
|
|
160
|
-
"hash": "0xb56f0fba45cc57a948b342186274dfd863996bb3",
|
|
161
|
-
"decimals": 18,
|
|
162
|
-
"name": "fBNB"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"symbol": "FUSD",
|
|
166
|
-
"hash": "0x1005d400bcc2a56b7352f09e273be3f9933a5fb1",
|
|
167
|
-
"decimals": 8,
|
|
168
|
-
"name": "FUSD"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"symbol": "FDE",
|
|
172
|
-
"hash": "0x9770f4d78a19d1a6fa94b472bcedffcc06b56c49",
|
|
173
|
-
"decimals": 8,
|
|
174
|
-
"name": "FDE"
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"symbol": "Hood",
|
|
178
|
-
"hash": "0xc8d56cac2dd82e2da605ccae6865a99da491b97e",
|
|
179
|
-
"decimals": 8,
|
|
180
|
-
"name": "RobinHood"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"symbol": "HD",
|
|
184
|
-
"hash": "0x4b027a8320d5705802e5efbb51f6231ebf412cf6",
|
|
185
|
-
"decimals": 8,
|
|
186
|
-
"name": "The Hongfei"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"symbol": "NRP",
|
|
190
|
-
"hash": "0x789518aa302b571e3e825f2c85a01ad731014a45",
|
|
191
|
-
"decimals": 8,
|
|
192
|
-
"name": "NeoRedPill"
|
|
193
|
-
}
|
|
194
|
-
]
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Arg, ContractInvocation } from '@cityofzion/neon-dappkit-types';
|
|
2
|
-
export type GetReservesParams = {
|
|
3
|
-
routerScriptHash: string;
|
|
4
|
-
tokenToReceiveHash: string;
|
|
5
|
-
tokenToUseHash: string;
|
|
6
|
-
};
|
|
7
|
-
export type TokenOutForTokenInParams = {
|
|
8
|
-
routerScriptHash: string;
|
|
9
|
-
senderAddress: string;
|
|
10
|
-
amountToReceive: string;
|
|
11
|
-
maximumSelling: string;
|
|
12
|
-
deadline: string;
|
|
13
|
-
args: Arg[];
|
|
14
|
-
};
|
|
15
|
-
export type TokenInForTokenOutParams = {
|
|
16
|
-
routerScriptHash: string;
|
|
17
|
-
senderAddress: string;
|
|
18
|
-
amountToUse: string;
|
|
19
|
-
minimumReceived: string;
|
|
20
|
-
deadline: string;
|
|
21
|
-
args: Arg[];
|
|
22
|
-
};
|
|
23
|
-
export type TransferArgs = {
|
|
24
|
-
contractHash: string;
|
|
25
|
-
senderAddress: string;
|
|
26
|
-
tokenHash: string;
|
|
27
|
-
amount: string;
|
|
28
|
-
};
|
|
29
|
-
export declare class NeonDappKitInvocationBuilderNeo3 {
|
|
30
|
-
static getReservesContractInvocation({ routerScriptHash, tokenToReceiveHash, tokenToUseHash, }: GetReservesParams): ContractInvocation;
|
|
31
|
-
static swapTokenOutForTokenInContractInvocation({ routerScriptHash, senderAddress, amountToReceive, maximumSelling, deadline, args, }: TokenOutForTokenInParams): ContractInvocation;
|
|
32
|
-
static swapTokenInForTokenOutContractInvocation({ routerScriptHash, senderAddress, amountToUse, minimumReceived, deadline, args, }: TokenInForTokenOutParams): ContractInvocation;
|
|
33
|
-
static transferContractInvocation({ contractHash, senderAddress, tokenHash, amount, }: TransferArgs): ContractInvocation;
|
|
34
|
-
}
|