@kiwarilabs/chidori-sdk 1.0.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/blockchain/chidori-provider.d.ts +15 -0
- package/dist/blockchain/chidori.d.ts +8 -0
- package/dist/blockchain/erc7818-namespace.d.ts +102 -0
- package/dist/cjs/blockchain/chidori-provider.d.ts +15 -0
- package/dist/cjs/blockchain/chidori.d.ts +8 -0
- package/dist/cjs/blockchain/erc7818-namespace.d.ts +102 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +614 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/internal/erc7818.d.ts +12 -0
- package/dist/cjs/test/unit/erc7818Expirable.test.d.ts +1 -0
- package/dist/cjs/types/ethers-types.d.ts +2 -0
- package/dist/cjs/types/types.d.ts +55 -0
- package/dist/es/blockchain/chidori-provider.d.ts +15 -0
- package/dist/es/blockchain/chidori.d.ts +8 -0
- package/dist/es/blockchain/erc7818-namespace.d.ts +102 -0
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +610 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/internal/erc7818.d.ts +12 -0
- package/dist/es/test/unit/erc7818Expirable.test.d.ts +1 -0
- package/dist/es/types/ethers-types.d.ts +2 -0
- package/dist/es/types/types.d.ts +55 -0
- package/dist/esm/blockchain/chidori-provider.d.ts +15 -0
- package/dist/esm/blockchain/chidori.d.ts +8 -0
- package/dist/esm/blockchain/erc7818-namespace.d.ts +102 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +610 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/erc7818.d.ts +12 -0
- package/dist/esm/test/unit/erc7818Expirable.test.d.ts +1 -0
- package/dist/esm/types/ethers-types.d.ts +2 -0
- package/dist/esm/types/types.d.ts +55 -0
- package/dist/index.d.ts +1 -0
- package/dist/internal/erc7818.d.ts +12 -0
- package/dist/test/unit/erc7818Expirable.test.d.ts +1 -0
- package/dist/types/ethers-types.d.ts +2 -0
- package/dist/types/types.d.ts +55 -0
- package/package.json +93 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
import { type JsonRpcApiProvider as ProviderEthersV6, type Signer as SignerEthersV6 } from 'ethers-v6';
|
2
|
+
import { Provider } from '@ethersproject/abstract-provider';
|
3
|
+
import { Signer } from '@ethersproject/abstract-signer';
|
4
|
+
import { JsonRpcProvider } from '@ethersproject/providers';
|
5
|
+
export type SupportProviderType = Signer | Provider | JsonRpcProvider | ProviderEthersV6 | SignerEthersV6;
|
6
|
+
export interface Providers {
|
7
|
+
provider: SupportProviderType;
|
8
|
+
}
|
9
|
+
export interface GetBalanceOfInterface {
|
10
|
+
contractAddress: string;
|
11
|
+
accountAddress: string;
|
12
|
+
}
|
13
|
+
export interface GetBalanceOfAtEpochInterface {
|
14
|
+
contractAddress: string;
|
15
|
+
accountAddress: string;
|
16
|
+
epoch: number;
|
17
|
+
}
|
18
|
+
export interface GetDecimalsInterface {
|
19
|
+
contractAddress: string;
|
20
|
+
}
|
21
|
+
export interface GetValidityDurationInterface {
|
22
|
+
contractAddress: string;
|
23
|
+
}
|
24
|
+
export interface GetCurrentEpochInterface {
|
25
|
+
contractAddress: string;
|
26
|
+
}
|
27
|
+
export interface GetIsEpochExpireInterface {
|
28
|
+
contractAddress: string;
|
29
|
+
identifier: number;
|
30
|
+
}
|
31
|
+
export interface GetEpochLengthInterface {
|
32
|
+
contractAddress: string;
|
33
|
+
}
|
34
|
+
export interface GetNameInterface {
|
35
|
+
contractAddress: string;
|
36
|
+
}
|
37
|
+
export interface GetSymbolInterface {
|
38
|
+
contractAddress: string;
|
39
|
+
}
|
40
|
+
export interface GetTotalSupplyInterface {
|
41
|
+
contractAddress: string;
|
42
|
+
}
|
43
|
+
export interface TransferInterface {
|
44
|
+
contractAddress: string;
|
45
|
+
to: string;
|
46
|
+
identifier: number;
|
47
|
+
value: number;
|
48
|
+
}
|
49
|
+
export interface TransferFromInterface {
|
50
|
+
contractAddress: string;
|
51
|
+
from: string;
|
52
|
+
to: string;
|
53
|
+
identifier: number;
|
54
|
+
value: number;
|
55
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { JsonRpcProvider, JsonRpcSigner } from '@ethersproject/providers';
|
2
|
+
import { Providers } from '../types/types';
|
3
|
+
export declare class ChidoriProvider {
|
4
|
+
readonly provider: {
|
5
|
+
provider: JsonRpcProvider;
|
6
|
+
signer: JsonRpcSigner;
|
7
|
+
};
|
8
|
+
constructor(config: {
|
9
|
+
provider: Providers;
|
10
|
+
});
|
11
|
+
wrapInputProviderLike(input: Providers): {
|
12
|
+
provider: JsonRpcProvider;
|
13
|
+
signer: JsonRpcSigner;
|
14
|
+
};
|
15
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Providers } from '../types/types';
|
2
|
+
import { ChidoriProvider } from './chidori-provider';
|
3
|
+
import { ERC7818Namespace } from './erc7818-namespace';
|
4
|
+
export declare class Chidori {
|
5
|
+
readonly erc7818Expirable: ERC7818Namespace;
|
6
|
+
readonly chidoriProvider: ChidoriProvider;
|
7
|
+
constructor(providers: Providers);
|
8
|
+
}
|
@@ -0,0 +1,102 @@
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
2
|
+
import { GetBalanceOfAtEpochInterface, GetBalanceOfInterface, GetCurrentEpochInterface, GetDecimalsInterface, GetEpochLengthInterface, GetIsEpochExpireInterface, GetNameInterface, GetSymbolInterface, GetTotalSupplyInterface, // TransferFromInterface,
|
3
|
+
GetValidityDurationInterface } from '../types/types';
|
4
|
+
import { ChidoriProvider } from './chidori-provider';
|
5
|
+
export declare class ERC7818Namespace {
|
6
|
+
private readonly chidoriProvider;
|
7
|
+
constructor(chidoriProvider: ChidoriProvider);
|
8
|
+
/**
|
9
|
+
* Get balance of owner.
|
10
|
+
*
|
11
|
+
* This method returns the balance of user.
|
12
|
+
*
|
13
|
+
* @param contractAddress - The address of the contract.
|
14
|
+
* @param accountAddress - The address of the account.
|
15
|
+
* @public
|
16
|
+
*/
|
17
|
+
getBalanceOf({ contractAddress, accountAddress }: GetBalanceOfInterface): Promise<string>;
|
18
|
+
/**
|
19
|
+
* Get balance at epoch of owner by identifier.
|
20
|
+
*
|
21
|
+
* This method returns the balance of user.
|
22
|
+
*
|
23
|
+
* @param contractAddress - The address of the contract.
|
24
|
+
* @param accountAddress - The address of the account.
|
25
|
+
* @param identifier - The Identifier "MAY" represents an epoch, round, period, or token identifier.
|
26
|
+
* @public
|
27
|
+
*/
|
28
|
+
getBalanceOfAtEpoch({ contractAddress, accountAddress, epoch }: GetBalanceOfAtEpochInterface): Promise<BigNumber>;
|
29
|
+
/**
|
30
|
+
* Get decimals of token.
|
31
|
+
*
|
32
|
+
* This method returns the decimals of token.
|
33
|
+
*
|
34
|
+
* @param contractAddress - The address of the contract.
|
35
|
+
* @public
|
36
|
+
*/
|
37
|
+
getDecimals({ contractAddress }: GetDecimalsInterface): Promise<Number>;
|
38
|
+
/**
|
39
|
+
* Get validity duration.
|
40
|
+
*
|
41
|
+
* This method returns validity duration in blocks or the time in seconds.
|
42
|
+
*
|
43
|
+
* @param contractAddress - The address of the contract.
|
44
|
+
* @public
|
45
|
+
*/
|
46
|
+
getValidityDuration({ contractAddress }: GetValidityDurationInterface): Promise<BigNumber>;
|
47
|
+
/**
|
48
|
+
* Get current epoch.
|
49
|
+
*
|
50
|
+
* This method returns current epoch of the token contract, often used for determining active/expired states.
|
51
|
+
*
|
52
|
+
* @param contractAddress - The address of the contract.
|
53
|
+
* @public
|
54
|
+
*/
|
55
|
+
getCurrentEpoch({ contractAddress }: GetCurrentEpochInterface): Promise<BigNumber>;
|
56
|
+
/**
|
57
|
+
* Get epoch length.
|
58
|
+
*
|
59
|
+
* This method returns dulation of single epoch.
|
60
|
+
*
|
61
|
+
* @param contractAddress - The address of the contract.
|
62
|
+
* @public
|
63
|
+
*/
|
64
|
+
getEpochLength({ contractAddress }: GetEpochLengthInterface): Promise<BigNumber>;
|
65
|
+
/**
|
66
|
+
* Get is epoch expire.
|
67
|
+
*
|
68
|
+
* This method returns boolean of the token contract, True if the token is expired, false otherwise.
|
69
|
+
*
|
70
|
+
* @param contractAddress - The address of the contract.
|
71
|
+
* @param identifier - The Identifier "MAY" represents an epoch, round, period, or token identifier.
|
72
|
+
* @public
|
73
|
+
*/
|
74
|
+
getIsExpochExpire({ contractAddress, identifier }: GetIsEpochExpireInterface): Promise<Boolean>;
|
75
|
+
/**
|
76
|
+
* Get name of token.
|
77
|
+
*
|
78
|
+
* This method returns the name of token.
|
79
|
+
*
|
80
|
+
* @param contractAddress - The address of the contract.
|
81
|
+
* @public
|
82
|
+
*/
|
83
|
+
getName({ contractAddress }: GetNameInterface): Promise<string>;
|
84
|
+
/**
|
85
|
+
* Get symbol of token.
|
86
|
+
*
|
87
|
+
* This method returns the symbol of token.
|
88
|
+
*
|
89
|
+
* @param contractAddress - The address of the contract.
|
90
|
+
* @public
|
91
|
+
*/
|
92
|
+
getSymbol({ contractAddress }: GetSymbolInterface): Promise<string>;
|
93
|
+
/**
|
94
|
+
* Get total supply of token.
|
95
|
+
*
|
96
|
+
* This method returns the total supply of token.
|
97
|
+
*
|
98
|
+
* @param contractAddress - The address of the contract.
|
99
|
+
* @public
|
100
|
+
*/
|
101
|
+
getTotalSupply({ contractAddress }: GetTotalSupplyInterface): Promise<BigNumber>;
|
102
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Chidori } from './blockchain/chidori';
|