Offramp Service
Reference page for the Offramp Service Interface
Interface
interface IOfframpService {
getUserOfframpAddress(dto: GetUserOfframpAddressRequest): Promise<GetUserOfframpAddressResponse>;
}
Structures used
GetUserOfframpAddressRequest
Field Name | Type |
---|---|
chain | Chain |
GetUserOfframpAddressResponse
Field Name | Type |
---|---|
message | string |
addresses | string[] |
Service Methods
getUserOfframpAddress
getUserOfframpAddress(params: GetUserOfframpAddressRequest): Promise<GetUserOfframpAddressResponse>
Overview
This method returns a crypto address to which user needs to transfer crypto assets on a given chain to begin offramp process.
Usage
Typescript
import getunblockSDK, { Chain } from "@getunblock/sdk";
(async () => {
// setup SDK
const sdk = getunblockSDK({
apiKey:
"API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
});
await sdk.auth.authenticateWithSiwe({
message: "[Generated SIWE message]*",
signature: "[Generated SIWE signature]*",
});
// * more info at https://docs.getunblock.com/docs/unblocker
// SDK API call example
const result = await sdk.offramp.getUserOfframpAddress({
chain: Chain.POLYGON
});
})();
Javascript
const getunblockSDK = require("@getunblock/sdk").default;
const { Chain } = require("@getunblock/sdk");
(async () => {
// setup SDK
const sdk = getunblockSDK({
apiKey:
"API-Key [Some merchant Key]", // Key generated at the moment the merchant was created in getunblock system
prod: false, // If true Production environment will be used otherwise Sandbox will be used instead
});
await sdk.auth.authenticateWithSiwe({
message: "[Generated SIWE message]*",
signature: "[Generated SIWE signature]*",
});
// * more info at https://docs.getunblock.com/docs/unblocker
// SDK API call example
const result = await sdk.offramp.getUserOfframpAddress({
chain: Chain.POLYGON
});
})();
Other Services Available
Updated over 1 year ago