Comparing version 15.2.0 to 15.2.1
@@ -443,7 +443,2 @@ /** | ||
balance: string | number; | ||
extra_currencies: { | ||
'@type': "extraCurrency"; | ||
id: number; | ||
amount: string; | ||
}[]; | ||
state: "active" | "uninitialized" | "frozen"; | ||
@@ -464,2 +459,7 @@ last_transaction_id: { | ||
sync_utime: number; | ||
extra_currencies?: { | ||
'@type': "extraCurrency"; | ||
id: number; | ||
amount: string; | ||
}[] | undefined; | ||
}>; | ||
@@ -466,0 +466,0 @@ getTransactions(address: Address, opts: { |
@@ -29,7 +29,7 @@ "use strict"; | ||
balance: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]), | ||
extra_currencies: zod_1.z.array(zod_1.z.object({ | ||
extra_currencies: zod_1.z.optional(zod_1.z.array(zod_1.z.object({ | ||
'@type': zod_1.z.literal("extraCurrency"), | ||
id: zod_1.z.number(), | ||
amount: zod_1.z.string() | ||
})), | ||
}))), | ||
state: zod_1.z.union([zod_1.z.literal('active'), zod_1.z.literal('uninitialized'), zod_1.z.literal('frozen')]), | ||
@@ -36,0 +36,0 @@ data: zod_1.z.string(), |
@@ -204,3 +204,3 @@ /** | ||
amount: string; | ||
}[]; | ||
}[] | undefined; | ||
state: "active" | "uninitialized" | "frozen"; | ||
@@ -207,0 +207,0 @@ code: Buffer | null; |
@@ -367,3 +367,3 @@ "use strict"; | ||
} | ||
if (state.extra_currencies.length > 0) { | ||
if (state.extra_currencies && state.extra_currencies.length > 0) { | ||
ecMap = {}; | ||
@@ -370,0 +370,0 @@ for (let ec of state.extra_currencies) { |
@@ -8,3 +8,3 @@ "use strict"; | ||
let client = new TonClient_1.TonClient({ | ||
endpoint: 'https://mainnet.tonhubapi.com/jsonRPC', | ||
endpoint: 'https://toncenter.com/api/v2/jsonRPC', | ||
}); | ||
@@ -38,2 +38,5 @@ const testAddress = core_1.Address.parse('EQCD39VS5jcptHL8vMjEXrzGaRcCVYto7HUn4bpAOg8xqB2N'); | ||
}); | ||
it('should check contract is deployed', async () => { | ||
expect(await client.isContractDeployed(testAddress)).toBe(true); | ||
}); | ||
it('should get extra currency info', async () => { | ||
@@ -46,3 +49,3 @@ // EC is rolled out only in testned yet | ||
let res = await testClient.getContractState(testAddr); | ||
let expectedEc = res.extra_currencies.find(e => e.id == 100); | ||
let expectedEc = res.extra_currencies?.find(e => e.id == 100); | ||
expect(expectedEc).not.toBeUndefined(); | ||
@@ -49,0 +52,0 @@ expect(BigInt(expectedEc.amount)).toBe(10000000n); |
{ | ||
"name": "@ton/ton", | ||
"version": "15.2.0", | ||
"version": "15.2.1", | ||
"repository": "https://github.com/ton-org/ton.git", | ||
@@ -5,0 +5,0 @@ "author": "Whales Corp. <developers@whalescorp.com>", |
443258
11550